[PATCH] D156679: [WIP][AMDGPU][SIInsertWaitcnts] Do not add s_waitcnt when the counters are known to be 0 already

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 8 03:22:26 PDT 2023


foad added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/SIInstrInfo.cpp:8291-8293
+  // FIXME: move to the right place
+  if (auto NonSoftOpcode = SIInstrInfo::getNonSoftWaitcntOpcode(Opcode))
+    Opcode = *NonSoftOpcode;
----------------
jmmartinez wrote:
> arsenm wrote:
> > This should use PseudoInstExpansion (which we apparently only have 2 uses of, I thought there were more)
> I'm not sure how to do this.
> 
> I've tried with the following, but it seems that result cannot be another pseudo:
> ```
> SOPInstructions.td:1281:5: error: In pseudo instruction 'S_WAITCNT_soft', result operator 'S_WAITCNT' cannot be a pseudo instruction
> def S_WAITCNT_soft : SOPP_Pseudo <"s_soft_waitcnt" , (ins SWaitCnt:$simm16), "$simm16">, 
>                                     PseudoInstExpansion<(S_WAITCNT SWaitCnt:$simm16)>;
> ```
> 
There are a bunch of places where we ant multiple Pseudos to map to the same Real. I'd love to have a good consistent way to implement this.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D156679/new/

https://reviews.llvm.org/D156679



More information about the llvm-commits mailing list