[PATCH] D66111: GlobalISel: Implement lower for G_SHUFFLE_VECTOR

Aditya Nandakumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 12 16:32:33 PDT 2019


aditya_nandakumar added inline comments.


================
Comment at: lib/CodeGen/GlobalISel/LegalizerHelper.cpp:3774
+  auto MIB = MIRBuilder.buildInstrNoInsert(TargetOpcode::G_BUILD_VECTOR)
+    .addDef(DstReg);
+
----------------
arsenm wrote:
> aditya_nandakumar wrote:
> > Would it be possible to buildInstr in a way that it can be CSE'd (collect the regs in a SmallVector and build in the end)?
> > While I think the chances of CSEing a G_BUILD_VECTOR is quite low, it probably doesn't hurt to enable it.
> It's possible, but I find the intermediate vectors for these sorts of things kind of annoying to use and it seemed more straightforward to add operands directly
Even if it's annoying, I'd prefer we try to build instructions in a way that's CSEable and in parallel maybe look at ways to make this less annoying.
Personally I like the intermediate vector + buildVector at once vs buildInstrNoInsert + insertInstr (maybe because I'm used to it).


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

https://reviews.llvm.org/D66111





More information about the llvm-commits mailing list