[llvm-commits] [llvm] r42573 - /llvm/trunk/lib/Target/README.txt

Chris Lattner sabre at nondot.org
Tue Oct 2 23:10:59 PDT 2007


Author: lattner
Date: Wed Oct  3 01:10:59 2007
New Revision: 42573

URL: http://llvm.org/viewvc/llvm-project?rev=42573&view=rev
Log:
add a note

Modified:
    llvm/trunk/lib/Target/README.txt

Modified: llvm/trunk/lib/Target/README.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/README.txt?rev=42573&r1=42572&r2=42573&view=diff

==============================================================================
--- llvm/trunk/lib/Target/README.txt (original)
+++ llvm/trunk/lib/Target/README.txt Wed Oct  3 01:10:59 2007
@@ -427,6 +427,22 @@
 
 //===---------------------------------------------------------------------===//
 
+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:
 





More information about the llvm-commits mailing list