mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-07 14:33:15 +00:00
Handle static alloca arguments to PHI nodes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19409 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
1482458b23
commit
ee749d7488
@ -836,8 +836,7 @@ void SelectionDAGISel::BuildSelectionDAG(SelectionDAG &DAG, BasicBlock *LLVMBB,
|
|||||||
// blocks are available as virtual registers.
|
// blocks are available as virtual registers.
|
||||||
for (BasicBlock::iterator I = LLVMBB->begin(), E = LLVMBB->end(); I != E;++I)
|
for (BasicBlock::iterator I = LLVMBB->begin(), E = LLVMBB->end(); I != E;++I)
|
||||||
if (!I->use_empty()) {
|
if (!I->use_empty()) {
|
||||||
std::map<const Value*, unsigned>::iterator VMI =
|
std::map<const Value*, unsigned>::iterator VMI =FuncInfo.ValueMap.find(I);
|
||||||
FuncInfo.ValueMap.find(I);
|
|
||||||
if (VMI != FuncInfo.ValueMap.end())
|
if (VMI != FuncInfo.ValueMap.end())
|
||||||
CopyValueToVirtualRegister(SDL, I, VMI->second);
|
CopyValueToVirtualRegister(SDL, I, VMI->second);
|
||||||
}
|
}
|
||||||
@ -878,7 +877,13 @@ void SelectionDAGISel::BuildSelectionDAG(SelectionDAG &DAG, BasicBlock *LLVMBB,
|
|||||||
Reg = RegOut;
|
Reg = RegOut;
|
||||||
} else {
|
} else {
|
||||||
Reg = FuncInfo.ValueMap[PHIOp];
|
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
|
// Remember that this register needs to added to the machine PHI node as
|
||||||
|
Loading…
x
Reference in New Issue
Block a user