llvm.org GIT mirror llvm / 360eb90
[Tests] Strengthen LICM test corpus to show alignment striping Doing scalar promotion w/o being able to prove the alignment of the hoisted load or sunk store is a bug. Update tests to actually show the alignment so that impact of the patch which fixes this can be seen. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355110 91177308-0d34-0410-b5e6-96231b3b80d8 Philip Reames 6 months ago
2 changed file(s) with 30 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
2020 br label %for.body.lr.ph
2121
2222 for.body.lr.ph: ; preds = %entry
23 ; CHECK-LABEL: for.body.lr.ph:
24 ; CHECK-NEXT: %addr.promoted = load i32, i32* %addr, align 1
2325 br label %for.header
2426
2527 for.header:
5860 br label %for.body.lr.ph
5961
6062 for.body.lr.ph: ; preds = %entry
63 ; CHECK-LABEL: for.body.lr.ph:
64 ; CHECK-NEXT: %addr.promoted = load i32, i32* %addr, align 1
6165 br label %for.header
6266
6367 for.header:
6262 for.cond.cleanup:
6363 ; CHECK: define void @test2
6464 ; CHECK: store i32
65 ; CHECK-NEXT: ret void
66 ret void
67 }
68
69 define void @test3(i1 zeroext %y) uwtable {
70 ; CHECK-LABEL: @test3
71 entry:
72 ; CHECK-LABEL: entry:
73 ; CHECK-NEXT: %a = alloca i32
74 ; CHECK-NEXT: %a.promoted = load i32, i32* %a, align 1
75 %a = alloca i32
76 br label %for.body
77
78 for.body:
79 %i.03 = phi i32 [ 0, %entry ], [ %inc, %for.body ]
80 %0 = load i32, i32* %a, align 4
81 %add = add nsw i32 %0, 1
82 tail call void @f()
83 store i32 %add, i32* %a, align 4
84 %inc = add nuw nsw i32 %i.03, 1
85 %exitcond = icmp eq i32 %inc, 10000
86 br i1 %exitcond, label %for.cond.cleanup, label %for.body
87
88 for.cond.cleanup:
89 ; CHECK-LABEL: for.cond.cleanup:
90 ; CHECK: store i32 %add.lcssa, i32* %a, align 1
6591 ; CHECK-NEXT: ret void
6692 ret void
6793 }