[polly] r248485 - Remove Analysis Output of TempScopInfo

Michael Kruse via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 24 04:41:21 PDT 2015


Author: meinersbur
Date: Thu Sep 24 06:41:21 2015
New Revision: 248485

URL: http://llvm.org/viewvc/llvm-project?rev=248485&view=rev
Log:
Remove Analysis Output of TempScopInfo

After the merge of TempScopInfo into ScopInfo the analysis output 
remained because of the existing unit tests. These remains are removed 
and the units tests converted to match the equivalent output of 
ScopInfo's analysis output. The unit tests are also moved into the
directory of ScopInfo tests.

Differential Revision: http://reviews.llvm.org/D13116

Added:
    polly/trunk/test/ScopInfo/inter_bb_scalar_dep.ll
      - copied, changed from r248484, polly/trunk/test/TempScop/inter_bb_scalar_dep.ll
    polly/trunk/test/ScopInfo/intra_and_inter_bb_scalar_dep.ll
      - copied, changed from r248484, polly/trunk/test/TempScop/intra_and_inter_bb_scalar_dep.ll
    polly/trunk/test/ScopInfo/intra_bb_scalar_dep.ll
      - copied, changed from r248484, polly/trunk/test/TempScop/intra_bb_scalar_dep.ll
    polly/trunk/test/ScopInfo/nested-loops.ll
      - copied unchanged from r248484, polly/trunk/test/TempScop/nested-loops.ll
    polly/trunk/test/ScopInfo/not-a-reduction.ll
      - copied unchanged from r248484, polly/trunk/test/TempScop/not-a-reduction.ll
    polly/trunk/test/ScopInfo/scalar_to_array.ll
      - copied, changed from r248484, polly/trunk/test/TempScop/scalar_to_array.ll
    polly/trunk/test/ScopInfo/tempscop-printing.ll
      - copied, changed from r248484, polly/trunk/test/TempScop/tempscop-printing.ll
Removed:
    polly/trunk/test/TempScop/
Modified:
    polly/trunk/include/polly/ScopInfo.h
    polly/trunk/lib/Analysis/ScopInfo.cpp
    polly/trunk/test/ScopInfo/cond_in_loop.ll

Modified: polly/trunk/include/polly/ScopInfo.h
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/include/polly/ScopInfo.h?rev=248485&r1=248484&r2=248485&view=diff
==============================================================================
--- polly/trunk/include/polly/ScopInfo.h (original)
+++ polly/trunk/include/polly/ScopInfo.h Thu Sep 24 06:41:21 2015
@@ -333,11 +333,6 @@ private:
   ///
   Value *AccessValue;
 
-  /// @brief Accessed element relative to the base pointer (in bytes).
-  ///
-  /// Currently only used by printIR.
-  const SCEV *Offset;
-
   /// @brief Are all the subscripts affine expression?
   bool IsAffine;
 
@@ -358,8 +353,6 @@ private:
   /// @brief Is this MemoryAccess modeling special PHI node accesses?
   bool isPHI() const { return IsPHI; }
 
-  void printIR(raw_ostream &OS) const;
-
   void setStatement(ScopStmt *Stmt) { this->Statement = Stmt; }
 
   __isl_give isl_basic_map *createBasicAccessMap(ScopStmt *Statement);
@@ -426,7 +419,6 @@ public:
   /// @param Id         Identifier that is guranteed to be unique within the
   ///                   same ScopStmt.
   /// @param BaseAddr   The accessed array's address.
-  /// @param Offset     Accessed memoray location relative to @p BaseAddr.
   /// @param ElemBytes  Number of accessed bytes.
   /// @param AccType    Whether read or write access.
   /// @param IsAffine   Whether the subscripts are affine expressions.
@@ -435,10 +427,9 @@ public:
   /// @param Sizes      Dimension lengths of the accessed array.
   /// @param BaseName   Name of the acessed array.
   MemoryAccess(Instruction *AccessInst, __isl_take isl_id *Id, AccessType Type,
-               Value *BaseAddress, const SCEV *Offset, unsigned ElemBytes,
-               bool Affine, ArrayRef<const SCEV *> Subscripts,
-               ArrayRef<const SCEV *> Sizes, Value *AccessValue, bool IsPHI,
-               StringRef BaseName);
+               Value *BaseAddress, unsigned ElemBytes, bool Affine,
+               ArrayRef<const SCEV *> Subscripts, ArrayRef<const SCEV *> Sizes,
+               Value *AccessValue, bool IsPHI, StringRef BaseName);
   ~MemoryAccess();
 
   /// @brief Get the type of a memory access.
@@ -1120,22 +1111,6 @@ public:
   }
   //@}
 
-  /// @brief Print data access information.
-  ///
-  /// @param OS The output stream the access functions is printed to.
-  /// @param SE The ScalarEvolution to help printing more details.
-  /// @param LI The LoopInfo that help printing the access functions.
-  void printIRAccesses(raw_ostream &OS, ScalarEvolution *SE,
-                       LoopInfo *LI) const;
-
-  /// @brief Print the access functions and loop bounds in this Scop.
-  ///
-  /// @param OS The output stream the access functions is printed to.
-  /// @param SE The ScalarEvolution that help printing the access functions.
-  /// @param LI The LoopInfo that help printing the access functions.
-  void printIRAccessesDetail(raw_ostream &OS, ScalarEvolution *SE, LoopInfo *LI,
-                             const Region *Reg, unsigned ind) const;
-
   ScalarEvolution *getSE() const;
 
   /// @brief Get the count of parameters used in this Scop.
@@ -1503,7 +1478,6 @@ class ScopInfo : public RegionPass {
   ///                    inside @p BB.
   /// @param Type        The kind of access.
   /// @param BaseAddress The accessed array's base address.
-  /// @param Offset      Accessed location relative to @p BaseAddress.
   /// @param ElemBytes   Size of accessed array element.
   /// @param Affine      Whether all subscripts are affine expressions.
   /// @param AccessValue Value read or written.
@@ -1512,26 +1486,25 @@ class ScopInfo : public RegionPass {
   /// @param IsPHI       Whether this is an emulated PHI node.
   void addMemoryAccess(BasicBlock *BB, Instruction *Inst,
                        MemoryAccess::AccessType Type, Value *BaseAddress,
-                       const SCEV *Offset, unsigned ElemBytes, bool Affine,
-                       Value *AccessValue, ArrayRef<const SCEV *> Subscripts,
+                       unsigned ElemBytes, bool Affine, Value *AccessValue,
+                       ArrayRef<const SCEV *> Subscripts,
                        ArrayRef<const SCEV *> Sizes, bool IsPHI);
 
   void addMemoryAccess(BasicBlock *BB, Instruction *Inst,
                        MemoryAccess::AccessType Type, Value *BaseAddress,
-                       const SCEV *Offset, unsigned ElemBytes, bool Affine,
-                       Value *AccessValue, bool IsPHI = false) {
-    addMemoryAccess(BB, Inst, Type, BaseAddress, Offset, ElemBytes, Affine,
-                    AccessValue, ArrayRef<const SCEV *>(),
-                    ArrayRef<const SCEV *>(), IsPHI);
+                       unsigned ElemBytes, bool Affine, Value *AccessValue,
+                       bool IsPHI = false) {
+    addMemoryAccess(BB, Inst, Type, BaseAddress, ElemBytes, Affine, AccessValue,
+                    ArrayRef<const SCEV *>(), ArrayRef<const SCEV *>(), IsPHI);
   }
 
   void addMemoryAccess(BasicBlock *BB, Instruction *Inst,
                        MemoryAccess::AccessType Type, Value *BaseAddress,
-                       const SCEV *Offset, unsigned ElemBytes, bool Affine,
+                       unsigned ElemBytes, bool Affine,
                        ArrayRef<const SCEV *> Subscripts,
                        ArrayRef<const SCEV *> Sizes, Value *AccessValue) {
-    addMemoryAccess(BB, Inst, Type, BaseAddress, Offset, ElemBytes, Affine,
-                    AccessValue, Subscripts, Sizes, false);
+    addMemoryAccess(BB, Inst, Type, BaseAddress, ElemBytes, Affine, AccessValue,
+                    Subscripts, Sizes, false);
   }
 
 public:

Modified: polly/trunk/lib/Analysis/ScopInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/ScopInfo.cpp?rev=248485&r1=248484&r2=248485&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/ScopInfo.cpp (original)
+++ polly/trunk/lib/Analysis/ScopInfo.cpp Thu Sep 24 06:41:21 2015
@@ -227,17 +227,6 @@ const ScopArrayInfo *ScopArrayInfo::getF
   return SAI;
 }
 
-void MemoryAccess::printIR(raw_ostream &OS) const {
-  if (isRead())
-    OS << "Read ";
-  else {
-    if (isMayWrite())
-      OS << "May";
-    OS << "Write ";
-  }
-  OS << BaseAddr->getName() << '[' << *Offset << "]\n";
-}
-
 const std::string
 MemoryAccess::getReductionOperatorStr(MemoryAccess::ReductionType RT) {
   switch (RT) {
@@ -614,14 +603,14 @@ void MemoryAccess::buildAccessRelation(c
 
 MemoryAccess::MemoryAccess(Instruction *AccessInst, __isl_take isl_id *Id,
                            AccessType Type, Value *BaseAddress,
-                           const SCEV *Offset, unsigned ElemBytes, bool Affine,
+                           unsigned ElemBytes, bool Affine,
                            ArrayRef<const SCEV *> Subscripts,
                            ArrayRef<const SCEV *> Sizes, Value *AccessValue,
                            bool IsPHI, StringRef BaseName)
     : Id(Id), IsPHI(IsPHI), AccType(Type), RedType(RT_NONE), Statement(nullptr),
       BaseAddr(BaseAddress), BaseName(BaseName), ElemBytes(ElemBytes),
       Sizes(Sizes.begin(), Sizes.end()), AccessInstruction(AccessInst),
-      AccessValue(AccessValue), Offset(Offset), IsAffine(Affine),
+      AccessValue(AccessValue), IsAffine(Affine),
       Subscripts(Subscripts.begin(), Subscripts.end()), AccessRelation(nullptr),
       NewAccessRelation(nullptr) {}
 
@@ -2668,34 +2657,6 @@ ScopStmt *Scop::getStmtForBasicBlock(Bas
   return StmtMapIt->second;
 }
 
-void Scop::printIRAccesses(raw_ostream &OS, ScalarEvolution *SE,
-                           LoopInfo *LI) const {
-  OS << "Scop: " << R.getNameStr() << "\n";
-
-  printIRAccessesDetail(OS, SE, LI, &R, 0);
-}
-
-void Scop::printIRAccessesDetail(raw_ostream &OS, ScalarEvolution *SE,
-                                 LoopInfo *LI, const Region *CurR,
-                                 unsigned ind) const {
-  // FIXME: Print other details rather than memory accesses.
-  for (const auto &CurBlock : CurR->blocks()) {
-    AccFuncMapType::const_iterator AccSetIt = AccFuncMap.find(CurBlock);
-
-    // Ignore trivial blocks that do not contain any memory access.
-    if (AccSetIt == AccFuncMap.end())
-      continue;
-
-    OS.indent(ind) << "BB: " << CurBlock->getName() << '\n';
-    typedef AccFuncSetType::const_iterator access_iterator;
-    const AccFuncSetType &AccFuncs = AccSetIt->second;
-
-    for (access_iterator AI = AccFuncs.begin(), AE = AccFuncs.end(); AI != AE;
-         ++AI)
-      AI->printIR(OS.indent(ind + 2));
-  }
-}
-
 int Scop::getRelativeLoopDepth(const Loop *L) const {
   Loop *OuterLoop =
       L ? R.outermostLoopInRegion(const_cast<Loop *>(L)) : nullptr;
@@ -2742,10 +2703,9 @@ void ScopInfo::buildPHIAccesses(PHINode
       // we have to insert a scalar dependence from the definition of OpI to
       // OpBB if the definition is not in OpBB.
       if (OpIBB != OpBB) {
-        addMemoryAccess(OpBB, PHI, MemoryAccess::READ, OpI, ZeroOffset, 1, true,
+        addMemoryAccess(OpBB, PHI, MemoryAccess::READ, OpI, 1, true, OpI);
+        addMemoryAccess(OpIBB, OpI, MemoryAccess::MUST_WRITE, OpI, 1, true,
                         OpI);
-        addMemoryAccess(OpIBB, OpI, MemoryAccess::MUST_WRITE, OpI, ZeroOffset,
-                        1, true, OpI);
       }
     }
 
@@ -2753,13 +2713,13 @@ void ScopInfo::buildPHIAccesses(PHINode
     // instruction.
     OpI = OpBB->getTerminator();
 
-    addMemoryAccess(OpBB, OpI, MemoryAccess::MUST_WRITE, PHI, ZeroOffset, 1,
-                    true, Op, /* IsPHI */ !IsExitBlock);
+    addMemoryAccess(OpBB, OpI, MemoryAccess::MUST_WRITE, PHI, 1, true, Op,
+                    /* IsPHI */ !IsExitBlock);
   }
 
   if (!OnlyNonAffineSubRegionOperands) {
-    addMemoryAccess(PHI->getParent(), PHI, MemoryAccess::READ, PHI, ZeroOffset,
-                    1, true, PHI,
+    addMemoryAccess(PHI->getParent(), PHI, MemoryAccess::READ, PHI, 1, true,
+                    PHI,
                     /* IsPHI */ !IsExitBlock);
   }
 }
@@ -2816,8 +2776,7 @@ bool ScopInfo::buildScalarDependences(In
     // Do not build a read access that is not in the current SCoP
     // Use the def instruction as base address of the MemoryAccess, so that it
     // will become the name of the scalar access in the polyhedral form.
-    addMemoryAccess(UseParent, UI, MemoryAccess::READ, Inst, ZeroOffset, 1,
-                    true, Inst);
+    addMemoryAccess(UseParent, UI, MemoryAccess::READ, Inst, 1, true, Inst);
   }
 
   if (ModelReadOnlyScalars) {
@@ -2832,8 +2791,8 @@ bool ScopInfo::buildScalarDependences(In
       if (isa<Constant>(Op))
         continue;
 
-      addMemoryAccess(Inst->getParent(), Inst, MemoryAccess::READ, Op,
-                      ZeroOffset, 1, true, Op);
+      addMemoryAccess(Inst->getParent(), Inst, MemoryAccess::READ, Op, 1, true,
+                      Op);
     }
   }
 
@@ -2905,7 +2864,7 @@ void ScopInfo::buildMemoryAccess(
             IntegerType::getInt64Ty(BasePtr->getContext()), Size)));
 
         addMemoryAccess(Inst->getParent(), Inst, Type, BasePointer->getValue(),
-                        AccessFunction, Size, true, Subscripts, SizesSCEV, Val);
+                        Size, true, Subscripts, SizesSCEV, Val);
         return;
       }
     }
@@ -2914,8 +2873,7 @@ void ScopInfo::buildMemoryAccess(
   auto AccItr = InsnToMemAcc.find(Inst);
   if (PollyDelinearize && AccItr != InsnToMemAcc.end()) {
     addMemoryAccess(Inst->getParent(), Inst, Type, BasePointer->getValue(),
-                    AccessFunction, Size, true,
-                    AccItr->second.DelinearizedSubscripts,
+                    Size, true, AccItr->second.DelinearizedSubscripts,
                     AccItr->second.Shape->DelinearizedSizes, Val);
     return;
   }
@@ -2940,8 +2898,8 @@ void ScopInfo::buildMemoryAccess(
   if (!IsAffine && Type == MemoryAccess::MUST_WRITE)
     Type = MemoryAccess::MAY_WRITE;
 
-  addMemoryAccess(Inst->getParent(), Inst, Type, BasePointer->getValue(),
-                  AccessFunction, Size, IsAffine, Subscripts, Sizes, Val);
+  addMemoryAccess(Inst->getParent(), Inst, Type, BasePointer->getValue(), Size,
+                  IsAffine, Subscripts, Sizes, Val);
 }
 
 void ScopInfo::buildAccessFunctions(Region &R, Region &SR) {
@@ -2986,17 +2944,19 @@ void ScopInfo::buildAccessFunctions(Regi
 
     if (buildScalarDependences(Inst, &R, NonAffineSubRegion)) {
       if (!isa<StoreInst>(Inst))
-        addMemoryAccess(&BB, Inst, MemoryAccess::MUST_WRITE, Inst, ZeroOffset,
-                        1, true, Inst);
+        addMemoryAccess(&BB, Inst, MemoryAccess::MUST_WRITE, Inst, 1, true,
+                        Inst);
     }
   }
 }
 
-void ScopInfo::addMemoryAccess(
-    BasicBlock *BB, Instruction *Inst, MemoryAccess::AccessType Type,
-    Value *BaseAddress, const SCEV *Offset, unsigned ElemBytes, bool Affine,
-    Value *AccessValue, ArrayRef<const SCEV *> Subscripts,
-    ArrayRef<const SCEV *> Sizes, bool IsPHI = false) {
+void ScopInfo::addMemoryAccess(BasicBlock *BB, Instruction *Inst,
+                               MemoryAccess::AccessType Type,
+                               Value *BaseAddress, unsigned ElemBytes,
+                               bool Affine, Value *AccessValue,
+                               ArrayRef<const SCEV *> Subscripts,
+                               ArrayRef<const SCEV *> Sizes,
+                               bool IsPHI = false) {
   AccFuncSetType &AccList = AccFuncMap[BB];
   size_t Identifier = AccList.size();
 
@@ -3006,7 +2966,7 @@ void ScopInfo::addMemoryAccess(
   std::string IdName = "__polly_array_ref_" + std::to_string(Identifier);
   isl_id *Id = isl_id_alloc(ctx, IdName.c_str(), nullptr);
 
-  AccList.emplace_back(Inst, Id, Type, BaseAddress, Offset, ElemBytes, Affine,
+  AccList.emplace_back(Inst, Id, Type, BaseAddress, ElemBytes, Affine,
                        Subscripts, Sizes, AccessValue, IsPHI, BaseName);
 }
 
@@ -3036,7 +2996,6 @@ void ScopInfo::print(raw_ostream &OS, co
     return;
   }
 
-  scop->printIRAccesses(OS, SE, LI);
   scop->print(OS);
 }
 

Modified: polly/trunk/test/ScopInfo/cond_in_loop.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/ScopInfo/cond_in_loop.ll?rev=248485&r1=248484&r2=248485&view=diff
==============================================================================
--- polly/trunk/test/ScopInfo/cond_in_loop.ll (original)
+++ polly/trunk/test/ScopInfo/cond_in_loop.ll Thu Sep 24 06:41:21 2015
@@ -45,4 +45,5 @@ return:
 }
 
 ; CHECK-LABEL: Printing analysis 'Polly - Create polyhedral description of Scops' for region: 'bb => return' in function 'f':
-; CHECK-NEXT:  Scop: bb => return
+; CHECK-NEXT:      Function: f
+; CHECK-NEXT:      Region: %bb---%return

Copied: polly/trunk/test/ScopInfo/inter_bb_scalar_dep.ll (from r248484, polly/trunk/test/TempScop/inter_bb_scalar_dep.ll)
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/ScopInfo/inter_bb_scalar_dep.ll?p2=polly/trunk/test/ScopInfo/inter_bb_scalar_dep.ll&p1=polly/trunk/test/TempScop/inter_bb_scalar_dep.ll&r1=248484&r2=248485&rev=248485&view=diff
==============================================================================
--- polly/trunk/test/TempScop/inter_bb_scalar_dep.ll (original)
+++ polly/trunk/test/ScopInfo/inter_bb_scalar_dep.ll Thu Sep 24 06:41:21 2015
@@ -25,16 +25,21 @@ for.i:
 
 entry.next:                                       ; preds = %for.i
   %init = load i64, i64* %init_ptr
-; CHECK: BB: entry.next
-; CHECK: Read init_ptr[0]
-; CHECK: Write init[0]
+; CHECK-LABEL: Stmt_entry_next
+; CHECK:           ReadAccess :=       [Reduction Type: NONE] [Scalar: 0]
+; CHECK-NEXT:          [N] -> { Stmt_entry_next[i0] -> MemRef_init_ptr[0] };
+; CHECK:           MustWriteAccess :=  [Reduction Type: NONE] [Scalar: 1]
+; CHECK-NEXT:          [N] -> { Stmt_entry_next[i0] -> MemRef_init[] };
   br label %for.j
 
 for.j:                                            ; preds = %for.j, %entry.next
   %indvar.j = phi i64 [ 0, %entry.next ], [ %indvar.j.next, %for.j ]
   %init_plus_two = add i64 %init, 2
-; CHECK: Read init[0]
-; CHECK: Write A[{0,+,8}<%for.j>]
+; CHECK-LABEL: Stmt_for_j
+; CHECK:           ReadAccess :=       [Reduction Type: NONE] [Scalar: 1]
+; CHECK-NEXT:          [N] -> { Stmt_for_j[i0, i1] -> MemRef_init[] };
+; CHECK:           MustWriteAccess :=  [Reduction Type: NONE] [Scalar: 0]
+; CHECK-NEXT:          [N] -> { Stmt_for_j[i0, i1] -> MemRef_A[i1] };
   %scevgep = getelementptr i64, i64* %A, i64 %indvar.j
   store i64 %init_plus_two, i64* %scevgep
   %indvar.j.next = add nsw i64 %indvar.j, 1

Copied: polly/trunk/test/ScopInfo/intra_and_inter_bb_scalar_dep.ll (from r248484, polly/trunk/test/TempScop/intra_and_inter_bb_scalar_dep.ll)
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/ScopInfo/intra_and_inter_bb_scalar_dep.ll?p2=polly/trunk/test/ScopInfo/intra_and_inter_bb_scalar_dep.ll&p1=polly/trunk/test/TempScop/intra_and_inter_bb_scalar_dep.ll&r1=248484&r2=248485&rev=248485&view=diff
==============================================================================
--- polly/trunk/test/TempScop/intra_and_inter_bb_scalar_dep.ll (original)
+++ polly/trunk/test/ScopInfo/intra_and_inter_bb_scalar_dep.ll Thu Sep 24 06:41:21 2015
@@ -26,19 +26,24 @@ for.i:
 
 entry.next:                                       ; preds = %for.i
   %init = load i64, i64* %init_ptr
-; CHECK: BB: entry.next
-; CHECK: Read init_ptr[0]
-; CHECK: Write init[0]
+; CHECK-LABEL: Stmt_entry_next
+; CHECK:           ReadAccess :=       [Reduction Type: NONE] [Scalar: 0]
+; CHECK-NEXT:          [N] -> { Stmt_entry_next[i0] -> MemRef_init_ptr[0] };
+; CHECK:           MustWriteAccess :=  [Reduction Type: NONE] [Scalar: 1]
+; CHECK-NEXT:          [N] -> { Stmt_entry_next[i0] -> MemRef_init[] };
   br label %for.j
 
 for.j:                                            ; preds = %for.j, %entry.next
   %indvar.j = phi i64 [ 0, %entry.next ], [ %indvar.j.next, %for.j ]
   %init_2 = load i64, i64* %init_ptr
   %init_sum = add i64 %init, %init_2
-; CHECK: BB: for.j
-; CHECK: Read init[0]
-; CHECK: Read init_ptr[0]
-; CHECK: Write A[{0,+,8}<%for.j>]
+; CHECK-LABEL: Stmt_for_j
+; CHECK:           ReadAccess :=       [Reduction Type: NONE] [Scalar: 1]
+; CHECK-NEXT:          [N] -> { Stmt_for_j[i0, i1] -> MemRef_init[] };
+; CHECK:           ReadAccess :=       [Reduction Type: NONE] [Scalar: 0]
+; CHECK-NEXT:          [N] -> { Stmt_for_j[i0, i1] -> MemRef_init_ptr[0] };
+; CHECK:           MustWriteAccess :=  [Reduction Type: NONE] [Scalar: 0]
+; CHECK-NEXT:          [N] -> { Stmt_for_j[i0, i1] -> MemRef_A[i1] };
   %scevgep = getelementptr i64, i64* %A, i64 %indvar.j
   store i64 %init_sum, i64* %scevgep
   %indvar.j.next = add nsw i64 %indvar.j, 1

Copied: polly/trunk/test/ScopInfo/intra_bb_scalar_dep.ll (from r248484, polly/trunk/test/TempScop/intra_bb_scalar_dep.ll)
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/ScopInfo/intra_bb_scalar_dep.ll?p2=polly/trunk/test/ScopInfo/intra_bb_scalar_dep.ll&p1=polly/trunk/test/TempScop/intra_bb_scalar_dep.ll&r1=248484&r2=248485&rev=248485&view=diff
==============================================================================
--- polly/trunk/test/TempScop/intra_bb_scalar_dep.ll (original)
+++ polly/trunk/test/ScopInfo/intra_bb_scalar_dep.ll Thu Sep 24 06:41:21 2015
@@ -32,9 +32,11 @@ for.j:
   %init_plus_two = add i64 %init, 2
   %scevgep = getelementptr i64, i64* %A, i64 %indvar.j
   store i64 %init_plus_two, i64* %scevgep
-; CHECK: BB: for.j
-; CHECK: Read init_ptr[0]
-; CHECK: Write A[{0,+,8}<%for.j>]
+; CHECK-LABEL: Stmt_for_j
+; CHECK:           ReadAccess :=       [Reduction Type: NONE] [Scalar: 0]
+; CHECK-NEXT:          [N] -> { Stmt_for_j[i0, i1] -> MemRef_init_ptr[0] };
+; CHECK:           MustWriteAccess :=  [Reduction Type: NONE] [Scalar: 0]
+; CHECK-NEXT:          [N] -> { Stmt_for_j[i0, i1] -> MemRef_A[i1] };
   %indvar.j.next = add nsw i64 %indvar.j, 1
   %exitcond.j = icmp eq i64 %indvar.j.next, %N
   br i1 %exitcond.j, label %for.i.end, label %for.j

Copied: polly/trunk/test/ScopInfo/scalar_to_array.ll (from r248484, polly/trunk/test/TempScop/scalar_to_array.ll)
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/ScopInfo/scalar_to_array.ll?p2=polly/trunk/test/ScopInfo/scalar_to_array.ll&p1=polly/trunk/test/TempScop/scalar_to_array.ll&r1=248484&r2=248485&rev=248485&view=diff
==============================================================================
--- polly/trunk/test/TempScop/scalar_to_array.ll (original)
+++ polly/trunk/test/ScopInfo/scalar_to_array.ll Thu Sep 24 06:41:21 2015
@@ -5,7 +5,9 @@ target datalayout = "e-p:64:64:64-i1:8:8
 
 @A = common global [1024 x float] zeroinitializer, align 8
 
-; CHECK: empty
+; Terminating loops without side-effects will be optimzied away, hence
+; detecting a scop would be pointless.
+; CHECK-NOT: Function: empty
 ; Function Attrs: nounwind
 define i32 @empty() #0 {
 entry:
@@ -29,7 +31,7 @@ return:
   ret i32 0
 }
 
-; CHECK: array_access
+; CHECK-LABEL: Function: array_access
 ; Function Attrs: nounwind
 define i32 @array_access() #0 {
 entry:
@@ -46,9 +48,10 @@ for.body:
   %float = uitofp i64 %indvar to float
   store float %float, float* %arrayidx
   br label %for.inc
-; CHECK: BB: for.body
-; CHECK-NOT: Read
-; CHECK: Write A[{0,+,4}<%for.cond>]
+; CHECK:     Stmt_for_body
+; CHECK-NOT:     ReadAccess
+; CHECK:         MustWriteAccess :=  [Reduction Type: NONE] [Scalar: 0]
+; CHECK-NEXT:        { Stmt_for_body[i0] -> MemRef_A[i0] };
 
 for.inc:                                          ; preds = %for.body
   %indvar.next = add i64 %indvar, 1
@@ -60,7 +63,7 @@ return:
 }
 
 ; Function Attrs: nounwind
-; CHECK: intra_scop_dep
+; CHECK-LABEL: Function: intra_scop_dep
 define i32 @intra_scop_dep() #0 {
 entry:
   fence seq_cst
@@ -75,9 +78,11 @@ for.body.a:
   %arrayidx = getelementptr [1024 x float], [1024 x float]* @A, i64 0, i64 %indvar
   %scalar = load float, float* %arrayidx
   br label %for.body.b
-; CHECK: BB: for.body.a
-; CHECK: Read A[{0,+,4}<%for.cond>]
-; CHECK: Write scalar[0]
+; CHECK:      Stmt_for_body_a
+; CHECK:          ReadAccess :=       [Reduction Type: NONE] [Scalar: 0]
+; CHECK-NEXT:         { Stmt_for_body_a[i0] -> MemRef_A[i0] };
+; CHECK:          MustWriteAccess :=  [Reduction Type: NONE] [Scalar: 1]
+; CHECK-NEXT:         { Stmt_for_body_a[i0] -> MemRef_scalar[] };
 
 for.body.b:                                       ; preds = %for.body.a
   %arrayidx2 = getelementptr [1024 x float], [1024 x float]* @A, i64 0, i64 %indvar
@@ -85,9 +90,11 @@ for.body.b:
   %sum = fadd float %scalar, %float
   store float %sum, float* %arrayidx2
   br label %for.inc
-; CHECK: BB: for.body.b
-; CHECK: Read scalar[0]
-; CHECK: Write A[{0,+,4}<%for.cond>]
+; CHECK:      Stmt_for_body_b
+; CHECK:          ReadAccess :=       [Reduction Type: NONE] [Scalar: 1]
+; CHECK-NEXT:          { Stmt_for_body_b[i0] -> MemRef_scalar[] };
+; CHECK:          MustWriteAccess :=  [Reduction Type: NONE] [Scalar: 0]
+; CHECK-NEXT:         { Stmt_for_body_b[i0] -> MemRef_A[i0] };
 
 for.inc:                                          ; preds = %for.body.b
   %indvar.next = add i64 %indvar, 1
@@ -104,7 +111,7 @@ return:
 ; Please note that this is still required when scalar to array rewritting is
 ; disabled.
 
-; CHECK: use_after_scop
+; CHECK-LABEL: Function: use_after_scop
 ; Function Attrs: nounwind
 define i32 @use_after_scop() #0 {
 entry:
@@ -121,9 +128,11 @@ for.body:
   %scalar = load float, float* %arrayidx
   store float %scalar, float* %scalar.s2a
 ; Escaped uses are still required to be rewritten to stack variable.
-; CHECK: BB: for.body
-; CHECK: Read A[{0,+,4}<%for.head>]
-; CHECK: Write scalar.s2a[0]
+; CHECK:      Stmt_for_body
+; CHECK:          ReadAccess :=       [Reduction Type: NONE] [Scalar: 0]
+; CHECK-NEXT:         { Stmt_for_body[i0] -> MemRef_A[i0] };
+; CHECK:          MustWriteAccess :=  [Reduction Type: NONE] [Scalar: 0]
+; CHECK-NEXT:         { Stmt_for_body[i0] -> MemRef_scalar_s2a[0] };
   br label %for.inc
 
 for.inc:                                          ; preds = %for.body
@@ -149,7 +158,7 @@ return:
 ;  o For integer values, such a translation may block the use of scalar
 ;    evolution on those values.
 ;
-; CHECK: before_scop
+; CHECK-LABEL: Function: before_scop
 ; Function Attrs: nounwind
 define i32 @before_scop() #0 {
 entry:
@@ -169,8 +178,9 @@ for.body:
   %arrayidx = getelementptr [1024 x float], [1024 x float]* @A, i64 0, i64 %indvar
   store float %scalar, float* %arrayidx
   br label %for.inc
-; CHECK: BB: for.body
-; CHECK: Write A[{0,+,4}<%for.cond>]
+; CHECK:      Stmt_for_body
+; CHECK:          MustWriteAccess :=  [Reduction Type: NONE] [Scalar: 0]
+; CHECK-NEXT:         { Stmt_for_body[i0] -> MemRef_A[i0] };
 
 for.inc:                                          ; preds = %for.body
   %indvar.next = add i64 %indvar, 1

Copied: polly/trunk/test/ScopInfo/tempscop-printing.ll (from r248484, polly/trunk/test/TempScop/tempscop-printing.ll)
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/ScopInfo/tempscop-printing.ll?p2=polly/trunk/test/ScopInfo/tempscop-printing.ll&p1=polly/trunk/test/TempScop/tempscop-printing.ll&r1=248484&r2=248485&rev=248485&view=diff
==============================================================================
--- polly/trunk/test/TempScop/tempscop-printing.ll (original)
+++ polly/trunk/test/ScopInfo/tempscop-printing.ll Thu Sep 24 06:41:21 2015
@@ -1,4 +1,4 @@
-; RUN: opt %loadPolly -polly-detect-unprofitable -basicaa -polly-scops -analyze < %s | FileCheck %s -check-prefix=SCALARACCESS
+; RUN: opt %loadPolly -polly-detect-unprofitable -basicaa -polly-scops -analyze < %s | FileCheck %s
 
 ; void f(long A[], int N, int *init_ptr) {
 ;   long i, j;
@@ -13,6 +13,7 @@
 
 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128"
 
+; CHECK-LABEL: Function: f
 define void @f(i64* noalias %A, i64 %N, i64* noalias %init_ptr) nounwind {
 entry:
   br label %for.i
@@ -23,17 +24,21 @@ for.i:
   br label %entry.next
 
 entry.next:
-; SCALARACCESS: BB: entry.next
+; CHECK:      Stmt_entry_next
   %init = load i64, i64* %init_ptr
-; SCALARACCESS: Read init_ptr[0]
-; SCALARACCESS:  Write init[0]
+; CHECK:          ReadAccess :=       [Reduction Type: NONE] [Scalar: 0]
+; CHECK-NEXT:         [N] -> { Stmt_entry_next[i0] -> MemRef_init_ptr[0] };
+; CHECK:          MustWriteAccess :=  [Reduction Type: NONE] [Scalar: 1]
+; CHECK-NEXT:         [N] -> { Stmt_entry_next[i0] -> MemRef_init[] };
   br label %for.j
 
 for.j:
   %indvar.j = phi i64 [ 0, %entry.next ], [ %indvar.j.next, %for.j ]
-; SCALARACCESS: BB: for.j
-; SCALARACCESS: Read init
-; SCALARACCESS: Write A[{0,+,8}<%for.j>]
+; CHECK:      Stmt_for_j
+; CHECK:          ReadAccess :=       [Reduction Type: NONE] [Scalar: 1]
+; CHECK-NEXT:         [N] -> { Stmt_for_j[i0, i1] -> MemRef_init[] };
+; CHECK:          MustWriteAccess :=  [Reduction Type: NONE] [Scalar: 0]
+; CHECK-NEXT:         [N] -> { Stmt_for_j[i0, i1] -> MemRef_A[i1] };
   %init_plus_two = add i64 %init, 2
   %scevgep = getelementptr i64, i64* %A, i64 %indvar.j
   store i64 %init_plus_two, i64* %scevgep
@@ -49,6 +54,7 @@ return:
   ret void
 }
 
+; CHECK-LABEL: Function: g
 define void @g(i64* noalias %A, i64 %N, i64* noalias %init_ptr) nounwind {
 entry:
   br label %for.i
@@ -59,19 +65,23 @@ for.i:
   br label %entry.next
 
 entry.next:
-; SCALARACCESS: BB: entry.next
+; CHECK:      Stmt_entry_next
   %init = load i64, i64* %init_ptr
-; SCALARACCESS: Read init_ptr[0]
-; SCALARACCESS:  Write init[0]
+; CHECK:          ReadAccess :=       [Reduction Type: NONE] [Scalar: 0]
+; CHECK-NEXT:         [N] -> { Stmt_entry_next[i0] -> MemRef_init_ptr[0] };
+; CHECK:          MustWriteAccess :=  [Reduction Type: NONE] [Scalar: 1]
+; CHECK-NEXT:         [N] -> { Stmt_entry_next[i0] -> MemRef_init[] };
   br label %for.j
 
 for.j:
-; SCALARACCESS: BB: for.j
+; CHECK:      Stmt_for_j
   %indvar.j = phi i64 [ 0, %entry.next ], [ %indvar.j.next, %for.j ]
   %scevgep = getelementptr i64, i64* %A, i64 %indvar.j
   store i64 %init, i64* %scevgep
-; SCALARACCESS: Read init
-; SCALARACCESS: Write A[{0,+,8}<%for.j>]
+; CHECK:          ReadAccess :=       [Reduction Type: NONE] [Scalar: 1]
+; CHECK-NEXT:         [N] -> { Stmt_for_j[i0, i1] -> MemRef_init[] };
+; CHECK:          MustWriteAccess :=  [Reduction Type: NONE] [Scalar: 0]
+; CHECK-NEXT:         [N] -> { Stmt_for_j[i0, i1] -> MemRef_A[i1] };
   %indvar.j.next = add nsw i64 %indvar.j, 1
   %exitcond.j = icmp eq i64 %indvar.j.next, %N
   br i1 %exitcond.j, label %for.i.end, label %for.j




More information about the llvm-commits mailing list