[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
Sun May 14 10:48:22 PDT 2023


goldstein.w.n added inline comments.


================
Comment at: llvm/lib/Target/X86/X86FixupVectorConstants.cpp:372
+                              0, 0, 3);
+  }
+
----------------
RKSimon wrote:
> goldstein.w.n wrote:
> > do all the `OpBcst\d+` opcodes not always match? Seems to be the same for all of them. If so I think it would be alot simpler to try all `OpBcst` sizes < Native_BitWidth. You could have an overload if you have want to support only checking a specific width later.
> I had wondered about trying to handle this inside lookupBroadcastFoldTable but I wasn't sure if it'd get confusing to have a memop for one element width returning a bcstop for another element width.
Think it would be clearer. Having 7 arguments to a function, where most of them are magic numbers to a degree isn't particularly clear either. Also seems less bug prone (could imagine easily accidentally do `ConvertToBroadcast(0, X86::Opcode, ...)` instead of `ConvertToBroadcast(0, 0, X86::Opcode, ...)`.


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