[llvm] [AMDGPU][True16][MC] true16 for v_fma_f16 (PR #119477)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 17 17:12:47 PST 2024
================
@@ -4033,14 +4033,29 @@ MachineInstr *SIInstrInfo::convertToThreeAddress(MachineInstr &MI,
if (Src0Literal && !ST.hasVOP3Literal())
return nullptr;
- unsigned NewOpc = IsFMA ? IsF16 ? AMDGPU::V_FMA_F16_gfx9_e64
- : IsF64 ? AMDGPU::V_FMA_F64_e64
- : IsLegacy
- ? AMDGPU::V_FMA_LEGACY_F32_e64
- : AMDGPU::V_FMA_F32_e64
- : IsF16 ? AMDGPU::V_MAD_F16_e64
- : IsLegacy ? AMDGPU::V_MAD_LEGACY_F32_e64
- : AMDGPU::V_MAD_F32_e64;
+ auto getNewFMAInst = [&]() {
----------------
arsenm wrote:
```suggestion
auto getNewFMAInst = [=]() {
```
I would just move this to a full fledged helper function instead of a lambda. It would also be more straightforward to just switch over all the possibilities, rather than going backwards from these IsFMA / IsF16 / IsLegacy derived from lists of opcodes above
https://github.com/llvm/llvm-project/pull/119477
More information about the llvm-commits
mailing list