[PATCH] D36774: DAG: Allow creating extract_vector_elt post-legalize

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 16 02:52:43 PDT 2017


RKSimon added inline comments.


================
Comment at: lib/CodeGen/SelectionDAG/DAGCombiner.cpp:13886
+        TLI.isOperationLegal(ISD::EXTRACT_VECTOR_ELT, VT) ||
+        TLI.isOperationExpand(ISD::VECTOR_SHUFFLE, VT)) {
       EVT IndexTy = TLI.getVectorIdxTy(DAG.getDataLayout());
----------------
I wonder if it'd be safe to test for TLI.isOperationLegalOrCustom(ISD::EXTRACT_VECTOR_ELT, VT) if the extract is from the same vector type and the same index (constant or variable) as the original? Would that cover the cases you have?


https://reviews.llvm.org/D36774





More information about the llvm-commits mailing list