If "These should be used only by the auto-parallelization pass", we might as
authorChris Lattner <sabre@nondot.org>
Mon, 1 Sep 2003 16:49:38 +0000 (16:49 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 1 Sep 2003 16:49:38 +0000 (16:49 +0000)
well put them INTO the auto-par pass.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8288 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/DataStructure/Parallelize.cpp
lib/Transforms/IPO/Parallelize.cpp

index 2c063d19643c8d4025d087e63783a71c09a3936d..562a263e29aee3ad254df9987c978aaf5594a102 100644 (file)
@@ -31,7 +31,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "Cilkifier.h"
 #include "llvm/Transforms/Utils/DemoteRegToStack.h"
 #include "llvm/Analysis/PgmDependenceGraph.h"
 #include "llvm/Analysis/Dominators.h"
@@ -86,6 +85,37 @@ bool CheckDominance(Function& func,
 #endif
 
 
+//---------------------------------------------------------------------------- 
+// Global constants used in marking Cilk functions and function calls.
+//---------------------------------------------------------------------------- 
+
+static const char * const CilkSuffix = ".llvm2cilk";
+static const char * const DummySyncFuncName = "__sync.llvm2cilk";
+
+//---------------------------------------------------------------------------- 
+// Routines to identify Cilk functions, calls to Cilk functions, and syncs.
+//---------------------------------------------------------------------------- 
+
+static bool isCilk(const Function& F) {
+  return (F.getName().rfind(CilkSuffix) ==
+          F.getName().size() - std::strlen(CilkSuffix));
+}
+
+static bool isCilkMain(const Function& F) {
+  return F.getName() == "main" + std::string(CilkSuffix);
+}
+
+
+static bool isCilk(const CallInst& CI) {
+  return CI.getCalledFunction() && isCilk(*CI.getCalledFunction());
+}
+
+static bool isSync(const CallInst& CI) { 
+  return CI.getCalledFunction() &&
+         CI.getCalledFunction()->getName() == DummySyncFuncName;
+}
+
+
 //---------------------------------------------------------------------------- 
 // class Cilkifier
 //
index 2c063d19643c8d4025d087e63783a71c09a3936d..562a263e29aee3ad254df9987c978aaf5594a102 100644 (file)
@@ -31,7 +31,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "Cilkifier.h"
 #include "llvm/Transforms/Utils/DemoteRegToStack.h"
 #include "llvm/Analysis/PgmDependenceGraph.h"
 #include "llvm/Analysis/Dominators.h"
@@ -86,6 +85,37 @@ bool CheckDominance(Function& func,
 #endif
 
 
+//---------------------------------------------------------------------------- 
+// Global constants used in marking Cilk functions and function calls.
+//---------------------------------------------------------------------------- 
+
+static const char * const CilkSuffix = ".llvm2cilk";
+static const char * const DummySyncFuncName = "__sync.llvm2cilk";
+
+//---------------------------------------------------------------------------- 
+// Routines to identify Cilk functions, calls to Cilk functions, and syncs.
+//---------------------------------------------------------------------------- 
+
+static bool isCilk(const Function& F) {
+  return (F.getName().rfind(CilkSuffix) ==
+          F.getName().size() - std::strlen(CilkSuffix));
+}
+
+static bool isCilkMain(const Function& F) {
+  return F.getName() == "main" + std::string(CilkSuffix);
+}
+
+
+static bool isCilk(const CallInst& CI) {
+  return CI.getCalledFunction() && isCilk(*CI.getCalledFunction());
+}
+
+static bool isSync(const CallInst& CI) { 
+  return CI.getCalledFunction() &&
+         CI.getCalledFunction()->getName() == DummySyncFuncName;
+}
+
+
 //---------------------------------------------------------------------------- 
 // class Cilkifier
 //