[PATCH] D12125: [DAGCombiner] Fold CONCAT_VECTORS of EXTRACT_SUBVECTOR (or undef) to VECTOR_SHUFFLE.

Andrea Di Biagio via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 19 05:36:35 PDT 2015


andreadb added a comment.

Hi Simon,


================
Comment at: lib/CodeGen/SelectionDAG/DAGCombiner.cpp:12236
@@ +12235,3 @@
+      Mask.append((unsigned)NumOpElts, -1);
+      continue;;
+    }
----------------
remove extra semicolon.

================
Comment at: lib/CodeGen/SelectionDAG/DAGCombiner.cpp:12272
@@ +12271,3 @@
+
+  if (!DAG.getTargetLoweringInfo().isShuffleMaskLegal(Mask, VT))
+    return SDValue();
----------------
This is the first place (at least on x86) where we check if VT is a legal type.
What about performing that check before calling 'combineConcatVectorOfExtracts' (at around line 12381)?
On x86, if VT is not legal, then we know in advance that the concat_vectors will not be folded. On other targets that don't check for the legality of VT in 'isShuffleMaskLegal', the folding would be premature. What do you think?


Repository:
  rL LLVM

http://reviews.llvm.org/D12125





More information about the llvm-commits mailing list