llvm.org GIT mirror llvm / 8581c26
fix PR6940: sitofp(undef) folds to 0.0, not undef. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102358 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 9 years ago
2 changed file(s) with 15 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
14511451 // After a zero extend, we know the top part is zero. SExt doesn't have
14521452 // to be handled here, because we don't know whether the top part is 1's
14531453 // or 0's.
1454 case Instruction::SIToFP: // some FP values are not possible, just use 0.
1455 case Instruction::UIToFP: // some FP values are not possible, just use 0.
14541456 markForcedConstant(I, Constant::getNullValue(ITy));
14551457 return true;
14561458 case Instruction::Mul:
0 ; RUN: opt %s -sccp -S | FileCheck %s
1
2
3 ; PR6940
4 define double @test1() {
5 %t = sitofp i32 undef to double
6 ret double %t
7 ; CHECK: @test1
8 ; CHECK: ret double 0.0
9 }
10
11
112 ; rdar://7832370
213 ; Check that lots of stuff doesn't get turned into undef.
3
4 define i32 @main() nounwind readnone ssp {
14 define i32 @test2() nounwind readnone ssp {
15 ; CHECK: @test2
516 init:
617 br label %control.outer.outer
718