Fix FastISel's bitcast code for the case where getRegForValue fails.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55431 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Dan Gohman 2008-08-27 20:41:38 +00:00
parent df3b99381f
commit a318dabc0e

View File

@ -226,7 +226,10 @@ bool FastISel::SelectBitCast(Instruction *I,
DenseMap<const Value*, unsigned> &ValueMap) {
// If the bitcast doesn't change the type, just use the operand value.
if (I->getType() == I->getOperand(0)->getType()) {
ValueMap[I] = getRegForValue(I->getOperand(0), ValueMap);
unsigned Reg = getRegForValue(I->getOperand(0), ValueMap);
if (Reg == 0)
return false;
ValueMap[I] = Reg;
return true;
}