changeset 16:d405342cecb1

can eliminate tail call regardless of optimize level
author Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
date Tue, 24 Sep 2013 19:04:26 +0900
parents 66597e792247
children 5e1f5bc27634
files lib/Transforms/IPO/PassManagerBuilder.cpp lib/Transforms/IPO/PruneEH.cpp
diffstat 2 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lib/Transforms/IPO/PassManagerBuilder.cpp	Tue Sep 17 21:32:34 2013 +0900
+++ b/lib/Transforms/IPO/PassManagerBuilder.cpp	Tue Sep 24 19:04:26 2013 +0900
@@ -207,7 +207,7 @@
   MPM.add(createInstructionCombiningPass());  // Combine silly seq's
 
 #ifndef noCbC
-  MPM.add(createTailCallEliminationPass(false));   // Eliminate tail calls
+  MPM.add(createTailCallEliminationPass(true));   // Eliminate tail calls
 #else
   MPM.add(createTailCallEliminationPass());   // Eliminate tail calls
 #endif
--- a/lib/Transforms/IPO/PruneEH.cpp	Tue Sep 17 21:32:34 2013 +0900
+++ b/lib/Transforms/IPO/PruneEH.cpp	Tue Sep 24 19:04:26 2013 +0900
@@ -107,7 +107,10 @@
         } else if (CheckReturn && isa<ReturnInst>(BB->getTerminator())) {
           SCCMightReturn = true;
         }
-
+#ifndef noCbC
+	else if(F->getReturnType()->is__CodeTy())
+	  SCCMightReturn = true;
+#endif
         // Invoke instructions don't allow unwinding to continue, so we are
         // only interested in call instructions.
         if (CheckUnwind && !SCCMightUnwind)