Skip to content

Commit a8f626d

Browse files
bokrzesipszymich
authored andcommitted
Fixes compilation problem on GCC 14
GCC detected dangerous pattern which required refactor in order to compile. (cherry picked from commit 03a6d27)
1 parent 92b3bc7 commit a8f626d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

IGC/Compiler/Optimizer/MCSOptimization.cpp

+2-1
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)