[PATCH] D96614: [AMDGPU][GlobalISel] Transform (fsub (fmul x, y), z) -> (fma x, y, -z)
Mirko Brkusanin via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 30 09:02:08 PDT 2021
mbrkusanin added inline comments.
================
Comment at: llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp:4687-4691
+ Register Src3 = Builder.buildFNeg(DstTy, RHS->getOperand(0).getReg())
+ .getReg(0);
+ Builder.buildInstr(PreferredFusedOpcode, {MI.getOperand(0).getReg()},
+ {LHS->getOperand(1).getReg(),
+ LHS->getOperand(2).getReg(), Src3});
----------------
Rename Src3 to NegZ so it matches the comment above.
Use B not Builder.
================
Comment at: llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp:4700-4704
+ Register Src1 = Builder.buildFNeg(DstTy, RHS->getOperand(1).getReg())
+ .getReg(0);
+ Builder.buildInstr(PreferredFusedOpcode, {MI.getOperand(0).getReg()},
+ {Src1, RHS->getOperand(2).getReg(),
+ LHS->getOperand(0).getReg()});
----------------
Rename Src1 to NegY so it matches the comment above.
Use B not Builder.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D96614/new/
https://reviews.llvm.org/D96614
More information about the llvm-commits
mailing list