[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 11:41:58 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:

Why is that always src0?

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


More information about the llvm-commits mailing list