summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@intel.com>2018-01-26 20:02:52 +0000
committerCraig Topper <craig.topper@intel.com>2018-01-26 20:02:52 +0000
commitd4795b700d5e6cf4ce87c71d9fe9376115a3d212 (patch)
tree48970e3e4d9547c01091bc4a5c36cc3d1bf9a67d /llvm/lib
parent4bb33349a6dc3ef4aca6c0c44763feb8c3bc3e7d (diff)
downloadbcm5719-llvm-d4795b700d5e6cf4ce87c71d9fe9376115a3d212.tar.gz
bcm5719-llvm-d4795b700d5e6cf4ce87c71d9fe9376115a3d212.zip
[X86] Allow any_extend to be combined with setcc on VLX targets.
For VLX target getSetccResultType returns vXi1 which prevents the target independent DAG combine from doing this tranform itself. llvm-svn: 323555
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/X86/X86ISelLowering.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp
index 5f08c9dd120..18f14316636 100644
--- a/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -36221,6 +36221,10 @@ static SDValue combineExtSetcc(SDNode *N, SelectionDAG &DAG,
EVT VT = N->getValueType(0);
SDLoc dl(N);
+ // Only handle sext/aext for now.
+ if (N->getOpcode() != ISD::SIGN_EXTEND && N->getOpcode() != ISD::ANY_EXTEND)
+ return SDValue();
+
// Only do this combine with AVX512 for vector extends.
if (!Subtarget.hasAVX512() || !VT.isVector() || N0->getOpcode() != ISD::SETCC)
return SDValue();
@@ -36474,6 +36478,10 @@ static SDValue combineZext(SDNode *N, SelectionDAG &DAG,
if (SDValue NewCMov = combineToExtendCMOV(N, DAG))
return NewCMov;
+ if (DCI.isBeforeLegalizeOps())
+ if (SDValue V = combineExtSetcc(N, DAG, Subtarget))
+ return V;
+
if (SDValue V = combineToExtendVectorInReg(N, DAG, DCI, Subtarget))
return V;
OpenPOWER on IntegriCloud