Closed
Description
this function is getting lowered incorrectly by global isel for AArch64:
@G = external global [10 x i32]
define void @f(i64 %0) {
%2 = getelementptr [10 x i32], ptr @G, i64 0, i64 %0
store i32 0, ptr %2, align 4
store i32 0, ptr getelementptr inbounds ([10 x i32], ptr @G, i64 0, i64 1), align 4
ret void
}
it should be storing 0 to index 1 and also index %0
but global isel is incorrectly coalescing these into a single store:
_f: ; @f
adrp x8, _G@GOTPAGE
lsl x9, x0, #2
ldr x8, [x8, _G@GOTPAGEOFF]
str xzr, [x8, x9]
ret