From bb64fd571bce276e89d597ff9992cf2128afc67c Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Mon, 3 Apr 2023 13:59:55 -0700 Subject: [PATCH] [SelectionDAGBuilder] Use SmallVectorImpl& for function arguments. NFC Make the reference const since we aren't modifying the vectors. --- .../CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | 23 ++++++++++++---------- .../lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h | 12 +++++------ 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp index 14d1d02..bb9cc40 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp @@ -7494,8 +7494,9 @@ static unsigned getISDForVPIntrinsic(const VPIntrinsic &VPIntrin) { return *ResOPC; } -void SelectionDAGBuilder::visitVPLoad(const VPIntrinsic &VPIntrin, EVT VT, - SmallVector &OpValues) { +void SelectionDAGBuilder::visitVPLoad( + const VPIntrinsic &VPIntrin, EVT VT, + const SmallVectorImpl &OpValues) { SDLoc DL = getCurSDLoc(); Value *PtrOperand = VPIntrin.getArgOperand(0); MaybeAlign Alignment = VPIntrin.getPointerAlignment(); @@ -7520,8 +7521,9 @@ void SelectionDAGBuilder::visitVPLoad(const VPIntrinsic &VPIntrin, EVT VT, setValue(&VPIntrin, LD); } -void SelectionDAGBuilder::visitVPGather(const VPIntrinsic &VPIntrin, EVT VT, - SmallVector &OpValues) { +void SelectionDAGBuilder::visitVPGather( + const VPIntrinsic &VPIntrin, EVT VT, + const SmallVectorImpl &OpValues) { SDLoc DL = getCurSDLoc(); const TargetLowering &TLI = DAG.getTargetLoweringInfo(); Value *PtrOperand = VPIntrin.getArgOperand(0); @@ -7561,8 +7563,8 @@ void SelectionDAGBuilder::visitVPGather(const VPIntrinsic &VPIntrin, EVT VT, setValue(&VPIntrin, LD); } -void SelectionDAGBuilder::visitVPStore(const VPIntrinsic &VPIntrin, - SmallVector &OpValues) { +void SelectionDAGBuilder::visitVPStore( + const VPIntrinsic &VPIntrin, const SmallVectorImpl &OpValues) { SDLoc DL = getCurSDLoc(); Value *PtrOperand = VPIntrin.getArgOperand(1); EVT VT = OpValues[0].getValueType(); @@ -7583,8 +7585,8 @@ void SelectionDAGBuilder::visitVPStore(const VPIntrinsic &VPIntrin, setValue(&VPIntrin, ST); } -void SelectionDAGBuilder::visitVPScatter(const VPIntrinsic &VPIntrin, - SmallVector &OpValues) { +void SelectionDAGBuilder::visitVPScatter( + const VPIntrinsic &VPIntrin, const SmallVectorImpl &OpValues) { SDLoc DL = getCurSDLoc(); const TargetLowering &TLI = DAG.getTargetLoweringInfo(); Value *PtrOperand = VPIntrin.getArgOperand(1); @@ -7626,7 +7628,8 @@ void SelectionDAGBuilder::visitVPScatter(const VPIntrinsic &VPIntrin, } void SelectionDAGBuilder::visitVPStridedLoad( - const VPIntrinsic &VPIntrin, EVT VT, SmallVectorImpl &OpValues) { + const VPIntrinsic &VPIntrin, EVT VT, + const SmallVectorImpl &OpValues) { SDLoc DL = getCurSDLoc(); Value *PtrOperand = VPIntrin.getArgOperand(0); MaybeAlign Alignment = VPIntrin.getPointerAlignment(); @@ -7651,7 +7654,7 @@ void SelectionDAGBuilder::visitVPStridedLoad( } void SelectionDAGBuilder::visitVPStridedStore( - const VPIntrinsic &VPIntrin, SmallVectorImpl &OpValues) { + const VPIntrinsic &VPIntrin, const SmallVectorImpl &OpValues) { SDLoc DL = getCurSDLoc(); Value *PtrOperand = VPIntrin.getArgOperand(1); EVT VT = OpValues[0].getValueType(); diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h index 6e92f6a..5166448 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h @@ -625,17 +625,17 @@ private: void visitTargetIntrinsic(const CallInst &I, unsigned Intrinsic); void visitConstrainedFPIntrinsic(const ConstrainedFPIntrinsic &FPI); void visitVPLoad(const VPIntrinsic &VPIntrin, EVT VT, - SmallVector &OpValues); + const SmallVectorImpl &OpValues); void visitVPStore(const VPIntrinsic &VPIntrin, - SmallVector &OpValues); + const SmallVectorImpl &OpValues); void visitVPGather(const VPIntrinsic &VPIntrin, EVT VT, - SmallVector &OpValues); + const SmallVectorImpl &OpValues); void visitVPScatter(const VPIntrinsic &VPIntrin, - SmallVector &OpValues); + const SmallVectorImpl &OpValues); void visitVPStridedLoad(const VPIntrinsic &VPIntrin, EVT VT, - SmallVectorImpl &OpValues); + const SmallVectorImpl &OpValues); void visitVPStridedStore(const VPIntrinsic &VPIntrin, - SmallVectorImpl &OpValues); + const SmallVectorImpl &OpValues); void visitVPCmp(const VPCmpIntrinsic &VPIntrin); void visitVectorPredicationIntrinsic(const VPIntrinsic &VPIntrin); -- 2.7.4