[llvm] [AMDGPU] Fold operand after shrinking instruction in SIFoldOperands (PR #68426)

Stanislav Mekhanoshin via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 6 12:16:21 PDT 2023


================
@@ -290,37 +291,40 @@ bool SIFoldOperands::updateOperand(FoldCandidate &Fold) const {
 
     if (Fold.Commuted)
       TII->commuteInstruction(*Inst32, false);
-    return true;
-  }
 
-  assert(!Fold.needsShrink() && "not handled");
+    Fold.UseMI = Inst32;
+    Fold.UseOpNo = AMDGPU::getNamedOperandIdx(Fold.UseMI->getOpcode(),
+                                              AMDGPU::OpName::src0);
----------------
rampitec wrote:

I see, it must be because a shrunk instruction is VOP1/2/C only and if it is and inline immediate we shall not shrink it. LGTM, but I would add assert here that operand is the use we are looking for.

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


More information about the llvm-commits mailing list