diff --git a/src/xenia/cpu/ppc/ppc_translator.cc b/src/xenia/cpu/ppc/ppc_translator.cc index 69b0da4e3..c559abe89 100644 --- a/src/xenia/cpu/ppc/ppc_translator.cc +++ b/src/xenia/cpu/ppc/ppc_translator.cc @@ -28,6 +28,11 @@ DEFINE_bool(dump_translated_hir_functions, false, "dumps translated hir", "CPU"); +DEFINE_bool(disable_context_promotion, false, + "Disables Context Promotion optimizations, this may be needed for " + "some sports games, but will reduce performance.", + "CPU"); + namespace xe { namespace cpu { namespace ppc { @@ -54,10 +59,17 @@ PPCTranslator::PPCTranslator(PPCFrontend* frontend) : frontend_(frontend) { // Passes are executed in the order they are added. Multiple of the same // pass type may be used. - if (validate) compiler_->AddPass(std::make_unique()); - compiler_->AddPass(std::make_unique()); - if (validate) compiler_->AddPass(std::make_unique()); + if (!cvars::disable_context_promotion) { + if (validate) { + compiler_->AddPass(std::make_unique()); + } + compiler_->AddPass(std::make_unique()); + + if (validate) { + compiler_->AddPass(std::make_unique()); + } + } // Grouped simplification + constant propagation. // Loops until no changes are made. auto sap = std::make_unique();