mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-19 19:12:56 +02:00
LiveRangeCalc: Don't start liveranges of PHI instruction at the block begin.
Summary: Letting them begin at the PHI instruction slightly simplifies the code but more importantly avoids breaking the assumption that live ranges starting at the block begin are also live at the end of the predecessor blocks. The MachineVerifier checks that but was apparently never run in the few instances where liveranges are calculated for machine-SSA functions. Reviewers: qcolombet Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D7779 llvm-svn: 230093
This commit is contained in:
parent
78a8d31aa0
commit
be9efdd856
@ -43,11 +43,8 @@ void LiveRangeCalc::reset(const MachineFunction *mf,
|
|||||||
static void createDeadDef(SlotIndexes &Indexes, VNInfo::Allocator &Alloc,
|
static void createDeadDef(SlotIndexes &Indexes, VNInfo::Allocator &Alloc,
|
||||||
LiveRange &LR, const MachineOperand &MO) {
|
LiveRange &LR, const MachineOperand &MO) {
|
||||||
const MachineInstr *MI = MO.getParent();
|
const MachineInstr *MI = MO.getParent();
|
||||||
SlotIndex DefIdx;
|
SlotIndex DefIdx =
|
||||||
if (MI->isPHI())
|
Indexes.getInstructionIndex(MI).getRegSlot(MO.isEarlyClobber());
|
||||||
DefIdx = Indexes.getMBBStartIdx(MI->getParent());
|
|
||||||
else
|
|
||||||
DefIdx = Indexes.getInstructionIndex(MI).getRegSlot(MO.isEarlyClobber());
|
|
||||||
|
|
||||||
// Create the def in LR. This may find an existing def.
|
// Create the def in LR. This may find an existing def.
|
||||||
LR.createDeadDef(DefIdx, Alloc);
|
LR.createDeadDef(DefIdx, Alloc);
|
||||||
|
Loading…
Reference in New Issue
Block a user