[PATCH] D57247: Simply operands of masked stores and scatters based on demanded elements

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 20 06:45:49 PDT 2019


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

LGTM with a couple of minor comments.



================
Comment at: lib/Transforms/InstCombine/InstCombineCalls.cpp:1226
+  const unsigned VWidth = ConstMask->getType()->getVectorNumElements();
+  APInt UndefElts(VWidth, 0);
+  if (Value *V = SimplifyDemandedVectorElts(II.getOperand(0),
----------------
Not sure if its any better but you can get this from DemandedElts.getBitWidth():

APInt UndefElts(DemandedElts.getBitWidth(), 0);


================
Comment at: lib/Transforms/InstCombine/InstCombineCalls.cpp:1291
+  const unsigned VWidth = ConstMask->getType()->getVectorNumElements();
+  APInt UndefElts(VWidth, 0);
+  if (Value *V = SimplifyDemandedVectorElts(II.getOperand(0),
----------------
DemandedElts.getBitWidth()


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

https://reviews.llvm.org/D57247





More information about the llvm-commits mailing list