Skip to content

Commit 456f079

Browse files
committed
[SelectionDAG] Add an ISD node for vector.extract.last.active
Since we shouldn't be changing lowering in SelectionDAGBuilder based on the target, introduce a new ISD node for extract.last.active and perform the current lowering in LegalizeVectorOps. This results in worse codegen for now, but it's easy for a target to match a single ISD node and improve the output.
1 parent 51c9c82 commit 456f079

File tree

11 files changed

+462
-229
lines changed

11 files changed

+462
-229
lines changed

llvm/include/llvm/CodeGen/ISDOpcodes.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1480,6 +1480,10 @@ enum NodeType {
14801480
// Output: Output Chain
14811481
EXPERIMENTAL_VECTOR_HISTOGRAM,
14821482

1483+
// experimental.vector.extract.last.active intrinsic
1484+
// Operands: Data, Mask, PassThru
1485+
VECTOR_EXTRACT_LAST_ACTIVE,
1486+
14831487
// llvm.clear_cache intrinsic
14841488
// Operands: Input Chain, Start Addres, End Address
14851489
// Outputs: Output Chain

llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,10 @@ void DAGTypeLegalizer::PromoteIntegerResult(SDNode *N, unsigned ResNo) {
155155
case ISD::ZERO_EXTEND_VECTOR_INREG:
156156
Res = PromoteIntRes_EXTEND_VECTOR_INREG(N); break;
157157

158+
case ISD::VECTOR_EXTRACT_LAST_ACTIVE:
159+
Res = PromoteIntRes_VECTOR_EXTRACT_LAST_ACTIVE(N);
160+
break;
161+
158162
case ISD::SIGN_EXTEND:
159163
case ISD::VP_SIGN_EXTEND:
160164
case ISD::ZERO_EXTEND:
@@ -2069,6 +2073,9 @@ bool DAGTypeLegalizer::PromoteIntegerOperand(SDNode *N, unsigned OpNo) {
20692073
case ISD::EXPERIMENTAL_VECTOR_HISTOGRAM:
20702074
Res = PromoteIntOp_VECTOR_HISTOGRAM(N, OpNo);
20712075
break;
2076+
case ISD::VECTOR_EXTRACT_LAST_ACTIVE:
2077+
Res = PromoteIntOp_VECTOR_EXTRACT_LAST_ACTIVE(N, OpNo);
2078+
break;
20722079
}
20732080

20742081
// If the result is null, the sub-method took care of registering results etc.
@@ -2810,6 +2817,14 @@ SDValue DAGTypeLegalizer::PromoteIntOp_VECTOR_HISTOGRAM(SDNode *N,
28102817
return SDValue(DAG.UpdateNodeOperands(N, NewOps), 0);
28112818
}
28122819

2820+
SDValue
2821+
DAGTypeLegalizer::PromoteIntOp_VECTOR_EXTRACT_LAST_ACTIVE(SDNode *N,
2822+
unsigned OpNo) {
2823+
SmallVector<SDValue, 3> NewOps(N->ops());
2824+
NewOps[OpNo] = GetPromotedInteger(N->getOperand(OpNo));
2825+
return SDValue(DAG.UpdateNodeOperands(N, NewOps), 0);
2826+
}
2827+
28132828
//===----------------------------------------------------------------------===//
28142829
// Integer Result Expansion
28152830
//===----------------------------------------------------------------------===//
@@ -2848,6 +2863,9 @@ void DAGTypeLegalizer::ExpandIntegerResult(SDNode *N, unsigned ResNo) {
28482863
case ISD::BUILD_PAIR: ExpandRes_BUILD_PAIR(N, Lo, Hi); break;
28492864
case ISD::EXTRACT_ELEMENT: ExpandRes_EXTRACT_ELEMENT(N, Lo, Hi); break;
28502865
case ISD::EXTRACT_VECTOR_ELT: ExpandRes_EXTRACT_VECTOR_ELT(N, Lo, Hi); break;
2866+
case ISD::VECTOR_EXTRACT_LAST_ACTIVE:
2867+
ExpandRes_VECTOR_EXTRACT_LAST_ACTIVE(N, Lo, Hi);
2868+
break;
28512869
case ISD::VAARG: ExpandRes_VAARG(N, Lo, Hi); break;
28522870

28532871
case ISD::ANY_EXTEND: ExpandIntRes_ANY_EXTEND(N, Lo, Hi); break;
@@ -6124,6 +6142,12 @@ SDValue DAGTypeLegalizer::PromoteIntRes_EXTEND_VECTOR_INREG(SDNode *N) {
61246142
return DAG.getNode(N->getOpcode(), dl, NVT, N->getOperand(0));
61256143
}
61266144

6145+
SDValue DAGTypeLegalizer::PromoteIntRes_VECTOR_EXTRACT_LAST_ACTIVE(SDNode *N) {
6146+
EVT VT = N->getValueType(0);
6147+
EVT NVT = TLI.getTypeToTransformTo(*DAG.getContext(), VT);
6148+
return DAG.getNode(ISD::VECTOR_EXTRACT_LAST_ACTIVE, SDLoc(N), NVT, N->ops());
6149+
}
6150+
61276151
SDValue DAGTypeLegalizer::PromoteIntRes_INSERT_VECTOR_ELT(SDNode *N) {
61286152
EVT OutVT = N->getValueType(0);
61296153
EVT NOutVT = TLI.getTypeToTransformTo(*DAG.getContext(), OutVT);

llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,7 @@ class LLVM_LIBRARY_VISIBILITY DAGTypeLegalizer {
378378
SDValue PromoteIntRes_VPFunnelShift(SDNode *N);
379379
SDValue PromoteIntRes_IS_FPCLASS(SDNode *N);
380380
SDValue PromoteIntRes_PATCHPOINT(SDNode *N);
381+
SDValue PromoteIntRes_VECTOR_EXTRACT_LAST_ACTIVE(SDNode *N);
381382

382383
// Integer Operand Promotion.
383384
bool PromoteIntegerOperand(SDNode *N, unsigned OpNo);
@@ -428,6 +429,7 @@ class LLVM_LIBRARY_VISIBILITY DAGTypeLegalizer {
428429
SDValue PromoteIntOp_VP_STRIDED(SDNode *N, unsigned OpNo);
429430
SDValue PromoteIntOp_VP_SPLICE(SDNode *N, unsigned OpNo);
430431
SDValue PromoteIntOp_VECTOR_HISTOGRAM(SDNode *N, unsigned OpNo);
432+
SDValue PromoteIntOp_VECTOR_EXTRACT_LAST_ACTIVE(SDNode *N, unsigned OpNo);
431433

432434
void SExtOrZExtPromotedOperands(SDValue &LHS, SDValue &RHS);
433435
void PromoteSetCCOperands(SDValue &LHS,SDValue &RHS, ISD::CondCode Code);
@@ -1215,6 +1217,8 @@ class LLVM_LIBRARY_VISIBILITY DAGTypeLegalizer {
12151217
void ExpandRes_BUILD_PAIR (SDNode *N, SDValue &Lo, SDValue &Hi);
12161218
void ExpandRes_EXTRACT_ELEMENT (SDNode *N, SDValue &Lo, SDValue &Hi);
12171219
void ExpandRes_EXTRACT_VECTOR_ELT(SDNode *N, SDValue &Lo, SDValue &Hi);
1220+
void ExpandRes_VECTOR_EXTRACT_LAST_ACTIVE(SDNode *N, SDValue &Lo,
1221+
SDValue &Hi);
12181222
void ExpandRes_NormalLoad (SDNode *N, SDValue &Lo, SDValue &Hi);
12191223
void ExpandRes_VAARG (SDNode *N, SDValue &Lo, SDValue &Hi);
12201224

llvm/lib/CodeGen/SelectionDAG/LegalizeTypesGeneric.cpp

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
//===----------------------------------------------------------------------===//
2020

2121
#include "LegalizeTypes.h"
22+
#include "llvm/Analysis/VectorUtils.h"
2223
#include "llvm/IR/DataLayout.h"
2324
using namespace llvm;
2425

@@ -244,6 +245,66 @@ void DAGTypeLegalizer::ExpandRes_EXTRACT_VECTOR_ELT(SDNode *N, SDValue &Lo,
244245
std::swap(Lo, Hi);
245246
}
246247

248+
void DAGTypeLegalizer::ExpandRes_VECTOR_EXTRACT_LAST_ACTIVE(SDNode *N,
249+
SDValue &Lo,
250+
SDValue &Hi) {
251+
SDValue Data = N->getOperand(0);
252+
SDValue Mask = N->getOperand(1);
253+
SDValue PassThru = N->getOperand(2);
254+
255+
ElementCount OldEltCount = Data.getValueType().getVectorElementCount();
256+
EVT OldEltVT = Data.getValueType().getVectorElementType();
257+
SDLoc dl(N);
258+
259+
EVT OldVT = N->getValueType(0);
260+
EVT NewVT = TLI.getTypeToTransformTo(*DAG.getContext(), OldVT);
261+
262+
if (OldVT != OldEltVT) {
263+
// The result of EXTRACT_LAST_ACTIVE may be larger than the element type of
264+
// the input vector. If so, extend the elements of the input vector to the
265+
// same bitwidth as the result before expanding.
266+
assert(OldEltVT.bitsLT(OldVT) && "Result type smaller then element type!");
267+
EVT NVecVT = EVT::getVectorVT(*DAG.getContext(), OldVT, OldEltCount);
268+
Data = DAG.getNode(ISD::ANY_EXTEND, dl, NVecVT, N->getOperand(0));
269+
}
270+
271+
SDValue NewVec = DAG.getNode(
272+
ISD::BITCAST, dl,
273+
EVT::getVectorVT(*DAG.getContext(), NewVT, OldEltCount * 2), Data);
274+
275+
auto [DataLo, DataHi] = DAG.SplitVector(NewVec, dl);
276+
auto [PassLo, PassHi] = DAG.SplitScalar(PassThru, dl, NewVT, NewVT);
277+
278+
EVT SplitVT = DataLo.getValueType();
279+
280+
// TODO: I *think* this works correctly, but I haven't confirmed it yet by
281+
// actually running a compiled program with example data.
282+
//
283+
// We want the matching lo and hi parts from whichever lane was the last
284+
// active.
285+
SDValue Deinterleaved;
286+
if (SplitVT.isFixedLengthVector()) {
287+
unsigned SplitNum = SplitVT.getVectorMinNumElements();
288+
SDValue Even = DAG.getVectorShuffle(SplitVT, dl, DataLo, DataHi,
289+
createStrideMask(0, 2, SplitNum));
290+
SDValue Odd = DAG.getVectorShuffle(SplitVT, dl, DataLo, DataHi,
291+
createStrideMask(1, 2, SplitNum));
292+
Deinterleaved = DAG.getMergeValues({Even, Odd}, dl);
293+
} else
294+
Deinterleaved =
295+
DAG.getNode(ISD::VECTOR_DEINTERLEAVE, dl,
296+
DAG.getVTList(SplitVT, SplitVT), DataLo, DataHi);
297+
298+
Lo = DAG.getNode(ISD::VECTOR_EXTRACT_LAST_ACTIVE, dl, NewVT,
299+
Deinterleaved.getValue(0), Mask, PassLo);
300+
Hi = DAG.getNode(ISD::VECTOR_EXTRACT_LAST_ACTIVE, dl, NewVT,
301+
Deinterleaved.getValue(1), Mask, PassHi);
302+
303+
// FIXME: Endianness?
304+
assert(!DAG.getDataLayout().isBigEndian() &&
305+
"Implement big endian result expansion for extract_last_active");
306+
}
307+
247308
void DAGTypeLegalizer::ExpandRes_NormalLoad(SDNode *N, SDValue &Lo,
248309
SDValue &Hi) {
249310
assert(ISD::isNormalLoad(N) && "This routine only for normal loads!");

llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#include "llvm/ADT/DenseMap.h"
3030
#include "llvm/ADT/SmallVector.h"
3131
#include "llvm/Analysis/TargetLibraryInfo.h"
32+
#include "llvm/Analysis/ValueTracking.h"
3233
#include "llvm/Analysis/VectorUtils.h"
3334
#include "llvm/CodeGen/ISDOpcodes.h"
3435
#include "llvm/CodeGen/SelectionDAG.h"
@@ -138,6 +139,7 @@ class VectorLegalizer {
138139
SDValue ExpandVP_FNEG(SDNode *Node);
139140
SDValue ExpandVP_FABS(SDNode *Node);
140141
SDValue ExpandVP_FCOPYSIGN(SDNode *Node);
142+
SDValue ExpandVECTOR_EXTRACT_LAST_ACTIVE(SDNode *Node);
141143
SDValue ExpandSELECT(SDNode *Node);
142144
std::pair<SDValue, SDValue> ExpandLoad(SDNode *N);
143145
SDValue ExpandStore(SDNode *N);
@@ -467,6 +469,7 @@ SDValue VectorLegalizer::LegalizeOp(SDValue Op) {
467469
case ISD::VECTOR_COMPRESS:
468470
case ISD::SCMP:
469471
case ISD::UCMP:
472+
case ISD::VECTOR_EXTRACT_LAST_ACTIVE:
470473
Action = TLI.getOperationAction(Node->getOpcode(), Node->getValueType(0));
471474
break;
472475
case ISD::SMULFIX:
@@ -1208,6 +1211,9 @@ void VectorLegalizer::Expand(SDNode *Node, SmallVectorImpl<SDValue> &Results) {
12081211
case ISD::VECTOR_COMPRESS:
12091212
Results.push_back(TLI.expandVECTOR_COMPRESS(Node, DAG));
12101213
return;
1214+
case ISD::VECTOR_EXTRACT_LAST_ACTIVE:
1215+
Results.push_back(ExpandVECTOR_EXTRACT_LAST_ACTIVE(Node));
1216+
return;
12111217
case ISD::SCMP:
12121218
case ISD::UCMP:
12131219
Results.push_back(TLI.expandCMP(Node, DAG));
@@ -1719,6 +1725,80 @@ SDValue VectorLegalizer::ExpandVP_FCOPYSIGN(SDNode *Node) {
17191725
return DAG.getNode(ISD::BITCAST, DL, VT, CopiedSign);
17201726
}
17211727

1728+
SDValue VectorLegalizer::ExpandVECTOR_EXTRACT_LAST_ACTIVE(SDNode *Node) {
1729+
SDLoc DL(Node);
1730+
SDValue Data = Node->getOperand(0);
1731+
SDValue Mask = Node->getOperand(1);
1732+
SDValue PassThru = Node->getOperand(2);
1733+
1734+
EVT DataVT = Data.getValueType();
1735+
EVT ScalarVT = PassThru.getValueType();
1736+
EVT BoolVT = Mask.getValueType().getScalarType();
1737+
1738+
// Find a suitable type for a stepvector.
1739+
ConstantRange VScaleRange(1, /*isFullSet=*/true); // Dummy value.
1740+
if (DataVT.isScalableVector())
1741+
VScaleRange = getVScaleRange(&DAG.getMachineFunction().getFunction(), 64);
1742+
const TargetLowering &TLI = DAG.getTargetLoweringInfo();
1743+
unsigned EltWidth = TLI.getBitWidthForCttzElements(
1744+
ScalarVT.getTypeForEVT(*DAG.getContext()), DataVT.getVectorElementCount(),
1745+
/*ZeroIsPoison=*/true, &VScaleRange);
1746+
1747+
// HACK: If the target selects a VT that's too wide based on the legal types
1748+
// for a vecreduce_umax, if will force expansion of the node -- which
1749+
// doesn't work on scalable vectors...
1750+
// Is there another method we could use to get a smaller VT instead
1751+
// of just capping to 32b?
1752+
EVT StepVT = MVT::getIntegerVT(std::min(EltWidth, 32u));
1753+
EVT StepVecVT = DataVT.changeVectorElementType(StepVT);
1754+
1755+
// HACK: If the target selects a VT that's too small to form a legal vector
1756+
// type, we also run into problems trying to expand the vecreduce_umax.
1757+
//
1758+
// I think perhaps we need to revisit how getBitWidthForCttzElements
1759+
// works...
1760+
if (TLI.getTypeAction(StepVecVT.getSimpleVT()) ==
1761+
TargetLowering::TypePromoteInteger) {
1762+
StepVecVT = TLI.getTypeToTransformTo(*DAG.getContext(), StepVecVT);
1763+
StepVT = StepVecVT.getVectorElementType();
1764+
}
1765+
1766+
// Zero out lanes with inactive elements, then find the highest remaining
1767+
// value from the stepvector.
1768+
SDValue Zeroes = DAG.getConstant(0, DL, StepVecVT);
1769+
SDValue StepVec = DAG.getStepVector(DL, StepVecVT);
1770+
SDValue ActiveElts = DAG.getSelect(DL, StepVecVT, Mask, StepVec, Zeroes);
1771+
1772+
// HACK: Unfortunately, LegalizeVectorOps does not recursively legalize *all*
1773+
// added nodes, just the end result nodes until it finds legal ops.
1774+
// LegalizeDAG doesn't handle VSELECT at all presently. So if we need to
1775+
// legalize a vselect then we have to do it here.
1776+
//
1777+
// We might want to change LegalizeVectorOps to walk backwards through the
1778+
// nodes like LegalizeDAG? And share VSELECT legalization code with
1779+
// LegalizeDAG?
1780+
//
1781+
// Or would that cause problems with illegal types that we might have just
1782+
// introduced?
1783+
//
1784+
// Having a legal op with illegal types marked as Legal should work, with the
1785+
// expectation being that type legalization fixes it up later.
1786+
if (TLI.getOperationAction(ISD::VSELECT, StepVecVT) == TargetLowering::Expand)
1787+
ActiveElts = LegalizeOp(ActiveElts);
1788+
1789+
SDValue HighestIdx = DAG.getNode(ISD::VECREDUCE_UMAX, DL, StepVT, ActiveElts);
1790+
1791+
// Extract the corresponding lane from the data vector
1792+
EVT ExtVT = TLI.getVectorIdxTy(DAG.getDataLayout());
1793+
SDValue Idx = DAG.getZExtOrTrunc(HighestIdx, DL, ExtVT);
1794+
SDValue Extract =
1795+
DAG.getNode(ISD::EXTRACT_VECTOR_ELT, DL, ScalarVT, Data, Idx);
1796+
1797+
// If all mask lanes were inactive, choose the passthru value instead.
1798+
SDValue AnyActive = DAG.getNode(ISD::VECREDUCE_OR, DL, BoolVT, Mask);
1799+
return DAG.getSelect(DL, ScalarVT, AnyActive, Extract, PassThru);
1800+
}
1801+
17221802
void VectorLegalizer::ExpandFP_TO_UINT(SDNode *Node,
17231803
SmallVectorImpl<SDValue> &Results) {
17241804
// Attempt to expand using TargetLowering.

llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp

Lines changed: 6 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -6426,43 +6426,18 @@ void SelectionDAGBuilder::visitVectorExtractLastActive(const CallInst &I,
64266426
unsigned Intrinsic) {
64276427
assert(Intrinsic == Intrinsic::experimental_vector_extract_last_active &&
64286428
"Tried lowering invalid vector extract last");
6429+
64296430
SDLoc sdl = getCurSDLoc();
64306431
SDValue Data = getValue(I.getOperand(0));
64316432
SDValue Mask = getValue(I.getOperand(1));
64326433
SDValue PassThru = getValue(I.getOperand(2));
64336434

6434-
EVT DataVT = Data.getValueType();
6435-
EVT ScalarVT = PassThru.getValueType();
6436-
EVT BoolVT = Mask.getValueType().getScalarType();
6437-
6438-
// Find a suitable type for a stepvector.
6439-
ConstantRange VScaleRange(1, /*isFullSet=*/true); // Dummy value.
6440-
if (DataVT.isScalableVector())
6441-
VScaleRange = getVScaleRange(I.getCaller(), 64);
64426435
const TargetLowering &TLI = DAG.getTargetLoweringInfo();
6443-
unsigned EltWidth = TLI.getBitWidthForCttzElements(
6444-
I.getType(), DataVT.getVectorElementCount(), /*ZeroIsPoison=*/true,
6445-
&VScaleRange);
6446-
MVT StepVT = MVT::getIntegerVT(EltWidth);
6447-
EVT StepVecVT = DataVT.changeVectorElementType(StepVT);
6448-
6449-
// Zero out lanes with inactive elements, then find the highest remaining
6450-
// value from the stepvector.
6451-
SDValue Zeroes = DAG.getConstant(0, sdl, StepVecVT);
6452-
SDValue StepVec = DAG.getStepVector(sdl, StepVecVT);
6453-
SDValue ActiveElts = DAG.getSelect(sdl, StepVecVT, Mask, StepVec, Zeroes);
6454-
SDValue HighestIdx =
6455-
DAG.getNode(ISD::VECREDUCE_UMAX, sdl, StepVT, ActiveElts);
6456-
6457-
// Extract the corresponding lane from the data vector
6458-
EVT ExtVT = TLI.getVectorIdxTy(DAG.getDataLayout());
6459-
SDValue Idx = DAG.getZExtOrTrunc(HighestIdx, sdl, ExtVT);
6460-
SDValue Extract =
6461-
DAG.getNode(ISD::EXTRACT_VECTOR_ELT, sdl, ScalarVT, Data, Idx);
6462-
6463-
// If all mask lanes were inactive, choose the passthru value instead.
6464-
SDValue AnyActive = DAG.getNode(ISD::VECREDUCE_OR, sdl, BoolVT, Mask);
6465-
SDValue Result = DAG.getSelect(sdl, ScalarVT, AnyActive, Extract, PassThru);
6436+
EVT ResultVT = TLI.getValueType(DAG.getDataLayout(), I.getType());
6437+
6438+
SDValue Result = DAG.getNode(ISD::VECTOR_EXTRACT_LAST_ACTIVE, sdl, ResultVT,
6439+
Data, Mask, PassThru);
6440+
64666441
setValue(&I, Result);
64676442
}
64686443

llvm/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -567,6 +567,9 @@ std::string SDNode::getOperationName(const SelectionDAG *G) const {
567567
case ISD::EXPERIMENTAL_VECTOR_HISTOGRAM:
568568
return "histogram";
569569

570+
case ISD::VECTOR_EXTRACT_LAST_ACTIVE:
571+
return "extract_last_active";
572+
570573
// Vector Predication
571574
#define BEGIN_REGISTER_VP_SDNODE(SDID, LEGALARG, NAME, ...) \
572575
case ISD::SDID: \

llvm/lib/CodeGen/TargetLoweringBase.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -818,6 +818,9 @@ void TargetLoweringBase::initActions() {
818818
setOperationAction(ISD::SDOPC, VT, Expand);
819819
#include "llvm/IR/VPIntrinsics.def"
820820

821+
// Masked vector extracts default to expand.
822+
setOperationAction(ISD::VECTOR_EXTRACT_LAST_ACTIVE, VT, Expand);
823+
821824
// FP environment operations default to expand.
822825
setOperationAction(ISD::GET_FPENV, VT, Expand);
823826
setOperationAction(ISD::SET_FPENV, VT, Expand);

llvm/lib/Target/AArch64/AArch64ISelLowering.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,16 @@ AArch64TargetLowering::AArch64TargetLowering(const TargetMachine &TM,
401401
addRegisterClass(MVT::f128, &AArch64::FPR128RegClass);
402402
}
403403

404+
// TODO: Should we include any other operations here? The calls to
405+
// addDRType/addQRType below do mark VSELECT as Expand for the
406+
// specified VTs, but leave other illegal types as the default
407+
// of 'Legal'. LegalizeDAG doesn't legalize VSELECT after type
408+
// legalization if LegalizeVectorOps introduces one.
409+
for (MVT VT : MVT::integer_fixedlen_vector_valuetypes())
410+
setOperationAction(ISD::VSELECT, VT, Expand);
411+
for (MVT VT : MVT::fp_fixedlen_vector_valuetypes())
412+
setOperationAction(ISD::VSELECT, VT, Expand);
413+
404414
if (Subtarget->hasNEON()) {
405415
addRegisterClass(MVT::v16i8, &AArch64::FPR8RegClass);
406416
addRegisterClass(MVT::v8i16, &AArch64::FPR16RegClass);

0 commit comments

Comments
 (0)