summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Checkers/CStringChecker.cpp
diff options
context:
space:
mode:
authorMichael Gottesman <mgottesman@apple.com>2013-11-17 03:25:24 +0000
committerMichael Gottesman <mgottesman@apple.com>2013-11-17 03:25:24 +0000
commit4d078a3d6fb72d13becefa5bc163ba3cde15baee (patch)
tree9de79f65c8f861013f99b5be0737da4b7764464f /clang/lib/StaticAnalyzer/Checkers/CStringChecker.cpp
parente5f00c8bd2a0b0c3bcac66745d209f25f8de2981 (diff)
downloadbcm5719-llvm-4d078a3d6fb72d13becefa5bc163ba3cde15baee.tar.gz
bcm5719-llvm-4d078a3d6fb72d13becefa5bc163ba3cde15baee.zip
[block-freq] Add BlockFrequency::scale that returns a remainder from the 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
Diffstat (limited to 'clang/lib/StaticAnalyzer/Checkers/CStringChecker.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud