diff options
author | Dan Gohman <gohman@apple.com> | 2010-05-06 00:02:14 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2010-05-06 00:02:14 +0000 |
commit | a7c717d8d42799960247680f300c6df801e7fa80 (patch) | |
tree | d64c7aa8d2c235ccd1d327251895424752debcad /llvm/lib/CodeGen/SelectionDAG/FastISel.cpp | |
parent | ffcb590b0fdb57033149c53d7b9884505d225bd5 (diff) | |
download | bcm5719-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.cpp | 11 |
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); } |