diff options
author | Hal Finkel <hfinkel@anl.gov> | 2015-01-10 00:30:55 +0000 |
---|---|---|
committer | Hal Finkel <hfinkel@anl.gov> | 2015-01-10 00:30:55 +0000 |
commit | 38dd590861c32563c3bb38bc8ca53055fc89d691 (patch) | |
tree | 96054acf3ba7dfc69f16122ffe9b249a389ac53f /clang/lib/CodeGen/CodeGenModule.h | |
parent | 0f1b4997cef22f3a8a0798a4a253d0db38d8735d (diff) | |
download | llvm-38dd590861c32563c3bb38bc8ca53055fc89d691.zip llvm-38dd590861c32563c3bb38bc8ca53055fc89d691.tar.gz llvm-38dd590861c32563c3bb38bc8ca53055fc89d691.tar.bz2 |
[LoopUnroll] Fix the partial unrolling threshold for small loop sizes
When we compute the size of a loop, we include the branch on the backedge and
the comparison feeding the conditional branch. Under normal circumstances,
these don't get replicated with the rest of the loop body when we unroll. This
led to the somewhat surprising behavior that really small loops would not get
unrolled enough -- they could be unrolled more and the resulting loop would be
below the threshold, because we were assuming they'd take
(LoopSize * UnrollingFactor) instructions after unrolling, instead of
(((LoopSize-2) * UnrollingFactor)+2) instructions. This fixes that computation.
llvm-svn: 225565
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.h')
0 files changed, 0 insertions, 0 deletions