[PATCH] D143787: [X86] Add new pass `X86FixupISel` for fixing up machine-instruction selection.

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 16 10:05:38 PST 2023


RKSimon added inline comments.


================
Comment at: llvm/lib/Target/X86/X86FixupISel.cpp:12
+// attempting to get the "right" instruction can break patterns. This pass
+// is not meant to do any analysis. It is only meant to be make transformations
+// that are guaranteed to be doable.
----------------
goldstein.w.n wrote:
> RKSimon wrote:
> > What do you mean by analysis? I'm hoping we can use scheduler models in the future to drive some transforms here.
> I mean something like transforming `vpermq ymm` <-> `vshufd ymm` should not be put in this file, as its not always valid (requires analyzing the mask to see if no lane crosses and repeated / mask is only in pairs of 2). OTOH `vpermilps <-> vshufd` are always interchangable. I'll make the logic more clear.
Agreed, anything involving valuetracking etc. shouldn't be done this late.

However, I don't see any problem with replacing instructions based on immediates that are part of the instruction - we already do this for load folding, commutation, domain switching etc.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D143787



More information about the llvm-commits mailing list