summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-01-09 01:16:24 +0000
committerChris Lattner <sabre@nondot.org>2005-01-09 01:16:24 +0000
commita2c5d9168cb022ff5f20cc80f173812892a75c57 (patch)
tree72579a7997e69cb67005c775fbaafafeeadaf465
parent9f59d28d675154f8a60dc5e49dd2a94c381f9b78 (diff)
downloadbcm5719-llvm-a2c5d9168cb022ff5f20cc80f173812892a75c57.tar.gz
bcm5719-llvm-a2c5d9168cb022ff5f20cc80f173812892a75c57.zip
Handle static alloca arguments to PHI nodes.
llvm-svn: 19409
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
index 4fe5ddf3335..090d3ef53e3 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
@@ -836,8 +836,7 @@ void SelectionDAGISel::BuildSelectionDAG(SelectionDAG &DAG, BasicBlock *LLVMBB,
// blocks are available as virtual registers.
for (BasicBlock::iterator I = LLVMBB->begin(), E = LLVMBB->end(); I != E;++I)
if (!I->use_empty()) {
- std::map<const Value*, unsigned>::iterator VMI =
- FuncInfo.ValueMap.find(I);
+ std::map<const Value*, unsigned>::iterator VMI =FuncInfo.ValueMap.find(I);
if (VMI != FuncInfo.ValueMap.end())
CopyValueToVirtualRegister(SDL, I, VMI->second);
}
@@ -878,7 +877,13 @@ void SelectionDAGISel::BuildSelectionDAG(SelectionDAG &DAG, BasicBlock *LLVMBB,
Reg = RegOut;
} else {
Reg = FuncInfo.ValueMap[PHIOp];
- assert(Reg && "Didn't codegen value into a register!??");
+ if (Reg == 0) {
+ assert(isa<AllocaInst>(PHIOp) &&
+ FuncInfo.StaticAllocaMap.count(cast<AllocaInst>(PHIOp)) &&
+ "Didn't codegen value into a register!??");
+ Reg = FuncInfo.CreateRegForValue(PHIOp);
+ CopyValueToVirtualRegister(SDL, PHIOp, Reg);
+ }
}
// Remember that this register needs to added to the machine PHI node as
OpenPOWER on IntegriCloud