mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-12 09:48:37 +12:00
PPU LLVM: New "stack" strategy
Minor pessimization: all memory accesses are volatile Special handling of prologues and epilogues Minor optimizing assumption for SP
This commit is contained in:
parent
712c04b2ad
commit
5c9f83c3a8
3 changed files with 47 additions and 65 deletions
|
@ -585,6 +585,32 @@ extern void ppu_initialize(const std::string& name, const std::vector<ppu_functi
|
|||
ReplaceInstWithInst(ci, CallInst::Create(f, {ci->getArgOperand(0)}));
|
||||
}
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
if (const auto li = dyn_cast<LoadInst>(inst))
|
||||
{
|
||||
// TODO: more careful check
|
||||
if (li->getNumUses() == 0)
|
||||
{
|
||||
// Remove unreferenced volatile loads
|
||||
li->eraseFromParent();
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
if (const auto si = dyn_cast<StoreInst>(inst))
|
||||
{
|
||||
// TODO: more careful check
|
||||
if (isa<UndefValue>(si->getOperand(0)) && si->getParent() == &func->getEntryBlock())
|
||||
{
|
||||
// Remove undef volatile stores
|
||||
si->eraseFromParent();
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -595,6 +621,7 @@ extern void ppu_initialize(const std::string& name, const std::vector<ppu_functi
|
|||
// Remove unused functions, structs, global variables, etc
|
||||
mpm.add(createStripDeadPrototypesPass());
|
||||
//mpm.add(createFunctionInliningPass());
|
||||
mpm.add(createDeadInstEliminationPass());
|
||||
mpm.run(*module);
|
||||
|
||||
std::string result;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue