diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2023-09-11 18:37:24 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2023-12-08 17:35:11 +0000 |
commit | 8a4dda33d67586ca2624f2a38417baa03a533a7f (patch) | |
tree | ea87f69d4341b5a653c3747ebbdbedd7b41da233 /contrib/llvm-project/llvm/lib/CodeGen/CalcSpillWeights.cpp | |
parent | 06c3fb2749bda94cb5201f81ffdb8fa6c3161b2e (diff) | |
parent | 8092e001bcd76c0b9fec2311f3a515aa60d2ed07 (diff) |
Diffstat (limited to 'contrib/llvm-project/llvm/lib/CodeGen/CalcSpillWeights.cpp')
-rw-r--r-- | contrib/llvm-project/llvm/lib/CodeGen/CalcSpillWeights.cpp | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/contrib/llvm-project/llvm/lib/CodeGen/CalcSpillWeights.cpp b/contrib/llvm-project/llvm/lib/CodeGen/CalcSpillWeights.cpp index 0377bc002067..5a005ba7b414 100644 --- a/contrib/llvm-project/llvm/lib/CodeGen/CalcSpillWeights.cpp +++ b/contrib/llvm-project/llvm/lib/CodeGen/CalcSpillWeights.cpp @@ -97,7 +97,7 @@ bool VirtRegAuxInfo::isRematerializable(const LiveInterval &LI, // Trace copies introduced by live range splitting. The inline // spiller can rematerialize through these copies, so the spill // weight must reflect this. - while (TII.isFullCopyInstr(*MI)) { + while (MI->isFullCopy()) { // The copy destination must match the interval register. if (MI->getOperand(0).getReg() != Reg) return false; @@ -224,16 +224,7 @@ float VirtRegAuxInfo::weightCalcHelper(LiveInterval &LI, SlotIndex *Start, continue; NumInstr++; - bool identityCopy = false; - auto DestSrc = TII.isCopyInstr(*MI); - if (DestSrc) { - const MachineOperand *DestRegOp = DestSrc->Destination; - const MachineOperand *SrcRegOp = DestSrc->Source; - identityCopy = DestRegOp->getReg() == SrcRegOp->getReg() && - DestRegOp->getSubReg() == SrcRegOp->getSubReg(); - } - - if (identityCopy || MI->isImplicitDef()) + if (MI->isIdentityCopy() || MI->isImplicitDef()) continue; if (!Visited.insert(MI).second) continue; @@ -267,7 +258,7 @@ float VirtRegAuxInfo::weightCalcHelper(LiveInterval &LI, SlotIndex *Start, } // Get allocation hints from copies. - if (!TII.isCopyInstr(*MI)) + if (!MI->isCopy()) continue; Register HintReg = copyHint(MI, LI.reg(), TRI, MRI); if (!HintReg) |