[PATCH] D76585: [PowerPC] Require NSZ flag for c-a*b to FNMSUB

Qing Shan Zhang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 14 19:03:36 PDT 2020


steven.zhang added inline comments.


================
Comment at: llvm/lib/Target/PowerPC/PPCISelLowering.cpp:15767
+                                         OptForSize, Cost, Depth + 1);
+    if (Cost == NegatibleCost::Expensive)
+      return SDValue();
----------------
You should check the value of NegN2 instead of the cost though their semantics might be the same.


================
Comment at: llvm/lib/Target/PowerPC/PPCISelLowering.cpp:15783
+
+    if (N0Cost < N1Cost)
+      return DAG.getNode(Opc, SDLoc(Op), VT, NegN0, N1, NegN2, Flags);
----------------
Please refer to how we did for FMA. i.e. Your implementation has problems when A=neutral, B=neutral, and C=cheaper


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D76585





More information about the llvm-commits mailing list