From 97c94b8fc630b55e17a37481910810639e28d086 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Thu, 6 May 2010 00:02:14 +0000 Subject: [PATCH] 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 --- lib/CodeGen/SelectionDAG/FastISel.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/CodeGen/SelectionDAG/FastISel.cpp b/lib/CodeGen/SelectionDAG/FastISel.cpp index 078e5fd3c07..9cc6f1b5ec4 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(V)) + ValueMap[V] = Reg; + else + LocalValueMap[V] = Reg; + return Reg; + } + return materializeRegForValue(V, VT); } -- 2.34.1