Skip to content

Commit a483d7b

Browse files
fda0igcbot
authored andcommitted
Coverity perfomance and potential bug fixes
Pass arguments via const reference to avoid additional copies on big objects.
1 parent e3fcc59 commit a483d7b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

IGC/Compiler/CISACodeGen/MemOpt.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2716,7 +2716,7 @@ namespace {
27162716
return splitVectorType(V, LdStKind::IS_LOAD);
27172717
}
27182718

2719-
void AllowDummyLoadCoalescing(InstAndOffsetPairs Loads);
2719+
void AllowDummyLoadCoalescing(const InstAndOffsetPairs& Loads);
27202720

27212721
// GatherCopy:
27222722
// copy multiple values (arg: Vals) into a single Dst (return value)
@@ -3816,7 +3816,7 @@ void LdStCombine::createBundles(BasicBlock* BB, InstAndOffsetPairs& LoadStores)
38163816
markVisited(LoadStores);
38173817
}
38183818

3819-
void LdStCombine::AllowDummyLoadCoalescing(InstAndOffsetPairs Loads)
3819+
void LdStCombine::AllowDummyLoadCoalescing(const InstAndOffsetPairs& Loads)
38203820
{
38213821
// Currently supports only this pattern.
38223822
// % 164 = add i32 % 114, 1020
@@ -3866,7 +3866,7 @@ void LdStCombine::AllowDummyLoadCoalescing(InstAndOffsetPairs Loads)
38663866
gep->getOperand(0), gepArg);
38673867
Instruction* dummyLoad = static_cast<Instruction*>
38683868
(irBuilder.CreateLoad(cast<GetElementPtrInst>(Addr)->getResultElementType(), Addr));
3869-
Loads.push_back(LdStInfo(dummyLoad, LastLoad.ByteOffset + newLoadSize));
3869+
(void)dummyLoad;
38703870
}
38713871
}
38723872
}

0 commit comments

Comments
 (0)