mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-07 14:33:15 +00:00
Fixed some tests to avoid LiveIntervals::getInstructionFromIndex(..) overhead where possible. Thanks to Jakob for the suggestions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114798 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
a6c1dbd541
commit
cec2945f30
@ -282,7 +282,7 @@ void InlineSpiller::reMaterializeAll() {
|
|||||||
lis_.RemoveMachineInstrFromMaps(DefMI);
|
lis_.RemoveMachineInstrFromMaps(DefMI);
|
||||||
vrm_.RemoveMachineInstrFromMaps(DefMI);
|
vrm_.RemoveMachineInstrFromMaps(DefMI);
|
||||||
DefMI->eraseFromParent();
|
DefMI->eraseFromParent();
|
||||||
VNI->def = lis_.getZeroIndex();
|
VNI->def = SlotIndex();
|
||||||
anyRemoved = true;
|
anyRemoved = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -807,8 +807,7 @@ bool PreAllocSplitting::Rematerialize(unsigned VReg, VNInfo* ValNo,
|
|||||||
MachineBasicBlock& MBB = *RestorePt->getParent();
|
MachineBasicBlock& MBB = *RestorePt->getParent();
|
||||||
|
|
||||||
MachineBasicBlock::iterator KillPt = BarrierMBB->end();
|
MachineBasicBlock::iterator KillPt = BarrierMBB->end();
|
||||||
if (LIs->getInstructionFromIndex(ValNo->def) == 0 ||
|
if (!DefMI || DefMI->getParent() == BarrierMBB)
|
||||||
DefMI->getParent() == BarrierMBB)
|
|
||||||
KillPt = findSpillPoint(BarrierMBB, Barrier, NULL, RefsInMBB);
|
KillPt = findSpillPoint(BarrierMBB, Barrier, NULL, RefsInMBB);
|
||||||
else
|
else
|
||||||
KillPt = llvm::next(MachineBasicBlock::iterator(DefMI));
|
KillPt = llvm::next(MachineBasicBlock::iterator(DefMI));
|
||||||
@ -1005,7 +1004,7 @@ bool PreAllocSplitting::SplitRegLiveInterval(LiveInterval *LI) {
|
|||||||
SlotIndex SpillIndex;
|
SlotIndex SpillIndex;
|
||||||
MachineInstr *SpillMI = NULL;
|
MachineInstr *SpillMI = NULL;
|
||||||
int SS = -1;
|
int SS = -1;
|
||||||
if (LIs->getInstructionFromIndex(ValNo->def) == 0) {
|
if (!DefMI) {
|
||||||
// If we don't know where the def is we must split just before the barrier.
|
// If we don't know where the def is we must split just before the barrier.
|
||||||
if ((SpillMI = FoldSpill(LI->reg, RC, 0, Barrier,
|
if ((SpillMI = FoldSpill(LI->reg, RC, 0, Barrier,
|
||||||
BarrierMBB, SS, RefsInMBB))) {
|
BarrierMBB, SS, RefsInMBB))) {
|
||||||
|
@ -349,10 +349,9 @@ bool SimpleRegisterCoalescing::RemoveCopyByCommutingDef(const CoalescerPair &CP,
|
|||||||
VNInfo *AValNo = ALR->valno;
|
VNInfo *AValNo = ALR->valno;
|
||||||
// If other defs can reach uses of this def, then it's not safe to perform
|
// If other defs can reach uses of this def, then it's not safe to perform
|
||||||
// the optimization.
|
// the optimization.
|
||||||
MachineInstr *DefMI = li_->getInstructionFromIndex(AValNo->def);
|
if (AValNo->isPHIDef() || AValNo->isUnused() || AValNo->hasPHIKill())
|
||||||
if (AValNo->isPHIDef() || DefMI == 0 || AValNo->isUnused() ||
|
|
||||||
AValNo->hasPHIKill())
|
|
||||||
return false;
|
return false;
|
||||||
|
MachineInstr *DefMI = li_->getInstructionFromIndex(AValNo->def);
|
||||||
if (!DefMI)
|
if (!DefMI)
|
||||||
return false;
|
return false;
|
||||||
const TargetInstrDesc &TID = DefMI->getDesc();
|
const TargetInstrDesc &TID = DefMI->getDesc();
|
||||||
@ -649,10 +648,11 @@ bool SimpleRegisterCoalescing::ReMaterializeTrivialDef(LiveInterval &SrcInt,
|
|||||||
VNInfo *ValNo = SrcLR->valno;
|
VNInfo *ValNo = SrcLR->valno;
|
||||||
// If other defs can reach uses of this def, then it's not safe to perform
|
// If other defs can reach uses of this def, then it's not safe to perform
|
||||||
// the optimization.
|
// the optimization.
|
||||||
if (ValNo->isPHIDef() || li_->getInstructionFromIndex(ValNo->def)==0 ||
|
if (ValNo->isPHIDef() || ValNo->isUnused() || ValNo->hasPHIKill())
|
||||||
ValNo->isUnused() || ValNo->hasPHIKill())
|
|
||||||
return false;
|
return false;
|
||||||
MachineInstr *DefMI = li_->getInstructionFromIndex(ValNo->def);
|
MachineInstr *DefMI = li_->getInstructionFromIndex(ValNo->def);
|
||||||
|
if (!DefMI)
|
||||||
|
return false;
|
||||||
assert(DefMI && "Defining instruction disappeared");
|
assert(DefMI && "Defining instruction disappeared");
|
||||||
const TargetInstrDesc &TID = DefMI->getDesc();
|
const TargetInstrDesc &TID = DefMI->getDesc();
|
||||||
if (!TID.isAsCheapAsAMove())
|
if (!TID.isAsCheapAsAMove())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user