Skip to content

Commit bf41fd7

Browse files
committed
[Hexagon] Avoid unnecessary by reference passing (NFC)
SplatVal is not modified in these functions, so pass it by value. This was probably a copy&paste mistake from checkConstantVector(), which does modify SplatVal.
1 parent 2f502f3 commit bf41fd7

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

llvm/lib/Target/Hexagon/HexagonGenWideningVecInstr.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,9 @@ class HexagonGenWideningVecInstr : public FunctionPass {
117117
bool IsResSigned);
118118
bool genVAvg(Instruction *Inst);
119119
bool checkConstantVector(Value *OP, int64_t &SplatVal, bool IsOPZExt);
120-
void updateMPYConst(Intrinsic::ID IntId, int64_t &SplatVal, bool IsOPZExt,
120+
void updateMPYConst(Intrinsic::ID IntId, int64_t SplatVal, bool IsOPZExt,
121121
Value *&OP, IRBuilder<> &IRB);
122-
void packConstant(Intrinsic::ID IntId, int64_t &SplatVal, Value *&OP,
122+
void packConstant(Intrinsic::ID IntId, int64_t SplatVal, Value *&OP,
123123
IRBuilder<> &IRB);
124124
};
125125

@@ -484,9 +484,8 @@ bool HexagonGenWideningVecInstr::checkConstantVector(Value *OP,
484484
}
485485

486486
void HexagonGenWideningVecInstr::updateMPYConst(Intrinsic::ID IntId,
487-
int64_t &SplatVal,
488-
bool IsOPZExt, Value *&OP,
489-
IRBuilder<> &IRB) {
487+
int64_t SplatVal, bool IsOPZExt,
488+
Value *&OP, IRBuilder<> &IRB) {
490489
if ((IntId == Intrinsic::hexagon_vmpy_uu ||
491490
IntId == Intrinsic::hexagon_vmpy_us ||
492491
IntId == Intrinsic::hexagon_vmpy_su ||
@@ -506,7 +505,7 @@ void HexagonGenWideningVecInstr::updateMPYConst(Intrinsic::ID IntId,
506505
}
507506

508507
void HexagonGenWideningVecInstr::packConstant(Intrinsic::ID IntId,
509-
int64_t &SplatVal, Value *&OP,
508+
int64_t SplatVal, Value *&OP,
510509
IRBuilder<> &IRB) {
511510
uint32_t Val32 = static_cast<uint32_t>(SplatVal);
512511
if (IntId == Intrinsic::hexagon_vmpy_ub_ub) {

0 commit comments

Comments
 (0)