diff options
| author | Chris Lattner <sabre@nondot.org> | 2008-03-02 19:29:42 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2008-03-02 19:29:42 +0000 |
| commit | d51372aa965a3d92dc9f9028af97ab70a3dbb8a9 (patch) | |
| tree | d3b24e2043f29082c2b606fd6d93d1797b9e3c86 /llvm/lib | |
| parent | 6b0a1892255bffab081875a987b2bf48c22f2cfb (diff) | |
| download | bcm5719-llvm-d51372aa965a3d92dc9f9028af97ab70a3dbb8a9.tar.gz bcm5719-llvm-d51372aa965a3d92dc9f9028af97ab70a3dbb8a9.zip | |
another random note
llvm-svn: 47831
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Target/README.txt | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/llvm/lib/Target/README.txt b/llvm/lib/Target/README.txt index 80b00377ae7..d477c82fbb2 100644 --- a/llvm/lib/Target/README.txt +++ b/llvm/lib/Target/README.txt @@ -705,3 +705,26 @@ int f() { } //===---------------------------------------------------------------------===// + +The loop unroller should partially unroll loops (instead of peeling them) +when code growth isn't too bad and when an unroll count allows simplification +of some code within the loop. One trivial example is: + +#include <stdio.h> +int main() { + int nRet = 17; + int nLoop; + for ( nLoop = 0; nLoop < 1000; nLoop++ ) { + if ( nLoop & 1 ) + nRet += 2; + else + nRet -= 1; + } + return nRet; +} + +Unrolling by 2 would eliminate the '&1' in both copies, leading to a net +reduction in code size. The resultant code would then also be suitable for +exit value computation. + +//===---------------------------------------------------------------------===// |

