[PATCH] D146494: [X86] Combine constant vector inputs for FMA
Noah Goldstein via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 25 16:46:24 PDT 2023
goldstein.w.n added inline comments.
================
Comment at: llvm/lib/Target/X86/X86ISelLowering.cpp:54173
+
+ // If the inverted value also can be eliminated, we have to persistancy
+ // prefer one of the values. We prefer a constant with negative value on the
----------------
persistently
================
Comment at: llvm/lib/Target/X86/X86ISelLowering.cpp:54178
+ if (auto *Cst = dyn_cast<ConstantFPSDNode>(op)) {
+ if (Cst->isNegative())
+ return SDValue();
----------------
e-kud wrote:
> RKSimon wrote:
> > Couldn't both V and NV have negative values now that they aren't splats?
> It seems to me that they can't. If `V` is `<x0, x1, ..., xn>` then `NV` is `<-x0, -x1, ..., -xn>`. So, `V` and `NV` always have elements of different sign. The corner case is `V` consisting only of `undef`s. But original and negated versions of such vector are the same. So, everything should be handled well.
But couldn't both `V` and `NV` contain some negative and some positive values?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D146494/new/
https://reviews.llvm.org/D146494
More information about the llvm-commits
mailing list