[PATCH] D59961: [DAGCombiner] simplify shuffle of shuffle
Simon Pilgrim via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 29 05:11:23 PDT 2019
RKSimon accepted this revision.
RKSimon added a comment.
This revision is now accepted and ready to land.
LGTM
================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:17952
+ ArrayRef<int> Mask0 = Shuf0->getMask();
+ for (int i = 0, e = (int)(Shuf->getMask().size()); i != e; ++i) {
+ // Ignore undef elements.
----------------
e = Mask.size()?
================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:17956
+ continue;
+ // Is the element of the shuffle operand chosen by this shuffle the same as
+ // the element chosen by the shuffle operand itself?
----------------
Maybe assert that 0 <= Mask[i] && Mask[i] < e ?
================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:17963
+ // shuffle, so we can replace this value.
+ return SDValue(Shuf0, 0);
+}
----------------
Just return Shuf->getOperand(0) ?
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D59961/new/
https://reviews.llvm.org/D59961
More information about the llvm-commits
mailing list