add a note

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42573 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2007-10-03 06:10:59 +00:00
parent 4ec2c7eba0
commit e1bb6ab7b0

View File

@ -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: