aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/Support/EndianStreamTest.cpp
diff options
context:
space:
mode:
authorMichael Zolotukhin <mzolotukhin@apple.com>2015-02-05 02:34:00 +0000
committerMichael Zolotukhin <mzolotukhin@apple.com>2015-02-05 02:34:00 +0000
commita9aadd2903c6d3af5b6b4a7f01c8d9156b0cc9a5 (patch)
tree1b02b1f1134330c9c153c48f4fabd2f1e5cb7709 /llvm/unittests/Support/EndianStreamTest.cpp
parent68c00bd2057e3a1a8f8320c35e30fd42a1ef3e02 (diff)
downloadllvm-a9aadd2903c6d3af5b6b4a7f01c8d9156b0cc9a5.zip
llvm-a9aadd2903c6d3af5b6b4a7f01c8d9156b0cc9a5.tar.gz
llvm-a9aadd2903c6d3af5b6b4a7f01c8d9156b0cc9a5.tar.bz2
Implement new heuristic for complete loop unrolling.
Complete loop unrolling can make some loads constant, thus enabling a lot of other optimizations. To catch such cases, we look for loads that might become constants and estimate number of instructions that would be simplified or become dead after substitution. Example: Suppose we have: int a[] = {0, 1, 0}; v = 0; for (i = 0; i < 3; i ++) v += b[i]*a[i]; If we completely unroll the loop, we would get: v = b[0]*a[0] + b[1]*a[1] + b[2]*a[2] Which then will be simplified to: v = b[0]* 0 + b[1]* 1 + b[2]* 0 And finally: v = b[1] llvm-svn: 228265
Diffstat (limited to 'llvm/unittests/Support/EndianStreamTest.cpp')
0 files changed, 0 insertions, 0 deletions