[llvm] [CalcSpillWeights] Simplify copy hint register collection. NFC. (PR #114236)

Valery Pykhtin via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 31 00:27:42 PDT 2024


================
@@ -238,16 +222,8 @@ 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())
----------------
vpykhtin wrote:

Good catch, I overlooked those, thanks

https://github.com/llvm/llvm-project/pull/114236


More information about the llvm-commits mailing list