diff options
author | Dan Gohman <gohman@apple.com> | 2008-08-27 20:41:38 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2008-08-27 20:41:38 +0000 |
commit | 61cfa3095d6da547eac9667a5447b09611b31ecf (patch) | |
tree | e448c1f9c3286e029b1d1eddfe4d1ce640fc3eb1 /llvm/lib/CodeGen/SelectionDAG/FastISel.cpp | |
parent | 57dc078570ddebfe01a15d6b306de6941e4c4ad4 (diff) | |
download | bcm5719-llvm-61cfa3095d6da547eac9667a5447b09611b31ecf.tar.gz bcm5719-llvm-61cfa3095d6da547eac9667a5447b09611b31ecf.zip |
Fix FastISel's bitcast code for the case where getRegForValue fails.
llvm-svn: 55431
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/FastISel.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/FastISel.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp index 7d40405bd53..82eee56cd2b 100644 --- a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp +++ b/llvm/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; } |