[PATCH] D48467: [X86] Recognize an fnma in the presence of an intervening shuffle.

Easwaran Raman via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 22 14:10:23 PDT 2018


I am going to take the approach suggested by Sanjay and expand isFNEG to
handle splat of a negated scalar. Then, the current combineFMA should take
care of the rest. I got the isFNEG to work with shuffle (and work on the
current test case) but haven't yet handled the insertelement case. I am out
traveling for the next ten days and will send a revised patch after I am
back.

On Fri, Jun 22, 2018 at 11:45 AM, Simon Pilgrim via Phabricator <
reviews at reviews.llvm.org> wrote:

> RKSimon added inline comments.
>
>
> ================
> Comment at: lib/Target/X86/X86ISelLowering.cpp:31185
> +    return Negate(Op0, Op1);
> +}
> +
> ----------------
> Please move the isFNEG as a NFC commit
>
>
> ================
> Comment at: lib/Target/X86/X86ISelLowering.cpp:31210
> +      break;
> +    }
> +  if (!UsedByFMA)
> ----------------
> Can this be written as a llvm::any_of pattern?
>
>
> ================
> Comment at: lib/Target/X86/X86ISelLowering.cpp:31214
> +
> +  ShuffleVectorSDNode *SVOp = dyn_cast<ShuffleVectorSDNode>(N);
> +  auto NegOp0 = isFNEG(N->getOperand(0).getNode());
> ----------------
> Early out if !SVOp || !SVOp->isSplat()
>
>
> ================
> Comment at: lib/Target/X86/X86ISelLowering.cpp:31215
> +  ShuffleVectorSDNode *SVOp = dyn_cast<ShuffleVectorSDNode>(N);
> +  auto NegOp0 = isFNEG(N->getOperand(0).getNode());
> +
> ----------------
> Don't use auto for non-obvious (casts etc.) cases.
>
>
> ================
> Comment at: lib/Target/X86/X86ISelLowering.cpp:31218
> +  if (SVOp && SVOp->isSplat() && NegOp0.getNode() &&
> +      N->getOperand(1).isUndef()) {
> +    EVT VT = N->getValueType(0);
> ----------------
> Its unlikely that Op1 isn't undef, but if you have cases of this you could
> handle both ops but testing SVOp->getSplatIndex()
>
>
> Repository:
>   rL LLVM
>
> https://reviews.llvm.org/D48467
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180622/428c960b/attachment.html>


More information about the llvm-commits mailing list