[llvm-commits] [polly] r134980 - in /polly/trunk: lib/CodeGeneration.cpp test/CodeGen/OpenMP/extract_memref.ll test/CodeGen/OpenMP/simple_nested_loop.ll test/CodeGen/OpenMP/structnames.ll

Tobias Grosser grosser at fim.uni-passau.de
Tue Jul 12 05:42:54 PDT 2011


Author: grosser
Date: Tue Jul 12 07:42:54 2011
New Revision: 134980

URL: http://llvm.org/viewvc/llvm-project?rev=134980&view=rev
Log:
Adapt to LLVM type system changes

Remove constness of Types and do not name the structures generated in the OpenMP
code.

Modified:
    polly/trunk/lib/CodeGeneration.cpp
    polly/trunk/test/CodeGen/OpenMP/extract_memref.ll
    polly/trunk/test/CodeGen/OpenMP/simple_nested_loop.ll
    polly/trunk/test/CodeGen/OpenMP/structnames.ll

Modified: polly/trunk/lib/CodeGeneration.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/CodeGeneration.cpp?rev=134980&r1=134979&r2=134980&view=diff
==============================================================================
--- polly/trunk/lib/CodeGeneration.cpp (original)
+++ polly/trunk/lib/CodeGeneration.cpp Tue Jul 12 07:42:54 2011
@@ -823,7 +823,7 @@
     Function *F = Builder.GetInsertBlock()->getParent();
     const std::string &Name = F->getNameStr() + ".omp_subfn";
 
-    std::vector<const Type*> Arguments(1, Builder.getInt8PtrTy());
+    std::vector<Type*> Arguments(1, Builder.getInt8PtrTy());
     FunctionType *FT = FunctionType::get(Builder.getVoidTy(), Arguments, false);
     Function *FN = Function::Create(FT, Function::InternalLinkage, Name, M);
     // Do not run any polly pass on the new function.
@@ -840,18 +840,14 @@
   /// Create the subfunction structure and add the values from the list.
   Value *addValuesToOpenMPStruct(SetVector<Value*> OMPDataVals,
                                  Function *SubFunction) {
-    Module *M = Builder.GetInsertBlock()->getParent()->getParent();
-    std::vector<const Type*> structMembers;
+    std::vector<Type*> structMembers;
 
     // Create the structure.
     for (unsigned i = 0; i < OMPDataVals.size(); i++)
       structMembers.push_back(OMPDataVals[i]->getType());
 
-    const std::string &Name = SubFunction->getNameStr() + ".omp.userContext";
     StructType *structTy = StructType::get(Builder.getContext(),
                                            structMembers);
-    M->addTypeName(Name, structTy);
-
     // Store the values into the structure.
     Value *structData = Builder.CreateAlloca(structTy, 0, "omp.userContext");
     for (unsigned i = 0; i < OMPDataVals.size(); i++) {
@@ -1275,7 +1271,7 @@
   {
     Module *M = Builder.GetInsertBlock()->getParent()->getParent();
     LLVMContext &Context = Builder.getContext();
-    const IntegerType *intPtrTy = TD->getIntPtrType(Context);
+    IntegerType *intPtrTy = TD->getIntPtrType(Context);
 
     if (!M->getFunction("GOMP_parallel_end")) {
       FunctionType *FT = FunctionType::get(Type::getVoidTy(Context), false);
@@ -1284,12 +1280,12 @@
 
     if (!M->getFunction("GOMP_parallel_loop_runtime_start")) {
       // Type of first argument.
-      std::vector<const Type*> Arguments(1, Builder.getInt8PtrTy());
+      std::vector<Type*> Arguments(1, Builder.getInt8PtrTy());
       FunctionType *FnArgTy = FunctionType::get(Builder.getVoidTy(), Arguments,
                                                 false);
       PointerType *FnPtrTy = PointerType::getUnqual(FnArgTy);
 
-      std::vector<const Type*> args;
+      std::vector<Type*> args;
       args.push_back(FnPtrTy);
       args.push_back(Builder.getInt8PtrTy());
       args.push_back(Builder.getInt32Ty());
@@ -1305,7 +1301,7 @@
     if (!M->getFunction("GOMP_loop_runtime_next")) {
       PointerType *intLongPtrTy = PointerType::getUnqual(intPtrTy);
 
-      std::vector<const Type*> args;
+      std::vector<Type*> args;
       args.push_back(intLongPtrTy);
       args.push_back(intLongPtrTy);
 
@@ -1316,7 +1312,7 @@
 
     if (!M->getFunction("GOMP_loop_end_nowait")) {
       FunctionType *FT = FunctionType::get(Builder.getVoidTy(),
-                                           std::vector<const Type*>(), false);
+                                           std::vector<Type*>(), false);
       Function::Create(FT, Function::ExternalLinkage,
 		       "GOMP_loop_end_nowait", M);
     }

Modified: polly/trunk/test/CodeGen/OpenMP/extract_memref.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/CodeGen/OpenMP/extract_memref.ll?rev=134980&r1=134979&r2=134980&view=diff
==============================================================================
--- polly/trunk/test/CodeGen/OpenMP/extract_memref.ll (original)
+++ polly/trunk/test/CodeGen/OpenMP/extract_memref.ll Tue Jul 12 07:42:54 2011
@@ -31,7 +31,9 @@
   call void @foo()
   ret i32 0
 }
-; CHECK: store [10 x float]* %A, [10 x float]**
-; CHECK: getelementptr inbounds %foo.omp_subfn.omp.userContext* %omp.userContext1
+; CHECK: getelementptr inbounds { [10 x float]* }* %omp.userContext, i32 0, i32 0
+; CHECK: store [10 x float]* %A, [10 x float]** %0
+; CHECK: %omp_data = bitcast { [10 x float]* }* %omp.userContext to i8*
+; CHECK: inbounds { [10 x float]* }* %omp.userContext1, i32 0, i32 0
 ; CHECK: load [10 x float]**
-; CHECK: getelementptr inbounds [10 x float]*
+

Modified: polly/trunk/test/CodeGen/OpenMP/simple_nested_loop.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/CodeGen/OpenMP/simple_nested_loop.ll?rev=134980&r1=134979&r2=134980&view=diff
==============================================================================
--- polly/trunk/test/CodeGen/OpenMP/simple_nested_loop.ll (original)
+++ polly/trunk/test/CodeGen/OpenMP/simple_nested_loop.ll Tue Jul 12 07:42:54 2011
@@ -55,9 +55,13 @@
 
 declare void @llvm.memset.p0i8.i32(i8* nocapture, i8, i32, i32, i1) nounwind
 
-; CHECK: %omp.userContext = alloca %loop_openmp.omp_subfn.omp.userContext
-; CHECK: getelementptr inbounds %loop_openmp.omp_subfn.omp.userContext* %omp.userContext
-; CHECK: %omp_data = bitcast %loop_openmp.omp_subfn.omp.userContext* %omp.userContext to i8*
-; CHECK: @GOMP_parallel_loop_runtime_start(void (i8*)* @loop_openmp.omp_subfn, i8* %omp_data
+; CHECK: %omp.userContext = alloca { i32, [10 x double]* }
+; CHECK: getelementptr inbounds { i32, [10 x double]* }* %omp.userContext, i32 0, i32 0
+; CHECK: store i32 %polly.loopiv, i32* %1
+; CHECK: getelementptr inbounds { i32, [10 x double]* }* %omp.userContext, i32 0, i32 1
+; CHECK: store [10 x double]* @A, [10 x double]** %2
+; CHECK: %omp_data = bitcast { i32, [10 x double]* }* %omp.userContext to i8*
+; CHECK: call void @GOMP_parallel_loop_runtime_start(void (i8*)* @loop_openmp.omp_subfn, i8* %omp_data, i32 0, i32 0, i32 10, i32 1)
 ; CHECK: call void @loop_openmp.omp_subfn(i8* %omp_data)
-; CHECK: %omp.userContext1 = bitcast i8* %omp.userContext to %loop_openmp.omp_subfn.omp.userContext*
+; CHECK: call void @GOMP_parallel_end()
+

Modified: polly/trunk/test/CodeGen/OpenMP/structnames.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/CodeGen/OpenMP/structnames.ll?rev=134980&r1=134979&r2=134980&view=diff
==============================================================================
--- polly/trunk/test/CodeGen/OpenMP/structnames.ll (original)
+++ polly/trunk/test/CodeGen/OpenMP/structnames.ll Tue Jul 12 07:42:54 2011
@@ -72,5 +72,6 @@
 
 declare void @llvm.memset.p0i8.i32(i8* nocapture, i8, i32, i32, i1) nounwind
 
-; CHECK: loop1_openmp.omp_subfn.omp.userContext
-; CHECK: loop1_openmp.omp_subfn1.omp.userContext
+; CHECK: %omp.userContext = alloca { [5 x float]*, [5 x float]* }
+; CHECK: %omp.userContext1 = alloca { i32, [5 x float]*, [5 x float]* }
+





More information about the llvm-commits mailing list