summaryrefslogtreecommitdiff
path: root/test/Transforms/LoopStrengthReduce
diff options
context:
space:
mode:
authorAndrew Trick <atrick@apple.com>2011-07-21 01:05:01 +0000
committerAndrew Trick <atrick@apple.com>2011-07-21 01:05:01 +0000
commitc2c988e5e0b15408f790c96fd7ad2d86a6a93a08 (patch)
treeae5b5c06bdeec484d08cda0bc150b2900370f395 /test/Transforms/LoopStrengthReduce
parentfb4eb165d66b8ca5ae09c37d98d3ed937454b6af (diff)
downloadllvm-c2c988e5e0b15408f790c96fd7ad2d86a6a93a08.tar.gz
llvm-c2c988e5e0b15408f790c96fd7ad2d86a6a93a08.tar.bz2
llvm-c2c988e5e0b15408f790c96fd7ad2d86a6a93a08.tar.xz
LSR must sometimes sign-extend before generating double constants.
rdar://9786536 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135650 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/LoopStrengthReduce')
-rw-r--r--test/Transforms/LoopStrengthReduce/2011-07-20-DoubleIV.ll21
1 files changed, 20 insertions, 1 deletions
diff --git a/test/Transforms/LoopStrengthReduce/2011-07-20-DoubleIV.ll b/test/Transforms/LoopStrengthReduce/2011-07-20-DoubleIV.ll
index 3ceeeb658d..aecb06cfb8 100644
--- a/test/Transforms/LoopStrengthReduce/2011-07-20-DoubleIV.ll
+++ b/test/Transforms/LoopStrengthReduce/2011-07-20-DoubleIV.ll
@@ -15,7 +15,26 @@ entry:
loop:
%i.01 = phi i32 [ -39, %entry ], [ %inc, %loop ]
- %conv7 = sitofp i32 %i.01 to double
+ %conv = sitofp i32 %i.01 to double
+ %inc = add nsw i32 %i.01, 1
+ br i1 undef, label %loop, label %for.end
+
+for.end:
+ unreachable
+}
+
+; Now check that the computed double constant is correct.
+; CHECK: @doubleIV
+; CHECK: phi double [ 0x43F0000000000000, %entry ]
+; CHECK: br
+define void @doubleIV() nounwind {
+entry:
+ br label %loop
+
+loop:
+ %i.01 = phi i32 [ -39, %entry ], [ %inc, %loop ]
+ %conv = sitofp i32 %i.01 to double
+ %div = fdiv double %conv, 4.000000e+01
%inc = add nsw i32 %i.01, 1
br i1 undef, label %loop, label %for.end