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

Qiu Chaofan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 14 01:33:24 PDT 2020


qiucf marked 3 inline comments as done.
qiucf added inline comments.


================
Comment at: llvm/lib/Target/PowerPC/PPCISelLowering.cpp:15658
+
+    // Choose the cheaper one to negate.
+    if (N0Cost > N1Cost) {
----------------
qiucf wrote:
> amyk wrote:
> > This could be a silly question but I'm curious and wanting to learn the transformation you implemented. When I read the comment "choose the cheaper one to negate," it looks like in the first condition that N1 is the cheaper one but N0 is being negated. Could you elaborate on this a little more?
> Yes. It's a little bit confusing since `NegatibleCost` defines `Expensive=0; Neutral=1; Cheaper=2`. And code in DAG combiner also follows such convention.
This should be fixed after D77993.


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