Basic constant propagation.

This commit is contained in:
Ben Vanik
2013-12-07 05:52:51 -08:00
parent 57432d5996
commit 3b268f07ef
10 changed files with 584 additions and 147 deletions

View File

@@ -986,7 +986,7 @@ XEEMITTER(rlwimix, 0x50000000, M )(PPCFunctionBuilder& f, InstrData& i) {
}
v = f.ZeroExtend(v, INT64_TYPE);
Value* ra = f.LoadGPR(i.M.RA);
v = f.Or(v, f.And(f.LoadGPR(i.M.RA), f.LoadConstant(~m)));
v = f.Or(v, f.And(f.LoadGPR(i.M.RA), f.LoadConstant((~(uint64_t)m))));
if (i.M.Rc) {
f.UpdateCR(0, v);
}

View File

@@ -33,7 +33,8 @@ PPCTranslator::PPCTranslator(PPCFrontend* frontend) :
compiler_ = new Compiler(frontend->runtime());
compiler_->AddPass(new passes::ContextPromotionPass());
//compiler_->AddPass(new passes::ConstantPropagationPass());
compiler_->AddPass(new passes::SimplificationPass());
compiler_->AddPass(new passes::ConstantPropagationPass());
//compiler_->AddPass(new passes::TypePropagationPass());
//compiler_->AddPass(new passes::ByteSwapEliminationPass());
compiler_->AddPass(new passes::SimplificationPass());