aboutsummaryrefslogtreecommitdiffstats
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
commit1c395700bf2f54e4585d6d986096bd67138dccae (patch)
treee567bcfa0feffc484ec2b5a3a94fda326d4e7319
parent6a9b05fbd4af5abb5e2f369025409e4450df27c4 (diff)
downloadexternal_llvm-1c395700bf2f54e4585d6d986096bd67138dccae.zip
external_llvm-1c395700bf2f54e4585d6d986096bd67138dccae.tar.gz
external_llvm-1c395700bf2f54e4585d6d986096bd67138dccae.tar.bz2
Fix a recent fast-isel coverage regression - don't bail out before
giving the target a chance to materialize constants. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56605 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/SelectionDAG/FastISel.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/CodeGen/SelectionDAG/FastISel.cpp b/lib/CodeGen/SelectionDAG/FastISel.cpp
index 4b77322..dd7e952 100644
--- a/lib/CodeGen/SelectionDAG/FastISel.cpp
+++ b/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;
}