mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-04-11 16:37:42 +00:00
Fix some minor issues folding undef, PR2052
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47314 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
50b2ca4c73
commit
46acf85b97
@ -175,7 +175,9 @@ Constant *llvm::ConstantFoldCastInstruction(unsigned opc, const Constant *V,
|
||||
if (isa<UndefValue>(V)) {
|
||||
// zext(undef) = 0, because the top bits will be zero.
|
||||
// sext(undef) = 0, because the top bits will all be the same.
|
||||
if (opc == Instruction::ZExt || opc == Instruction::SExt)
|
||||
// [us]itofp(undef) = 0, because the result value is bounded.
|
||||
if (opc == Instruction::ZExt || opc == Instruction::SExt ||
|
||||
opc == Instruction::UIToFP || opc == Instruction::SIToFP)
|
||||
return Constant::getNullValue(DestTy);
|
||||
return UndefValue::get(DestTy);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user