@@ -4070,9 +4070,10 @@ static std::pair<SDValue, SDValue> splitVector(SDValue Op, SelectionDAG &DAG,
4070
4070
}
4071
4071
4072
4072
/// Break an operation into 2 half sized ops and then concatenate the results.
4073
- static SDValue splitVectorOp(SDValue Op, SelectionDAG &DAG, const SDLoc &dl ) {
4073
+ static SDValue splitVectorOp(SDValue Op, SelectionDAG &DAG) {
4074
4074
unsigned NumOps = Op.getNumOperands();
4075
4075
EVT VT = Op.getValueType();
4076
+ SDLoc dl(Op);
4076
4077
4077
4078
// Extract the LHS Lo/Hi vectors
4078
4079
SmallVector<SDValue> LoOps(NumOps, SDValue());
@@ -4095,8 +4096,7 @@ static SDValue splitVectorOp(SDValue Op, SelectionDAG &DAG, const SDLoc &dl) {
4095
4096
4096
4097
/// Break an unary integer operation into 2 half sized ops and then
4097
4098
/// concatenate the result back.
4098
- static SDValue splitVectorIntUnary(SDValue Op, SelectionDAG &DAG,
4099
- const SDLoc &dl) {
4099
+ static SDValue splitVectorIntUnary(SDValue Op, SelectionDAG &DAG) {
4100
4100
// Make sure we only try to split 256/512-bit types to avoid creating
4101
4101
// narrow vectors.
4102
4102
EVT VT = Op.getValueType();
@@ -4107,20 +4107,19 @@ static SDValue splitVectorIntUnary(SDValue Op, SelectionDAG &DAG,
4107
4107
assert(Op.getOperand(0).getValueType().getVectorNumElements() ==
4108
4108
VT.getVectorNumElements() &&
4109
4109
"Unexpected VTs!");
4110
- return splitVectorOp(Op, DAG, dl );
4110
+ return splitVectorOp(Op, DAG);
4111
4111
}
4112
4112
4113
4113
/// Break a binary integer operation into 2 half sized ops and then
4114
4114
/// concatenate the result back.
4115
- static SDValue splitVectorIntBinary(SDValue Op, SelectionDAG &DAG,
4116
- const SDLoc &dl) {
4115
+ static SDValue splitVectorIntBinary(SDValue Op, SelectionDAG &DAG) {
4117
4116
// Assert that all the types match.
4118
4117
EVT VT = Op.getValueType();
4119
4118
(void)VT;
4120
4119
assert(Op.getOperand(0).getValueType() == VT &&
4121
4120
Op.getOperand(1).getValueType() == VT && "Unexpected VTs!");
4122
4121
assert((VT.is256BitVector() || VT.is512BitVector()) && "Unsupported VT!");
4123
- return splitVectorOp(Op, DAG, dl );
4122
+ return splitVectorOp(Op, DAG);
4124
4123
}
4125
4124
4126
4125
// Helper for splitting operands of an operation to legal target size and
@@ -20055,7 +20054,7 @@ static SDValue LowerAVXExtend(SDValue Op, SelectionDAG &DAG,
20055
20054
20056
20055
if (VT == MVT::v32i16 && !Subtarget.hasBWI()) {
20057
20056
assert(InVT == MVT::v32i8 && "Unexpected VT!");
20058
- return splitVectorIntUnary(Op, DAG, dl );
20057
+ return splitVectorIntUnary(Op, DAG);
20059
20058
}
20060
20059
20061
20060
if (Subtarget.hasInt256())
@@ -20636,7 +20635,7 @@ SDValue X86TargetLowering::LowerTRUNCATE(SDValue Op, SelectionDAG &DAG) const {
20636
20635
if (Subtarget.hasAVX512()) {
20637
20636
if (InVT == MVT::v32i16 && !Subtarget.hasBWI()) {
20638
20637
assert(VT == MVT::v32i8 && "Unexpected VT!");
20639
- return splitVectorIntUnary(Op, DAG, DL );
20638
+ return splitVectorIntUnary(Op, DAG);
20640
20639
}
20641
20640
20642
20641
// word to byte only under BWI. Otherwise we have to promoted to v16i32
@@ -21616,8 +21615,7 @@ SDValue X86TargetLowering::LowerFP_TO_BF16(SDValue Op,
21616
21615
21617
21616
/// Depending on uarch and/or optimizing for size, we might prefer to use a
21618
21617
/// vector operation in place of the typical scalar operation.
21619
- static SDValue lowerAddSubToHorizontalOp(SDValue Op, const SDLoc &DL,
21620
- SelectionDAG &DAG,
21618
+ static SDValue lowerAddSubToHorizontalOp(SDValue Op, SelectionDAG &DAG,
21621
21619
const X86Subtarget &Subtarget) {
21622
21620
// If both operands have other uses, this is probably not profitable.
21623
21621
SDValue LHS = Op.getOperand(0);
@@ -21673,6 +21671,7 @@ static SDValue lowerAddSubToHorizontalOp(SDValue Op, const SDLoc &DL,
21673
21671
21674
21672
// Creating a 256-bit horizontal op would be wasteful, and there is no 512-bit
21675
21673
// equivalent, so extract the 256/512-bit source op to 128-bit if we can.
21674
+ SDLoc DL(Op);
21676
21675
if (BitWidth == 256 || BitWidth == 512) {
21677
21676
unsigned LaneIdx = LExtIndex / NumEltsPerLane;
21678
21677
X = extract128BitVector(X, LaneIdx * NumEltsPerLane, DAG, DL);
@@ -21693,7 +21692,7 @@ static SDValue lowerAddSubToHorizontalOp(SDValue Op, const SDLoc &DL,
21693
21692
SDValue X86TargetLowering::lowerFaddFsub(SDValue Op, SelectionDAG &DAG) const {
21694
21693
assert((Op.getValueType() == MVT::f32 || Op.getValueType() == MVT::f64) &&
21695
21694
"Only expecting float/double");
21696
- return lowerAddSubToHorizontalOp(Op, SDLoc(Op), DAG, Subtarget);
21695
+ return lowerAddSubToHorizontalOp(Op, DAG, Subtarget);
21697
21696
}
21698
21697
21699
21698
/// ISD::FROUND is defined to round to nearest with ties rounding away from 0.
@@ -24450,7 +24449,7 @@ static SDValue LowerSIGN_EXTEND(SDValue Op, const X86Subtarget &Subtarget,
24450
24449
24451
24450
if (VT == MVT::v32i16 && !Subtarget.hasBWI()) {
24452
24451
assert(InVT == MVT::v32i8 && "Unexpected VT!");
24453
- return splitVectorIntUnary(Op, DAG, dl );
24452
+ return splitVectorIntUnary(Op, DAG);
24454
24453
}
24455
24454
24456
24455
if (Subtarget.hasInt256())
@@ -27813,7 +27812,7 @@ static SDValue LowerVectorCTLZ_AVX512CDI(SDValue Op, SelectionDAG &DAG,
27813
27812
// Split vector, it's Lo and Hi parts will be handled in next iteration.
27814
27813
if (NumElems > 16 ||
27815
27814
(NumElems == 16 && !Subtarget.canExtendTo512DQ()))
27816
- return splitVectorIntUnary(Op, DAG, dl );
27815
+ return splitVectorIntUnary(Op, DAG);
27817
27816
27818
27817
MVT NewVT = MVT::getVectorVT(MVT::i32, NumElems);
27819
27818
assert((NewVT.is256BitVector() || NewVT.is512BitVector()) &&
@@ -27923,11 +27922,11 @@ static SDValue LowerVectorCTLZ(SDValue Op, const SDLoc &DL,
27923
27922
27924
27923
// Decompose 256-bit ops into smaller 128-bit ops.
27925
27924
if (VT.is256BitVector() && !Subtarget.hasInt256())
27926
- return splitVectorIntUnary(Op, DAG, DL );
27925
+ return splitVectorIntUnary(Op, DAG);
27927
27926
27928
27927
// Decompose 512-bit ops into smaller 256-bit ops.
27929
27928
if (VT.is512BitVector() && !Subtarget.hasBWI())
27930
- return splitVectorIntUnary(Op, DAG, DL );
27929
+ return splitVectorIntUnary(Op, DAG);
27931
27930
27932
27931
assert(Subtarget.hasSSSE3() && "Expected SSSE3 support for PSHUFB");
27933
27932
return LowerVectorCTLZInRegLUT(Op, DL, Subtarget, DAG);
@@ -28000,18 +27999,16 @@ static SDValue LowerCTTZ(SDValue Op, const X86Subtarget &Subtarget,
28000
27999
static SDValue lowerAddSub(SDValue Op, SelectionDAG &DAG,
28001
28000
const X86Subtarget &Subtarget) {
28002
28001
MVT VT = Op.getSimpleValueType();
28003
- SDLoc DL(Op);
28004
-
28005
28002
if (VT == MVT::i16 || VT == MVT::i32)
28006
- return lowerAddSubToHorizontalOp(Op, DL, DAG, Subtarget);
28003
+ return lowerAddSubToHorizontalOp(Op, DAG, Subtarget);
28007
28004
28008
28005
if (VT == MVT::v32i16 || VT == MVT::v64i8)
28009
- return splitVectorIntBinary(Op, DAG, DL );
28006
+ return splitVectorIntBinary(Op, DAG);
28010
28007
28011
28008
assert(Op.getSimpleValueType().is256BitVector() &&
28012
28009
Op.getSimpleValueType().isInteger() &&
28013
28010
"Only handle AVX 256-bit vector integer operation");
28014
- return splitVectorIntBinary(Op, DAG, DL );
28011
+ return splitVectorIntBinary(Op, DAG);
28015
28012
}
28016
28013
28017
28014
static SDValue LowerADDSAT_SUBSAT(SDValue Op, SelectionDAG &DAG,
@@ -28025,7 +28022,7 @@ static SDValue LowerADDSAT_SUBSAT(SDValue Op, SelectionDAG &DAG,
28025
28022
(VT.is256BitVector() && !Subtarget.hasInt256())) {
28026
28023
assert(Op.getSimpleValueType().isInteger() &&
28027
28024
"Only handle AVX vector integer operation");
28028
- return splitVectorIntBinary(Op, DAG, DL );
28025
+ return splitVectorIntBinary(Op, DAG);
28029
28026
}
28030
28027
28031
28028
// Avoid the generic expansion with min/max if we don't have pminu*/pmaxu*.
@@ -28087,11 +28084,10 @@ static SDValue LowerADDSAT_SUBSAT(SDValue Op, SelectionDAG &DAG,
28087
28084
static SDValue LowerABS(SDValue Op, const X86Subtarget &Subtarget,
28088
28085
SelectionDAG &DAG) {
28089
28086
MVT VT = Op.getSimpleValueType();
28090
- SDLoc DL(Op);
28091
-
28092
28087
if (VT == MVT::i16 || VT == MVT::i32 || VT == MVT::i64) {
28093
28088
// Since X86 does not have CMOV for 8-bit integer, we don't convert
28094
28089
// 8-bit integer abs to NEG and CMOV.
28090
+ SDLoc DL(Op);
28095
28091
SDValue N0 = Op.getOperand(0);
28096
28092
SDValue Neg = DAG.getNode(X86ISD::SUB, DL, DAG.getVTList(VT, MVT::i32),
28097
28093
DAG.getConstant(0, DL, VT), N0);
@@ -28102,6 +28098,7 @@ static SDValue LowerABS(SDValue Op, const X86Subtarget &Subtarget,
28102
28098
28103
28099
// ABS(vXi64 X) --> VPBLENDVPD(X, 0-X, X).
28104
28100
if ((VT == MVT::v2i64 || VT == MVT::v4i64) && Subtarget.hasSSE41()) {
28101
+ SDLoc DL(Op);
28105
28102
SDValue Src = Op.getOperand(0);
28106
28103
SDValue Sub =
28107
28104
DAG.getNode(ISD::SUB, DL, VT, DAG.getConstant(0, DL, VT), Src);
@@ -28111,11 +28108,11 @@ static SDValue LowerABS(SDValue Op, const X86Subtarget &Subtarget,
28111
28108
if (VT.is256BitVector() && !Subtarget.hasInt256()) {
28112
28109
assert(VT.isInteger() &&
28113
28110
"Only handle AVX 256-bit vector integer operation");
28114
- return splitVectorIntUnary(Op, DAG, DL );
28111
+ return splitVectorIntUnary(Op, DAG);
28115
28112
}
28116
28113
28117
28114
if ((VT == MVT::v32i16 || VT == MVT::v64i8) && !Subtarget.hasBWI())
28118
- return splitVectorIntUnary(Op, DAG, DL );
28115
+ return splitVectorIntUnary(Op, DAG);
28119
28116
28120
28117
// Default to expand.
28121
28118
return SDValue();
@@ -28124,14 +28121,13 @@ static SDValue LowerABS(SDValue Op, const X86Subtarget &Subtarget,
28124
28121
static SDValue LowerAVG(SDValue Op, const X86Subtarget &Subtarget,
28125
28122
SelectionDAG &DAG) {
28126
28123
MVT VT = Op.getSimpleValueType();
28127
- SDLoc DL(Op);
28128
28124
28129
28125
// For AVX1 cases, split to use legal ops.
28130
28126
if (VT.is256BitVector() && !Subtarget.hasInt256())
28131
- return splitVectorIntBinary(Op, DAG, DL );
28127
+ return splitVectorIntBinary(Op, DAG);
28132
28128
28133
28129
if (VT == MVT::v32i16 || VT == MVT::v64i8)
28134
- return splitVectorIntBinary(Op, DAG, DL );
28130
+ return splitVectorIntBinary(Op, DAG);
28135
28131
28136
28132
// Default to expand.
28137
28133
return SDValue();
@@ -28140,14 +28136,13 @@ static SDValue LowerAVG(SDValue Op, const X86Subtarget &Subtarget,
28140
28136
static SDValue LowerMINMAX(SDValue Op, const X86Subtarget &Subtarget,
28141
28137
SelectionDAG &DAG) {
28142
28138
MVT VT = Op.getSimpleValueType();
28143
- SDLoc DL(Op);
28144
28139
28145
28140
// For AVX1 cases, split to use legal ops.
28146
28141
if (VT.is256BitVector() && !Subtarget.hasInt256())
28147
- return splitVectorIntBinary(Op, DAG, DL );
28142
+ return splitVectorIntBinary(Op, DAG);
28148
28143
28149
28144
if (VT == MVT::v32i16 || VT == MVT::v64i8)
28150
- return splitVectorIntBinary(Op, DAG, DL );
28145
+ return splitVectorIntBinary(Op, DAG);
28151
28146
28152
28147
// Default to expand.
28153
28148
return SDValue();
@@ -28304,15 +28299,15 @@ static SDValue LowerFMINIMUM_FMAXIMUM(SDValue Op, const X86Subtarget &Subtarget,
28304
28299
static SDValue LowerABD(SDValue Op, const X86Subtarget &Subtarget,
28305
28300
SelectionDAG &DAG) {
28306
28301
MVT VT = Op.getSimpleValueType();
28307
- SDLoc dl(Op);
28308
28302
28309
28303
// For AVX1 cases, split to use legal ops.
28310
28304
if (VT.is256BitVector() && !Subtarget.hasInt256())
28311
- return splitVectorIntBinary(Op, DAG, dl );
28305
+ return splitVectorIntBinary(Op, DAG);
28312
28306
28313
28307
if ((VT == MVT::v32i16 || VT == MVT::v64i8) && !Subtarget.useBWIRegs())
28314
- return splitVectorIntBinary(Op, DAG, dl );
28308
+ return splitVectorIntBinary(Op, DAG);
28315
28309
28310
+ SDLoc dl(Op);
28316
28311
bool IsSigned = Op.getOpcode() == ISD::ABDS;
28317
28312
const TargetLowering &TLI = DAG.getTargetLoweringInfo();
28318
28313
@@ -28355,10 +28350,10 @@ static SDValue LowerMUL(SDValue Op, const X86Subtarget &Subtarget,
28355
28350
28356
28351
// Decompose 256-bit ops into 128-bit ops.
28357
28352
if (VT.is256BitVector() && !Subtarget.hasInt256())
28358
- return splitVectorIntBinary(Op, DAG, dl );
28353
+ return splitVectorIntBinary(Op, DAG);
28359
28354
28360
28355
if ((VT == MVT::v32i16 || VT == MVT::v64i8) && !Subtarget.hasBWI())
28361
- return splitVectorIntBinary(Op, DAG, dl );
28356
+ return splitVectorIntBinary(Op, DAG);
28362
28357
28363
28358
SDValue A = Op.getOperand(0);
28364
28359
SDValue B = Op.getOperand(1);
@@ -28581,10 +28576,10 @@ static SDValue LowerMULH(SDValue Op, const X86Subtarget &Subtarget,
28581
28576
28582
28577
// Decompose 256-bit ops into 128-bit ops.
28583
28578
if (VT.is256BitVector() && !Subtarget.hasInt256())
28584
- return splitVectorIntBinary(Op, DAG, dl );
28579
+ return splitVectorIntBinary(Op, DAG);
28585
28580
28586
28581
if ((VT == MVT::v32i16 || VT == MVT::v64i8) && !Subtarget.hasBWI())
28587
- return splitVectorIntBinary(Op, DAG, dl );
28582
+ return splitVectorIntBinary(Op, DAG);
28588
28583
28589
28584
if (VT == MVT::v4i32 || VT == MVT::v8i32 || VT == MVT::v16i32) {
28590
28585
assert((VT == MVT::v4i32 && Subtarget.hasSSE2()) ||
@@ -29762,10 +29757,10 @@ static SDValue LowerShift(SDValue Op, const X86Subtarget &Subtarget,
29762
29757
29763
29758
// Decompose 256-bit shifts into 128-bit shifts.
29764
29759
if (VT.is256BitVector())
29765
- return splitVectorIntBinary(Op, DAG, dl );
29760
+ return splitVectorIntBinary(Op, DAG);
29766
29761
29767
29762
if (VT == MVT::v32i16 || VT == MVT::v64i8)
29768
- return splitVectorIntBinary(Op, DAG, dl );
29763
+ return splitVectorIntBinary(Op, DAG);
29769
29764
29770
29765
return SDValue();
29771
29766
}
@@ -29842,7 +29837,7 @@ static SDValue LowerFunnelShift(SDValue Op, const X86Subtarget &Subtarget,
29842
29837
EltSizeInBits < 32)) {
29843
29838
// Pre-mask the amount modulo using the wider vector.
29844
29839
Op = DAG.getNode(Op.getOpcode(), DL, VT, Op0, Op1, AmtMod);
29845
- return splitVectorOp(Op, DAG, DL );
29840
+ return splitVectorOp(Op, DAG);
29846
29841
}
29847
29842
29848
29843
// Attempt to fold scalar shift as unpack(y,x) << zext(splat(z))
@@ -30004,7 +29999,7 @@ static SDValue LowerRotate(SDValue Op, const X86Subtarget &Subtarget,
30004
29999
30005
30000
// Split 256-bit integers on XOP/pre-AVX2 targets.
30006
30001
if (VT.is256BitVector() && (Subtarget.hasXOP() || !Subtarget.hasAVX2()))
30007
- return splitVectorIntBinary(Op, DAG, DL );
30002
+ return splitVectorIntBinary(Op, DAG);
30008
30003
30009
30004
// XOP has 128-bit vector variable + immediate rotates.
30010
30005
// +ve/-ve Amt = rotate left/right - just need to handle ISD::ROTL.
@@ -30040,7 +30035,7 @@ static SDValue LowerRotate(SDValue Op, const X86Subtarget &Subtarget,
30040
30035
30041
30036
// Split 512-bit integers on non 512-bit BWI targets.
30042
30037
if (VT.is512BitVector() && !Subtarget.useBWIRegs())
30043
- return splitVectorIntBinary(Op, DAG, DL );
30038
+ return splitVectorIntBinary(Op, DAG);
30044
30039
30045
30040
assert(
30046
30041
(VT == MVT::v4i32 || VT == MVT::v8i16 || VT == MVT::v16i8 ||
@@ -31120,11 +31115,11 @@ static SDValue LowerVectorCTPOP(SDValue Op, const SDLoc &DL,
31120
31115
31121
31116
// Decompose 256-bit ops into smaller 128-bit ops.
31122
31117
if (VT.is256BitVector() && !Subtarget.hasInt256())
31123
- return splitVectorIntUnary(Op, DAG, DL );
31118
+ return splitVectorIntUnary(Op, DAG);
31124
31119
31125
31120
// Decompose 512-bit ops into smaller 256-bit ops.
31126
31121
if (VT.is512BitVector() && !Subtarget.hasBWI())
31127
- return splitVectorIntUnary(Op, DAG, DL );
31122
+ return splitVectorIntUnary(Op, DAG);
31128
31123
31129
31124
// For element types greater than i8, do vXi8 pop counts and a bytesum.
31130
31125
if (VT.getScalarType() != MVT::i8) {
@@ -31248,7 +31243,7 @@ static SDValue LowerBITREVERSE_XOP(SDValue Op, SelectionDAG &DAG) {
31248
31243
31249
31244
// Decompose 256-bit ops into smaller 128-bit ops.
31250
31245
if (VT.is256BitVector())
31251
- return splitVectorIntUnary(Op, DAG, DL );
31246
+ return splitVectorIntUnary(Op, DAG);
31252
31247
31253
31248
assert(VT.is128BitVector() &&
31254
31249
"Only 128-bit vector bitreverse lowering supported.");
@@ -31287,11 +31282,11 @@ static SDValue LowerBITREVERSE(SDValue Op, const X86Subtarget &Subtarget,
31287
31282
31288
31283
// Split 512-bit ops without BWI so that we can still use the PSHUFB lowering.
31289
31284
if (VT.is512BitVector() && !Subtarget.hasBWI())
31290
- return splitVectorIntUnary(Op, DAG, DL );
31285
+ return splitVectorIntUnary(Op, DAG);
31291
31286
31292
31287
// Decompose 256-bit ops into smaller 128-bit ops on pre-AVX2.
31293
31288
if (VT.is256BitVector() && !Subtarget.hasInt256())
31294
- return splitVectorIntUnary(Op, DAG, DL );
31289
+ return splitVectorIntUnary(Op, DAG);
31295
31290
31296
31291
// Lower vXi16/vXi32/vXi64 as BSWAP + vXi8 BITREVERSE.
31297
31292
if (VT.getScalarType() != MVT::i8) {
@@ -55938,7 +55933,7 @@ static SDValue combineEXTRACT_SUBVECTOR(SDNode *N, SelectionDAG &DAG,
55938
55933
if (isConcatenatedNot(InVecBC.getOperand(0)) ||
55939
55934
isConcatenatedNot(InVecBC.getOperand(1))) {
55940
55935
// extract (and v4i64 X, (not (concat Y1, Y2))), n -> andnp v2i64 X(n), Y1
55941
- SDValue Concat = splitVectorIntBinary(InVecBC, DAG, SDLoc(InVecBC) );
55936
+ SDValue Concat = splitVectorIntBinary(InVecBC, DAG);
55942
55937
return DAG.getNode(ISD::EXTRACT_SUBVECTOR, DL, VT,
55943
55938
DAG.getBitcast(InVecVT, Concat), N->getOperand(1));
55944
55939
}
0 commit comments