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

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 15 17:20:36 PDT 2023


craig.topper added inline comments.


================
Comment at: llvm/lib/Target/X86/X86ISelLowering.cpp:54487
+  // vector.
+  for (const SDNode *User : V->uses()) {
+    if (User->getOpcode() != ISD::FMA && User->getOpcode() != ISD::STRICT_FMA)
----------------
Can we use `llvm::any_of` or `!llvm::all_of` with a lambda?


================
Comment at: llvm/lib/Target/X86/X86ISelLowering.cpp:54495
+  EVT EltVT = VT.getVectorElementType();
+  for (auto op : V->op_values()) {
+    if (auto *Cst = dyn_cast<ConstantFPSDNode>(op)) {
----------------
Capitalize `op`


================
Comment at: llvm/lib/Target/X86/X86ISelLowering.cpp:54510
+  // original version.
+  for (const SDNode *User : NV->uses())
+    if (User->getOpcode() != ISD::FMA && User->getOpcode() != ISD::STRICT_FMA)
----------------
Can we use `llvm::any_of` or `!llvm::all_of` with a lambda?


================
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
----------------
"consistently" is probably a better word than "peristently"


================
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)) {
----------------
llvm::any_of


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