[llvm] r343995 - [X86] Prefer isTypeLegal over checking isSimple in a DAG combine.
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 8 13:02:59 PDT 2018
Author: ctopper
Date: Mon Oct 8 13:02:59 2018
New Revision: 343995
URL: http://llvm.org/viewvc/llvm-project?rev=343995&view=rev
Log:
[X86] Prefer isTypeLegal over checking isSimple in a DAG combine.
Simple types are a superset of what all in tree targets in LLVM could possibly have a legal type. This means the behavior of using isSimple to check for a supported type for X86 could change over time. For example, this could would change if a v256i1 type was added to MVT in the future.
Modified:
llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=343995&r1=343994&r2=343995&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Mon Oct 8 13:02:59 2018
@@ -40211,7 +40211,9 @@ static SDValue combineExtractSubvector(S
EVT VT = N->getValueType(0);
EVT WideVecVT = N->getOperand(0).getValueType();
SDValue WideVec = peekThroughBitcasts(N->getOperand(0));
- if (Subtarget.hasAVX() && !Subtarget.hasAVX2() && WideVecVT.isSimple() &&
+ const TargetLowering &TLI = DAG.getTargetLoweringInfo();
+ if (Subtarget.hasAVX() && !Subtarget.hasAVX2() &&
+ TLI.isTypeLegal(WideVecVT) &&
WideVecVT.getSizeInBits() == 256 && WideVec.getOpcode() == ISD::AND) {
auto isConcatenatedNot = [] (SDValue V) {
V = peekThroughBitcasts(V);
More information about the llvm-commits
mailing list