[llvm] [AMDGPU][True16] si-fold-operand selecting srcidx for v_mov_b16_t16_e64 (PR #162101)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 9 23:47:41 PDT 2025


================
@@ -932,7 +932,8 @@ static MachineOperand *lookUpCopyChain(const SIInstrInfo &TII,
   for (MachineInstr *SubDef = MRI.getVRegDef(SrcReg);
        SubDef && TII.isFoldableCopy(*SubDef);
        SubDef = MRI.getVRegDef(Sub->getReg())) {
-    unsigned SrcIdx = TII.getFoldableCopySrcIdx(*SubDef);
+    const int SrcIdx =
+        (SubDef->getOpcode()) == AMDGPU::V_MOV_B16_t16_e64 ? 2 : 1;
----------------
arsenm wrote:

```suggestion
        SubDef->getOpcode() == AMDGPU::V_MOV_B16_t16_e64 ? 2 : 1;
```

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


More information about the llvm-commits mailing list