summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/LoopVersioning/lcssa.ll
diff options
context:
space:
mode:
authorAdam Nemet <anemet@apple.com>2016-03-22 18:38:15 +0000
committerAdam Nemet <anemet@apple.com>2016-03-22 18:38:15 +0000
commit8b47e0d0ea7909fa2ffd9132d37b0c7b8885c97d (patch)
tree7c20a19b83bbe20fdb4b49c28951ed1d3bfc7dc8 /llvm/test/Transforms/LoopVersioning/lcssa.ll
parente409e688a328d1c61229653a7d4e1ab108cf3a3c (diff)
downloadbcm5719-llvm-8b47e0d0ea7909fa2ffd9132d37b0c7b8885c97d.tar.gz
bcm5719-llvm-8b47e0d0ea7909fa2ffd9132d37b0c7b8885c97d.zip
[LoopVersioning] Relax an assert for LCSSA PHIs
When you have multiple LCSSA (single-operand) PHIs that are converted into two-operand PHIs due to versioning, only assert that the PHI currently being converted has a single operand. I.e. we don't want to check PHIs that were converted earlier in the loop. Fixes PR27023. Thanks to Karl-Johan Karlsson for the minimized testcase! llvm-svn: 264081
Diffstat (limited to 'llvm/test/Transforms/LoopVersioning/lcssa.ll')
-rw-r--r--llvm/test/Transforms/LoopVersioning/lcssa.ll35
1 files changed, 35 insertions, 0 deletions
diff --git a/llvm/test/Transforms/LoopVersioning/lcssa.ll b/llvm/test/Transforms/LoopVersioning/lcssa.ll
new file mode 100644
index 00000000000..2cd4662c371
--- /dev/null
+++ b/llvm/test/Transforms/LoopVersioning/lcssa.ll
@@ -0,0 +1,35 @@
+; RUN: opt -basicaa -loop-versioning -S < %s | FileCheck %s
+target triple = "x86_64-unknown-linux-gnu"
+
+define void @fill(i8** %ls1.20, i8** %ls2.21, i8* %cse3.22) {
+; CHECK: bb1.lver.check:
+; CHECK: br i1 %memcheck.conflict, label %bb1.ph.lver.orig, label %bb1.ph
+bb1.ph:
+ %ls1.20.promoted = load i8*, i8** %ls1.20
+ %ls2.21.promoted = load i8*, i8** %ls2.21
+ br label %bb1
+
+bb1:
+ %_tmp302 = phi i8* [ %ls2.21.promoted, %bb1.ph ], [ %_tmp30, %bb1 ]
+ %_tmp281 = phi i8* [ %ls1.20.promoted, %bb1.ph ], [ %_tmp28, %bb1 ]
+ %_tmp14 = getelementptr i8, i8* %_tmp281, i16 -1
+ %_tmp15 = load i8, i8* %_tmp14
+ %add = add i8 %_tmp15, 1
+ store i8 %add, i8* %_tmp281
+ store i8 %add, i8* %_tmp302
+ %_tmp28 = getelementptr i8, i8* %_tmp281, i16 1
+ %_tmp30 = getelementptr i8, i8* %_tmp302, i16 1
+ br i1 false, label %bb1, label %bb3.loopexit
+
+bb3.loopexit:
+ %_tmp30.lcssa = phi i8* [ %_tmp30, %bb1 ]
+ %_tmp15.lcssa = phi i8 [ %_tmp15, %bb1 ]
+ %_tmp28.lcssa = phi i8* [ %_tmp28, %bb1 ]
+ store i8* %_tmp28.lcssa, i8** %ls1.20
+ store i8 %_tmp15.lcssa, i8* %cse3.22
+ store i8* %_tmp30.lcssa, i8** %ls2.21
+ br label %bb3
+
+bb3:
+ ret void
+}
OpenPOWER on IntegriCloud