aboutsummaryrefslogtreecommitdiff
path: root/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
commit97c94b8fc630b55e17a37481910810639e28d086 (patch)
treea06f61cae70a10971b22cbb6803ef3cc3afb5ea5 /lib/CodeGen/SelectionDAG/FastISel.cpp
parenta7a0ed79012ea36f838239cf1d04959711aec2a9 (diff)
In bottom-up mode, defer the materialization of local constant values.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103139 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/FastISel.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/FastISel.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/CodeGen/SelectionDAG/FastISel.cpp b/lib/CodeGen/SelectionDAG/FastISel.cpp
index 078e5fd3c0..9cc6f1b5ec 100644
--- a/lib/CodeGen/SelectionDAG/FastISel.cpp
+++ b/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);
}