From: Chris Lattner Date: Wed, 3 Oct 2007 06:10:59 +0000 (+0000) Subject: add a note X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=e1bb6ab7b0594f47906d928a8f82b45514366436;p=oota-llvm.git add a note git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42573 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/README.txt b/lib/Target/README.txt index 37b671f34b7..2db7e64874b 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: