[JIT] Fix constant propagation for OPCODE_SELECT.

This commit is contained in:
gibbed
2018-11-23 07:52:14 -06:00
parent 94284ea9aa
commit 4c04a9383a
3 changed files with 56 additions and 8 deletions

View File

@@ -53,10 +53,15 @@ PPCTranslator::PPCTranslator(PPCFrontend* frontend) : frontend_(frontend) {
if (validate) compiler_->AddPass(std::make_unique<passes::ValidationPass>());
compiler_->AddPass(std::make_unique<passes::ContextPromotionPass>());
if (validate) compiler_->AddPass(std::make_unique<passes::ValidationPass>());
compiler_->AddPass(std::make_unique<passes::SimplificationPass>());
if (validate) compiler_->AddPass(std::make_unique<passes::ValidationPass>());
compiler_->AddPass(std::make_unique<passes::ConstantPropagationPass>());
if (validate) compiler_->AddPass(std::make_unique<passes::ValidationPass>());
// TODO(gibbed): loop until these passes stop making changes?
for (int i = 0; i < 5; ++i) {
compiler_->AddPass(std::make_unique<passes::SimplificationPass>());
if (validate)
compiler_->AddPass(std::make_unique<passes::ValidationPass>());
compiler_->AddPass(std::make_unique<passes::ConstantPropagationPass>());
if (validate)
compiler_->AddPass(std::make_unique<passes::ValidationPass>());
}
if (backend->machine_info()->supports_extended_load_store) {
// Backend supports the advanced LOAD/STORE instructions.
// These will save us a lot of HIR opcodes.