Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt	(revision 92714)
+++ CMakeLists.txt	(working copy)
@@ -300,6 +300,7 @@
 add_subdirectory(lib/Transforms/Scalar)
 add_subdirectory(lib/Transforms/IPO)
 add_subdirectory(lib/Transforms/Hello)
+add_subdirectory(lib/Transforms/Poly)
 add_subdirectory(lib/Linker)
 add_subdirectory(lib/Analysis)
 add_subdirectory(lib/Analysis/IPA)
Index: include/llvm/LinkAllPasses.h
===================================================================
--- include/llvm/LinkAllPasses.h	(revision 92714)
+++ include/llvm/LinkAllPasses.h	(working copy)
@@ -28,6 +28,7 @@
 #include "llvm/Function.h"
 #include "llvm/Transforms/Instrumentation.h"
 #include "llvm/Transforms/IPO.h"
+#include "llvm/Transforms/Poly.h"
 #include "llvm/Transforms/Scalar.h"
 #include "llvm/Transforms/Utils/UnifyFunctionExitNodes.h"
 #include <cstdlib>
@@ -139,6 +140,8 @@
       (void) llvm::createSCCVNPass();
       (void) llvm::createABCDPass();
 
+	  (void) llvm::createPolyPass();
+
       (void)new llvm::IntervalPartition();
       (void)new llvm::FindUsedTypes();
       (void)new llvm::ScalarEvolution();
Index: include/llvm/Transforms/Poly.h
===================================================================
--- include/llvm/Transforms/Poly.h	(revision 0)
+++ include/llvm/Transforms/Poly.h	(revision 0)
@@ -0,0 +1,30 @@
+//===-- Poly.h - Polyhedral optimizations -----------------------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This header file defines prototypes for accessor functions that expose passes
+// in the Poly library.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_TRANSFORMS_POLY_H
+#define LLVM_TRANSFORMS_POLY_H
+
+namespace llvm {
+	
+class FunctionPass;
+	
+//===----------------------------------------------------------------------===//
+//
+// Poly - the wrapper pass for llvm polyhedral optimization framework
+//
+FunctionPass *createPolyPass();
+
+}//end namespace llvm
+
+#endif
Index: lib/Transforms/Makefile
===================================================================
--- lib/Transforms/Makefile	(revision 92714)
+++ lib/Transforms/Makefile	(working copy)
@@ -8,7 +8,7 @@
 ##===----------------------------------------------------------------------===##
 
 LEVEL = ../..
-PARALLEL_DIRS = Utils Instrumentation Scalar InstCombine IPO Hello
+PARALLEL_DIRS = Utils Instrumentation Scalar InstCombine IPO Hello Poly
 
 include $(LEVEL)/Makefile.config
 
Index: lib/Transforms/Poly/CMakeLists.txt
===================================================================
--- lib/Transforms/Poly/CMakeLists.txt	(revision 0)
+++ lib/Transforms/Poly/CMakeLists.txt	(revision 0)
@@ -0,0 +1,5 @@
+add_llvm_library(LLVMPoly
+  Poly.cpp
+  )
+
+target_link_libraries (LLVMPoly LLVMSupport)
Index: lib/Transforms/Poly/Makefile
===================================================================
--- lib/Transforms/Poly/Makefile	(revision 0)
+++ lib/Transforms/Poly/Makefile	(revision 0)
@@ -0,0 +1,16 @@
+##===- lib/Transforms/Hello/Makefile -----------------------*- Makefile -*-===##
+#
+#                     The LLVM Compiler Infrastructure
+#
+# This file is distributed under the University of Illinois Open Source
+# License. See LICENSE.TXT for details.
+#
+##===----------------------------------------------------------------------===##
+
+LEVEL = ../../..
+LIBRARYNAME = LLVMPoly
+LOADABLE_MODULE = 1
+USEDLIBS =
+
+include $(LEVEL)/Makefile.common
+
Index: lib/Transforms/Poly/Poly.cpp
===================================================================
--- lib/Transforms/Poly/Poly.cpp	(revision 0)
+++ lib/Transforms/Poly/Poly.cpp	(revision 0)
@@ -0,0 +1,44 @@
+//===- Poly.cpp - The Wrapper Pass for LLVM Polyhedral optimization framework ---------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file implements the wrapper pass for llvm polyhedral optimization framework
+// http://wiki.llvm.org/Polyhedral_optimization_framework
+//
+//===----------------------------------------------------------------------===//
+
+#define DEBUG_TYPE "poly"
+#include "llvm/Pass.h"
+#include "llvm/Function.h"
+#include "llvm/Transforms/Poly.h"
+#include "llvm/Support/raw_ostream.h"
+using namespace llvm;
+
+namespace {
+  // Poly - the toy for llvm Polyhedral optimization framework right now 
+  struct Poly : public FunctionPass {
+    static char ID;
+    Poly() : FunctionPass(&ID) {}
+
+    virtual bool runOnFunction(Function &F) {
+      errs() << "Hello Poly!\n";
+      errs().write_escaped(F.getName()) << '\n';
+	  //poly frontend
+	  //run polyhedral optimization
+	  //poly backend
+      return false;
+    }
+  };
+}
+
+char Poly::ID = 0;
+static RegisterPass<Poly> X("poly", "Polyhedral optimization framework wrapper");
+
+FunctionPass *llvm::createPolyPass() {
+  return new Poly();
+}
Index: tools/bugpoint/CMakeLists.txt
===================================================================
--- tools/bugpoint/CMakeLists.txt	(revision 92714)
+++ tools/bugpoint/CMakeLists.txt	(working copy)
@@ -1,4 +1,4 @@
-set(LLVM_LINK_COMPONENTS asmparser instrumentation scalaropts ipo
+set(LLVM_LINK_COMPONENTS asmparser instrumentation scalaropts ipo poly
   linker bitreader bitwriter)
 set(LLVM_REQUIRES_EH 1)
 
Index: tools/bugpoint/Makefile
===================================================================
--- tools/bugpoint/Makefile	(revision 92714)
+++ tools/bugpoint/Makefile	(working copy)
@@ -11,7 +11,7 @@
 TOOLNAME = bugpoint
 
 LINK_COMPONENTS := asmparser instrumentation scalaropts ipo \
-                   linker bitreader bitwriter
+                   linker bitreader bitwriter poly
 REQUIRES_EH := 1
 
 include $(LEVEL)/Makefile.common
Index: tools/opt/CMakeLists.txt
===================================================================
--- tools/opt/CMakeLists.txt	(revision 92714)
+++ tools/opt/CMakeLists.txt	(working copy)
@@ -1,4 +1,4 @@
-set(LLVM_LINK_COMPONENTS bitreader asmparser bitwriter instrumentation scalaropts ipo)
+set(LLVM_LINK_COMPONENTS bitreader asmparser bitwriter instrumentation scalaropts ipo poly)
 
 add_llvm_tool(opt
   AnalysisWrappers.cpp
Index: tools/opt/Makefile
===================================================================
--- tools/opt/Makefile	(revision 92714)
+++ tools/opt/Makefile	(working copy)
@@ -9,6 +9,6 @@
 LEVEL = ../..
 TOOLNAME = opt
 
-LINK_COMPONENTS := bitreader bitwriter asmparser instrumentation scalaropts ipo
+LINK_COMPONENTS := bitreader bitwriter asmparser instrumentation scalaropts ipo poly
 
 include $(LEVEL)/Makefile.common
