[opengtl-commits] [447] * remove setTailCall

[ Thread Index | Date Index | More lists.tuxfamily.org/opengtl-commits Archives ]


Revision: 447
Author:   cyrille
Date:     2008-10-11 22:41:07 +0200 (Sat, 11 Oct 2008)

Log Message:
-----------
* remove setTailCall
* use level 4 optimisation

Modified Paths:
--------------
    trunk/OpenGTL/OpenCTL/OpenCTL/Program.cpp
    trunk/OpenGTL/OpenGTL/GTLCore/AST/FunctionDeclaration.cpp
    trunk/OpenGTL/OpenGTL/GTLCore/CodeGenerator_p.cpp
    trunk/OpenGTL/OpenGTL/GTLCore/ModuleData_p.cpp
    trunk/OpenGTL/OpenGTL/GTLCore/Optimiser.cpp
    trunk/OpenGTL/OpenGTL/GTLCore/Optimiser.h
    trunk/OpenGTL/OpenGTL/GTLCore/Optimiser_p.cpp


Modified: trunk/OpenGTL/OpenCTL/OpenCTL/Program.cpp
===================================================================
--- trunk/OpenGTL/OpenCTL/OpenCTL/Program.cpp	2008-10-11 16:25:23 UTC (rev 446)
+++ trunk/OpenGTL/OpenCTL/OpenCTL/Program.cpp	2008-10-11 20:41:07 UTC (rev 447)
@@ -307,7 +307,7 @@
       OCTL_DEBUG( *function->getFunctionType());
 #endif
       llvm::CallInst *CallFunc = llvm::CallInst::Create(function, arguments.begin(), arguments.end(), "", bodyBlock);
-      CallFunc->setTailCall();
+      CallFunc->setTailCall(false);
       // If there was buffering, save to output
       OCTL_DEBUG("If there was buffering, save to output");
       for(int i = 0; i < dstCountChannels; ++i)

Modified: trunk/OpenGTL/OpenGTL/GTLCore/AST/FunctionDeclaration.cpp
===================================================================
--- trunk/OpenGTL/OpenGTL/GTLCore/AST/FunctionDeclaration.cpp	2008-10-11 16:25:23 UTC (rev 446)
+++ trunk/OpenGTL/OpenGTL/GTLCore/AST/FunctionDeclaration.cpp	2008-10-11 20:41:07 UTC (rev 447)
@@ -144,7 +144,7 @@
     arguments.push_back( defaultValue);
     // Make the call
     llvm::CallInst *callPrevious = llvm::CallInst::Create(previousFunction, arguments.begin(), arguments.end(), "", BB);
-    callPrevious->setTailCall(true);
+    callPrevious->setTailCall(false);
     if( m_function->returnType()->dataType() == Type::VOID )
     {
       llvm::ReturnInst::Create( BB );

Modified: trunk/OpenGTL/OpenGTL/GTLCore/CodeGenerator_p.cpp
===================================================================
--- trunk/OpenGTL/OpenGTL/GTLCore/CodeGenerator_p.cpp	2008-10-11 16:25:23 UTC (rev 446)
+++ trunk/OpenGTL/OpenGTL/GTLCore/CodeGenerator_p.cpp	2008-10-11 20:41:07 UTC (rev 447)
@@ -652,7 +652,7 @@
 #endif
   
   llvm::CallInst *CallFunc = llvm::CallInst::Create(llvmFunction, convertedParams.begin(), convertedParams.end(), "", bb);
-  CallFunc->setTailCall();
+  CallFunc->setTailCall(false);
   return GTLCore::ExpressionResult( CallFunc, _function->returnType(), true );
 }
 

Modified: trunk/OpenGTL/OpenGTL/GTLCore/ModuleData_p.cpp
===================================================================
--- trunk/OpenGTL/OpenGTL/GTLCore/ModuleData_p.cpp	2008-10-11 16:25:23 UTC (rev 446)
+++ trunk/OpenGTL/OpenGTL/GTLCore/ModuleData_p.cpp	2008-10-11 20:41:07 UTC (rev 447)
@@ -25,6 +25,7 @@
 #include "GTLCore/Function.h"
 #include "TypeManager.h"
 #include "Macros_p.h"
+#include "Optimiser_p.h"
 
 #include <llvm/Module.h>
 #include <llvm/PassManager.h>
@@ -158,4 +159,5 @@
     delete clone;
   }
   linker.releaseModule();
+  GTLCore::Optimiser::instance()->d->passManager()->run( *m_llvmModule );
 }

Modified: trunk/OpenGTL/OpenGTL/GTLCore/Optimiser.cpp
===================================================================
--- trunk/OpenGTL/OpenGTL/GTLCore/Optimiser.cpp	2008-10-11 16:25:23 UTC (rev 446)
+++ trunk/OpenGTL/OpenGTL/GTLCore/Optimiser.cpp	2008-10-11 20:41:07 UTC (rev 447)
@@ -43,5 +43,5 @@
 
 int Optimiser::maximumRecommendedLevel()
 {
-  return 2;
+  return 4;
 }

Modified: trunk/OpenGTL/OpenGTL/GTLCore/Optimiser.h
===================================================================
--- trunk/OpenGTL/OpenGTL/GTLCore/Optimiser.h	2008-10-11 16:25:23 UTC (rev 446)
+++ trunk/OpenGTL/OpenGTL/GTLCore/Optimiser.h	2008-10-11 20:41:07 UTC (rev 447)
@@ -38,6 +38,7 @@
     friend class OpenCTL::Compiler;
     friend class OpenCTL::Program;
     friend class OpenShiva::Compiler;
+    friend class ModuleData;
     private:
       Optimiser();
       ~Optimiser();

Modified: trunk/OpenGTL/OpenGTL/GTLCore/Optimiser_p.cpp
===================================================================
--- trunk/OpenGTL/OpenGTL/GTLCore/Optimiser_p.cpp	2008-10-11 16:25:23 UTC (rev 446)
+++ trunk/OpenGTL/OpenGTL/GTLCore/Optimiser_p.cpp	2008-10-11 20:41:07 UTC (rev 447)
@@ -75,7 +75,7 @@
 
 Optimiser::Private::Private() : m_passManager(0)
 {
-  setLevel( 2 );
+  setLevel( 4 );
 }
 
 Optimiser::Private::~Private()


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/