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

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 22 06:04:22 PDT 2021


foad added inline comments.


================
Comment at: llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp:3939
+  bool HasFMA = TLI.isFMAFasterThanFMulAndFAdd(*MF, DstType) &&
+                (!LegalOperations || isLegal({TargetOpcode::G_FMA, {DstType}}));
+
----------------
matejam wrote:
> foad wrote:
> > This expression is exactly what "isLegalOrBeforeLegalization" does, so you didn't need to create isLegal.
> "isLegalOrBeforeLegalization" returns the value of "!LI || LI->getAction(Query).Action == LegalizeActions::Legal"
> and  isLegal returns the value of "LI && LI->getAction(Query).Action == LegalizeActions::Legal", so I thinks it's not exactly the same.
I mean `!LegalOperations || isLegal(...)` is the same as `isLegalOrBeforeLegalization(...)`. Because `LegalOperations` is just another name for `LI`.


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

https://reviews.llvm.org/D93305



More information about the llvm-commits mailing list