[llvm] [AMDGPU][MC] Support src modifiers for v_mov_b32 and v_movrel* instructions (PR #76498)
Mirko BrkuĊĦanin via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 18 05:47:22 PST 2024
================
@@ -3309,6 +3310,14 @@ bool SIInstrInfo::isFoldableCopy(const MachineInstr &MI) {
case AMDGPU::V_ACCVGPR_READ_B32_e64:
case AMDGPU::V_ACCVGPR_MOV_B32:
return true;
+ case AMDGPU::V_MOV_B32_e64:
+ if (MI
+ .getOperand(AMDGPU::getNamedOperandIdx(
+ AMDGPU::V_MOV_B32_e64, AMDGPU::OpName::src0_modifiers))
+ .getImm() == 0)
+ return true;
+ else
+ return false;
----------------
mbrkusanin wrote:
```suggestion
case AMDGPU::V_MOV_B32_e64: {
int16_t Idx = AMDGPU::getNamedOperandIdx(AMDGPU::V_MOV_B32_e64,
AMDGPU::OpName::src0_modifiers);
return MI.getOperand(Idx).getImm() == SISrcMods::NONE;
}
```
https://github.com/llvm/llvm-project/pull/76498
More information about the llvm-commits
mailing list