diff options
-rw-r--r-- | lib/Target/README.txt | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/Target/README.txt b/lib/Target/README.txt index 37b671f34b..2db7e64874 100644 --- a/lib/Target/README.txt +++ b/lib/Target/README.txt @@ -427,6 +427,22 @@ return: //===---------------------------------------------------------------------===// +Tail recursion elimination is not transforming this function, because it is +returning n, which fails the isDynamicConstant check in the accumulator +recursion checks. + +long long fib(const long long n) { + switch(n) { + case 0: + case 1: + return n; + default: + return fib(n-1) + fib(n-2); + } +} + +//===---------------------------------------------------------------------===// + Argument promotion should promote arguments for recursive functions, like this: |