[PATCH] D150526: [X86] Add X86FixupVectorConstantsPass to re-fold AVX512 vector load folds as broadcast folds

LuoYuanke via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 18 19:17:35 PDT 2023


LuoYuanke added inline comments.


================
Comment at: llvm/lib/Target/X86/X86FixupVectorConstants.cpp:77
+  // anything useful.
+  if (ConstantEntry.isMachineConstantPoolEntry())
+    return nullptr;
----------------
I'm not quite familar with MachineConstantPoolValue, so I don't understand why we should bail for MachineConstantPoolEntry. What's the difference between MachineConstantPoolValue and Constant?


================
Comment at: llvm/lib/Target/X86/X86FixupVectorConstants.cpp:127
+// remove undefs.
+static std::optional<APInt> isSplatableConstant(const Constant *C,
+                                                unsigned SplatBitWidth) {
----------------
It looks to me `isSplatableConstant` should return a bool value, but it return APInt value. Does it make sense to rename it to `getSplatableConstant`?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D150526/new/

https://reviews.llvm.org/D150526



More information about the llvm-commits mailing list