diff --git a/llvm/test/Transforms/InferAlignment/addrspace.ll b/llvm/test/Transforms/InferAlignment/addrspace.ll --- a/llvm/test/Transforms/InferAlignment/addrspace.ll +++ b/llvm/test/Transforms/InferAlignment/addrspace.ll @@ -1,5 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 2 -; RUN: opt -S -passes=no-op-function %s -o - | FileCheck %s +; RUN: opt -S -passes=infer-alignment %s -o - | FileCheck %s ; ------------------------------------------------------------------------------ ; Vector type @@ -9,7 +9,7 @@ define <4 x float> @constant_fold_bitcast_vector_as() { ; CHECK-LABEL: define <4 x float> @constant_fold_bitcast_vector_as() { -; CHECK-NEXT: [[A:%.*]] = load <4 x float>, ptr addrspace(3) @v4f_as3, align 4 +; CHECK-NEXT: [[A:%.*]] = load <4 x float>, ptr addrspace(3) @v4f_as3, align 16 ; CHECK-NEXT: ret <4 x float> [[A]] ; %a = load <4 x float>, ptr addrspace(3) @v4f_as3, align 4 @@ -24,7 +24,7 @@ define i32 @test_cast_gep_small_indices_as() { ; CHECK-LABEL: define i32 @test_cast_gep_small_indices_as() { -; CHECK-NEXT: [[X:%.*]] = load i32, ptr addrspace(3) @i32_array_as3, align 4 +; CHECK-NEXT: [[X:%.*]] = load i32, ptr addrspace(3) @i32_array_as3, align 16 ; CHECK-NEXT: ret i32 [[X]] ; %x = load i32, ptr addrspace(3) @i32_array_as3, align 4 @@ -33,7 +33,7 @@ define i32 @test_cast_gep_large_indices_as() { ; CHECK-LABEL: define i32 @test_cast_gep_large_indices_as() { -; CHECK-NEXT: [[X:%.*]] = load i32, ptr addrspace(3) @i32_array_as3, align 4 +; CHECK-NEXT: [[X:%.*]] = load i32, ptr addrspace(3) @i32_array_as3, align 16 ; CHECK-NEXT: ret i32 [[X]] ; %x = load i32, ptr addrspace(3) @i32_array_as3, align 4 @@ -56,7 +56,7 @@ define i32 @test_constant_cast_gep_struct_indices_as() { ; CHECK-LABEL: define i32 @test_constant_cast_gep_struct_indices_as() { ; CHECK-NEXT: [[X:%.*]] = getelementptr [[STRUCT_FOO:%.*]], ptr addrspace(3) @global_ptr, i18 0, i32 2, i12 2 -; CHECK-NEXT: [[Y:%.*]] = load i32, ptr addrspace(3) [[X]], align 4 +; CHECK-NEXT: [[Y:%.*]] = load i32, ptr addrspace(3) [[X]], align 16 ; CHECK-NEXT: ret i32 [[Y]] ; %x = getelementptr %struct.foo, ptr addrspace(3) @global_ptr, i18 0, i32 2, i12 2 diff --git a/llvm/test/Transforms/InferAlignment/alloca-cast.ll b/llvm/test/Transforms/InferAlignment/alloca-cast.ll --- a/llvm/test/Transforms/InferAlignment/alloca-cast.ll +++ b/llvm/test/Transforms/InferAlignment/alloca-cast.ll @@ -1,5 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 2 -; RUN: opt < %s -S -passes=no-op-function | FileCheck %s +; RUN: opt < %s -S -passes=infer-alignment | FileCheck %s ; C source: ; struct Foo { @@ -22,9 +22,9 @@ ; CHECK-LABEL: define void @f ; CHECK-SAME: (ptr [[P:%.*]]) { ; CHECK-NEXT: entry: -; CHECK-NEXT: [[LOCAL:%.*]] = alloca [[STRUCT_FOO:%.*]], align 4 +; CHECK-NEXT: [[LOCAL:%.*]] = alloca [[STRUCT_FOO:%.*]], align 8 ; CHECK-NEXT: [[TMP0:%.*]] = load i64, ptr [[P]], align 8 -; CHECK-NEXT: store i64 [[TMP0]], ptr [[LOCAL]], align 4 +; CHECK-NEXT: store i64 [[TMP0]], ptr [[LOCAL]], align 8 ; CHECK-NEXT: call void @escape(ptr [[LOCAL]]) ; CHECK-NEXT: ret void ; diff --git a/llvm/test/Transforms/InferAlignment/alloca.ll b/llvm/test/Transforms/InferAlignment/alloca.ll --- a/llvm/test/Transforms/InferAlignment/alloca.ll +++ b/llvm/test/Transforms/InferAlignment/alloca.ll @@ -1,5 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 2 -; RUN: opt < %s -passes=no-op-function -S | FileCheck %s +; RUN: opt < %s -passes=infer-alignment -S | FileCheck %s target triple = "i386-apple-darwin9.6" %struct.Key = type { { i32, i32 } } @@ -13,11 +13,11 @@ ; CHECK-NEXT: %"alloca point" = bitcast i32 0 to i32 ; CHECK-NEXT: [[TMP0:%.*]] = getelementptr [[STRUCT_KEY]], ptr [[IOSPEC]], i32 0, i32 0 ; CHECK-NEXT: [[TMP1:%.*]] = getelementptr { i32, i32 }, ptr [[TMP0]], i32 0, i32 0 -; CHECK-NEXT: store i32 0, ptr [[TMP1]], align 4 +; CHECK-NEXT: store i32 0, ptr [[TMP1]], align 8 ; CHECK-NEXT: [[TMP2:%.*]] = getelementptr { i32, i32 }, ptr [[TMP0]], i32 0, i32 1 ; CHECK-NEXT: store i32 0, ptr [[TMP2]], align 4 ; CHECK-NEXT: [[TMP3:%.*]] = getelementptr [[STRUCT_KEY]], ptr [[IOSPEC]], i32 0, i32 0 -; CHECK-NEXT: store i64 [[KEY_TOKEN2]], ptr [[TMP3]], align 4 +; CHECK-NEXT: store i64 [[KEY_TOKEN2]], ptr [[TMP3]], align 8 ; CHECK-NEXT: [[TMP4:%.*]] = call i32 (...) @foo(ptr byval([[STRUCT_KEY]]) align 4 [[IOSPEC]], ptr [[RET]]) #[[ATTR0]] ; CHECK-NEXT: [[TMP5:%.*]] = load i32, ptr [[RET]], align 4 ; CHECK-NEXT: ret i32 [[TMP5]] diff --git a/llvm/test/Transforms/InferAlignment/assume-inevitable.ll b/llvm/test/Transforms/InferAlignment/assume-inevitable.ll --- a/llvm/test/Transforms/InferAlignment/assume-inevitable.ll +++ b/llvm/test/Transforms/InferAlignment/assume-inevitable.ll @@ -1,5 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 2 -; RUN: opt < %s -passes=no-op-function -S | FileCheck %s +; RUN: opt < %s -passes=infer-alignment -S | FileCheck %s ; Check that assume is propagated backwards through all ; operations that are `isGuaranteedToTransferExecutionToSuccessor` @@ -10,11 +10,11 @@ ; CHECK-NEXT: entry: ; CHECK-NEXT: [[DUMMY:%.*]] = alloca i8, align 4 ; CHECK-NEXT: [[M:%.*]] = alloca i64, align 8 -; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4 +; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 32 ; CHECK-NEXT: [[LOADRES:%.*]] = load i32, ptr [[B]], align 4 -; CHECK-NEXT: store i32 [[LOADRES]], ptr [[A]], align 4 +; CHECK-NEXT: store i32 [[LOADRES]], ptr [[A]], align 32 ; CHECK-NEXT: [[OBJSZ:%.*]] = call i64 @llvm.objectsize.i64.p0(ptr [[C]], i1 false, i1 false, i1 false) -; CHECK-NEXT: store i64 [[OBJSZ]], ptr [[M]], align 4 +; CHECK-NEXT: store i64 [[OBJSZ]], ptr [[M]], align 8 ; CHECK-NEXT: [[PTRINT:%.*]] = ptrtoint ptr [[A]] to i64 ; CHECK-NEXT: [[MASKEDPTR:%.*]] = and i64 [[PTRINT]], 31 ; CHECK-NEXT: [[MASKCOND:%.*]] = icmp eq i64 [[MASKEDPTR]], 0 diff --git a/llvm/test/Transforms/InferAlignment/assume-loop-align.ll b/llvm/test/Transforms/InferAlignment/assume-loop-align.ll --- a/llvm/test/Transforms/InferAlignment/assume-loop-align.ll +++ b/llvm/test/Transforms/InferAlignment/assume-loop-align.ll @@ -1,5 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 2 -; RUN: opt -passes=no-op-function -S < %s | FileCheck %s +; RUN: opt -passes=infer-alignment -S < %s | FileCheck %s target triple = "x86_64-unknown-linux-gnu" ; Function Attrs: nounwind uwtable @@ -19,10 +19,10 @@ ; CHECK: for.body: ; CHECK-NEXT: [[INDVAR:%.*]] = phi i64 [ 0, [[ENTRY:%.*]] ], [ [[INDVAR_NEXT:%.*]], [[FOR_BODY]] ] ; CHECK-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, ptr [[B]], i64 [[INDVAR]] -; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[ARRAYIDX]], align 4 +; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[ARRAYIDX]], align 64 ; CHECK-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP0]], 1 ; CHECK-NEXT: [[ARRAYIDX2:%.*]] = getelementptr inbounds i32, ptr [[A]], i64 [[INDVAR]] -; CHECK-NEXT: store i32 [[ADD]], ptr [[ARRAYIDX2]], align 4 +; CHECK-NEXT: store i32 [[ADD]], ptr [[ARRAYIDX2]], align 64 ; CHECK-NEXT: [[INDVAR_NEXT]] = add nuw nsw i64 [[INDVAR]], 16 ; CHECK-NEXT: [[TMP1:%.*]] = trunc i64 [[INDVAR_NEXT]] to i32 ; CHECK-NEXT: [[CMP:%.*]] = icmp slt i32 [[TMP1]], 1648 diff --git a/llvm/test/Transforms/InferAlignment/atomic.ll b/llvm/test/Transforms/InferAlignment/atomic.ll --- a/llvm/test/Transforms/InferAlignment/atomic.ll +++ b/llvm/test/Transforms/InferAlignment/atomic.ll @@ -1,5 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 2 -; RUN: opt -S < %s -passes=no-op-function | FileCheck %s +; RUN: opt -S < %s -passes=infer-alignment | FileCheck %s target triple = "x86_64-apple-macosx10.7.0" ; Check transforms involving atomic operations @@ -12,7 +12,7 @@ define i8 @test_atomic_global_load() { ; CHECK-LABEL: define i8 @test_atomic_global_load() { -; CHECK-NEXT: [[V:%.*]] = load atomic i8, ptr @c seq_cst, align 1 +; CHECK-NEXT: [[V:%.*]] = load atomic i8, ptr @c seq_cst, align 8 ; CHECK-NEXT: ret i8 [[V]] ; %v = load atomic i8, ptr @c seq_cst, align 1 @@ -21,7 +21,7 @@ define i32 @test1() { ; CHECK-LABEL: define i32 @test1() { -; CHECK-NEXT: [[X:%.*]] = load atomic i32, ptr @c unordered, align 4 +; CHECK-NEXT: [[X:%.*]] = load atomic i32, ptr @c unordered, align 8 ; CHECK-NEXT: ret i32 [[X]] ; %x = load atomic i32, ptr @c unordered, align 4 @@ -30,7 +30,7 @@ define i32 @test2() { ; CHECK-LABEL: define i32 @test2() { -; CHECK-NEXT: [[X:%.*]] = load atomic i32, ptr @c monotonic, align 4 +; CHECK-NEXT: [[X:%.*]] = load atomic i32, ptr @c monotonic, align 8 ; CHECK-NEXT: ret i32 [[X]] ; %x = load atomic i32, ptr @c monotonic, align 4 @@ -39,7 +39,7 @@ define i32 @test3() { ; CHECK-LABEL: define i32 @test3() { -; CHECK-NEXT: [[X:%.*]] = load atomic i32, ptr @c seq_cst, align 4 +; CHECK-NEXT: [[X:%.*]] = load atomic i32, ptr @c seq_cst, align 8 ; CHECK-NEXT: ret i32 [[X]] ; %x = load atomic i32, ptr @c seq_cst, align 4 @@ -54,7 +54,7 @@ ; ordering imposed. define i32 @test4() { ; CHECK-LABEL: define i32 @test4() { -; CHECK-NEXT: store atomic i32 0, ptr @c unordered, align 4 +; CHECK-NEXT: store atomic i32 0, ptr @c unordered, align 8 ; CHECK-NEXT: ret i32 0 ; store atomic i32 0, ptr @c unordered, align 4 @@ -63,7 +63,7 @@ define i32 @test5() { ; CHECK-LABEL: define i32 @test5() { -; CHECK-NEXT: store atomic i32 0, ptr @c monotonic, align 4 +; CHECK-NEXT: store atomic i32 0, ptr @c monotonic, align 8 ; CHECK-NEXT: ret i32 0 ; store atomic i32 0, ptr @c monotonic, align 4 @@ -72,7 +72,7 @@ define i32 @test6() { ; CHECK-LABEL: define i32 @test6() { -; CHECK-NEXT: store atomic i32 0, ptr @c seq_cst, align 4 +; CHECK-NEXT: store atomic i32 0, ptr @c seq_cst, align 8 ; CHECK-NEXT: ret i32 0 ; store atomic i32 0, ptr @c seq_cst, align 4 @@ -85,7 +85,7 @@ define i32 @test1_null() { ; CHECK-LABEL: define i32 @test1_null() { -; CHECK-NEXT: [[X:%.*]] = load atomic i32, ptr null unordered, align 4 +; CHECK-NEXT: [[X:%.*]] = load atomic i32, ptr null unordered, align 4294967296 ; CHECK-NEXT: ret i32 [[X]] ; %x = load atomic i32, ptr null unordered, align 4 @@ -94,7 +94,7 @@ define i32 @test2_null() { ; CHECK-LABEL: define i32 @test2_null() { -; CHECK-NEXT: [[X:%.*]] = load atomic i32, ptr null monotonic, align 4 +; CHECK-NEXT: [[X:%.*]] = load atomic i32, ptr null monotonic, align 4294967296 ; CHECK-NEXT: ret i32 [[X]] ; %x = load atomic i32, ptr null monotonic, align 4 @@ -103,7 +103,7 @@ define i32 @test3_null() { ; CHECK-LABEL: define i32 @test3_null() { -; CHECK-NEXT: [[X:%.*]] = load atomic i32, ptr null seq_cst, align 4 +; CHECK-NEXT: [[X:%.*]] = load atomic i32, ptr null seq_cst, align 4294967296 ; CHECK-NEXT: ret i32 [[X]] ; %x = load atomic i32, ptr null seq_cst, align 4 @@ -116,7 +116,7 @@ define i32 @test4_null() { ; CHECK-LABEL: define i32 @test4_null() { -; CHECK-NEXT: store atomic i32 0, ptr null unordered, align 4 +; CHECK-NEXT: store atomic i32 0, ptr null unordered, align 4294967296 ; CHECK-NEXT: ret i32 0 ; store atomic i32 0, ptr null unordered, align 4 @@ -125,7 +125,7 @@ define i32 @test5_null() { ; CHECK-LABEL: define i32 @test5_null() { -; CHECK-NEXT: store atomic i32 0, ptr null monotonic, align 4 +; CHECK-NEXT: store atomic i32 0, ptr null monotonic, align 4294967296 ; CHECK-NEXT: ret i32 0 ; store atomic i32 0, ptr null monotonic, align 4 @@ -134,7 +134,7 @@ define i32 @test6_null() { ; CHECK-LABEL: define i32 @test6_null() { -; CHECK-NEXT: store atomic i32 0, ptr null seq_cst, align 4 +; CHECK-NEXT: store atomic i32 0, ptr null seq_cst, align 4294967296 ; CHECK-NEXT: ret i32 0 ; store atomic i32 0, ptr null seq_cst, align 4 diff --git a/llvm/test/Transforms/InferAlignment/basic.ll b/llvm/test/Transforms/InferAlignment/basic.ll --- a/llvm/test/Transforms/InferAlignment/basic.ll +++ b/llvm/test/Transforms/InferAlignment/basic.ll @@ -1,5 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 2 -; RUN: opt -passes=no-op-function -S < %s | FileCheck %s +; RUN: opt -passes=infer-alignment -S < %s | FileCheck %s ; ------------------------------------------------------------------------------ ; Undef and null @@ -18,7 +18,7 @@ define i32 @load_from_null(ptr %P) { ; CHECK-LABEL: define i32 @load_from_null ; CHECK-SAME: (ptr [[P:%.*]]) { -; CHECK-NEXT: [[RET:%.*]] = load i32, ptr null, align 4 +; CHECK-NEXT: [[RET:%.*]] = load i32, ptr null, align 4294967296 ; CHECK-NEXT: ret i32 [[RET]] ; %ret = load i32, ptr null @@ -38,7 +38,7 @@ define void @store_into_null(ptr %P) { ; CHECK-LABEL: define void @store_into_null ; CHECK-SAME: (ptr [[P:%.*]]) { -; CHECK-NEXT: store i32 124, ptr null, align 4 +; CHECK-NEXT: store i32 124, ptr null, align 4294967296 ; CHECK-NEXT: ret void ; store i32 124, ptr null @@ -60,9 +60,9 @@ ; CHECK-LABEL: define i8 @test1 ; CHECK-SAME: (i8 [[X:%.*]], i32 [[Y:%.*]]) { ; CHECK-NEXT: [[ALLOC:%.*]] = alloca i32, align 4 -; CHECK-NEXT: store i8 [[X]], ptr [[ALLOC]], align 1 +; CHECK-NEXT: store i8 [[X]], ptr [[ALLOC]], align 4 ; CHECK-NEXT: store i32 [[Y]], ptr [[ALLOC]], align 4 -; CHECK-NEXT: [[RET:%.*]] = load i8, ptr [[ALLOC]], align 1 +; CHECK-NEXT: [[RET:%.*]] = load i8, ptr [[ALLOC]], align 4 ; CHECK-NEXT: ret i8 [[RET]] ; %alloc = alloca i32 @@ -78,9 +78,9 @@ define i8 @test2(i8 %x, i32 %y) { ; CHECK-LABEL: define i8 @test2 ; CHECK-SAME: (i8 [[X:%.*]], i32 [[Y:%.*]]) { -; CHECK-NEXT: store i8 [[X]], ptr @test2_global, align 1 +; CHECK-NEXT: store i8 [[X]], ptr @test2_global, align 4 ; CHECK-NEXT: store i32 [[Y]], ptr @test2_global, align 4 -; CHECK-NEXT: [[RET:%.*]] = load i8, ptr @test2_global, align 1 +; CHECK-NEXT: [[RET:%.*]] = load i8, ptr @test2_global, align 4 ; CHECK-NEXT: ret i8 [[RET]] ; store i8 %x, ptr @test2_global diff --git a/llvm/test/Transforms/InferAlignment/dbginfo-1.ll b/llvm/test/Transforms/InferAlignment/dbginfo-1.ll --- a/llvm/test/Transforms/InferAlignment/dbginfo-1.ll +++ b/llvm/test/Transforms/InferAlignment/dbginfo-1.ll @@ -1,14 +1,14 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 2 -; RUN: opt < %s -passes='no-op-function' -S | FileCheck %s +; RUN: opt < %s -passes='infer-alignment' -S | FileCheck %s define i32 @foo( %x) { ; CHECK-LABEL: define i32 @foo ; CHECK-SAME: ( [[X:%.*]]) { ; CHECK-NEXT: entry: -; CHECK-NEXT: [[ARR:%.*]] = alloca i32, align 4 +; CHECK-NEXT: [[ARR:%.*]] = alloca i32, align 8 ; CHECK-NEXT: call void @llvm.dbg.declare(metadata ptr [[ARR]], metadata [[META8:![0-9]+]], metadata !DIExpression()), !dbg [[DBG14:![0-9]+]] -; CHECK-NEXT: store [[X]], ptr [[ARR]], align 4 -; CHECK-NEXT: [[RES:%.*]] = load i32, ptr [[ARR]], align 4 +; CHECK-NEXT: store [[X]], ptr [[ARR]], align 8 +; CHECK-NEXT: [[RES:%.*]] = load i32, ptr [[ARR]], align 8 ; CHECK-NEXT: ret i32 [[RES]] ; entry: @@ -23,10 +23,10 @@ ; CHECK-LABEL: define i32 @foo2 ; CHECK-SAME: ( [[X:%.*]]) { ; CHECK-NEXT: entry: -; CHECK-NEXT: [[ARR:%.*]] = alloca [4 x i32], align 4 +; CHECK-NEXT: [[ARR:%.*]] = alloca [4 x i32], align 8 ; CHECK-NEXT: call void @llvm.dbg.declare(metadata ptr [[ARR]], metadata [[META15:![0-9]+]], metadata !DIExpression()), !dbg [[DBG17:![0-9]+]] -; CHECK-NEXT: store [[X]], ptr [[ARR]], align 4 -; CHECK-NEXT: [[RES:%.*]] = load i32, ptr [[ARR]], align 4 +; CHECK-NEXT: store [[X]], ptr [[ARR]], align 8 +; CHECK-NEXT: [[RES:%.*]] = load i32, ptr [[ARR]], align 8 ; CHECK-NEXT: ret i32 [[RES]] ; entry: diff --git a/llvm/test/Transforms/InferAlignment/dbginfo-2.ll b/llvm/test/Transforms/InferAlignment/dbginfo-2.ll --- a/llvm/test/Transforms/InferAlignment/dbginfo-2.ll +++ b/llvm/test/Transforms/InferAlignment/dbginfo-2.ll @@ -1,5 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 2 -; RUN: opt -passes=no-op-function -S < %s | FileCheck %s +; RUN: opt -passes=infer-alignment -S < %s | FileCheck %s define void @combine_metadata_dominance1(ptr %p) { ; CHECK-LABEL: define void @combine_metadata_dominance1 @@ -9,7 +9,7 @@ ; CHECK-NEXT: br label [[BB1:%.*]] ; CHECK: bb1: ; CHECK-NEXT: [[B:%.*]] = load ptr, ptr [[P]], align 8, !align !1 -; CHECK-NEXT: store i32 0, ptr [[A]], align 4 +; CHECK-NEXT: store i32 0, ptr [[A]], align 8 ; CHECK-NEXT: store i32 0, ptr [[B]], align 4 ; CHECK-NEXT: ret void ; @@ -32,7 +32,7 @@ ; CHECK-NEXT: br label [[BB1:%.*]] ; CHECK: bb1: ; CHECK-NEXT: [[B:%.*]] = load ptr, ptr [[P]], align 8, !align !1 -; CHECK-NEXT: store i32 0, ptr [[A]], align 4 +; CHECK-NEXT: store i32 0, ptr [[A]], align 8 ; CHECK-NEXT: store i32 0, ptr [[B]], align 4 ; CHECK-NEXT: ret void ; diff --git a/llvm/test/Transforms/InferAlignment/gep.ll b/llvm/test/Transforms/InferAlignment/gep.ll --- a/llvm/test/Transforms/InferAlignment/gep.ll +++ b/llvm/test/Transforms/InferAlignment/gep.ll @@ -1,5 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 2 -; RUN: opt -passes=no-op-function -S < %s | FileCheck %s +; RUN: opt -passes=infer-alignment -S < %s | FileCheck %s @x = external global <2 x i64>, align 16 @xx = external global [13 x <2 x i64>], align 16 @@ -12,7 +12,7 @@ ; CHECK-LABEL: define <2 x i64> @hem ; CHECK-SAME: (i32 [[I:%.*]]) { ; CHECK-NEXT: [[T:%.*]] = getelementptr <2 x i64>, ptr @x, i32 [[I]] -; CHECK-NEXT: [[TMP1:%.*]] = load <2 x i64>, ptr [[T]], align 1 +; CHECK-NEXT: [[TMP1:%.*]] = load <2 x i64>, ptr [[T]], align 16 ; CHECK-NEXT: ret <2 x i64> [[TMP1]] ; %t = getelementptr <2 x i64>, ptr @x, i32 %i @@ -24,7 +24,7 @@ ; CHECK-LABEL: define <2 x i64> @hem_2d ; CHECK-SAME: (i32 [[I:%.*]], i32 [[J:%.*]]) { ; CHECK-NEXT: [[T:%.*]] = getelementptr [13 x <2 x i64>], ptr @xx, i32 [[I]], i32 [[J]] -; CHECK-NEXT: [[TMP1:%.*]] = load <2 x i64>, ptr [[T]], align 1 +; CHECK-NEXT: [[TMP1:%.*]] = load <2 x i64>, ptr [[T]], align 16 ; CHECK-NEXT: ret <2 x i64> [[TMP1]] ; %t = getelementptr [13 x <2 x i64>], ptr @xx, i32 %i, i32 %j @@ -39,7 +39,7 @@ define i4 @test_vector_load_i4() { ; CHECK-LABEL: define i4 @test_vector_load_i4() { ; CHECK-NEXT: [[PTR0:%.*]] = getelementptr i8, ptr @foo, i64 0 -; CHECK-NEXT: [[RES0:%.*]] = load i4, ptr [[PTR0]], align 1 +; CHECK-NEXT: [[RES0:%.*]] = load i4, ptr [[PTR0]], align 8 ; CHECK-NEXT: ret i4 [[RES0]] ; %ptr0 = getelementptr i8, ptr @foo, i64 0 @@ -59,7 +59,7 @@ ; CHECK-LABEL: define i32 @test_gep_in_struct ; CHECK-SAME: (i64 [[IDX:%.*]]) { ; CHECK-NEXT: [[NS7:%.*]] = getelementptr inbounds [128 x %struct.CallerInfo], ptr @CallerInfos, i64 0, i64 [[IDX]], i32 1 -; CHECK-NEXT: [[RES:%.*]] = load i32, ptr [[NS7]], align 1 +; CHECK-NEXT: [[RES:%.*]] = load i32, ptr [[NS7]], align 8 ; CHECK-NEXT: ret i32 [[RES]] ; %NS7 = getelementptr inbounds [128 x %struct.CallerInfo], ptr @CallerInfos, i64 0, i64 %idx, i32 1 @@ -75,7 +75,7 @@ ; CHECK-LABEL: define void @hem_store ; CHECK-SAME: (i32 [[I:%.*]], <2 x i64> [[Y:%.*]]) { ; CHECK-NEXT: [[T:%.*]] = getelementptr <2 x i64>, ptr @x, i32 [[I]] -; CHECK-NEXT: store <2 x i64> [[Y]], ptr [[T]], align 1 +; CHECK-NEXT: store <2 x i64> [[Y]], ptr [[T]], align 16 ; CHECK-NEXT: ret void ; %t = getelementptr <2 x i64>, ptr @x, i32 %i @@ -87,7 +87,7 @@ ; CHECK-LABEL: define void @hem_2d_store ; CHECK-SAME: (i32 [[I:%.*]], i32 [[J:%.*]], <2 x i64> [[Y:%.*]]) { ; CHECK-NEXT: [[T:%.*]] = getelementptr [13 x <2 x i64>], ptr @xx, i32 [[I]], i32 [[J]] -; CHECK-NEXT: store <2 x i64> [[Y]], ptr [[T]], align 1 +; CHECK-NEXT: store <2 x i64> [[Y]], ptr [[T]], align 16 ; CHECK-NEXT: ret void ; %t = getelementptr [13 x <2 x i64>], ptr @xx, i32 %i, i32 %j @@ -101,7 +101,7 @@ ; CHECK-LABEL: define void @test_evaluate_gep_as_ptrs_array ; CHECK-SAME: (ptr addrspace(2) [[B:%.*]]) { ; CHECK-NEXT: [[A:%.*]] = getelementptr [4 x ptr addrspace(2)], ptr addrspace(1) @arst, i16 0, i16 2 -; CHECK-NEXT: store ptr addrspace(2) [[B]], ptr addrspace(1) [[A]], align 8 +; CHECK-NEXT: store ptr addrspace(2) [[B]], ptr addrspace(1) [[A]], align 16 ; CHECK-NEXT: ret void ; %A = getelementptr [4 x ptr addrspace(2)], ptr addrspace(1) @arst, i16 0, i16 2 @@ -118,26 +118,26 @@ define void @frob() { ; CHECK-LABEL: define void @frob() { -; CHECK-NEXT: store i32 1, ptr @Y, align 4 +; CHECK-NEXT: store i32 1, ptr @Y, align 16 ; CHECK-NEXT: store i32 1, ptr getelementptr inbounds ([3 x %struct.X], ptr @Y, i64 0, i64 0, i32 0, i64 1), align 4 -; CHECK-NEXT: store i32 1, ptr getelementptr inbounds ([3 x %struct.X], ptr @Y, i64 0, i64 0, i32 0, i64 2), align 4 +; CHECK-NEXT: store i32 1, ptr getelementptr inbounds ([3 x %struct.X], ptr @Y, i64 0, i64 0, i32 0, i64 2), align 8 ; CHECK-NEXT: store i32 1, ptr getelementptr ([3 x %struct.X], ptr @Y, i64 0, i64 0, i32 0, i64 3), align 4 -; CHECK-NEXT: store i32 1, ptr getelementptr ([3 x %struct.X], ptr @Y, i64 0, i64 0, i32 0, i64 4), align 4 +; CHECK-NEXT: store i32 1, ptr getelementptr ([3 x %struct.X], ptr @Y, i64 0, i64 0, i32 0, i64 4), align 16 ; CHECK-NEXT: store i32 1, ptr getelementptr ([3 x %struct.X], ptr @Y, i64 0, i64 0, i32 0, i64 5), align 4 -; CHECK-NEXT: store i32 1, ptr getelementptr ([3 x %struct.X], ptr @Y, i64 0, i64 0, i32 0, i64 6), align 4 +; CHECK-NEXT: store i32 1, ptr getelementptr ([3 x %struct.X], ptr @Y, i64 0, i64 0, i32 0, i64 6), align 8 ; CHECK-NEXT: store i32 1, ptr getelementptr ([3 x %struct.X], ptr @Y, i64 0, i64 0, i32 0, i64 7), align 4 -; CHECK-NEXT: store i32 1, ptr getelementptr ([3 x %struct.X], ptr @Y, i64 0, i64 0, i32 0, i64 8), align 4 +; CHECK-NEXT: store i32 1, ptr getelementptr ([3 x %struct.X], ptr @Y, i64 0, i64 0, i32 0, i64 8), align 16 ; CHECK-NEXT: store i32 1, ptr getelementptr ([3 x %struct.X], ptr @Y, i64 0, i64 0, i32 0, i64 9), align 4 -; CHECK-NEXT: store i32 1, ptr getelementptr ([3 x %struct.X], ptr @Y, i64 0, i64 0, i32 0, i64 10), align 4 +; CHECK-NEXT: store i32 1, ptr getelementptr ([3 x %struct.X], ptr @Y, i64 0, i64 0, i32 0, i64 10), align 8 ; CHECK-NEXT: store i32 1, ptr getelementptr ([3 x %struct.X], ptr @Y, i64 0, i64 0, i32 0, i64 11), align 4 -; CHECK-NEXT: store i32 1, ptr getelementptr ([3 x %struct.X], ptr @Y, i64 0, i64 0, i32 0, i64 12), align 4 +; CHECK-NEXT: store i32 1, ptr getelementptr ([3 x %struct.X], ptr @Y, i64 0, i64 0, i32 0, i64 12), align 16 ; CHECK-NEXT: store i32 1, ptr getelementptr ([3 x %struct.X], ptr @Y, i64 0, i64 0, i32 0, i64 13), align 4 ; CHECK-NEXT: store i32 1, ptr getelementptr ([3 x %struct.X], ptr @Y, i64 0, i64 0, i32 0, i64 14), align 8 ; CHECK-NEXT: store i32 1, ptr getelementptr ([3 x %struct.X], ptr @Y, i64 0, i64 0, i32 0, i64 15), align 4 -; CHECK-NEXT: store i32 1, ptr getelementptr ([3 x %struct.X], ptr @Y, i64 0, i64 0, i32 0, i64 16), align 8 +; CHECK-NEXT: store i32 1, ptr getelementptr ([3 x %struct.X], ptr @Y, i64 0, i64 0, i32 0, i64 16), align 16 ; CHECK-NEXT: store i32 1, ptr getelementptr ([3 x %struct.X], ptr @Y, i64 0, i64 0, i32 0, i64 17), align 4 ; CHECK-NEXT: store i32 1, ptr getelementptr ([3 x %struct.X], ptr @Y, i64 0, i64 0, i32 0, i64 18), align 8 -; CHECK-NEXT: store i32 1, ptr getelementptr ([3 x %struct.X], ptr @Y, i64 0, i64 0, i32 0, i64 36), align 8 +; CHECK-NEXT: store i32 1, ptr getelementptr ([3 x %struct.X], ptr @Y, i64 0, i64 0, i32 0, i64 36), align 16 ; CHECK-NEXT: store i32 1, ptr getelementptr ([3 x %struct.X], ptr @Y, i64 0, i64 0, i32 0, i64 19), align 8 ; CHECK-NEXT: ret void ; diff --git a/llvm/test/Transforms/InferAlignment/irregular-size.ll b/llvm/test/Transforms/InferAlignment/irregular-size.ll --- a/llvm/test/Transforms/InferAlignment/irregular-size.ll +++ b/llvm/test/Transforms/InferAlignment/irregular-size.ll @@ -1,11 +1,11 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 2 -; RUN: opt < %s -passes=no-op-function -S | FileCheck %s +; RUN: opt < %s -passes=infer-alignment -S | FileCheck %s define i177 @ossfuzz_9880(i177 %X) { ; CHECK-LABEL: define i177 @ossfuzz_9880 ; CHECK-SAME: (i177 [[X:%.*]]) { ; CHECK-NEXT: [[A:%.*]] = alloca i177, align 8 -; CHECK-NEXT: [[L1:%.*]] = load i177, ptr [[A]], align 4 +; CHECK-NEXT: [[L1:%.*]] = load i177, ptr [[A]], align 8 ; CHECK-NEXT: ret i177 [[L1]] ; %A = alloca i177 diff --git a/llvm/test/Transforms/InferAlignment/load-assume.ll b/llvm/test/Transforms/InferAlignment/load-assume.ll --- a/llvm/test/Transforms/InferAlignment/load-assume.ll +++ b/llvm/test/Transforms/InferAlignment/load-assume.ll @@ -1,5 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 2 -; RUN: opt < %s -passes=no-op-function -S | FileCheck --check-prefixes=CHECK %s +; RUN: opt < %s -passes=infer-alignment -S | FileCheck --check-prefixes=CHECK %s target triple = "x86_64-unknown-linux-gnu" declare void @llvm.assume(i1) @@ -11,7 +11,7 @@ define i32 @foo1(ptr %a) { ; CHECK-LABEL: define i32 @foo1 ; CHECK-SAME: (ptr [[A:%.*]]) { -; CHECK-NEXT: [[T0:%.*]] = load i32, ptr [[A]], align 4 +; CHECK-NEXT: [[T0:%.*]] = load i32, ptr [[A]], align 32 ; CHECK-NEXT: [[PTRINT:%.*]] = ptrtoint ptr [[A]] to i64 ; CHECK-NEXT: [[MASKEDPTR:%.*]] = and i64 [[PTRINT]], 31 ; CHECK-NEXT: [[MASKCOND:%.*]] = icmp eq i64 [[MASKEDPTR]], 0 @@ -33,7 +33,7 @@ ; CHECK-NEXT: [[MASKEDPTR:%.*]] = and i64 [[PTRINT]], 31 ; CHECK-NEXT: [[MASKCOND:%.*]] = icmp eq i64 [[MASKEDPTR]], 0 ; CHECK-NEXT: tail call void @llvm.assume(i1 [[MASKCOND]]) -; CHECK-NEXT: [[T0:%.*]] = load i32, ptr [[A]], align 4 +; CHECK-NEXT: [[T0:%.*]] = load i32, ptr [[A]], align 32 ; CHECK-NEXT: ret i32 [[T0]] ; %ptrint = ptrtoint ptr %a to i64 diff --git a/llvm/test/Transforms/InferAlignment/load-attr.ll b/llvm/test/Transforms/InferAlignment/load-attr.ll --- a/llvm/test/Transforms/InferAlignment/load-attr.ll +++ b/llvm/test/Transforms/InferAlignment/load-attr.ll @@ -1,5 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 2 -; RUN: opt < %s -passes=no-op-function -S | FileCheck %s +; RUN: opt < %s -passes=infer-alignment -S | FileCheck %s target triple = "x86_64-unknown-linux-gnu" ; Function Attrs: nounwind uwtable @@ -7,7 +7,7 @@ ; CHECK-LABEL: define i32 @foo1 ; CHECK-SAME: (ptr align 32 [[A:%.*]]) #[[ATTR0:[0-9]+]] { ; CHECK-NEXT: entry: -; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4 +; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 32 ; CHECK-NEXT: ret i32 [[TMP0]] ; entry: @@ -21,7 +21,7 @@ ; CHECK-SAME: (ptr align 32 [[A:%.*]]) #[[ATTR0]] { ; CHECK-NEXT: entry: ; CHECK-NEXT: [[V:%.*]] = call ptr @func1(ptr [[A]]) -; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[V]], align 4 +; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[V]], align 32 ; CHECK-NEXT: ret i32 [[TMP0]] ; entry: diff --git a/llvm/test/Transforms/InferAlignment/ptrmask.ll b/llvm/test/Transforms/InferAlignment/ptrmask.ll --- a/llvm/test/Transforms/InferAlignment/ptrmask.ll +++ b/llvm/test/Transforms/InferAlignment/ptrmask.ll @@ -1,5 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 2 -; RUN: opt < %s -passes=no-op-function -S | FileCheck %s +; RUN: opt < %s -passes=infer-alignment -S | FileCheck %s declare ptr @llvm.ptrmask.p0.i64(ptr, i64) declare ptr @llvm.ptrmask.p0.i32(ptr, i32) @@ -22,7 +22,7 @@ ; CHECK-LABEL: define <16 x i8> @ptrmask_align_unknown_ptr_align8 ; CHECK-SAME: (ptr align 8 [[PTR:%.*]], i64 [[MASK:%.*]]) { ; CHECK-NEXT: [[ALIGNED:%.*]] = call ptr @llvm.ptrmask.p0.i64(ptr [[PTR]], i64 [[MASK]]) -; CHECK-NEXT: [[LOAD:%.*]] = load <16 x i8>, ptr [[ALIGNED]], align 1 +; CHECK-NEXT: [[LOAD:%.*]] = load <16 x i8>, ptr [[ALIGNED]], align 8 ; CHECK-NEXT: ret <16 x i8> [[LOAD]] ; %aligned = call ptr @llvm.ptrmask.p0.i64(ptr %ptr, i64 %mask) @@ -35,7 +35,7 @@ ; CHECK-LABEL: define <16 x i8> @ptrmask_align2_ptr_align1 ; CHECK-SAME: (ptr align 1 [[PTR:%.*]]) { ; CHECK-NEXT: [[ALIGNED:%.*]] = call ptr @llvm.ptrmask.p0.i64(ptr [[PTR]], i64 -2) -; CHECK-NEXT: [[LOAD:%.*]] = load <16 x i8>, ptr [[ALIGNED]], align 1 +; CHECK-NEXT: [[LOAD:%.*]] = load <16 x i8>, ptr [[ALIGNED]], align 2 ; CHECK-NEXT: ret <16 x i8> [[LOAD]] ; %aligned = call ptr @llvm.ptrmask.p0.i64(ptr %ptr, i64 -2) @@ -48,7 +48,7 @@ ; CHECK-LABEL: define <16 x i8> @ptrmask_align4_ptr_align1 ; CHECK-SAME: (ptr align 1 [[PTR:%.*]]) { ; CHECK-NEXT: [[ALIGNED:%.*]] = call ptr @llvm.ptrmask.p0.i64(ptr [[PTR]], i64 -4) -; CHECK-NEXT: [[LOAD:%.*]] = load <16 x i8>, ptr [[ALIGNED]], align 1 +; CHECK-NEXT: [[LOAD:%.*]] = load <16 x i8>, ptr [[ALIGNED]], align 4 ; CHECK-NEXT: ret <16 x i8> [[LOAD]] ; %aligned = call ptr @llvm.ptrmask.p0.i64(ptr %ptr, i64 -4) @@ -61,7 +61,7 @@ ; CHECK-LABEL: define <16 x i8> @ptrmask_align8_ptr_align1 ; CHECK-SAME: (ptr align 1 [[PTR:%.*]]) { ; CHECK-NEXT: [[ALIGNED:%.*]] = call ptr @llvm.ptrmask.p0.i64(ptr [[PTR]], i64 -8) -; CHECK-NEXT: [[LOAD:%.*]] = load <16 x i8>, ptr [[ALIGNED]], align 1 +; CHECK-NEXT: [[LOAD:%.*]] = load <16 x i8>, ptr [[ALIGNED]], align 8 ; CHECK-NEXT: ret <16 x i8> [[LOAD]] ; %aligned = call ptr @llvm.ptrmask.p0.i64(ptr %ptr, i64 -8) @@ -75,7 +75,7 @@ ; CHECK-LABEL: define <16 x i8> @ptrmask_align8_ptr_align8 ; CHECK-SAME: (ptr align 8 [[PTR:%.*]]) { ; CHECK-NEXT: [[ALIGNED:%.*]] = call ptr @llvm.ptrmask.p0.i64(ptr [[PTR]], i64 -8) -; CHECK-NEXT: [[LOAD:%.*]] = load <16 x i8>, ptr [[ALIGNED]], align 1 +; CHECK-NEXT: [[LOAD:%.*]] = load <16 x i8>, ptr [[ALIGNED]], align 8 ; CHECK-NEXT: ret <16 x i8> [[LOAD]] ; %aligned = call ptr @llvm.ptrmask.p0.i64(ptr %ptr, i64 -8) @@ -89,7 +89,7 @@ ; CHECK-LABEL: define <16 x i8> @ptrmask_align8_ptr_align16 ; CHECK-SAME: (ptr align 16 [[PTR:%.*]]) { ; CHECK-NEXT: [[ALIGNED:%.*]] = call ptr @llvm.ptrmask.p0.i64(ptr [[PTR]], i64 -8) -; CHECK-NEXT: [[LOAD:%.*]] = load <16 x i8>, ptr [[ALIGNED]], align 1 +; CHECK-NEXT: [[LOAD:%.*]] = load <16 x i8>, ptr [[ALIGNED]], align 16 ; CHECK-NEXT: ret <16 x i8> [[LOAD]] ; %aligned = call ptr @llvm.ptrmask.p0.i64(ptr %ptr, i64 -8) @@ -103,7 +103,7 @@ ; CHECK-LABEL: define <16 x i8> @ptrmask_align8_ptr_align1_smallmask ; CHECK-SAME: (ptr align 1 [[PTR:%.*]]) { ; CHECK-NEXT: [[ALIGNED:%.*]] = call ptr @llvm.ptrmask.p0.i32(ptr [[PTR]], i32 -8) -; CHECK-NEXT: [[LOAD:%.*]] = load <16 x i8>, ptr [[ALIGNED]], align 1 +; CHECK-NEXT: [[LOAD:%.*]] = load <16 x i8>, ptr [[ALIGNED]], align 8 ; CHECK-NEXT: ret <16 x i8> [[LOAD]] ; %aligned = call ptr @llvm.ptrmask.p0.i32(ptr %ptr, i32 -8) @@ -117,7 +117,7 @@ ; CHECK-LABEL: define <16 x i8> @ptrmask_align8_ptr_align1_bigmask ; CHECK-SAME: (ptr align 1 [[PTR:%.*]]) { ; CHECK-NEXT: [[ALIGNED:%.*]] = call ptr @llvm.ptrmask.p0.i128(ptr [[PTR]], i128 -8) -; CHECK-NEXT: [[LOAD:%.*]] = load <16 x i8>, ptr [[ALIGNED]], align 1 +; CHECK-NEXT: [[LOAD:%.*]] = load <16 x i8>, ptr [[ALIGNED]], align 8 ; CHECK-NEXT: ret <16 x i8> [[LOAD]] ; %aligned = call ptr @llvm.ptrmask.p0.i128(ptr %ptr, i128 -8) diff --git a/llvm/test/Transforms/InferAlignment/store-2d-gep.ll b/llvm/test/Transforms/InferAlignment/store-2d-gep.ll --- a/llvm/test/Transforms/InferAlignment/store-2d-gep.ll +++ b/llvm/test/Transforms/InferAlignment/store-2d-gep.ll @@ -1,5 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 2 -; RUN: opt < %s -passes=no-op-function -S | FileCheck %s +; RUN: opt < %s -passes=infer-alignment -S | FileCheck %s define void @foo2(ptr %b, i64 %n, i64 %u, i64 %y) nounwind { ; CHECK-LABEL: define void @foo2 @@ -17,7 +17,7 @@ ; CHECK-NEXT: [[J:%.*]] = mul i64 [[I]], [[V]] ; CHECK-NEXT: [[H:%.*]] = add i64 [[J]], [[Z]] ; CHECK-NEXT: [[T8:%.*]] = getelementptr double, ptr [[E]], i64 [[H]] -; CHECK-NEXT: store <2 x double> zeroinitializer, ptr [[T8]], align 8 +; CHECK-NEXT: store <2 x double> zeroinitializer, ptr [[T8]], align 16 ; CHECK-NEXT: [[INDVAR_NEXT]] = add i64 [[I]], 1 ; CHECK-NEXT: [[EXITCOND:%.*]] = icmp eq i64 [[INDVAR_NEXT]], [[N]] ; CHECK-NEXT: br i1 [[EXITCOND]], label [[RETURN]], label [[BB]] @@ -68,7 +68,7 @@ ; CHECK: bb1: ; CHECK-NEXT: [[J:%.*]] = phi i64 [ 0, [[BB7_OUTER]] ], [ [[INDVAR_NEXT:%.*]], [[BB1]] ] ; CHECK-NEXT: [[T4:%.*]] = getelementptr [1001 x [20000 x double]], ptr @Nice, i64 0, i64 [[I]], i64 [[J]] -; CHECK-NEXT: store <2 x double> zeroinitializer, ptr [[T4]], align 8 +; CHECK-NEXT: store <2 x double> zeroinitializer, ptr [[T4]], align 16 ; CHECK-NEXT: [[S4:%.*]] = getelementptr [1001 x [20001 x double]], ptr @Awkward, i64 0, i64 [[I]], i64 [[J]] ; CHECK-NEXT: store <2 x double> zeroinitializer, ptr [[S4]], align 8 ; CHECK-NEXT: [[INDVAR_NEXT]] = add i64 [[J]], 2 diff --git a/llvm/test/Transforms/InferAlignment/store-alloca.ll b/llvm/test/Transforms/InferAlignment/store-alloca.ll --- a/llvm/test/Transforms/InferAlignment/store-alloca.ll +++ b/llvm/test/Transforms/InferAlignment/store-alloca.ll @@ -1,7 +1,7 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 2 -; RUN: opt < %s -passes=no-op-function -S -data-layout="E-p:64:64:64-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-v64:64:64-v128:128:128" | FileCheck %s -check-prefixes=ALL,CHECK -; RUN: opt < %s -passes=no-op-function -S -data-layout="E-p:32:32:32-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-v64:64:64-v128:128:128" | FileCheck %s -check-prefixes=ALL,P32 -; RUN: opt < %s -passes=no-op-function -S | FileCheck %s -check-prefixes=NODL +; RUN: opt < %s -passes=infer-alignment -S -data-layout="E-p:64:64:64-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-v64:64:64-v128:128:128" | FileCheck %s -check-prefixes=ALL,CHECK +; RUN: opt < %s -passes=infer-alignment -S -data-layout="E-p:32:32:32-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-v64:64:64-v128:128:128" | FileCheck %s -check-prefixes=ALL,P32 +; RUN: opt < %s -passes=infer-alignment -S | FileCheck %s -check-prefixes=NODL define void @test3() { ; ALL-LABEL: define void @test3() { @@ -13,7 +13,7 @@ ; NODL-LABEL: define void @test3() { ; NODL-NEXT: [[A:%.*]] = alloca { i32 }, align 8 ; NODL-NEXT: [[B:%.*]] = getelementptr { i32 }, ptr [[A]], i32 0, i32 0 -; NODL-NEXT: store i32 123, ptr [[B]], align 4 +; NODL-NEXT: store i32 123, ptr [[B]], align 8 ; NODL-NEXT: ret void ; %A = alloca { i32 } ; [#uses=1] @@ -30,7 +30,7 @@ ; CHECK-NEXT: [[C:%.*]] = alloca i32, align 4 ; CHECK-NEXT: store i32 123, ptr [[A]], align 4 ; CHECK-NEXT: store ptr [[A]], ptr [[B]], align 8 -; CHECK-NEXT: store i32 123, ptr [[B]], align 4 +; CHECK-NEXT: store i32 123, ptr [[B]], align 8 ; CHECK-NEXT: store atomic i32 2, ptr [[A]] unordered, align 4 ; CHECK-NEXT: store atomic i32 3, ptr [[A]] release, align 4 ; CHECK-NEXT: store atomic i32 4, ptr [[A]] seq_cst, align 4 @@ -58,12 +58,12 @@ ; NODL-NEXT: [[A:%.*]] = alloca { i32 }, align 8 ; NODL-NEXT: [[B:%.*]] = alloca ptr, align 8 ; NODL-NEXT: [[C:%.*]] = alloca i32, align 4 -; NODL-NEXT: store i32 123, ptr [[A]], align 4 +; NODL-NEXT: store i32 123, ptr [[A]], align 8 ; NODL-NEXT: store ptr [[A]], ptr [[B]], align 8 -; NODL-NEXT: store i32 123, ptr [[B]], align 4 -; NODL-NEXT: store atomic i32 2, ptr [[A]] unordered, align 4 -; NODL-NEXT: store atomic i32 3, ptr [[A]] release, align 4 -; NODL-NEXT: store atomic i32 4, ptr [[A]] seq_cst, align 4 +; NODL-NEXT: store i32 123, ptr [[B]], align 8 +; NODL-NEXT: store atomic i32 2, ptr [[A]] unordered, align 8 +; NODL-NEXT: store atomic i32 3, ptr [[A]] release, align 8 +; NODL-NEXT: store atomic i32 4, ptr [[A]] seq_cst, align 8 ; NODL-NEXT: [[C_1:%.*]] = addrspacecast ptr [[C]] to ptr addrspace(1) ; NODL-NEXT: store i32 123, ptr addrspace(1) [[C_1]], align 4 ; NODL-NEXT: ret void @@ -99,7 +99,7 @@ ; NODL-NEXT: entry: ; NODL-NEXT: [[A:%.*]] = alloca { i32 }, align 8 ; NODL-NEXT: [[B:%.*]] = alloca i32, align 4 -; NODL-NEXT: store volatile i32 123, ptr [[A]], align 4 +; NODL-NEXT: store volatile i32 123, ptr [[A]], align 8 ; NODL-NEXT: tail call void @f(ptr [[B]]) ; NODL-NEXT: ret void ; diff --git a/llvm/test/Transforms/InferAlignment/vector.ll b/llvm/test/Transforms/InferAlignment/vector.ll --- a/llvm/test/Transforms/InferAlignment/vector.ll +++ b/llvm/test/Transforms/InferAlignment/vector.ll @@ -1,5 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 2 -; RUN: opt < %s -passes=no-op-function -S | FileCheck %s +; RUN: opt < %s -passes=infer-alignment -S | FileCheck %s ; InferAlignment should be able to prove vector alignment in the ; presence of a few mild address computation tricks. @@ -12,7 +12,7 @@ define <2 x i64> @load_test1() { ; CHECK-LABEL: define <2 x i64> @load_test1() { -; CHECK-NEXT: [[TMP1:%.*]] = load <2 x i64>, ptr @x, align 1 +; CHECK-NEXT: [[TMP1:%.*]] = load <2 x i64>, ptr @x, align 16 ; CHECK-NEXT: ret <2 x i64> [[TMP1]] ; %tmp1 = load <2 x i64>, ptr @x, align 1 @@ -23,7 +23,7 @@ ; CHECK-LABEL: define <2 x i64> @load_test2() { ; CHECK-NEXT: [[T:%.*]] = alloca <2 x i64>, align 16 ; CHECK-NEXT: call void @use(ptr [[T]]) -; CHECK-NEXT: [[TMP1:%.*]] = load <2 x i64>, ptr [[T]], align 1 +; CHECK-NEXT: [[TMP1:%.*]] = load <2 x i64>, ptr [[T]], align 16 ; CHECK-NEXT: ret <2 x i64> [[TMP1]] ; %t = alloca <2 x i64> @@ -41,7 +41,7 @@ ; CHECK-LABEL: define <16 x i8> @load_test3 ; CHECK-SAME: (<2 x i64> [[X:%.*]]) { ; CHECK-NEXT: entry: -; CHECK-NEXT: [[TMP:%.*]] = load <16 x i8>, ptr @GLOBAL, align 1 +; CHECK-NEXT: [[TMP:%.*]] = load <16 x i8>, ptr @GLOBAL, align 16 ; CHECK-NEXT: ret <16 x i8> [[TMP]] ; entry: @@ -54,7 +54,7 @@ define <16 x i8> @load_test3_as1(<2 x i64> %x) { ; CHECK-LABEL: define <16 x i8> @load_test3_as1 ; CHECK-SAME: (<2 x i64> [[X:%.*]]) { -; CHECK-NEXT: [[TMP:%.*]] = load <16 x i8>, ptr addrspace(1) @GLOBAL_as1, align 1 +; CHECK-NEXT: [[TMP:%.*]] = load <16 x i8>, ptr addrspace(1) @GLOBAL_as1, align 16 ; CHECK-NEXT: ret <16 x i8> [[TMP]] ; %tmp = load <16 x i8>, ptr addrspace(1) @GLOBAL_as1, align 1 @@ -66,7 +66,7 @@ define <16 x i8> @load_test3_as1_gep(<2 x i64> %x) { ; CHECK-LABEL: define <16 x i8> @load_test3_as1_gep ; CHECK-SAME: (<2 x i64> [[X:%.*]]) { -; CHECK-NEXT: [[TMP:%.*]] = load <16 x i8>, ptr addrspace(1) getelementptr inbounds ([8 x i32], ptr addrspace(1) @GLOBAL_as1_gep, i16 0, i16 4), align 1 +; CHECK-NEXT: [[TMP:%.*]] = load <16 x i8>, ptr addrspace(1) getelementptr inbounds ([8 x i32], ptr addrspace(1) @GLOBAL_as1_gep, i16 0, i16 4), align 16 ; CHECK-NEXT: ret <16 x i8> [[TMP]] ; %tmp = load <16 x i8>, ptr addrspace(1) getelementptr ([8 x i32], ptr addrspace(1) @GLOBAL_as1_gep, i16 0, i16 4), align 1 @@ -80,7 +80,7 @@ define void @store_test1(<2 x i64> %y) { ; CHECK-LABEL: define void @store_test1 ; CHECK-SAME: (<2 x i64> [[Y:%.*]]) { -; CHECK-NEXT: store <2 x i64> [[Y]], ptr @x, align 1 +; CHECK-NEXT: store <2 x i64> [[Y]], ptr @x, align 16 ; CHECK-NEXT: ret void ; store <2 x i64> %y, ptr @x, align 1 @@ -92,7 +92,7 @@ ; CHECK-SAME: (<2 x i64> [[Y:%.*]]) { ; CHECK-NEXT: [[T:%.*]] = alloca <2 x i64>, align 16 ; CHECK-NEXT: call void @use(ptr [[T]]) -; CHECK-NEXT: store <2 x i64> [[Y]], ptr [[T]], align 1 +; CHECK-NEXT: store <2 x i64> [[Y]], ptr [[T]], align 16 ; CHECK-NEXT: ret void ; %t = alloca <2 x i64> diff --git a/llvm/test/Transforms/InferAlignment/vscale.ll b/llvm/test/Transforms/InferAlignment/vscale.ll --- a/llvm/test/Transforms/InferAlignment/vscale.ll +++ b/llvm/test/Transforms/InferAlignment/vscale.ll @@ -1,12 +1,12 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 2 -; RUN: opt -passes=no-op-function -S < %s | FileCheck %s +; RUN: opt -passes=infer-alignment -S < %s | FileCheck %s ; These tests serve to verify code changes when underlying gep ptr is alloca. define i32 @gep_alloca_vscale_zero() { ; CHECK-LABEL: define i32 @gep_alloca_vscale_zero() { ; CHECK-NEXT: [[A:%.*]] = alloca , align 16 ; CHECK-NEXT: [[TMP:%.*]] = getelementptr , ptr [[A]], i32 0, i32 2 -; CHECK-NEXT: [[LOAD:%.*]] = load i32, ptr [[TMP]], align 4 +; CHECK-NEXT: [[LOAD:%.*]] = load i32, ptr [[TMP]], align 8 ; CHECK-NEXT: ret i32 [[LOAD]] ; %a = alloca @@ -19,9 +19,9 @@ ; CHECK-LABEL: define void @scalable4i32_to_fixed16i32 ; CHECK-SAME: (ptr [[OUT:%.*]]) { ; CHECK-NEXT: entry: -; CHECK-NEXT: [[TMP:%.*]] = alloca , align 16 -; CHECK-NEXT: store <16 x i32> zeroinitializer, ptr [[TMP]], align 16 -; CHECK-NEXT: [[RELOAD:%.*]] = load volatile <16 x i32>, ptr [[TMP]], align 16 +; CHECK-NEXT: [[TMP:%.*]] = alloca , align 64 +; CHECK-NEXT: store <16 x i32> zeroinitializer, ptr [[TMP]], align 64 +; CHECK-NEXT: [[RELOAD:%.*]] = load volatile <16 x i32>, ptr [[TMP]], align 64 ; CHECK-NEXT: store <16 x i32> [[RELOAD]], ptr [[OUT]], align 16 ; CHECK-NEXT: ret void ; @@ -37,9 +37,9 @@ ; CHECK-LABEL: define void @scalable16i32_to_fixed16i32 ; CHECK-SAME: (ptr [[OUT:%.*]]) { ; CHECK-NEXT: entry: -; CHECK-NEXT: [[TMP:%.*]] = alloca , align 16 -; CHECK-NEXT: store volatile <16 x i32> zeroinitializer, ptr [[TMP]], align 16 -; CHECK-NEXT: [[RELOAD:%.*]] = load volatile <16 x i32>, ptr [[TMP]], align 16 +; CHECK-NEXT: [[TMP:%.*]] = alloca , align 64 +; CHECK-NEXT: store volatile <16 x i32> zeroinitializer, ptr [[TMP]], align 64 +; CHECK-NEXT: [[RELOAD:%.*]] = load volatile <16 x i32>, ptr [[TMP]], align 64 ; CHECK-NEXT: store <16 x i32> [[RELOAD]], ptr [[OUT]], align 16 ; CHECK-NEXT: ret void ; @@ -55,9 +55,9 @@ ; CHECK-LABEL: define void @scalable32i32_to_scalable16i32 ; CHECK-SAME: (ptr [[OUT:%.*]]) { ; CHECK-NEXT: entry: -; CHECK-NEXT: [[TMP:%.*]] = alloca , align 16 -; CHECK-NEXT: store volatile zeroinitializer, ptr [[TMP]], align 16 -; CHECK-NEXT: [[RELOAD:%.*]] = load volatile , ptr [[TMP]], align 16 +; CHECK-NEXT: [[TMP:%.*]] = alloca , align 64 +; CHECK-NEXT: store volatile zeroinitializer, ptr [[TMP]], align 64 +; CHECK-NEXT: [[RELOAD:%.*]] = load volatile , ptr [[TMP]], align 64 ; CHECK-NEXT: store [[RELOAD]], ptr [[OUT]], align 16 ; CHECK-NEXT: ret void ; @@ -73,9 +73,9 @@ ; CHECK-LABEL: define void @scalable32i16_to_scalable16i32 ; CHECK-SAME: (ptr [[OUT:%.*]]) { ; CHECK-NEXT: entry: -; CHECK-NEXT: [[TMP:%.*]] = alloca , align 16 -; CHECK-NEXT: store volatile zeroinitializer, ptr [[TMP]], align 16 -; CHECK-NEXT: [[RELOAD:%.*]] = load volatile , ptr [[TMP]], align 16 +; CHECK-NEXT: [[TMP:%.*]] = alloca , align 64 +; CHECK-NEXT: store volatile zeroinitializer, ptr [[TMP]], align 64 +; CHECK-NEXT: [[RELOAD:%.*]] = load volatile , ptr [[TMP]], align 64 ; CHECK-NEXT: store [[RELOAD]], ptr [[OUT]], align 16 ; CHECK-NEXT: ret void ; @@ -91,11 +91,11 @@ ; CHECK-LABEL: define void @scalable32i16_to_scalable16i32_multiuse ; CHECK-SAME: (ptr [[OUT:%.*]], ptr [[OUT2:%.*]]) { ; CHECK-NEXT: entry: -; CHECK-NEXT: [[TMP:%.*]] = alloca , align 16 -; CHECK-NEXT: store volatile zeroinitializer, ptr [[TMP]], align 16 -; CHECK-NEXT: [[RELOAD:%.*]] = load volatile , ptr [[TMP]], align 16 +; CHECK-NEXT: [[TMP:%.*]] = alloca , align 64 +; CHECK-NEXT: store volatile zeroinitializer, ptr [[TMP]], align 64 +; CHECK-NEXT: [[RELOAD:%.*]] = load volatile , ptr [[TMP]], align 64 ; CHECK-NEXT: store [[RELOAD]], ptr [[OUT]], align 16 -; CHECK-NEXT: [[RELOAD2:%.*]] = load volatile , ptr [[TMP]], align 16 +; CHECK-NEXT: [[RELOAD2:%.*]] = load volatile , ptr [[TMP]], align 64 ; CHECK-NEXT: store [[RELOAD2]], ptr [[OUT2]], align 16 ; CHECK-NEXT: ret void ;