[PATCH] D62699: [InlineCost] Add support for UnaryOperator

Cameron McInally via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 30 15:02:16 PDT 2019

cameron.mcinally added inline comments.

Comment at: llvm/lib/Analysis/InlineCost.cpp:1131
+  // is expensive, this may eventually become a library call. Treat the cost
+  // as such.
+  if (I.getType()->isFloatingPointTy() &&
craig.topper wrote:
> efriedma wrote:
> > Is this actually true?  fneg should be one or two native instructions for almost every combination of type/target, even ones that don't have native floating-point support.
> Probably not. But it is the answer we would have gotten for fsub -0.0, %x.  Should we exclude both forms of writing fneg from this?
This seems like a good check to have around for a general UnaryOperator. Of course there's only one right now, but who knows in the future...



More information about the llvm-commits mailing list