[PATCH] D36571: [DAGCombiner] combine vextract (v1iX extract_subvector(vNiX, Idx)) into vextract(vNiX, Idx).

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 13 14:21:12 PDT 2017


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

LGTM with a couple of minors



================
Comment at: lib/CodeGen/SelectionDAG/SelectionDAG.cpp:4378
+    // EXTRACT_VECTOR_ELT of v1iX EXTRACT_SUBVECTOR could be formed
+    // when vetor types are scalarized and v1iX is legal.
+    if (N1.getOpcode() == ISD::EXTRACT_SUBVECTOR &&
----------------
vector


================
Comment at: lib/CodeGen/SelectionDAG/SelectionDAG.cpp:4381
+        N1.getValueType().getVectorNumElements() == 1) {
+      // vextract (v1iX extract_subvector(vNiX, Idx)) -> vextract(vNiX,Idx)
+      return getNode(ISD::EXTRACT_VECTOR_ELT, DL, VT, N1.getOperand(0),
----------------
Move this up to the rest of the comment


https://reviews.llvm.org/D36571





More information about the llvm-commits mailing list