mirror of
https://github.com/RPCSX/llvm.git
synced 2025-01-26 22:45:05 +00:00
Make the UselessRegs argument optional in the LiveRangeEdit constructor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127181 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
be2119e8e2
commit
1973b3e254
@ -333,7 +333,7 @@ void InlineSpiller::insertSpill(LiveInterval &NewLI,
|
|||||||
void InlineSpiller::spill(LiveInterval *li,
|
void InlineSpiller::spill(LiveInterval *li,
|
||||||
SmallVectorImpl<LiveInterval*> &newIntervals,
|
SmallVectorImpl<LiveInterval*> &newIntervals,
|
||||||
const SmallVectorImpl<LiveInterval*> &spillIs) {
|
const SmallVectorImpl<LiveInterval*> &spillIs) {
|
||||||
LiveRangeEdit edit(*li, newIntervals, spillIs);
|
LiveRangeEdit edit(*li, newIntervals, &spillIs);
|
||||||
spill(edit);
|
spill(edit);
|
||||||
if (VerifySpills)
|
if (VerifySpills)
|
||||||
mf_.verify(&pass_, "After inline spill");
|
mf_.verify(&pass_, "After inline spill");
|
||||||
|
@ -75,9 +75,10 @@ bool LiveRangeEdit::allUsesAvailableAt(const MachineInstr *OrigMI,
|
|||||||
if (MO.isDef())
|
if (MO.isDef())
|
||||||
return false;
|
return false;
|
||||||
// We cannot depend on virtual registers in uselessRegs_.
|
// We cannot depend on virtual registers in uselessRegs_.
|
||||||
for (unsigned ui = 0, ue = uselessRegs_.size(); ui != ue; ++ui)
|
if (uselessRegs_)
|
||||||
if (uselessRegs_[ui]->reg == MO.getReg())
|
for (unsigned ui = 0, ue = uselessRegs_->size(); ui != ue; ++ui)
|
||||||
return false;
|
if ((*uselessRegs_)[ui]->reg == MO.getReg())
|
||||||
|
return false;
|
||||||
|
|
||||||
LiveInterval &li = lis.getInterval(MO.getReg());
|
LiveInterval &li = lis.getInterval(MO.getReg());
|
||||||
const VNInfo *OVNI = li.getVNInfoAt(OrigIdx);
|
const VNInfo *OVNI = li.getVNInfoAt(OrigIdx);
|
||||||
|
@ -31,7 +31,7 @@ class VirtRegMap;
|
|||||||
class LiveRangeEdit {
|
class LiveRangeEdit {
|
||||||
LiveInterval &parent_;
|
LiveInterval &parent_;
|
||||||
SmallVectorImpl<LiveInterval*> &newRegs_;
|
SmallVectorImpl<LiveInterval*> &newRegs_;
|
||||||
const SmallVectorImpl<LiveInterval*> &uselessRegs_;
|
const SmallVectorImpl<LiveInterval*> *uselessRegs_;
|
||||||
|
|
||||||
/// firstNew_ - Index of the first register added to newRegs_.
|
/// firstNew_ - Index of the first register added to newRegs_.
|
||||||
const unsigned firstNew_;
|
const unsigned firstNew_;
|
||||||
@ -66,7 +66,7 @@ public:
|
|||||||
/// rematerializing values because they are about to be removed.
|
/// rematerializing values because they are about to be removed.
|
||||||
LiveRangeEdit(LiveInterval &parent,
|
LiveRangeEdit(LiveInterval &parent,
|
||||||
SmallVectorImpl<LiveInterval*> &newRegs,
|
SmallVectorImpl<LiveInterval*> &newRegs,
|
||||||
const SmallVectorImpl<LiveInterval*> &uselessRegs)
|
const SmallVectorImpl<LiveInterval*> *uselessRegs = 0)
|
||||||
: parent_(parent), newRegs_(newRegs), uselessRegs_(uselessRegs),
|
: parent_(parent), newRegs_(newRegs), uselessRegs_(uselessRegs),
|
||||||
firstNew_(newRegs.size()), scannedRemattable_(false) {}
|
firstNew_(newRegs.size()), scannedRemattable_(false) {}
|
||||||
|
|
||||||
@ -87,7 +87,7 @@ public:
|
|||||||
|
|
||||||
/// anyRematerializable - Return true if any parent values may be
|
/// anyRematerializable - Return true if any parent values may be
|
||||||
/// rematerializable.
|
/// rematerializable.
|
||||||
/// This function must be called before ny rematerialization is attempted.
|
/// This function must be called before any rematerialization is attempted.
|
||||||
bool anyRematerializable(LiveIntervals&, const TargetInstrInfo&,
|
bool anyRematerializable(LiveIntervals&, const TargetInstrInfo&,
|
||||||
AliasAnalysis*);
|
AliasAnalysis*);
|
||||||
|
|
||||||
|
@ -601,8 +601,7 @@ void RAGreedy::splitAroundRegion(LiveInterval &VirtReg, unsigned PhysReg,
|
|||||||
SmallVector<IndexPair, 8> InterferenceRanges;
|
SmallVector<IndexPair, 8> InterferenceRanges;
|
||||||
mapGlobalInterference(PhysReg, InterferenceRanges);
|
mapGlobalInterference(PhysReg, InterferenceRanges);
|
||||||
|
|
||||||
SmallVector<LiveInterval*, 4> SpillRegs;
|
LiveRangeEdit LREdit(VirtReg, NewVRegs);
|
||||||
LiveRangeEdit LREdit(VirtReg, NewVRegs, SpillRegs);
|
|
||||||
SE->reset(LREdit);
|
SE->reset(LREdit);
|
||||||
|
|
||||||
// Create the main cross-block interval.
|
// Create the main cross-block interval.
|
||||||
@ -1130,8 +1129,7 @@ unsigned RAGreedy::tryLocalSplit(LiveInterval &VirtReg, AllocationOrder &Order,
|
|||||||
<< '-' << Uses[BestAfter] << ", " << BestDiff
|
<< '-' << Uses[BestAfter] << ", " << BestDiff
|
||||||
<< ", " << (BestAfter - BestBefore + 1) << " instrs\n");
|
<< ", " << (BestAfter - BestBefore + 1) << " instrs\n");
|
||||||
|
|
||||||
SmallVector<LiveInterval*, 4> SpillRegs;
|
LiveRangeEdit LREdit(VirtReg, NewVRegs);
|
||||||
LiveRangeEdit LREdit(VirtReg, NewVRegs, SpillRegs);
|
|
||||||
SE->reset(LREdit);
|
SE->reset(LREdit);
|
||||||
|
|
||||||
SE->openIntv();
|
SE->openIntv();
|
||||||
@ -1183,8 +1181,7 @@ unsigned RAGreedy::trySplit(LiveInterval &VirtReg, AllocationOrder &Order,
|
|||||||
if (Stage < RS_Block) {
|
if (Stage < RS_Block) {
|
||||||
SplitAnalysis::BlockPtrSet Blocks;
|
SplitAnalysis::BlockPtrSet Blocks;
|
||||||
if (SA->getMultiUseBlocks(Blocks)) {
|
if (SA->getMultiUseBlocks(Blocks)) {
|
||||||
SmallVector<LiveInterval*, 4> SpillRegs;
|
LiveRangeEdit LREdit(VirtReg, NewVRegs);
|
||||||
LiveRangeEdit LREdit(VirtReg, NewVRegs, SpillRegs);
|
|
||||||
SE->reset(LREdit);
|
SE->reset(LREdit);
|
||||||
SE->splitSingleBlocks(Blocks);
|
SE->splitSingleBlocks(Blocks);
|
||||||
setStage(NewVRegs.begin(), NewVRegs.end(), RS_Block);
|
setStage(NewVRegs.begin(), NewVRegs.end(), RS_Block);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user