[PATCH] D146494: [X86] Combine constant vector inputs for FMA

Evgenii Kudriashov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 14 20:04:09 PDT 2023


e-kud marked an inline comment as done.
e-kud added inline comments.


================
Comment at: llvm/lib/Target/X86/X86ISelLowering.cpp:54178
+    if (auto *Cst = dyn_cast<ConstantFPSDNode>(op)) {
+      if (Cst->isNegative())
+        return SDValue();
----------------
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.


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