mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-02 08:26:29 +00:00
These should be rewritten to fold without using the 'Rules' mechanism, but
until this happens at least make sext from bool and sitofp from bool do the right thing. llvm-svn: 32087
This commit is contained in:
parent
f6a48f7ea5
commit
64b24381a8
@ -890,6 +890,9 @@ Constant *llvm::ConstantFoldCastInstruction(unsigned opc, const Constant *V,
|
||||
if (isa<ConstantInt>(V))
|
||||
V = ConstantInt::get(SrcTy->getSignedVersion(),
|
||||
cast<ConstantIntegral>(V)->getSExtValue());
|
||||
else if (const ConstantBool *CB = dyn_cast<ConstantBool>(V))
|
||||
V = ConstantInt::get(Type::SByteTy, CB->getValue() ? -1 : 0);
|
||||
|
||||
break;
|
||||
case Instruction::Trunc:
|
||||
// We just handle trunc directly here. The code below doesn't work for
|
||||
|
Loading…
Reference in New Issue
Block a user