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

Noah Goldstein via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 18 10:36:05 PDT 2023


goldstein.w.n added inline comments.


================
Comment at: llvm/lib/Target/X86/X86FixupVectorConstants.cpp:129
+                                                unsigned SplatBitWidth) {
+  if (std::optional<APInt> Bits = extractConstantBits(C))
+    if (Bits->isSplat(SplatBitWidth))
----------------
Do we need a check that Bits->getBitWidth() >= SplatBitWidth?


================
Comment at: llvm/lib/Target/X86/X86FixupVectorConstants.cpp:231
+  // Currently only AVX512 instructions are handled.
+  if (!ST->hasAVX512())
+    return false;
----------------
Is there a way to check that MI is VEC type? If so maybe check that too before going to the foldingtable lookup?


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