Issue |
90242
|
Summary |
incorrect coalescing of stores by AArch64 global isel backend
|
Labels |
backend:AArch64,
llvm:codegen,
miscompilation,
llvm:globalisel
|
Assignees |
|
Reporter |
regehr
|
this function is getting lowered incorrectly by global isel for AArch64:
```llvm
@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
```
cc @hatsunespica
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs