[llvm-branch-commits] [llvm] [AMDGPU] Create V_FMAAK_F16/V_FMAMK_F16 in true16 with imm folding (PR #173317)

Matt Arsenault via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Jan 14 09:00:37 PST 2026


================
@@ -3807,6 +3800,18 @@ bool SIInstrInfo::foldImmediate(MachineInstr &UseMI, MachineInstr &DefMI,
       removeModOperands(UseMI);
       UseMI.setDesc(get(NewOpc));
 
+      if (NewOpc == AMDGPU::V_FMAMK_F16_t16 ||
+          NewOpc == AMDGPU::V_FMAMK_F16_fake16) {
+        auto Tmp = MRI->createVirtualRegister(
+            NewOpc == AMDGPU::V_FMAMK_F16_t16 ? &AMDGPU::VGPR_16_Lo128RegClass
+                                              : &AMDGPU::VGPR_32_Lo128RegClass);
----------------
arsenm wrote:

Can you instead query the register class from the instruction definition, i.e. getRegClass()

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


More information about the llvm-branch-commits mailing list