mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-24 13:04:33 +02:00
8076523: assert(((ABS(iv_adjustment_in_bytes) % elt_size) == 0)) fails in superword.cpp
Check that offset % mem_oper_size == 0 when alignment is verified during vectorization. Reviewed-by: iveresov
This commit is contained in:
parent
86e3a8d9f4
commit
81bb7521bd
1 changed files with 7 additions and 5 deletions
|
@ -449,11 +449,13 @@ bool SuperWord::ref_is_alignable(SWPointer& p) {
|
||||||
int preloop_stride = pre_end->stride_con();
|
int preloop_stride = pre_end->stride_con();
|
||||||
|
|
||||||
int span = preloop_stride * p.scale_in_bytes();
|
int span = preloop_stride * p.scale_in_bytes();
|
||||||
|
int mem_size = p.memory_size();
|
||||||
// Stride one accesses are alignable.
|
int offset = p.offset_in_bytes();
|
||||||
if (ABS(span) == p.memory_size())
|
// Stride one accesses are alignable if offset is aligned to memory operation size.
|
||||||
|
// Offset can be unaligned when UseUnalignedAccesses is used.
|
||||||
|
if (ABS(span) == mem_size && (ABS(offset) % mem_size) == 0) {
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
// If initial offset from start of object is computable,
|
// If initial offset from start of object is computable,
|
||||||
// compute alignment within the vector.
|
// compute alignment within the vector.
|
||||||
int vw = vector_width_in_bytes(p.mem());
|
int vw = vector_width_in_bytes(p.mem());
|
||||||
|
@ -463,7 +465,7 @@ bool SuperWord::ref_is_alignable(SWPointer& p) {
|
||||||
if (init_nd->is_Con() && p.invar() == NULL) {
|
if (init_nd->is_Con() && p.invar() == NULL) {
|
||||||
int init = init_nd->bottom_type()->is_int()->get_con();
|
int init = init_nd->bottom_type()->is_int()->get_con();
|
||||||
|
|
||||||
int init_offset = init * p.scale_in_bytes() + p.offset_in_bytes();
|
int init_offset = init * p.scale_in_bytes() + offset;
|
||||||
assert(init_offset >= 0, "positive offset from object start");
|
assert(init_offset >= 0, "positive offset from object start");
|
||||||
|
|
||||||
if (span > 0) {
|
if (span > 0) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue