From c84801adb371e8d5115b8277dc384cf584ddd4cc Mon Sep 17 00:00:00 2001 From: Lioncache Date: Sun, 5 Oct 2025 03:16:36 -0400 Subject: [PATCH] RedundantFlagCalc: Avoid vector copy in OptimizeParity() Previously this was making a copy of the vector, when we only need to read from it. --- .../IR/Passes/RedundantFlagCalculationElimination.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/FEXCore/Source/Interface/IR/Passes/RedundantFlagCalculationElimination.cpp b/FEXCore/Source/Interface/IR/Passes/RedundantFlagCalculationElimination.cpp index 3d3cdc9a2..d2db6e080 100644 --- a/FEXCore/Source/Interface/IR/Passes/RedundantFlagCalculationElimination.cpp +++ b/FEXCore/Source/Interface/IR/Passes/RedundantFlagCalculationElimination.cpp @@ -627,9 +627,9 @@ void DeadFlagCalculationEliminination::OptimizeParity(IREmitter* IREmit, IRListV } for (auto [Block, BlockHeader] : CurrentIR.GetBlocks()) { - auto ID = BlockHeader->C()->ID; + const auto ID = BlockHeader->C()->ID; + const auto& Predecessors = CFG.Get(ID)->Predecessors; bool Full = false; - auto Predecessors = CFG.Get(ID)->Predecessors; if (Predecessors.empty()) { // Conservatively assume there was full parity before the start block