summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorEric Christopher <echristo@apple.com>2012-03-20 01:07:58 +0000
committerEric Christopher <echristo@apple.com>2012-03-20 01:07:58 +0000
commit8c5293c9556317143505c085cf428e11962e1273 (patch)
tree66fc7d311692c91df4ed5ae8e2c7ab6dc9ce4f5f /lib
parentc415af225d9546a66ac9f7368a973e0be25b438d (diff)
downloadllvm-8c5293c9556317143505c085cf428e11962e1273.tar.gz
llvm-8c5293c9556317143505c085cf428e11962e1273.tar.bz2
llvm-8c5293c9556317143505c085cf428e11962e1273.tar.xz
Do everything up to generating code to try to get a register for
a variable. The previous code would break the debug info changing code invariant. This will regress debug info for arguments where we elide the alloca created. Fixes rdar://11066468 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153074 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/CodeGen/SelectionDAG/FastISel.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/CodeGen/SelectionDAG/FastISel.cpp b/lib/CodeGen/SelectionDAG/FastISel.cpp
index c5efde3746..9f4a44a492 100644
--- a/lib/CodeGen/SelectionDAG/FastISel.cpp
+++ b/lib/CodeGen/SelectionDAG/FastISel.cpp
@@ -590,7 +590,12 @@ bool FastISel::SelectCall(const User *I) {
Reg = TRI.getFrameRegister(*FuncInfo.MF);
}
if (!Reg)
- Reg = getRegForValue(Address);
+ Reg = lookUpRegForValue(Address);
+
+ if (!Reg && isa<Instruction>(Address) &&
+ (!isa<AllocaInst>(Address) ||
+ !FuncInfo.StaticAllocaMap.count(cast<AllocaInst>(Address))))
+ Reg = FuncInfo.InitializeRegForValue(Address);
if (Reg)
BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL,