[llvm] [AMDGPU][GlobalISel] Add RegBankLegalize support for G_FSUB (PR #171244)

Petar Avramovic via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 9 08:57:30 PST 2025


================
@@ -934,7 +934,9 @@ RegBankLegalizeRules::RegBankLegalizeRules(const GCNSubtarget &_ST,
 
   bool hasSALUFloat = ST->hasSALUFloatInsts();
 
-  addRulesForGOpcs({G_FADD, G_FMUL, G_STRICT_FADD, G_STRICT_FMUL}, Standard)
+  addRulesForGOpcs(
+      {G_FADD, G_FSUB, G_FMUL, G_STRICT_FADD, G_STRICT_FSUB, G_STRICT_FMUL},
----------------
petar-avramovic wrote:

fsub does not belong in this group, there is only f16 and f32 version of instruction (s64 and vsf16 are lowered to fadd+fneg in legalizer).

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


More information about the llvm-commits mailing list