[PATCH] D97937: [AMDGPU][GlobalISel] Transform (fadd (fpext (fmul x, y)), z) -> (fma (fpext x), (fpext y), z)

Mirko Brkusanin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 30 07:47:29 PDT 2021


mbrkusanin added inline comments.


================
Comment at: llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp:4376-4382
+      auto FpExt1 = Builder.buildFPExt(DstType, 
+                                       FpExtSrc->getOperand(1).getReg());
+      auto FpExt2 = Builder.buildFPExt(DstType,
+                                       FpExtSrc->getOperand(2).getReg());
+      Builder.buildInstr(PreferredFusedOpcode, {MI.getOperand(0).getReg()},
+                         {FpExt1.getReg(0),
+                          FpExt2.getReg(0), RHS->getOperand(0).getReg()});
----------------
Use B not Builder.
Also maybe rename from FpExt1 and FpExt2 to FpExtX and FpExtY so it matches the comment above.


================
Comment at: llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp:4395-4402
+      auto FpExt1 = Builder.buildFPExt(DstType,
+                                       FpExtSrc->getOperand(1).getReg());
+      auto FpExt2 = Builder.buildFPExt(DstType,
+                                       FpExtSrc->getOperand(2).getReg());
+      Builder.buildInstr(PreferredFusedOpcode,
+                         {MI.getOperand(0).getReg()},
+                         {FpExt1.getReg(0), FpExt2.getReg(0),
----------------
(same as above)
Use B not Builder.
Also maybe rename from FpExt1 and FpExt2 to FpExtY and FpExtZ so it matches the comment above.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D97937/new/

https://reviews.llvm.org/D97937



More information about the llvm-commits mailing list