[llvm-commits] CVS: llvm/lib/Transforms/IPO/Parallelize.cpp

Chris Lattner lattner at cs.uiuc.edu
Mon Sep 1 11:50:01 PDT 2003


Changes in directory llvm/lib/Transforms/IPO:

Parallelize.cpp updated: 1.5 -> 1.6

---
Log message:

If "These should be used only by the auto-parallelization pass", we might as
well put them INTO the auto-par pass.


---
Diffs of the changes:

Index: llvm/lib/Transforms/IPO/Parallelize.cpp
diff -u llvm/lib/Transforms/IPO/Parallelize.cpp:1.5 llvm/lib/Transforms/IPO/Parallelize.cpp:1.6
--- llvm/lib/Transforms/IPO/Parallelize.cpp:1.5	Mon Sep  1 11:45:30 2003
+++ llvm/lib/Transforms/IPO/Parallelize.cpp	Mon Sep  1 11:49:38 2003
@@ -31,7 +31,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "Cilkifier.h"
 #include "llvm/Transforms/Utils/DemoteRegToStack.h"
 #include "llvm/Analysis/PgmDependenceGraph.h"
 #include "llvm/Analysis/Dominators.h"
@@ -84,6 +83,37 @@
 }
 
 #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;
+}
 
 
 //---------------------------------------------------------------------------- 





More information about the llvm-commits mailing list