[PATCH] D28777: [InstCombine][SSE] Add DemandedElts support for PACKSS/PACKUS instructions

Michael Kuperstein via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 19 11:27:41 PST 2017

mkuper added inline comments.

Comment at: lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp:1527
+      for (unsigned i = 0; i != NumLanes; ++i) {
+        APInt LaneElts2 = UndefElts2.lshr(InnerVWidthPerLane * i);
+        APInt LaneElts3 = UndefElts3.lshr(InnerVWidthPerLane * i);
RKSimon wrote:
> mkuper wrote:
> > Maybe make UndefElts an array of 2 APInts? This will make this code slightly prettier.
> UndefElts is a pass by reference argument that is used by the caller so I can't do much to change it. I agree that the code is messy but it is probably as good as it can be.
Sorry, I meant "make UndefElts2 and UndefElts3 a 2-element array".
I think having this code with a nested loop would be nicer than duplicating each line twice.



More information about the llvm-commits mailing list