summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/LoopVersioning/loop-invariant-bound.ll
diff options
context:
space:
mode:
authorEric Christopher <echristo@gmail.com>2019-04-17 04:52:47 +0000
committerEric Christopher <echristo@gmail.com>2019-04-17 04:52:47 +0000
commitcee313d288a4faf0355d76fb6e0e927e211d08a5 (patch)
treed386075318d761197779a96e5d8fc0dc7b06342b /llvm/test/Transforms/LoopVersioning/loop-invariant-bound.ll
parentc3d6a929fdd92fd06d4304675ade8d7210ee711a (diff)
downloadbcm5719-llvm-cee313d288a4faf0355d76fb6e0e927e211d08a5.tar.gz
bcm5719-llvm-cee313d288a4faf0355d76fb6e0e927e211d08a5.zip
Revert "Temporarily Revert "Add basic loop fusion pass.""
The reversion apparently deleted the test/Transforms directory. Will be re-reverting again. llvm-svn: 358552
Diffstat (limited to 'llvm/test/Transforms/LoopVersioning/loop-invariant-bound.ll')
-rw-r--r--llvm/test/Transforms/LoopVersioning/loop-invariant-bound.ll38
1 files changed, 38 insertions, 0 deletions
diff --git a/llvm/test/Transforms/LoopVersioning/loop-invariant-bound.ll b/llvm/test/Transforms/LoopVersioning/loop-invariant-bound.ll
new file mode 100644
index 00000000000..01c5a55bd5b
--- /dev/null
+++ b/llvm/test/Transforms/LoopVersioning/loop-invariant-bound.ll
@@ -0,0 +1,38 @@
+; RUN: opt -loop-versioning -S < %s | FileCheck %s
+; Checks that when introducing check, we don't accidentally introduce non-dominating instructions
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+
+%Dual.212 = type { %Dual.213, %Partials.215 }
+%Dual.213 = type { double, %Partials.214 }
+%Partials.214 = type { [2 x double] }
+%Partials.215 = type { [2 x %Dual.213] }
+
+; Function Attrs: sspreq
+define void @"julia_axpy!_65480"(%Dual.212*, %Dual.212* %other) {
+top:
+ br label %if24
+
+; CHECK-NOT: %bc = bitcast i64* %v2.sroa.0.0..sroa_cast
+; CHECK: %bound0 = icmp ult i8* %[[x:[a-z0-9]+]], %[[y:[a-z0-9]+]]
+; CHECK-NOT: %bound1 = icmp ult i8* %[[y]], %[[x]]
+
+if24: ; preds = %if24, %top
+ %"#temp#1.sroa.3.02" = phi i64 [ undef, %top ], [ %2, %if24 ]
+ %"#temp#1.sroa.0.01" = phi i64 [ undef, %top ], [ %1, %if24 ]
+ %1 = add i64 %"#temp#1.sroa.0.01", 1
+ %2 = add i64 %"#temp#1.sroa.3.02", 1
+ ; This pointer is loop invariant. LAA used to re-use it from memcheck, even though it didn't dominate.
+ %v2.sroa.0.0..sroa_cast = bitcast %Dual.212* %0 to i64*
+ %v2.sroa.0.0.copyload = load i64, i64* %v2.sroa.0.0..sroa_cast, align 1
+ %3 = add i64 %"#temp#1.sroa.0.01", -1
+ %4 = getelementptr inbounds %Dual.212, %Dual.212* %other, i64 0, i32 1, i32 0, i64 0, i32 1, i32 0, i64 0
+ %5 = bitcast double* %4 to i64*
+ store i64 undef, i64* %5, align 8
+ %notlhs27 = icmp eq i64 %2, undef
+ %notrhs28 = icmp eq i64 %1, undef
+ %6 = or i1 %notrhs28, %notlhs27
+ br i1 %6, label %L41.L335_crit_edge, label %if24
+
+L41.L335_crit_edge: ; preds = %if24
+ ret void
+}
OpenPOWER on IntegriCloud