[JIT] Run the SimplificationPass/ConstantPropagationPass until there are no changes.

This commit is contained in:
gibbed
2018-11-23 11:59:29 -06:00
parent b121f45c7f
commit 5fbcb8991e
10 changed files with 348 additions and 36 deletions

View File

@@ -10,27 +10,27 @@
#ifndef XENIA_CPU_COMPILER_PASSES_SIMPLIFICATION_PASS_H_
#define XENIA_CPU_COMPILER_PASSES_SIMPLIFICATION_PASS_H_
#include "xenia/cpu/compiler/compiler_pass.h"
#include "xenia/cpu/compiler/passes/conditional_group_subpass.h"
namespace xe {
namespace cpu {
namespace compiler {
namespace passes {
class SimplificationPass : public CompilerPass {
class SimplificationPass : public ConditionalGroupSubpass {
public:
SimplificationPass();
~SimplificationPass() override;
bool Run(hir::HIRBuilder* builder) override;
bool Run(hir::HIRBuilder* builder, bool& result) override;
private:
void EliminateConversions(hir::HIRBuilder* builder);
void CheckTruncate(hir::Instr* i);
void CheckByteSwap(hir::Instr* i);
bool EliminateConversions(hir::HIRBuilder* builder);
bool CheckTruncate(hir::Instr* i);
bool CheckByteSwap(hir::Instr* i);
void SimplifyAssignments(hir::HIRBuilder* builder);
hir::Value* CheckValue(hir::Value* value);
bool SimplifyAssignments(hir::HIRBuilder* builder);
hir::Value* CheckValue(hir::Value* value, bool& result);
};
} // namespace passes