From f5e4e26e08bbba6fca3a2aaead601c8abcd2c36d Mon Sep 17 00:00:00 2001 From: LC Date: Fri, 24 Jul 2026 15:32:18 -0400 Subject: [PATCH] IRValidation: Move var closer to usage Same behavior, just more compact. --- FEXCore/Source/Interface/IR/Passes/IRValidation.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/FEXCore/Source/Interface/IR/Passes/IRValidation.cpp b/FEXCore/Source/Interface/IR/Passes/IRValidation.cpp index 6e3dc18a1..f54d8259d 100644 --- a/FEXCore/Source/Interface/IR/Passes/IRValidation.cpp +++ b/FEXCore/Source/Interface/IR/Passes/IRValidation.cpp @@ -118,8 +118,7 @@ void IRValidation::Run(IREmitter* IREmit) { } } - uint8_t NumArgs = IR::GetRAArgs(IROp->Op); - + const uint8_t NumArgs = IR::GetRAArgs(IROp->Op); for (uint32_t i = 0; i < NumArgs; ++i) { OrderedNodeWrapper Arg = IROp->Args[i]; const auto ArgID = Arg.ID(); @@ -127,8 +126,6 @@ void IRValidation::Run(IREmitter* IREmit) { continue; } - IROps Op = CurrentIR.GetOp(Arg)->Op; - if (ArgID.IsValid()) { Uses[ArgID.Value]++; } @@ -136,7 +133,8 @@ void IRValidation::Run(IREmitter* IREmit) { // We do not validate the location of inline constants because it's // irrelevant, they're ignored by RA and always inlined to where they // need to be. This lets us pool inline constants globally. - bool Ignore = (Op == OP_IRHEADER || Op == OP_INLINECONSTANT); + const IROps Op = CurrentIR.GetOp(Arg)->Op; + const bool Ignore = (Op == OP_IRHEADER || Op == OP_INLINECONSTANT); if (!Ignore && ArgID.IsValid() && !NodeIsLive.Get(ArgID.Value)) { HadError = true;