print_info: Add optimized IR output for A64
This commit is contained in:
parent
996d5cb841
commit
976edaf2d2
1 changed files with 11 additions and 2 deletions
|
@ -27,6 +27,7 @@
|
||||||
#include "frontend/A64/translate/impl/impl.h"
|
#include "frontend/A64/translate/impl/impl.h"
|
||||||
#include "frontend/A64/translate/translate.h"
|
#include "frontend/A64/translate/translate.h"
|
||||||
#include "frontend/ir/basic_block.h"
|
#include "frontend/ir/basic_block.h"
|
||||||
|
#include "ir_opt/passes.h"
|
||||||
|
|
||||||
#include <fmt/format.h>
|
#include <fmt/format.h>
|
||||||
#include <fmt/ostream.h>
|
#include <fmt/ostream.h>
|
||||||
|
@ -54,7 +55,7 @@ void PrintA32Instruction(u32 instruction) {
|
||||||
const A32::LocationDescriptor location{0, {}, {}};
|
const A32::LocationDescriptor location{0, {}, {}};
|
||||||
IR::Block block{location};
|
IR::Block block{location};
|
||||||
const bool should_continue = A32::TranslateSingleInstruction(block, location, instruction);
|
const bool should_continue = A32::TranslateSingleInstruction(block, location, instruction);
|
||||||
fmt::print("should_continue: {}\n", should_continue);
|
fmt::print("should_continue: {}\n\n", should_continue);
|
||||||
fmt::print("IR:\n");
|
fmt::print("IR:\n");
|
||||||
fmt::print("{}\n", IR::DumpBlock(block));
|
fmt::print("{}\n", IR::DumpBlock(block));
|
||||||
}
|
}
|
||||||
|
@ -66,9 +67,17 @@ void PrintA64Instruction(u32 instruction) {
|
||||||
const A64::LocationDescriptor location{0, {}};
|
const A64::LocationDescriptor location{0, {}};
|
||||||
IR::Block block{location};
|
IR::Block block{location};
|
||||||
const bool should_continue = A64::TranslateSingleInstruction(block, location, instruction);
|
const bool should_continue = A64::TranslateSingleInstruction(block, location, instruction);
|
||||||
fmt::print("should_continue: {}\n", should_continue);
|
fmt::print("should_continue: {}\n\n", should_continue);
|
||||||
fmt::print("IR:\n");
|
fmt::print("IR:\n");
|
||||||
fmt::print("{}\n", IR::DumpBlock(block));
|
fmt::print("{}\n", IR::DumpBlock(block));
|
||||||
|
|
||||||
|
Optimization::A64GetSetElimination(block);
|
||||||
|
Optimization::ConstantPropagation(block);
|
||||||
|
Optimization::DeadCodeElimination(block);
|
||||||
|
Optimization::IdentityRemovalPass(block);
|
||||||
|
|
||||||
|
fmt::print("Optimized IR:\n");
|
||||||
|
fmt::print("{}\n", IR::DumpBlock(block));
|
||||||
}
|
}
|
||||||
|
|
||||||
class ExecEnv final : public Dynarmic::A32::UserCallbacks {
|
class ExecEnv final : public Dynarmic::A32::UserCallbacks {
|
||||||
|
|
Loading…
Reference in a new issue