[PATCH] D53877: [IR] Strawman for dedicated FNeg IR instruction

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 30 12:34:23 PDT 2018


lebedev.ri added a comment.

In https://reviews.llvm.org/D53877#1280892, @cameron.mcinally wrote:

> In https://reviews.llvm.org/D53877#1280756, @lebedev.ri wrote:
>
> > > with the intention of adding more Unary operations in the future. E.g. integer Neg (and maybe Abs, Copysign, etc.).
> >
> > While there are very clear reasons for `FNeg` to exist, this isn't so true for any of the others listed here..
>
>
> I don't disagree with that. On the other hand, these do seem like common enough operators to justify retiring the intrinsics and creating IR operators for them.


>From what i know, the bar isn't "common enough operator", the bar is more like "too easy to break the existing multi-op pattern".
Funnel shift (rotates) has recently met it, and was added as an operator.
But anyway.

> Also, integer Neg may have a stronger case for a dedicated IR instruction than the others. It's currently implemented as -0-x (Sub), which is pretty weird.




Repository:
  rL LLVM

https://reviews.llvm.org/D53877





More information about the llvm-commits mailing list