Skip to content

[X86] Construct SmallVector with ArrayRef (NFC) #133860

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 1, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions llvm/lib/Target/X86/X86ISelLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9330,7 +9330,7 @@ X86TargetLowering::LowerBUILD_VECTOR(SDValue Op, SelectionDAG &DAG) const {

// See if we can use a vector load to get all of the elements.
{
SmallVector<SDValue, 64> Ops(Op->op_begin(), Op->op_begin() + NumElems);
SmallVector<SDValue, 64> Ops(Op->ops().take_front(NumElems));
if (SDValue LD =
EltsFromConsecutiveLoads(VT, Ops, dl, DAG, Subtarget, false))
return LD;
Expand Down Expand Up @@ -23207,7 +23207,7 @@ static SDValue EmitTest(SDValue Op, X86::CondCode X86CC, const SDLoc &dl,
DAG.getConstant(0, dl, Op.getValueType()));
}
SDVTList VTs = DAG.getVTList(Op.getValueType(), MVT::i32);
SmallVector<SDValue, 4> Ops(Op->op_begin(), Op->op_begin() + NumOperands);
SmallVector<SDValue, 4> Ops(Op->ops().take_front(NumOperands));

SDValue New = DAG.getNode(Opcode, dl, VTs, Ops);
DAG.ReplaceAllUsesOfValueWith(SDValue(Op.getNode(), 0), New);
Expand Down Expand Up @@ -30365,7 +30365,7 @@ static SDValue LowerShift(SDValue Op, const X86Subtarget &Subtarget,
// element to the other.
// This optimized lowering is only valid if the elements in a pair can
// be treated identically.
SmallVector<SDValue, 32> AmtWideElts(Amt->op_begin(), Amt->op_end());
SmallVector<SDValue, 32> AmtWideElts(Amt->ops());
SmallVector<SDValue, 32> TmpAmtWideElts;
int WideEltSizeInBits = EltSizeInBits;
while (WideEltSizeInBits < 32) {
Expand Down Expand Up @@ -32896,7 +32896,7 @@ static SDValue ExtendToType(SDValue InOp, MVT NVT, SelectionDAG &DAG,
EVT EltVT = InOp.getOperand(0).getValueType();
SDValue FillVal =
FillWithZeroes ? DAG.getConstant(0, dl, EltVT) : DAG.getUNDEF(EltVT);
SmallVector<SDValue, 16> Ops(InOp->op_begin(), InOp->op_end());
SmallVector<SDValue, 16> Ops(InOp->ops());
Ops.append(WidenNumElts - InNumElts, FillVal);
return DAG.getBuildVector(NVT, dl, Ops);
}
Expand Down