diff options
Diffstat (limited to 'lib/CodeGen/SelectionDAG/FastISel.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/FastISel.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/CodeGen/SelectionDAG/FastISel.cpp b/lib/CodeGen/SelectionDAG/FastISel.cpp index 4b77322607..dd7e95294f 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; } |