jit-ir: Remove redundant simplify pass.

This is just doing the same thing as the const folding pass, really.
This commit is contained in:
Unknown W. Brackets 2016-05-09 00:13:01 -07:00
parent f638477b9a
commit f6d245f3c4
5 changed files with 1 additions and 29 deletions

View file

@ -143,10 +143,6 @@ int IRWriter::AddConstantFloat(float value) {
return AddConstant(val);
}
void IRWriter::Simplify() {
SimplifyInPlace(&insts_[0], (int)insts_.size(), constPool_.data());
}
const char *GetGPRName(int r) {
if (r < 32) {
return currentDebugMIPS->GetRegName(0, r);

View file

@ -270,8 +270,6 @@ public:
constPool_.clear();
}
void Simplify();
const std::vector<IRInst> &GetInstructions() const { return insts_; }
const std::vector<u32> &GetConstants() const { return constPool_; }

View file

@ -245,8 +245,6 @@ void IRJit::DoJit(u32 em_address, IRBlock *b) {
}
}
ir.Simplify();
IRWriter simplified;
IRWriter *code = &ir;
if (true) {

View file

@ -1,24 +1,7 @@
#include "Common/Log.h"
#include "Core/MIPS/IR/IRPassSimplify.h"
#include "Core/MIPS/IR/IRRegCache.h"
void SimplifyInPlace(IRInst *inst, int count, const u32 *constPool) {
for (int i = 0; i < count; i++) {
switch (inst[i].op) {
case IROp::AddConst:
if (constPool[inst[i].src2] == 0)
inst[i].op = IROp::Mov;
else if (inst[i].src1 == 0) {
inst[i].op = IROp::SetConst;
inst[i].src1 = inst[i].src2;
}
break;
default:
break;
}
}
}
u32 Evaluate(u32 a, u32 b, IROp op) {
switch (op) {
case IROp::Add: case IROp::AddConst: return a + b;

View file

@ -2,9 +2,6 @@
#include "Core/MIPS/IR/IRInst.h"
// Dumb example of a simplification pass that can't add or remove instructions.
void SimplifyInPlace(IRInst *inst, int count, const u32 *constPool);
typedef bool (*IRPassFunc)(const IRWriter &in, IRWriter &out);
bool IRApplyPasses(const IRPassFunc *passes, size_t c, const IRWriter &in, IRWriter &out);