mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-17 18:24:34 +00:00
add a note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54602 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -438,6 +438,19 @@ long long fib(const long long n) {
|
|||||||
|
|
||||||
//===---------------------------------------------------------------------===//
|
//===---------------------------------------------------------------------===//
|
||||||
|
|
||||||
|
Tail recursion elimination should handle:
|
||||||
|
|
||||||
|
int pow2m1(int n) {
|
||||||
|
if (n == 0)
|
||||||
|
return 0;
|
||||||
|
return 2 * pow2m1 (n - 1) + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
Also, multiplies can be turned into SHL's, so they should be handled as if
|
||||||
|
they were associative. "return foo() << 1" can be tail recursion eliminated.
|
||||||
|
|
||||||
|
//===---------------------------------------------------------------------===//
|
||||||
|
|
||||||
Argument promotion should promote arguments for recursive functions, like
|
Argument promotion should promote arguments for recursive functions, like
|
||||||
this:
|
this:
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user