mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-16 08:08:01 +00:00
fix PR6940: sitofp(undef) folds to 0.0, not undef.
llvm-svn: 102358
This commit is contained in:
parent
9f29bb8809
commit
9065710fcf
@ -1452,6 +1452,8 @@ bool SCCPSolver::ResolvedUndefsIn(Function &F) {
|
||||
// After a zero extend, we know the top part is zero. SExt doesn't have
|
||||
// to be handled here, because we don't know whether the top part is 1's
|
||||
// or 0's.
|
||||
case Instruction::SIToFP: // some FP values are not possible, just use 0.
|
||||
case Instruction::UIToFP: // some FP values are not possible, just use 0.
|
||||
markForcedConstant(I, Constant::getNullValue(ITy));
|
||||
return true;
|
||||
case Instruction::Mul:
|
||||
|
@ -1,8 +1,19 @@
|
||||
; RUN: opt %s -sccp -S | FileCheck %s
|
||||
|
||||
|
||||
; PR6940
|
||||
define double @test1() {
|
||||
%t = sitofp i32 undef to double
|
||||
ret double %t
|
||||
; CHECK: @test1
|
||||
; CHECK: ret double 0.0
|
||||
}
|
||||
|
||||
|
||||
; rdar://7832370
|
||||
; Check that lots of stuff doesn't get turned into undef.
|
||||
|
||||
define i32 @main() nounwind readnone ssp {
|
||||
define i32 @test2() nounwind readnone ssp {
|
||||
; CHECK: @test2
|
||||
init:
|
||||
br label %control.outer.outer
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user