summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/JumpThreading/fold-not-thread.ll
diff options
context:
space:
mode:
authorXin Tong <trent.xin.tong@gmail.com>2017-05-01 15:34:17 +0000
committerXin Tong <trent.xin.tong@gmail.com>2017-05-01 15:34:17 +0000
commit21f8ac235ec3c1312f835c988a7c2b456a702806 (patch)
treeff32de87b828e5fb8520d8d7158989df4aa3515a /llvm/test/Transforms/JumpThreading/fold-not-thread.ll
parentd28f0cd44892a01781da466e3ad01014c1a758cf (diff)
downloadbcm5719-llvm-21f8ac235ec3c1312f835c988a7c2b456a702806.tar.gz
bcm5719-llvm-21f8ac235ec3c1312f835c988a7c2b456a702806.zip
[JumpThread] Do RAUW in case Cond folds to a constant in the CFG
Summary: [JumpThread] Do RAUW in case Cond folds to a constant in the CFG Reviewers: sanjoy Reviewed By: sanjoy Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D32407 llvm-svn: 301804
Diffstat (limited to 'llvm/test/Transforms/JumpThreading/fold-not-thread.ll')
-rw-r--r--llvm/test/Transforms/JumpThreading/fold-not-thread.ll57
1 files changed, 57 insertions, 0 deletions
diff --git a/llvm/test/Transforms/JumpThreading/fold-not-thread.ll b/llvm/test/Transforms/JumpThreading/fold-not-thread.ll
index 75deca62f75..3bd71066089 100644
--- a/llvm/test/Transforms/JumpThreading/fold-not-thread.ll
+++ b/llvm/test/Transforms/JumpThreading/fold-not-thread.ll
@@ -133,3 +133,60 @@ L3:
ret void
}
+; Make sure we can do the RAUW for %add...
+;
+; CHECK-LABEL: @rauw_if_possible(
+; CHECK: call void @f4(i32 96)
+define void @rauw_if_possible(i32 %value) nounwind {
+entry:
+ %cmp = icmp eq i32 %value, 32
+ br i1 %cmp, label %L0, label %L3
+L0:
+ call i32 @f2()
+ call i32 @f2()
+ %add = add i32 %value, 64
+ switch i32 %add, label %L3 [
+ i32 32, label %L1
+ i32 96, label %L2
+ ]
+
+L1:
+ call void @f3()
+ ret void
+L2:
+ call void @f4(i32 %add)
+ ret void
+L3:
+ call void @f3()
+ ret void
+}
+
+; Make sure we can NOT do the RAUW for %add...
+;
+; CHECK-LABEL: @rauw_if_possible2(
+; CHECK: call void @f4(i32 %add)
+define void @rauw_if_possible2(i32 %value) nounwind {
+entry:
+ %cmp = icmp eq i32 %value, 32
+ %add = add i32 %value, 64
+ br i1 %cmp, label %L0, label %L2
+L0:
+ call i32 @f2()
+ call i32 @f2()
+ switch i32 %add, label %L3 [
+ i32 32, label %L1
+ i32 96, label %L2
+ ]
+
+L1:
+ call void @f3()
+ ret void
+L2:
+ call void @f4(i32 %add)
+ ret void
+L3:
+ call void @f3()
+ ret void
+}
+
+
OpenPOWER on IntegriCloud