mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-15 20:29:48 +00:00
Put a heuristic in place to prevent GVN from falling into bad cases with massively complicated CFGs.
This speeds up a particular testcase from 12+ hours to 5 seconds with little perceptible loss of quality. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55391 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
3200d92947
commit
516eb1c139
@ -862,6 +862,12 @@ bool GVN::processNonLocalLoad(LoadInst* L,
|
||||
DenseMap<BasicBlock*, Value*> deps;
|
||||
MD.getNonLocalDependency(L, deps);
|
||||
|
||||
// If we had to process more than one hundred blocks to find the
|
||||
// dependencies, this load isn't worth worrying about. Optimizing
|
||||
// it will be too expensive.
|
||||
if (deps.size() > 100)
|
||||
return false;
|
||||
|
||||
DenseMap<BasicBlock*, Value*> repl;
|
||||
|
||||
// Filter out useless results (non-locals, etc)
|
||||
|
Loading…
Reference in New Issue
Block a user