[llvm] [AMDGPU] Exclude implicit uses and defs in SIInsertWaitcnts. NFC. (PR #108953)

via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 17 03:15:07 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-backend-amdgpu

Author: Stanislav Mekhanoshin (rampitec)

<details>
<summary>Changes</summary>

Change all_uses/all_defs to uses/defs where it obviously cannot happen.

---
Full diff: https://github.com/llvm/llvm-project/pull/108953.diff


1 Files Affected:

- (modified) llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp (+5-5) 


``````````diff
diff --git a/llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp b/llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp
index fd9fe1196b7853..743e4bf3d3d679 100644
--- a/llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp
+++ b/llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp
@@ -819,7 +819,7 @@ void WaitcntBrackets::updateByEvent(const SIInstrInfo *TII,
                  Inst.getOpcode() != AMDGPU::DS_APPEND &&
                  Inst.getOpcode() != AMDGPU::DS_CONSUME &&
                  Inst.getOpcode() != AMDGPU::DS_ORDERED_COUNT) {
-        for (const MachineOperand &Op : Inst.all_uses()) {
+        for (const MachineOperand &Op : Inst.uses()) {
           if (Op.isReg() && TRI->isVectorRegister(*MRI, Op.getReg()))
             setExpScore(&Inst, TRI, MRI, Op, CurrScore);
         }
@@ -863,7 +863,7 @@ void WaitcntBrackets::updateByEvent(const SIInstrInfo *TII,
         // can be used as the actual source after export patching, so
         // we need to treat them like sources and set the EXP_CNT
         // score.
-        for (MachineOperand &DefMO : Inst.all_defs()) {
+        for (MachineOperand &DefMO : Inst.defs()) {
           if (TRI->isVGPR(*MRI, DefMO.getReg())) {
             setRegScore(
                 TRI->getEncodingValue(AMDGPU::getMCReg(DefMO.getReg(), *ST)),
@@ -871,7 +871,7 @@ void WaitcntBrackets::updateByEvent(const SIInstrInfo *TII,
           }
         }
       }
-      for (const MachineOperand &Op : Inst.all_uses()) {
+      for (const MachineOperand &Op : Inst.uses()) {
         if (Op.isReg() && TRI->isVectorRegister(*MRI, Op.getReg()))
           setExpScore(&Inst, TRI, MRI, Op, CurrScore);
       }
@@ -2326,7 +2326,7 @@ bool SIInsertWaitcnts::shouldFlushVmCnt(MachineLoop *ML,
         if (MI.mayStore())
           HasVMemStore = true;
       }
-      for (const MachineOperand &Op : MI.all_uses()) {
+      for (const MachineOperand &Op : MI.uses()) {
         if (!Op.isReg() || !TRI->isVectorRegister(*MRI, Op.getReg()))
           continue;
         RegInterval Interval = Brackets.getRegInterval(&MI, MRI, TRI, Op);
@@ -2353,7 +2353,7 @@ bool SIInsertWaitcnts::shouldFlushVmCnt(MachineLoop *ML,
 
       // VMem load vgpr def
       if (isVMEMOrFlatVMEM(MI) && MI.mayLoad()) {
-        for (const MachineOperand &Op : MI.all_defs()) {
+        for (const MachineOperand &Op : MI.defs()) {
           RegInterval Interval = Brackets.getRegInterval(&MI, MRI, TRI, Op);
           for (int RegNo = Interval.first; RegNo < Interval.second; ++RegNo) {
             // If we find a register that is loaded inside the loop, 1. and 2.

``````````

</details>


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


More information about the llvm-commits mailing list