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

Evgenii Kudriashov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 15 19:27:05 PDT 2023


e-kud marked 5 inline comments as done.
e-kud added inline comments.


================
Comment at: llvm/lib/Target/X86/X86ISelLowering.cpp:54514
+
+  // If the inverted version also can be eliminated, we have to persistently
+  // prefer one of the values. We prefer a constant with a negative value on
----------------
craig.topper wrote:
> "consistently" is probably a better word than "peristently"
Indeed :)


================
Comment at: llvm/lib/Target/X86/X86ISelLowering.cpp:54517
+  // the first place.
+  for (auto op : V->op_values()) {
+    if (auto *Cst = dyn_cast<ConstantFPSDNode>(op)) {
----------------
craig.topper wrote:
> llvm::any_of
I don't think that `any_of` is much better here. We need to stop traversing after the first non-undef value (this is controlled by return value of the lambda) and return `true` or `false` (using a variable from context). Then we generally ignore return result of `any_of` and use only the variable with the result. It looks artificial to me. Probably I'm missing something.

Added an extra comment here.


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