From 03a6d273e4897302531a69ced73e7b9b51b44a4d Mon Sep 17 00:00:00 2001 From: bokrzesi <99400121+bokrzesi@users.noreply.github.com> Date: Wed, 7 Aug 2024 14:53:35 +0000 Subject: [PATCH] Fixes compilation problem on GCC 14 GCC detected dangerous pattern which required refactor in order to compile. --- IGC/Compiler/Optimizer/MCSOptimization.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/IGC/Compiler/Optimizer/MCSOptimization.cpp b/IGC/Compiler/Optimizer/MCSOptimization.cpp index ab89bfc8114e..b96d16974287 100644 --- a/IGC/Compiler/Optimizer/MCSOptimization.cpp +++ b/IGC/Compiler/Optimizer/MCSOptimization.cpp @@ -182,6 +182,7 @@ void MCSOptimization::visitCallInst(llvm::CallInst& I) for (auto BB : useBlocks) { std::vector ldmsInstsToMove; + std::vector ldmsInstsToClub; for (auto inst = BB->begin(); inst != BB->end(); inst++) { if (LdmsInstrinsic * ldmsIntr = dyn_cast(inst)) @@ -203,7 +204,7 @@ void MCSOptimization::visitCallInst(llvm::CallInst& I) while (!allInstsWillBeMoved) { - std::vector ldmsInstsToClub; + ldmsInstsToClub.clear(); //Threshold is more than # of insts that are to be moved. So move all. if (instClubThreshold >= static_cast(ldmsInstsToMove.size())) {