summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-09-25 01:28:51 +0000
committerDan Gohman <gohman@apple.com>2008-09-25 01:28:51 +0000
commit3663f156f705970b566223b4a5966438cd8e3f50 (patch)
tree76916bfa996e4b813c9d1c73d5520d128776f0be /llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
parentb8e69f17557e18b74cba505dd26ae80134ba325f (diff)
downloadbcm5719-llvm-3663f156f705970b566223b4a5966438cd8e3f50.tar.gz
bcm5719-llvm-3663f156f705970b566223b4a5966438cd8e3f50.zip
Fix a recent fast-isel coverage regression - don't bail out before
giving the target a chance to materialize constants. llvm-svn: 56605
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/FastISel.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/FastISel.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
index 4b773226072..dd7e95294f1 100644
--- a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
@@ -75,16 +75,17 @@ unsigned FastISel::getRegForValue(Value *V) {
} else if (isa<UndefValue>(V)) {
Reg = createResultReg(TLI.getRegClassFor(VT));
BuildMI(MBB, TII.get(TargetInstrInfo::IMPLICIT_DEF), Reg);
- } else {
- return 0;
}
+ // If target-independent code couldn't handle the value, give target-specific
+ // code a try.
if (!Reg && isa<Constant>(V))
Reg = TargetMaterializeConstant(cast<Constant>(V));
// Don't cache constant materializations in the general ValueMap.
// To do so would require tracking what uses they dominate.
- LocalValueMap[V] = Reg;
+ if (Reg != 0)
+ LocalValueMap[V] = Reg;
return Reg;
}
OpenPOWER on IntegriCloud