[llvm] [SROA] Prevent load atomic vector from being generated (PR #112432)

via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 17 23:41:22 PDT 2024


================
@@ -1992,8 +1992,9 @@ define i32 @load_volatile_past_end() {
 
 define i32 @load_atomic_past_end() {
 ; CHECK-LABEL: @load_atomic_past_end(
-; CHECK-NEXT:    [[A_0_LOAD_EXT:%.*]] = zext i1 undef to i32
-; CHECK-NEXT:    ret i32 [[A_0_LOAD_EXT]]
+; CHECK-NEXT:    [[A:%.*]] = alloca i1, align 1
+; CHECK-NEXT:    [[V:%.*]] = load atomic i32, ptr [[A]] seq_cst, align 4
+; CHECK-NEXT:    ret i32 [[V]]
----------------
jofrn wrote:

Due to this test, we may want to check only the type without `DL`. Adding too many checks hinders optimization.

https://github.com/llvm/llvm-project/pull/112432


More information about the llvm-commits mailing list