Browse Source
[dynarmic] add safe-opt to skip IR verification (#2613 )
Most programs are well behaved and don't cause internal IR issues. Hence, verification can be safely skipped.
Signed-off-by: lizzie <lizzie@eden-emu.dev>
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/2613
Reviewed-by: MaranBr <maranbr@eden-emu.dev>
Co-authored-by: lizzie <lizzie@eden-emu.dev>
Co-committed-by: lizzie <lizzie@eden-emu.dev>
pull/2632/head
lizzie
3 months ago
committed by
crueter
No known key found for this signature in database
GPG Key ID: 425ACD2D4830EBC6
2 changed files with
9 additions and
4 deletions
src/dynarmic/src/dynarmic/interface/optimization_flags.h
src/dynarmic/src/dynarmic/ir/opt_passes.cpp
@ -1,3 +1,6 @@
/ / SPDX - FileCopyrightText : Copyright 2025 Eden Emulator Project
/ / SPDX - License - Identifier : GPL - 3.0 - or - later
/* This file is part of the dynarmic project.
* Copyright ( c ) 2020 MerryMage
* SPDX - License - Identifier : 0 BSD
@ -34,6 +37,8 @@ enum class OptimizationFlag : std::uint32_t {
MiscIROpt = 0x00000020 ,
/ / / Optimize for code speed rather than for code size ( this serves well for tight loops )
CodeSpeed = 0x00000040 ,
/ / / Disable verification passes
DisableVerification = 0x00000080 ,
/ / / This is an UNSAFE optimization that reduces accuracy of fused multiply - add operations .
/ / / This unfuses fused instructions to improve performance on host CPUs without FMA support .
@ -1491,9 +1491,9 @@ void Optimize(IR::Block& block, const A32::UserConfig& conf, const Optimization:
Optimization : : DeadCodeElimination ( block ) ;
}
Optimization : : IdentityRemovalPass ( block ) ;
//if (!conf.HasOptimization(OptimizationFlag::DisableVerification)) {
if ( ! conf . HasOptimization ( OptimizationFlag : : DisableVerification ) ) {
Optimization : : VerificationPass ( block ) ;
//}
}
}
void Optimize ( IR : : Block & block , const A64 : : UserConfig & conf , const Optimization : : PolyfillOptions & polyfill_options ) {
@ -1511,9 +1511,9 @@ void Optimize(IR::Block& block, const A64::UserConfig& conf, const Optimization:
if ( conf . HasOptimization ( OptimizationFlag : : MiscIROpt ) ) [[likely]] {
Optimization : : A64MergeInterpretBlocksPass ( block , conf . callbacks ) ;
}
//if (!conf.HasOptimization(OptimizationFlag::DisableVerification)) {
if ( ! conf . HasOptimization ( OptimizationFlag : : DisableVerification ) ) {
Optimization : : VerificationPass ( block ) ;
//}
}
}
} // namespace Dynarmic::Optimization