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

Tobias Grosser grosser at fim.uni-passau.de
Wed Oct 31 22:34:55 PDT 2012


Author: grosser
Date: Thu Nov  1 00:34:55 2012
New Revision: 167215

URL: http://llvm.org/viewvc/llvm-project?rev=167215&view=rev
Log:
Codegen: Selectively copy in array addresses for OpenMP code

The detection of values that need to be copied in to the generated OpenMP
subfunction also detects the array base addresses needed in the SCoP. Hence, it
is not necessary to unconditionally copy all the base addresses to the generated
function.

Test cases are modified to reflect this change. Arrays which are global
variables do not occur in the struct passed to the subfunction anymore. A test
case for base address copy-in is added in copy_in_array.{c,ll}.

Committed with slight modifications

Contributed by:  Armin Groesslinger <armin.groesslinger at uni-passau.de>

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

Modified: polly/trunk/lib/CodeGen/CodeGeneration.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/CodeGen/CodeGeneration.cpp?rev=167215&r1=167214&r2=167215&view=diff
==============================================================================
--- polly/trunk/lib/CodeGen/CodeGeneration.cpp (original)
+++ polly/trunk/lib/CodeGen/CodeGeneration.cpp Thu Nov  1 00:34:55 2012
@@ -504,16 +504,6 @@
        I != E; I++)
     Values.insert(I->second);
 
-  // The memory reference base addresses
-  for (Scop::iterator SI = S->begin(), SE = S->end(); SI != SE; ++SI) {
-    ScopStmt *Stmt = *SI;
-    for (SmallVector<MemoryAccess*, 8>::iterator I = Stmt->memacc_begin(),
-         E = Stmt->memacc_end(); I != E; ++I) {
-      Value *BaseAddr = const_cast<Value*>((*I)->getBaseAddr());
-      Values.insert((BaseAddr));
-    }
-  }
-
   // Find the temporaries that are referenced in the clast statements'
   // basic blocks but are not defined by these blocks (e.g., references
   // to function arguments or temporaries defined before the start of

Modified: polly/trunk/test/CodeGen/OpenMP/copy_in_argument.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/CodeGen/OpenMP/copy_in_argument.ll?rev=167215&r1=167214&r2=167215&view=diff
==============================================================================
--- polly/trunk/test/CodeGen/OpenMP/copy_in_argument.ll (original)
+++ polly/trunk/test/CodeGen/OpenMP/copy_in_argument.ll Thu Nov  1 00:34:55 2012
@@ -31,4 +31,4 @@
   ret void
 }
 
-; CHECK: %omp.userContext = alloca { [100 x float]*, float }
+; CHECK: %omp.userContext = alloca { float }

Modified: polly/trunk/test/CodeGen/OpenMP/copy_in_temporary.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/CodeGen/OpenMP/copy_in_temporary.ll?rev=167215&r1=167214&r2=167215&view=diff
==============================================================================
--- polly/trunk/test/CodeGen/OpenMP/copy_in_temporary.ll (original)
+++ polly/trunk/test/CodeGen/OpenMP/copy_in_temporary.ll Thu Nov  1 00:34:55 2012
@@ -32,4 +32,4 @@
   ret void
 }
 
-; CHECK: %omp.userContext = alloca { [100 x float]*, float }
+; CHECK: %omp.userContext = alloca { 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=167215&r1=167214&r2=167215&view=diff
==============================================================================
--- polly/trunk/test/CodeGen/OpenMP/simple_nested_loop.ll (original)
+++ polly/trunk/test/CodeGen/OpenMP/simple_nested_loop.ll Thu Nov  1 00:34:55 2012
@@ -55,12 +55,10 @@
 
 declare void @llvm.memset.p0i8.i32(i8* nocapture, i8, i32, i32, i1) nounwind
 
-; CHECK: %omp.userContext = alloca { i32, [10 x double]* }
-; CHECK: getelementptr inbounds { i32, [10 x double]* }* %omp.userContext, i32 0, i32 0
+; CHECK: %omp.userContext = alloca { i32 }
+; CHECK: getelementptr inbounds { i32 }* %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: %omp_data = bitcast { i32 }* %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: 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=167215&r1=167214&r2=167215&view=diff
==============================================================================
--- polly/trunk/test/CodeGen/OpenMP/structnames.ll (original)
+++ polly/trunk/test/CodeGen/OpenMP/structnames.ll Thu Nov  1 00:34:55 2012
@@ -72,6 +72,6 @@
 
 declare void @llvm.memset.p0i8.i32(i8* nocapture, i8, i32, i32, i1) nounwind
 
-; CHECK: %omp.userContext = alloca { [5 x float]*, [5 x float]* }
-; CHECK: %omp.userContext1 = alloca { i32, [5 x float]*, [5 x float]* }
+; CHECK: %omp.userContext = alloca {}
+; CHECK: %omp.userContext1 = alloca { i32 }
 





More information about the llvm-commits mailing list