Jakub Staszak
5a47c78397
Change SmallVector to SmallPtrSet in BranchProbabilityInfo. Handle cases where
...
one than one successor goes to the same block.
llvm-svn: 136638
2011-08-01 19:16:26 +00:00
Jakub Staszak
8f686498df
Do not handle cases with >= and <= predicates.
...
llvm-svn: 136588
2011-07-31 05:54:04 +00:00
Jakub Staszak
0fe2246aab
Remove untrue comment.
...
llvm-svn: 136587
2011-07-31 04:51:14 +00:00
Jakub Staszak
6795c54cb7
Do not handle case where LHS is equal to zero, because InstCombiner always moves
...
it to RHS anyway.
llvm-svn: 136586
2011-07-31 04:47:20 +00:00
Jakub Staszak
384a405be9
Add Zero Heurestics to BranchProbabilityInfo. If we compare value to zero we
...
decide whether condition is likely to be true this way:
x == 0 -> false
x < 0 -> false
x <= 0 -> false
x != 0 -> true
x > 0 -> true
x >= 0 -> true
llvm-svn: 136583
2011-07-31 03:27:24 +00:00
Jakub Staszak
02fa079dc3
Add more constantness in BranchProbabilityInfo.
...
llvm-svn: 136502
2011-07-29 19:30:00 +00:00
Jakub Staszak
ad93033183
Remove incEdgeWeight and decEdgeWeight. Set edge weight directly to avoid
...
rounding errors.
llvm-svn: 136456
2011-07-29 02:36:53 +00:00
Jakub Staszak
d6d0b202f1
Change LBH_TAKEN_WEIGHT to 124 (from 128). Right now, sum of
...
LBH_TAKEN_WEIGHT + LBH_NONTAKEN_WEIGHT = 128 which in _most_ cases reduce
number of rounding errors.
llvm-svn: 136428
2011-07-28 23:42:08 +00:00
Jakub Staszak
53da869f0c
Heuristics are in descending priority now. If we use one of them, skip the rest.
...
llvm-svn: 136402
2011-07-28 21:45:07 +00:00
Jakub Staszak
c5d6bbc669
Add InEdges (edges from header to the loop) in Loop Branch Heuristics, so
...
there is no frequency difference whether condition is in the header or in
the latch.
llvm-svn: 136398
2011-07-28 21:33:46 +00:00
Jakub Staszak
7bd3be24d8
Remove "LoopInfo.h" include from BranchProbabilityInfo.h.
...
llvm-svn: 135353
2011-07-16 20:31:15 +00:00
Jakub Staszak
ada22d8fca
Fix pointer heuristic. Check whether predicator is ICMP_NE instead of if it is
...
not isEquality().
llvm-svn: 135296
2011-07-15 20:51:06 +00:00
Jakub Staszak
4cd344d775
Calculate backedge probability correctly.
...
llvm-svn: 133776
2011-06-23 23:52:11 +00:00
Jakub Staszak
d74cc36bcb
Introduce BlockFrequency analysis for BasicBlocks.
...
llvm-svn: 133766
2011-06-23 21:45:20 +00:00
Jakub Staszak
5c7b7d64ba
Introduce MachineBranchProbabilityInfo class, which has similar API to
...
BranchProbabilityInfo (expect setEdgeWeight which is not available here).
Branch Weights are kept in MachineBasicBlocks. To turn off this analysis
set -use-mbpi=false.
llvm-svn: 133184
2011-06-16 20:22:37 +00:00
Benjamin Kramer
8f8ff3e797
Move class into an anonymous namespace.
...
llvm-svn: 132925
2011-06-13 18:38:56 +00:00
Andrew Trick
4591f882c2
Branch profiling: floating-point avoidance.
...
Patch by: Jakub Staszak!
Introduces BranchProbability. Changes unsigned to uint32_t all over and
uint64_t only when overflow is expected.
llvm-svn: 132867
2011-06-11 01:05:22 +00:00
Nick Lewycky
813e24b6a9
Fold assert-only-used variable into the assert.
...
llvm-svn: 132620
2011-06-04 02:07:10 +00:00
Andrew Trick
c894f04286
Missing include of climits in the new BranchProbability pass.
...
llvm-svn: 132616
2011-06-04 01:30:52 +00:00
Andrew Trick
7a9eb604a9
New BranchProbabilityInfo analysis. Patch by Jakub Staszak!
...
BranchProbabilityInfo provides an interface for IR passes to query the
likelihood that control follows a CFG edge. This patch provides an
initial implementation of static branch predication that will populate
BranchProbabilityInfo for branches with no external profile
information using very simple heuristics. It currently isn't hooked up
to any external profile data, so static prediction does all the work.
llvm-svn: 132613
2011-06-04 01:16:30 +00:00