summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/Support/BlockFrequencyTest.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [block-freq] Add a right shift to BlockFrequency that saturates at 1.Michael Gottesman2013-12-141-0/+8
| | | | llvm-svn: 197302
* [block-freq] Update data in test case to be unsigned long long to fix mingw ↵Michael Gottesman2013-11-221-80/+80
| | | | | | build. llvm-svn: 195411
* [block-freq] Add BlockFrequency::scale that returns a remainder from the ↵Michael Gottesman2013-11-171-0/+133
| | | | | | | | | | | | | | | | | | | | | | | | | | division and make the private scale in BlockFrequency more performant. This change is the first in a series of changes improving LLVM's Block Frequency propogation implementation to not lose probability mass in branchy code when propogating block frequency information from a basic block to its successors. This patch is a simple infrastructure improvement that does not actually modify the block frequency algorithm. The specific changes are: 1. Changes the division algorithm used when scaling block frequencies by branch probabilities to a short division algorithm. This gives us the remainder for free as well as provides a nice speed boost. When I benched the old routine and the new routine on a Sandy Bridge iMac with disabled turbo mode performing 8192 iterations on an array of length 32768, I saw ~600% increase in speed in mean/median performance. 2. Exposes a scale method that returns a remainder. This is important so we can ensure that when we scale a block frequency by some branch probability BP = N/D, the remainder from the division by D can be retrieved and propagated to other children to ensure no probability mass is lost (more to come on this). llvm-svn: 194950
* Fix a bad overflow check pointed out by Ben.Jakob Stoklund Olesen2013-06-281-0/+5
| | | | llvm-svn: 185226
* Add a division operator to BlockFrequency.Jakob Stoklund Olesen2013-06-281-0/+18
| | | | | | | | | | | Allow a BlockFrequency to be divided by a non-zero BranchProbability with saturating arithmetic. This will be used to compute the frequency of a loop header given the probability of leaving the loop. Our long division algorithm already saturates on overflow, so that was a freebie. llvm-svn: 185184
* Revert "BlockFrequency: Saturate at 1 instead of 0 when multiplying a ↵Benjamin Kramer2013-06-211-12/+1
| | | | | | | | frequency with a branch probability." This reverts commit r184584. Breaks PPC selfhost. llvm-svn: 184590
* BlockFrequency: Saturate at 1 instead of 0 when multiplying a frequency with ↵Benjamin Kramer2013-06-211-1/+12
| | | | | | | | | | | | | | | a branch probability. Zero is used by BlockFrequencyInfo as a special "don't know" value. It also causes a sink for frequencies as you can't ever get off a zero frequency with more multiplies. This recovers a 10% regression on MultiSource/Benchmarks/7zip. A zero frequency was propagated into an inner loop causing excessive spilling. PR16402. llvm-svn: 184584
* Sort the #include lines for unittest/...Chandler Carruth2012-12-041-2/+1
| | | | llvm-svn: 169250
* For reasons I can't fathom MSVC supports ULL but not LLU suffixes on long ↵Benjamin Kramer2012-06-171-1/+1
| | | | | | long integer literals. llvm-svn: 158648
* Implement comparison operators for BranchProbability in a way that can't ↵Benjamin Kramer2011-10-241-0/+9
| | | | | | | | overflow INT64_MAX. Add a test case for the edge case that triggers this. Thanks to Chandler for bringing this to my attention. llvm-svn: 142794
* Add compare operators to BranchProbability and use it to determine if an ↵Benjamin Kramer2011-10-231-0/+20
| | | | | | edge is hot. llvm-svn: 142751
* Add test cases for BlockFrequency.Jakub Staszak2011-07-271-0/+56
llvm-svn: 136244
OpenPOWER on IntegriCloud