[llvm-commits] [polly] r136774 - in /polly/trunk: lib/Analysis/ScopInfo.cpp lib/Exchange/JSONExporter.cpp test/CodeGen/MemAccess/memaccess_simple_analyze.ll

Raghesh Aloor raghesh.a at gmail.com
Wed Aug 3 06:47:59 PDT 2011


Author: raghesh
Date: Wed Aug  3 08:47:59 2011
New Revision: 136774

URL: http://llvm.org/viewvc/llvm-project?rev=136774&view=rev
Log:
Memaccess: Display Changed Access Relation

The changed access relations imported from JSCOP file is shown
as output of -analyze pass.


Added:
    polly/trunk/test/CodeGen/MemAccess/memaccess_simple_analyze.ll
Modified:
    polly/trunk/lib/Analysis/ScopInfo.cpp
    polly/trunk/lib/Exchange/JSONExporter.cpp

Modified: polly/trunk/lib/Analysis/ScopInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/ScopInfo.cpp?rev=136774&r1=136773&r2=136774&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/ScopInfo.cpp (original)
+++ polly/trunk/lib/Analysis/ScopInfo.cpp Wed Aug  3 08:47:59 2011
@@ -337,8 +337,8 @@
   return isl_set_is_equal(stride, strideZero);
 }
 
-void MemoryAccess::setNewAccessFunction(isl_map *newAccessRelation) {
-  newAccessRelation = newAccessRelation;
+void MemoryAccess::setNewAccessFunction(isl_map *newAccess) {
+  newAccessRelation = newAccess;
 }
 
 //===----------------------------------------------------------------------===//

Modified: polly/trunk/lib/Exchange/JSONExporter.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Exchange/JSONExporter.cpp?rev=136774&r1=136773&r2=136774&view=diff
==============================================================================
--- polly/trunk/lib/Exchange/JSONExporter.cpp (original)
+++ polly/trunk/lib/Exchange/JSONExporter.cpp Wed Aug  3 08:47:59 2011
@@ -69,6 +69,7 @@
 struct JSONImporter : public ScopPass {
   static char ID;
   Scop *S;
+  std::vector<std::string> newAccessStrings;
   explicit JSONImporter() : ScopPass(ID) {}
 
   std::string getFileName(Scop *S) const;
@@ -189,6 +190,9 @@
 
 void JSONImporter::printScop(raw_ostream &OS) const {
   S->print(OS);
+  for (std::vector<std::string>::const_iterator I = newAccessStrings.begin(),
+       E = newAccessStrings.end(); I != E; I++)
+    OS << "New access function '" << *I << "'detected in JSCOP file\n";
 }
 
 typedef Dependences::StatementToIslMapTy StatementToIslMapTy;
@@ -268,6 +272,7 @@
       if (!isl_map_is_equal(newAccessMap, currentAccessMap)) {
         // Statistics.
         ++NewAccessMapFound;
+        newAccessStrings.push_back(accesses.asCString());	
         (*MI)->setNewAccessFunction(newAccessMap);
       }
       memoryAccessIdx++;

Added: polly/trunk/test/CodeGen/MemAccess/memaccess_simple_analyze.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/CodeGen/MemAccess/memaccess_simple_analyze.ll?rev=136774&view=auto
==============================================================================
--- polly/trunk/test/CodeGen/MemAccess/memaccess_simple_analyze.ll (added)
+++ polly/trunk/test/CodeGen/MemAccess/memaccess_simple_analyze.ll Wed Aug  3 08:47:59 2011
@@ -0,0 +1,48 @@
+;RUN: opt %loadPolly -polly-import-jscop -analyze -polly-import-jscop-dir=`dirname %s` -polly-import-jscop-postfix=transformed %s | FileCheck %s
+; ModuleID = 'memaccess_simple.ll'
+target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32"
+target triple = "i386-pc-linux-gnu"
+
+ at A = common global [100 x i32] zeroinitializer, align 4
+ at B = common global [100 x i32] zeroinitializer, align 4
+
+define i32 @memaccess_simple() nounwind {
+entry:
+  br label %for.cond
+
+for.cond:                                         ; preds = %for.inc, %entry
+  %0 = phi i32 [ 0, %entry ], [ %inc, %for.inc ]
+  %arrayidx = getelementptr [100 x i32]* @A, i32 0, i32 %0
+  %exitcond1 = icmp ne i32 %0, 12
+  br i1 %exitcond1, label %for.body, label %for.end
+
+for.body:                                         ; preds = %for.cond
+  store i32 %0, i32* %arrayidx
+  br label %for.inc
+
+for.inc:                                          ; preds = %for.body
+  %inc = add nsw i32 %0, 1
+  br label %for.cond
+
+for.end:                                          ; preds = %for.cond
+  br label %for.cond4
+
+for.cond4:                                        ; preds = %for.inc11, %for.end
+  %1 = phi i32 [ 0, %for.end ], [ %inc13, %for.inc11 ]
+  %arrayidx10 = getelementptr [100 x i32]* @B, i32 0, i32 %1
+  %exitcond = icmp ne i32 %1, 12
+  br i1 %exitcond, label %for.body7, label %for.end14
+
+for.body7:                                        ; preds = %for.cond4
+  store i32 %1, i32* %arrayidx10
+  br label %for.inc11
+
+for.inc11:                                        ; preds = %for.body7
+  %inc13 = add nsw i32 %1, 1
+  br label %for.cond4
+
+for.end14:                                        ; preds = %for.cond4
+  ret i32 0
+}
+; CHECK: New access function '{ Stmt_for_body7[i0] -> MemRef_B[0] }'detected in JSCOP file
+; CHECK: New access function '{ Stmt_for_body[i0] -> MemRef_A[0] }'detected in JSCOP file





More information about the llvm-commits mailing list