[llvm] [AMDGPU] SIFoldOperands check that shrunk op is valid (PR #156298)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 1 21:20:49 PDT 2025


================
@@ -868,6 +868,8 @@ bool SIFoldOperandsImpl::tryAddToFoldList(
       // Make sure to get the 32-bit version of the commuted opcode.
       unsigned MaybeCommutedOpc = MI->getOpcode();
       Op32 = AMDGPU::getVOPe32(MaybeCommutedOpc);
+      if (TII->pseudoToMCOpcode(Op32) == -1)
----------------
arsenm wrote:

SIInstrInfo::commuteOpcode already checks this, is this being skipped somehow? 

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


More information about the llvm-commits mailing list