Skip to content

Commit c754687

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 1bdb0a4 commit c754687

File tree

11 files changed

+432
-199
lines changed

11 files changed

+432
-199
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.
@@ -2803,6 +2810,14 @@ SDValue DAGTypeLegalizer::PromoteIntOp_VECTOR_HISTOGRAM(SDNode *N,
28032810
return SDValue(DAG.UpdateNodeOperands(N, NewOps), 0);
28042811
}
28052812

2813+
SDValue
2814+
DAGTypeLegalizer::PromoteIntOp_VECTOR_EXTRACT_LAST_ACTIVE(SDNode *N,
2815+
unsigned OpNo) {
2816+
SmallVector<SDValue, 3> NewOps(N->ops());
2817+
NewOps[OpNo] = GetPromotedInteger(N->getOperand(OpNo));
2818+
return SDValue(DAG.UpdateNodeOperands(N, NewOps), 0);
2819+
}
2820+
28062821
//===----------------------------------------------------------------------===//
28072822
// Integer Result Expansion
28082823
//===----------------------------------------------------------------------===//
@@ -2840,6 +2855,9 @@ void DAGTypeLegalizer::ExpandIntegerResult(SDNode *N, unsigned ResNo) {
28402855
case ISD::BUILD_PAIR: ExpandRes_BUILD_PAIR(N, Lo, Hi); break;
28412856
case ISD::EXTRACT_ELEMENT: ExpandRes_EXTRACT_ELEMENT(N, Lo, Hi); break;
28422857
case ISD::EXTRACT_VECTOR_ELT: ExpandRes_EXTRACT_VECTOR_ELT(N, Lo, Hi); break;
2858+
case ISD::VECTOR_EXTRACT_LAST_ACTIVE:
2859+
ExpandRes_VECTOR_EXTRACT_LAST_ACTIVE(N, Lo, Hi);
2860+
break;
28432861
case ISD::VAARG: ExpandRes_VAARG(N, Lo, Hi); break;
28442862

28452863
case ISD::ANY_EXTEND: ExpandIntRes_ANY_EXTEND(N, Lo, Hi); break;
@@ -6102,6 +6120,12 @@ SDValue DAGTypeLegalizer::PromoteIntRes_EXTEND_VECTOR_INREG(SDNode *N) {
61026120
return DAG.getNode(N->getOpcode(), dl, NVT, N->getOperand(0));
61036121
}
61046122

6123+
SDValue DAGTypeLegalizer::PromoteIntRes_VECTOR_EXTRACT_LAST_ACTIVE(SDNode *N) {
6124+
EVT VT = N->getValueType(0);
6125+
EVT NVT = TLI.getTypeToTransformTo(*DAG.getContext(), VT);
6126+
return DAG.getNode(ISD::VECTOR_EXTRACT_LAST_ACTIVE, SDLoc(N), NVT, N->ops());
6127+
}
6128+
61056129
SDValue DAGTypeLegalizer::PromoteIntRes_INSERT_VECTOR_ELT(SDNode *N) {
61066130
EVT OutVT = N->getValueType(0);
61076131
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);
@@ -1214,6 +1216,8 @@ class LLVM_LIBRARY_VISIBILITY DAGTypeLegalizer {
12141216
void ExpandRes_BUILD_PAIR (SDNode *N, SDValue &Lo, SDValue &Hi);
12151217
void ExpandRes_EXTRACT_ELEMENT (SDNode *N, SDValue &Lo, SDValue &Hi);
12161218
void ExpandRes_EXTRACT_VECTOR_ELT(SDNode *N, SDValue &Lo, SDValue &Hi);
1219+
void ExpandRes_VECTOR_EXTRACT_LAST_ACTIVE(SDNode *N, SDValue &Lo,
1220+
SDValue &Hi);
12171221
void ExpandRes_NormalLoad (SDNode *N, SDValue &Lo, SDValue &Hi);
12181222
void ExpandRes_VAARG (SDNode *N, SDValue &Lo, SDValue &Hi);
12191223

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);
@@ -465,6 +467,7 @@ SDValue VectorLegalizer::LegalizeOp(SDValue Op) {
465467
case ISD::VECTOR_COMPRESS:
466468
case ISD::SCMP:
467469
case ISD::UCMP:
470+
case ISD::VECTOR_EXTRACT_LAST_ACTIVE:
468471
Action = TLI.getOperationAction(Node->getOpcode(), Node->getValueType(0));
469472
break;
470473
case ISD::SMULFIX:
@@ -1202,6 +1205,9 @@ void VectorLegalizer::Expand(SDNode *Node, SmallVectorImpl<SDValue> &Results) {
12021205
case ISD::VECTOR_COMPRESS:
12031206
Results.push_back(TLI.expandVECTOR_COMPRESS(Node, DAG));
12041207
return;
1208+
case ISD::VECTOR_EXTRACT_LAST_ACTIVE:
1209+
Results.push_back(ExpandVECTOR_EXTRACT_LAST_ACTIVE(Node));
1210+
return;
12051211
case ISD::SCMP:
12061212
case ISD::UCMP:
12071213
Results.push_back(TLI.expandCMP(Node, DAG));
@@ -1713,6 +1719,80 @@ SDValue VectorLegalizer::ExpandVP_FCOPYSIGN(SDNode *Node) {
17131719
return DAG.getNode(ISD::BITCAST, DL, VT, CopiedSign);
17141720
}
17151721

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

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

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)