aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/SelectionDAG/FastISel.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-08-27 20:41:38 +0000
committerDan Gohman <gohman@apple.com>2008-08-27 20:41:38 +0000
commitf2075e053142cf60be2df91c4ea675a913333fe5 (patch)
tree4d84639ac3a3e4258e690b815e3f9361f9898e9c /lib/CodeGen/SelectionDAG/FastISel.cpp
parent75e2ceec552574757669f41dfbe605a6c0a58097 (diff)
downloadexternal_llvm-f2075e053142cf60be2df91c4ea675a913333fe5.zip
external_llvm-f2075e053142cf60be2df91c4ea675a913333fe5.tar.gz
external_llvm-f2075e053142cf60be2df91c4ea675a913333fe5.tar.bz2
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
Diffstat (limited to 'lib/CodeGen/SelectionDAG/FastISel.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/FastISel.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/CodeGen/SelectionDAG/FastISel.cpp b/lib/CodeGen/SelectionDAG/FastISel.cpp
index 7d40405..82eee56 100644
--- a/lib/CodeGen/SelectionDAG/FastISel.cpp
+++ b/lib/CodeGen/SelectionDAG/FastISel.cpp
@@ -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;
}