[PATCH] D97163: [GlobalISel] Implement fewerElements legalization for vector reductions.

Amara Emerson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 1 16:07:21 PST 2021


aemerson added inline comments.


================
Comment at: llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp:4092
+  const unsigned NumParts = SrcTy.getNumElements() / NarrowTy.getNumElements();
+  extractParts(SrcReg, NarrowTy, NumParts, SplitSrcs);
+  SmallVector<Register> PartialReductions;
----------------
arsenm wrote:
> I've been trying to move away from using extractParts. Can you reframe this with extractGCDType to handle the odd cases?
I'm having trouble constructing test cases that don't fall over due some missing pieces of legalization. E.g. no support for non-pow-2 num-elements, and using G_IMPLICIT_DEF also falls over because it generates concats that we also don't support (a whole can of worms I'm not sure how to begin fixing). Can we stick with this method before having to do all that?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D97163



More information about the llvm-commits mailing list