[llvm] 36f21ee - [InstSimplify] Fix alloca alignments in test (NFC)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 12 01:32:58 PST 2024


Author: Nikita Popov
Date: 2024-11-12T10:32:48+01:00
New Revision: 36f21eedcfd06ff97ead9625adbf6d8153edd233

URL: https://github.com/llvm/llvm-project/commit/36f21eedcfd06ff97ead9625adbf6d8153edd233
DIFF: https://github.com/llvm/llvm-project/commit/36f21eedcfd06ff97ead9625adbf6d8153edd233.diff

LOG: [InstSimplify] Fix alloca alignments in test (NFC)

These zero-sized types should be 1-aligned, but we seem to
default to 8-aligned.

Added: 
    

Modified: 
    llvm/test/Transforms/InstSimplify/cmp-alloca-offsets.ll

Removed: 
    


################################################################################
diff  --git a/llvm/test/Transforms/InstSimplify/cmp-alloca-offsets.ll b/llvm/test/Transforms/InstSimplify/cmp-alloca-offsets.ll
index d076035b269e46..ef69805747091a 100644
--- a/llvm/test/Transforms/InstSimplify/cmp-alloca-offsets.ll
+++ b/llvm/test/Transforms/InstSimplify/cmp-alloca-offsets.ll
@@ -233,12 +233,12 @@ define i1 @mixed_alloca_size4() {
 define i1 @zst_alloca_start() {
 ; CHECK-LABEL: @zst_alloca_start(
 ; CHECK-NEXT:    [[A:%.*]] = alloca i64, align 8
-; CHECK-NEXT:    [[A2:%.*]] = alloca {}, align 8
+; CHECK-NEXT:    [[A2:%.*]] = alloca {}, align 1
 ; CHECK-NEXT:    call void @escape(ptr [[A]], ptr [[A2]])
 ; CHECK-NEXT:    ret i1 false
 ;
   %a = alloca i64
-  %a2 = alloca {}
+  %a2 = alloca {}, align 1
   %gep = getelementptr i8, ptr %a, i64 0
   %cmp = icmp eq ptr %gep, %a2
   call void @escape(ptr %a, ptr %a2)
@@ -248,12 +248,12 @@ define i1 @zst_alloca_start() {
 define i1 @zst_alloca_middle() {
 ; CHECK-LABEL: @zst_alloca_middle(
 ; CHECK-NEXT:    [[A:%.*]] = alloca i64, align 8
-; CHECK-NEXT:    [[A2:%.*]] = alloca {}, align 8
+; CHECK-NEXT:    [[A2:%.*]] = alloca {}, align 1
 ; CHECK-NEXT:    call void @escape(ptr [[A]], ptr [[A2]])
 ; CHECK-NEXT:    ret i1 false
 ;
   %a = alloca i64
-  %a2 = alloca {}
+  %a2 = alloca {}, align 1
   %gep = getelementptr i8, ptr %a, i64 4
   %cmp = icmp eq ptr %gep, %a2
   call void @escape(ptr %a, ptr %a2)
@@ -263,21 +263,21 @@ define i1 @zst_alloca_middle() {
 define i1 @zst_alloca_end() {
 ; CHECK-LABEL: @zst_alloca_end(
 ; CHECK-NEXT:    [[A:%.*]] = alloca i64, align 8
-; CHECK-NEXT:    [[A2:%.*]] = alloca {}, align 8
+; CHECK-NEXT:    [[A2:%.*]] = alloca {}, align 1
 ; CHECK-NEXT:    [[GEP:%.*]] = getelementptr i8, ptr [[A]], i64 8
 ; CHECK-NEXT:    [[CMP:%.*]] = icmp eq ptr [[GEP]], [[A2]]
 ; CHECK-NEXT:    call void @escape(ptr [[A]], ptr [[A2]])
 ; CHECK-NEXT:    ret i1 [[CMP]]
 ;
   %a = alloca i64
-  %a2 = alloca {}
+  %a2 = alloca {}, align 1
   %gep = getelementptr i8, ptr %a, i64 8
   %cmp = icmp eq ptr %gep, %a2
   call void @escape(ptr %a, ptr %a2)
   ret i1 %cmp
 }
 
- at gz = external global {}
+ at gz = external global {}, align 1
 
 define i1 @zst_global_start() {
 ; CHECK-LABEL: @zst_global_start(


        


More information about the llvm-commits mailing list