forked from OSchip/llvm-project
Bugfix in InlineSpiller::traceSiblingValue().
Properly determine whether or not a phi was added by splitting. Check against the current VNInfo of OrigLI instead of against the OrigVNI argument. Patch provided by Jonas Paulsson. Reviewed by Quentin Colombet. llvm-svn: 224009
This commit is contained in:
parent
fc081457f1
commit
cb06a36c9a
|
@ -508,6 +508,7 @@ MachineInstr *InlineSpiller::traceSiblingValue(unsigned UseReg, VNInfo *UseVNI,
|
|||
SmallVector<std::pair<unsigned, VNInfo*>, 8> WorkList;
|
||||
WorkList.push_back(std::make_pair(UseReg, UseVNI));
|
||||
|
||||
LiveInterval &OrigLI = LIS.getInterval(Original);
|
||||
do {
|
||||
unsigned Reg;
|
||||
VNInfo *VNI;
|
||||
|
@ -521,8 +522,11 @@ MachineInstr *InlineSpiller::traceSiblingValue(unsigned UseReg, VNInfo *UseVNI,
|
|||
|
||||
// Trace through PHI-defs created by live range splitting.
|
||||
if (VNI->isPHIDef()) {
|
||||
// Stop at original PHIs. We don't know the value at the predecessors.
|
||||
if (VNI->def == OrigVNI->def) {
|
||||
// Stop at original PHIs. We don't know the value at the
|
||||
// predecessors. Look up the VNInfo for the current definition
|
||||
// in OrigLI, to properly determine whether or not this phi was
|
||||
// added by splitting.
|
||||
if (VNI->def == OrigLI.getVNInfoAt(VNI->def)->def) {
|
||||
DEBUG(dbgs() << "orig phi value\n");
|
||||
SVI->second.DefByOrigPHI = true;
|
||||
SVI->second.AllDefsAreReloads = false;
|
||||
|
@ -542,7 +546,6 @@ MachineInstr *InlineSpiller::traceSiblingValue(unsigned UseReg, VNInfo *UseVNI,
|
|||
// Separate all values dominated by OrigVNI into PHIs and non-PHIs.
|
||||
SmallVector<VNInfo*, 8> PHIs, NonPHIs;
|
||||
LiveInterval &LI = LIS.getInterval(Reg);
|
||||
LiveInterval &OrigLI = LIS.getInterval(Original);
|
||||
|
||||
for (LiveInterval::vni_iterator VI = LI.vni_begin(), VE = LI.vni_end();
|
||||
VI != VE; ++VI) {
|
||||
|
|
Loading…
Reference in New Issue