summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2017-09-07 17:24:43 +0000
committerMatt Arsenault <Matthew.Arsenault@amd.com>2017-09-07 17:24:43 +0000
commit61ec738b60a4fb47ec9b7195de55f1ecb5cbdb45 (patch)
tree4f994ea11a5005148a6ad1b046b0a76f6cf337cc /llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
parent5f5b586c99670933380bc8dcb17e9a7aae354612 (diff)
downloadbcm5719-llvm-61ec738b60a4fb47ec9b7195de55f1ecb5cbdb45.tar.gz
bcm5719-llvm-61ec738b60a4fb47ec9b7195de55f1ecb5cbdb45.zip
DAG: Allow creating extract_vector_elt post-legalize
Fixes some combine issues for AMDGPU where we weren't getting the many extract_vector_elt combines expected in a future patch. This should really be checking isOperationLegalOrCustom on the extract. That improves a number of x86 lit tests, but a few get stuck in an infinite loop from one place where a similar looking extract is created. I have a different workaround in the backend for that which keeps many of those improvements, but also adds a few regressions. llvm-svn: 312730
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index c068e1df836..ee237cbf238 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -13963,7 +13963,10 @@ SDValue DAGCombiner::visitEXTRACT_VECTOR_ELT(SDNode *N) {
// FIXME: We should handle recursing on other vector shuffles and
// scalar_to_vector here as well.
- if (!LegalOperations) {
+ if (!LegalOperations ||
+ // FIXME: Should really be just isOperationLegalOrCustom.
+ TLI.isOperationLegal(ISD::EXTRACT_VECTOR_ELT, VT) ||
+ TLI.isOperationExpand(ISD::VECTOR_SHUFFLE, VT)) {
EVT IndexTy = TLI.getVectorIdxTy(DAG.getDataLayout());
return DAG.getNode(ISD::EXTRACT_VECTOR_ELT, SDLoc(N), NVT, SVInVec,
DAG.getConstant(OrigElt, SDLoc(SVOp), IndexTy));
OpenPOWER on IntegriCloud