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 | 53b727791729c5fc1ea5e40dd41fe93bfcde0288 (patch) | |
tree | 70a29ab1d77578aebe83ca02fdc3787355912316 | |
parent | 150943c17867ad87cd372efc7a030d0c099d326e (diff) |
another random note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47831 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Target/README.txt | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/Target/README.txt b/lib/Target/README.txt index 80b00377ae..d477c82fbb 100644 --- a/lib/Target/README.txt +++ b/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. + +//===---------------------------------------------------------------------===// |