Skip to content

Commit 1987d18

Browse files
authored
[X86] isFreeToSplitVector - use a SDValue instead of SDNode argument. NFC. (#129906)
Every caller was having to call getNode() - so move that insider the helper.
1 parent c6e2cbe commit 1987d18

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

llvm/lib/Target/X86/X86ISelLowering.cpp

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4311,9 +4311,9 @@ static SDValue isUpperSubvectorUndef(SDValue V, const SDLoc &DL,
43114311

43124312
// Helper to check if we can access all the constituent subvectors without any
43134313
// extract ops.
4314-
static bool isFreeToSplitVector(SDNode *N, SelectionDAG &DAG) {
4314+
static bool isFreeToSplitVector(SDValue V, SelectionDAG &DAG) {
43154315
SmallVector<SDValue> Ops;
4316-
return collectConcatOps(N, Ops, DAG);
4316+
return collectConcatOps(V.getNode(), Ops, DAG);
43174317
}
43184318

43194319
static std::pair<SDValue, SDValue> splitVector(SDValue Op, SelectionDAG &DAG,
@@ -18324,10 +18324,10 @@ SDValue X86TargetLowering::LowerVSELECT(SDValue Op, SelectionDAG &DAG) const {
1832418324
// TODO: Add Load splitting to isFreeToSplitVector ?
1832518325
if (EltSize < 32 && VT.is256BitVector() && !Subtarget.hasAVX2() &&
1832618326
!Subtarget.hasXOP()) {
18327-
bool FreeCond = isFreeToSplitVector(Cond.getNode(), DAG);
18328-
bool FreeLHS = isFreeToSplitVector(LHS.getNode(), DAG) ||
18327+
bool FreeCond = isFreeToSplitVector(Cond, DAG);
18328+
bool FreeLHS = isFreeToSplitVector(LHS, DAG) ||
1832918329
(ISD::isNormalLoad(LHS.getNode()) && LHS.hasOneUse());
18330-
bool FreeRHS = isFreeToSplitVector(RHS.getNode(), DAG) ||
18330+
bool FreeRHS = isFreeToSplitVector(RHS, DAG) ||
1833118331
(ISD::isNormalLoad(RHS.getNode()) && RHS.hasOneUse());
1833218332
if (FreeCond && (FreeLHS || FreeRHS))
1833318333
return splitVectorOp(Op, DAG, dl);
@@ -20958,7 +20958,7 @@ static SDValue matchTruncateWithPACK(unsigned &PackOpcode, EVT DstVT,
2095820958
// Prefer to lower v4i64 -> v4i32 as a shuffle unless we can cheaply
2095920959
// split this for packing.
2096020960
if (SrcVT == MVT::v4i64 && DstVT == MVT::v4i32 &&
20961-
!isFreeToSplitVector(In.getNode(), DAG) &&
20961+
!isFreeToSplitVector(In, DAG) &&
2096220962
(!Subtarget.hasAVX() || DAG.ComputeNumSignBits(In) != 64))
2096320963
return SDValue();
2096420964

@@ -21228,7 +21228,7 @@ SDValue X86TargetLowering::LowerTRUNCATE(SDValue Op, SelectionDAG &DAG) const {
2122821228

2122921229
// Attempt to truncate with PACKUS/PACKSS even on AVX512 if we'd have to
2123021230
// concat from subvectors to use VPTRUNC etc.
21231-
if (!Subtarget.hasAVX512() || isFreeToSplitVector(In.getNode(), DAG))
21231+
if (!Subtarget.hasAVX512() || isFreeToSplitVector(In, DAG))
2123221232
if (SDValue SignPack = LowerTruncateVecPackWithSignBits(
2123321233
VT, In, DL, Subtarget, DAG, Op->getFlags()))
2123421234
return SignPack;
@@ -25311,7 +25311,7 @@ static SDValue LowerStore(SDValue Op, const X86Subtarget &Subtarget,
2531125311
if (StoreVT.is256BitVector() ||
2531225312
((StoreVT == MVT::v32i16 || StoreVT == MVT::v64i8) &&
2531325313
!Subtarget.hasBWI())) {
25314-
if (StoredVal.hasOneUse() && isFreeToSplitVector(StoredVal.getNode(), DAG))
25314+
if (StoredVal.hasOneUse() && isFreeToSplitVector(StoredVal, DAG))
2531525315
return splitVectorStore(St, DAG);
2531625316
return SDValue();
2531725317
}
@@ -46930,8 +46930,7 @@ static SDValue narrowVectorSelect(SDNode *N, SelectionDAG &DAG, const SDLoc &DL,
4693046930
SDValue TVal = N->getOperand(1);
4693146931
SDValue FVal = N->getOperand(2);
4693246932
if (!TVal.hasOneUse() || !FVal.hasOneUse() ||
46933-
!isFreeToSplitVector(TVal.getNode(), DAG) ||
46934-
!isFreeToSplitVector(FVal.getNode(), DAG))
46933+
!isFreeToSplitVector(TVal, DAG) || !isFreeToSplitVector(FVal, DAG))
4693546934
return SDValue();
4693646935

4693746936
auto makeBlend = [Opcode](SelectionDAG &DAG, const SDLoc &DL,
@@ -58710,7 +58709,7 @@ static SDValue narrowExtractedVectorSelect(SDNode *Ext, const SDLoc &DL,
5871058709
SelectionDAG &DAG) {
5871158710
SDValue Sel = Ext->getOperand(0);
5871258711
if (Sel.getOpcode() != ISD::VSELECT ||
58713-
!isFreeToSplitVector(Sel.getOperand(0).getNode(), DAG))
58712+
!isFreeToSplitVector(Sel.getOperand(0), DAG))
5871458713
return SDValue();
5871558714

5871658715
// Note: We assume simple value types because this should only be called with

0 commit comments

Comments
 (0)