summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilip Reames <listmail@philipreames.com>2019-02-28 18:08:04 +0000
committerPhilip Reames <listmail@philipreames.com>2019-02-28 18:08:04 +0000
commit63a67527a42e1f9adda9ca2d7c404b8d5640d3e9 (patch)
treed293af25689407f9cf6ffeecb0829b88025fa1b5
parentaf2b0bef4361e8308697022f55209199190f08a3 (diff)
downloadbcm5719-llvm-63a67527a42e1f9adda9ca2d7c404b8d5640d3e9.tar.gz
bcm5719-llvm-63a67527a42e1f9adda9ca2d7c404b8d5640d3e9.zip
[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. llvm-svn: 355110
-rw-r--r--llvm/test/Transforms/LICM/promote-tls.ll4
-rw-r--r--llvm/test/Transforms/LICM/scalar-promote-unwind.ll26
2 files changed, 30 insertions, 0 deletions
diff --git a/llvm/test/Transforms/LICM/promote-tls.ll b/llvm/test/Transforms/LICM/promote-tls.ll
index 076d05cf094..3fe46e81ed9 100644
--- a/llvm/test/Transforms/LICM/promote-tls.ll
+++ b/llvm/test/Transforms/LICM/promote-tls.ll
@@ -21,6 +21,8 @@ entry:
br label %for.body.lr.ph
for.body.lr.ph: ; preds = %entry
+; CHECK-LABEL: for.body.lr.ph:
+; CHECK-NEXT: %addr.promoted = load i32, i32* %addr, align 1
br label %for.header
for.header:
@@ -59,6 +61,8 @@ entry:
br label %for.body.lr.ph
for.body.lr.ph: ; preds = %entry
+; CHECK-LABEL: for.body.lr.ph:
+; CHECK-NEXT: %addr.promoted = load i32, i32* %addr, align 1
br label %for.header
for.header:
diff --git a/llvm/test/Transforms/LICM/scalar-promote-unwind.ll b/llvm/test/Transforms/LICM/scalar-promote-unwind.ll
index f1f52eed1d4..bb90a4f821c 100644
--- a/llvm/test/Transforms/LICM/scalar-promote-unwind.ll
+++ b/llvm/test/Transforms/LICM/scalar-promote-unwind.ll
@@ -67,6 +67,32 @@ for.cond.cleanup:
ret void
}
+define void @test3(i1 zeroext %y) uwtable {
+; CHECK-LABEL: @test3
+entry:
+; CHECK-LABEL: entry:
+; CHECK-NEXT: %a = alloca i32
+; CHECK-NEXT: %a.promoted = load i32, i32* %a, align 1
+ %a = alloca i32
+ br label %for.body
+
+for.body:
+ %i.03 = phi i32 [ 0, %entry ], [ %inc, %for.body ]
+ %0 = load i32, i32* %a, align 4
+ %add = add nsw i32 %0, 1
+ tail call void @f()
+ store i32 %add, i32* %a, align 4
+ %inc = add nuw nsw i32 %i.03, 1
+ %exitcond = icmp eq i32 %inc, 10000
+ br i1 %exitcond, label %for.cond.cleanup, label %for.body
+
+for.cond.cleanup:
+; CHECK-LABEL: for.cond.cleanup:
+; CHECK: store i32 %add.lcssa, i32* %a, align 1
+; CHECK-NEXT: ret void
+ ret void
+}
+
@_ZTIi = external constant i8*
; In this test, the loop is within a try block. There is an explicit unwind edge out of the loop.
OpenPOWER on IntegriCloud