[llvm] [AMDGPU][True16][CodeGen] fix v_mov_b16_t16 index in folding pass (PR #161764)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 3 17:54:16 PDT 2025


================
@@ -931,7 +931,9 @@ static MachineOperand *lookUpCopyChain(const SIInstrInfo &TII,
   for (MachineInstr *SubDef = MRI.getVRegDef(SrcReg);
        SubDef && TII.isFoldableCopy(*SubDef);
        SubDef = MRI.getVRegDef(Sub->getReg())) {
-    MachineOperand &SrcOp = SubDef->getOperand(1);
+    unsigned SrcIdx = TII.getFoldableCopySrcIdx(*SubDef);
+    MachineOperand &SrcOp = SubDef->getOperand(SrcIdx);
----------------
arsenm wrote:

Fix the mismatched operand name then, I don't want to maintain this switch 

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


More information about the llvm-commits mailing list