forked from OSchip/llvm-project
Set an allocation hint when rematting before a COPY.
This almost guarantees that the COPY will be coalesced. llvm-svn: 125140
This commit is contained in:
parent
123b89b67f
commit
0b2f8d24b3
|
@ -154,6 +154,10 @@ bool InlineSpiller::reMaterializeFor(MachineBasicBlock::iterator MI) {
|
|||
LiveInterval &NewLI = edit_->create(mri_, lis_, vrm_);
|
||||
NewLI.markNotSpillable();
|
||||
|
||||
// Rematting for a copy: Set allocation hint to be the destination register.
|
||||
if (MI->isCopy())
|
||||
mri_.setRegAllocationHint(NewLI.reg, 0, MI->getOperand(0).getReg());
|
||||
|
||||
// Finally we can rematerialize OrigMI before MI.
|
||||
SlotIndex DefIdx = edit_->rematerializeAt(*MI->getParent(), MI, NewLI.reg, RM,
|
||||
lis_, tii_, tri_);
|
||||
|
|
Loading…
Reference in New Issue