Skip to content

Commit 03a6d27

Browse files
bokrzesiigcbot
authored andcommitted
Fixes compilation problem on GCC 14
GCC detected dangerous pattern which required refactor in order to compile.
1 parent bd533e0 commit 03a6d27

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

IGC/Compiler/Optimizer/MCSOptimization.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ void MCSOptimization::visitCallInst(llvm::CallInst& I)
182182
for (auto BB : useBlocks)
183183
{
184184
std::vector<LdmsInstrinsic*> ldmsInstsToMove;
185+
std::vector<LdmsInstrinsic*> ldmsInstsToClub;
185186
for (auto inst = BB->begin(); inst != BB->end(); inst++)
186187
{
187188
if (LdmsInstrinsic * ldmsIntr = dyn_cast<LdmsInstrinsic>(inst))
@@ -203,7 +204,7 @@ void MCSOptimization::visitCallInst(llvm::CallInst& I)
203204

204205
while (!allInstsWillBeMoved)
205206
{
206-
std::vector<LdmsInstrinsic*> ldmsInstsToClub;
207+
ldmsInstsToClub.clear();
207208
//Threshold is more than # of insts that are to be moved. So move all.
208209
if (instClubThreshold >= static_cast<int>(ldmsInstsToMove.size()))
209210
{

0 commit comments

Comments
 (0)