[PATCH] D53728: [GlobalISel] LegalizerHelper: Implement fewerElementsVector for G_LOAD/G_STORE

Daniel Sanders via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 13 04:20:39 PST 2018


dsanders accepted this revision.
dsanders added a comment.
This revision is now accepted and ready to land.

LGTM. The only comment I have is an observation that odd-length vectors generally don't fit well into fewerElements at the moment but that's not for this patch



================
Comment at: lib/CodeGen/GlobalISel/LegalizerHelper.cpp:1115
+    if (!IsLoad)
+      extractParts(ValReg, NarrowTy, NumParts, NarrowRegs);
+
----------------
We don't need to deal with it for this patch but: It occurs to me that extractParts can never change an odd-length vector into an even-length one. The effect of this is that most odd-length vectors can only unmerge into scalars (there's a few exceptions like 9 into 3 but only a few within the normal range of vector lengths) yet it would be more efficient to fewerElements a 5-element vector into a 4-element and a 1-element vector so that we can still use vectors for the majority of it.


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

https://reviews.llvm.org/D53728





More information about the llvm-commits mailing list