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

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 24 09:11:45 PDT 2017


arsenm 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());
----------------
RKSimon wrote:
> 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?
It would cover my cases, but I still see the x86 infinite loop problems.

The specific x86 issue is X86ISelLowering.cpp:14284 where it recreates another extract


https://reviews.llvm.org/D36774





More information about the llvm-commits mailing list