[llvm] [AMDGPU][NFC][SIInsertWaitcnts] Remove redundant checks for invalidate instructions (PR #166139)

Stephen Thomas via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 3 03:02:10 PST 2025


================
@@ -530,16 +544,6 @@ class SIInsertWaitcnts {
   // Return the appropriate VMEM_*_ACCESS type for Inst, which must be a VMEM
   // instruction.
   WaitEventType getVmemWaitEventType(const MachineInstr &Inst) const {
-    switch (Inst.getOpcode()) {
----------------
stepthomas wrote:

Not that I know of, but way it's currently used means we can statically guarantee that in the remaining two cases where getVmemWaitEventType() is called they never will be these instructions, unless the logic using the function changes substantially.

Perhaps renaming and re-documenting the function would be in order.

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


More information about the llvm-commits mailing list