[llvm-dev] [FPEnv] FNEG instruction

Cameron McInally via llvm-dev
Wed, 26 Sep 2018 15:42:08 -0000

On Wed, Sep 26, 2018 at 9:32 AM Sanjay Patel <spatel at rotateright.com>
wrote:

>
>
> On Tue, Sep 25, 2018 at 7:47 PM Cameron McInally <cameron.mcinally at
nyu.edu>
> wrote:
>
>>
>> This is the first time I'm looking at foldShuffledBinop(...), so
maybe a
>> naive question, but why not do similar shuffle canonicalizations on
unary
>> (or ternary) operations? That may be a better fix in the long run.
>>
>
> AFAIK, all of the math/logic folding that we do currently is on binary
> operators because all of the instructions have that form:
> http://llvm.org/docs/LangRef.html#instruction-reference
>
> As discussed, we fake the unary neg/not/fneg as binops. Excluding
> control-flow, the only unary instructions are casts, and I don't see
any
> ternary or higher math ops other than intrinsics.
>

Digressing a bit...

That sounds like a bug, not a feature. Casts/converts, rounds, abs, other
libm functions, fmas, compares, and probably more can be masked. If
intermixed shuffles are preventing combines on those, intrinsics or not,
that isn't ideal.
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.llvm.org/pipermail/llvm-dev/attachments/20180926/6deec4ac/attachment.html>