[PATCH] D153544: [AMDGPU] Use V_FMA_MIX* more often
Matt Arsenault via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 6 15:24:13 PDT 2023
arsenm added inline comments.
================
Comment at: llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp:5340
+ assert(MI.getOpcode() == TargetOpcode::G_FPTRUNC);
+ const auto &TLI = *MI.getMF()->getSubtarget().getTargetLowering();
+
----------------
I think CombinerHelper already has a TLI member
================
Comment at: llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp:5361
+ auto Tmp = MRI.createGenericVirtualRegister(MRI.getType(SrcReg));
+ B.buildInstr(PreferredFusedOpcode, {Tmp},
+ {FMulMI->getOperand(1).getReg(),
----------------
I think just using the type here works
================
Comment at: llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp:5365
+ B.buildConstant(MRI.getType(SrcReg), 0).getReg(0)});
+ B.buildFPTrunc(DstReg, Tmp);
+ };
----------------
Missing an erase?
================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:15838
+ bool HasFMA =
+ TLI.isFMAFasterThanFMulAndFAdd(DAG.getMachineFunction(), VT) &&
+ (!LegalOperations || TLI.isOperationLegalOrCustom(ISD::FMA, VT));
----------------
Swap the order of these checks
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D153544/new/
https://reviews.llvm.org/D153544
More information about the llvm-commits
mailing list