summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/LoopVersioning/loop-invariant-bound.ll
diff options
context:
space:
mode:
authorJames Molloy <james.molloy@arm.com>2017-04-05 09:24:26 +0000
committerJames Molloy <james.molloy@arm.com>2017-04-05 09:24:26 +0000
commit37dd4d7aaab4df34b732d4238627049948a0fef6 (patch)
tree2f30597a9b47f2509768006e5588d28ea2c1a082 /llvm/test/Transforms/LoopVersioning/loop-invariant-bound.ll
parent07d7c42c5d4ce7bedf23fe805931e633d554d206 (diff)
downloadbcm5719-llvm-37dd4d7aaab4df34b732d4238627049948a0fef6.tar.gz
bcm5719-llvm-37dd4d7aaab4df34b732d4238627049948a0fef6.zip
[LAA] Correctly return a half-open range in expandBounds
This is a latent bug that's been hanging around for a while. For a loop-invariant pointer, expandBounds would return the range {Ptr, Ptr}, but this was interpreted as a half-open range, not a closed range. So we ended up planting incorrect bounds checks. Even worse, they were tautological, so we ended up incorrectly executing the optimized loop. llvm-svn: 299526
Diffstat (limited to 'llvm/test/Transforms/LoopVersioning/loop-invariant-bound.ll')
-rw-r--r--llvm/test/Transforms/LoopVersioning/loop-invariant-bound.ll7
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/test/Transforms/LoopVersioning/loop-invariant-bound.ll b/llvm/test/Transforms/LoopVersioning/loop-invariant-bound.ll
index 3411adbf245..01c5a55bd5b 100644
--- a/llvm/test/Transforms/LoopVersioning/loop-invariant-bound.ll
+++ b/llvm/test/Transforms/LoopVersioning/loop-invariant-bound.ll
@@ -8,12 +8,13 @@ target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
%Partials.215 = type { [2 x %Dual.213] }
; Function Attrs: sspreq
-define void @"julia_axpy!_65480"(%Dual.212*) {
+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
+; 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 ]
@@ -24,7 +25,7 @@ if24: ; preds = %if24, %top
%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* undef, i64 %3, i32 1, i32 0, i64 0, i32 1, i32 0, i64 0
+ %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
OpenPOWER on IntegriCloud