summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-05-06 00:02:14 +0000
committerDan Gohman <gohman@apple.com>2010-05-06 00:02:14 +0000
commita7c717d8d42799960247680f300c6df801e7fa80 (patch)
treed64c7aa8d2c235ccd1d327251895424752debcad /llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
parentffcb590b0fdb57033149c53d7b9884505d225bd5 (diff)
downloadbcm5719-llvm-a7c717d8d42799960247680f300c6df801e7fa80.tar.gz
bcm5719-llvm-a7c717d8d42799960247680f300c6df801e7fa80.zip
In bottom-up mode, defer the materialization of local constant values.
llvm-svn: 103139
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/FastISel.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/FastISel.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
index 078e5fd3c07..9cc6f1b5ec4 100644
--- a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
@@ -84,6 +84,17 @@ unsigned FastISel::getRegForValue(const Value *V) {
if (Reg != 0)
return Reg;
+ // In bottom-up mode, just create the virtual register which will be used
+ // to hold the value. It will be materialized later.
+ if (IsBottomUp) {
+ Reg = createResultReg(TLI.getRegClassFor(VT));
+ if (isa<Instruction>(V))
+ ValueMap[V] = Reg;
+ else
+ LocalValueMap[V] = Reg;
+ return Reg;
+ }
+
return materializeRegForValue(V, VT);
}
OpenPOWER on IntegriCloud