diff options
author | Andrew Trick <atrick@apple.com> | 2011-07-21 01:05:01 +0000 |
---|---|---|
committer | Andrew Trick <atrick@apple.com> | 2011-07-21 01:05:01 +0000 |
commit | c2c988e5e0b15408f790c96fd7ad2d86a6a93a08 (patch) | |
tree | ae5b5c06bdeec484d08cda0bc150b2900370f395 /test | |
parent | fb4eb165d66b8ca5ae09c37d98d3ed937454b6af (diff) | |
download | external_llvm-c2c988e5e0b15408f790c96fd7ad2d86a6a93a08.zip external_llvm-c2c988e5e0b15408f790c96fd7ad2d86a6a93a08.tar.gz external_llvm-c2c988e5e0b15408f790c96fd7ad2d86a6a93a08.tar.bz2 |
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')
-rw-r--r-- | test/Transforms/LoopStrengthReduce/2011-07-20-DoubleIV.ll | 21 |
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 3ceeeb6..aecb06c 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 |