[flang-commits] [clang] [clang-tools-extra] [compiler-rt] [flang] [llvm] [AMDGPU] Fold operand after shrinking instruction in SIFoldOperands (PR #68426)

Jay Foad via flang-commits flang-commits at lists.llvm.org
Thu Nov 2 02:43:18 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);
----------------
jayfoad wrote:

Adding the assert showed up some problems to do with knowing whether or not the instruction has been commuted. I need to spend some more time on that.

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


More information about the flang-commits mailing list