diff options
author | Chris Lattner <sabre@nondot.org> | 2009-10-27 21:27:42 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-10-27 21:27:42 +0000 |
commit | c5c281ea44cc96b17aee19754ab03e65e8ba8ead (patch) | |
tree | b52e6c6236b5701f3a6dad4bc1ca93d81d7f7cb6 /llvm/lib/Analysis | |
parent | e8628a020695599ed6d13fd5e84e22801b946af5 (diff) | |
download | bcm5719-llvm-c5c281ea44cc96b17aee19754ab03e65e8ba8ead.tar.gz bcm5719-llvm-c5c281ea44cc96b17aee19754ab03e65e8ba8ead.zip |
Random updates to passes for indbr, I need blockaddress before I can do much more.
llvm-svn: 85316
Diffstat (limited to 'llvm/lib/Analysis')
-rw-r--r-- | llvm/lib/Analysis/InlineCost.cpp | 3 | ||||
-rw-r--r-- | llvm/lib/Analysis/SparsePropagation.cpp | 5 |
2 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/InlineCost.cpp b/llvm/lib/Analysis/InlineCost.cpp index febdd9101c8..559f468bd64 100644 --- a/llvm/lib/Analysis/InlineCost.cpp +++ b/llvm/lib/Analysis/InlineCost.cpp @@ -31,6 +31,9 @@ unsigned InlineCostAnalyzer::FunctionInfo:: // Eliminating a switch is a big win, proportional to the number of edges // deleted. Reduction += (SI->getNumSuccessors()-1) * 40; + else if (isa<IndBrInst>(*UI)) + // Eliminating an indirect branch is a big win. + Reduction += 200; else if (CallInst *CI = dyn_cast<CallInst>(*UI)) { // Turning an indirect call into a direct call is a BIG win Reduction += CI->getCalledValue() == V ? 500 : 0; diff --git a/llvm/lib/Analysis/SparsePropagation.cpp b/llvm/lib/Analysis/SparsePropagation.cpp index b7844f02276..6578cb4681e 100644 --- a/llvm/lib/Analysis/SparsePropagation.cpp +++ b/llvm/lib/Analysis/SparsePropagation.cpp @@ -166,6 +166,11 @@ void SparseSolver::getFeasibleSuccessors(TerminatorInst &TI, return; } + if (IndBrInst *IBI = dyn_cast<IndBrInst>(TI)) { + Succs.assign(Succs.size(), true); + return; + } + SwitchInst &SI = cast<SwitchInst>(TI); LatticeVal SCValue; if (AggressiveUndef) |