[polly] r244606 - Revise the simplification of regions

Michael Kruse via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 11 07:39:21 PDT 2015


Author: meinersbur
Date: Tue Aug 11 09:39:21 2015
New Revision: 244606

URL: http://llvm.org/viewvc/llvm-project?rev=244606&view=rev
Log:
Revise the simplification of regions

The previous code had several problems:

For newly created BasicBlocks it did not (always) call RegionInfo::setRegionFor in order to update its analysis. At the moment RegionInfo does not verify its BBMap, but will in the future. This is fixed by determining the region new BBs belong to and set it accordingly. The new executeScopConditionally() requires accurate getRegionFor information. 

Which block is created by SplitEdge depends on the incoming and outgoing edges of the blocks it connects, which makes handling its output more difficult than it needs to be. Especially for finding which block has been created an to assign a region to it for the setRegionFor problem above. This patch uses an implementation for splitEdge that always creates a block between the predecessor and successor. simplifyRegion has also been simplified by using SplitBlockPredecessors instead of SplitEdge. Isolating the entries and exits have been refectored into individual functions.

Previously simplifyRegion did more than just ensuring that there is only one entering and one exiting edge. It ensured that the entering block had no other outgoing edge which was necessary for executeScopConditionally(). Now the latter uses the alternative splitEdge implementation which can handle this situation so simplifyRegion really only needs to simplify the region.

Also, executeScopConditionally assumed that there can be no PHI nodes in blocks with one incoming edge. This is wrong and LCSSA deliberately produces such edges. However, previous passes ensured that there can be no such PHIs in exit nodes, but which will no longer hold in the future.

The new code that the property that it preserves the identity of region block (the property that the memory address of the BasicBlock containing the instructions remains the same; new blocks only contain PHI nodes and a terminator), especially the entry block. As a result, there is no need to update the reference to the BasicBlock of ScopStmt that contain its instructions because they have been moved to other basic blocks.

Reviewers: grosser

Part of Differential Revision: http://reviews.llvm.org/D11867 


Modified:
    polly/trunk/include/polly/Support/ScopHelper.h
    polly/trunk/lib/CodeGen/CodeGeneration.cpp
    polly/trunk/lib/CodeGen/Utils.cpp
    polly/trunk/lib/Support/ScopHelper.cpp
    polly/trunk/test/Isl/CodeGen/loop_with_conditional_entry_edge_split_hard_case.ll
    polly/trunk/test/Isl/CodeGen/phi_loop_carried_float.ll
    polly/trunk/test/Isl/CodeGen/phi_loop_carried_float_escape.ll
    polly/trunk/test/Isl/CodeGen/simple_non_single_entry.ll

Modified: polly/trunk/include/polly/Support/ScopHelper.h
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/include/polly/Support/ScopHelper.h?rev=244606&r1=244605&r2=244606&view=diff
==============================================================================
--- polly/trunk/include/polly/Support/ScopHelper.h (original)
+++ polly/trunk/include/polly/Support/ScopHelper.h Tue Aug 11 09:39:21 2015
@@ -26,6 +26,10 @@ class PHINode;
 class Region;
 class Pass;
 class BasicBlock;
+class StringRef;
+class DominatorTree;
+class RegionInfo;
+class ScalarEvolution;
 }
 
 namespace polly {
@@ -51,16 +55,20 @@ llvm::Loop *castToLoop(const llvm::Regio
 bool hasInvokeEdge(const llvm::PHINode *PN);
 
 llvm::Value *getPointerOperand(llvm::Instruction &Inst);
-llvm::BasicBlock *createSingleExitEdge(llvm::Region *R, llvm::Pass *P);
 
-/// @brief Simplify the region in a SCoP to have a single unconditional entry
-///        edge and a single exit edge.
+/// @brief Simplify the region to have a single unconditional entry edge and a
+/// single exit edge.
 ///
-/// @param S  The SCoP that is simplified.
-/// @param P  The pass that is currently running.
-///
-/// @return The unique entering block for the region.
-llvm::BasicBlock *simplifyRegion(polly::Scop *S, llvm::Pass *P);
+/// Although this function allows DT and RI to be null, regions only work
+/// properly if the DominatorTree (for Region::contains) and RegionInfo are kept
+/// up-to-date.
+///
+/// @param R  The region to be simplified
+/// @param DT DominatorTree to be updated.
+/// @param LI LoopInfo to be updated.
+/// @param RI RegionInfo to be updated.
+void simplifyRegion(llvm::Region *R, llvm::DominatorTree *DT,
+                    llvm::LoopInfo *LI, llvm::RegionInfo *RI);
 
 /// @brief Split the entry block of a function to store the newly inserted
 ///        allocations outside of all Scops.

Modified: polly/trunk/lib/CodeGen/CodeGeneration.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/CodeGen/CodeGeneration.cpp?rev=244606&r1=244605&r2=244606&view=diff
==============================================================================
--- polly/trunk/lib/CodeGen/CodeGeneration.cpp (original)
+++ polly/trunk/lib/CodeGen/CodeGeneration.cpp Tue Aug 11 09:39:21 2015
@@ -53,6 +53,7 @@ public:
   IslAstInfo *AI;
   DominatorTree *DT;
   ScalarEvolution *SE;
+  RegionInfo *RI;
   ///}
 
   /// @brief The loop annotator to generate llvm.loop metadata.
@@ -103,13 +104,16 @@ public:
     DT = &getAnalysis<DominatorTreeWrapperPass>().getDomTree();
     SE = &getAnalysis<ScalarEvolution>();
     DL = &S.getRegion().getEntry()->getParent()->getParent()->getDataLayout();
-
-    assert(!S.getRegion().isTopLevelRegion() &&
-           "Top level regions are not supported");
+    RI = &getAnalysis<RegionInfoPass>().getRegionInfo();
+    Region *R = &S.getRegion();
+    assert(!R->isTopLevelRegion() && "Top level regions are not supported");
 
     Annotator.buildAliasScopes(S);
 
-    BasicBlock *EnteringBB = simplifyRegion(&S, this);
+    simplifyRegion(R, DT, LI, RI);
+    assert(R->isSimple());
+    BasicBlock *EnteringBB = S.getRegion().getEnteringBlock();
+    assert(EnteringBB);
     PollyIRBuilder Builder = createPollyIRBuilder(EnteringBB, Annotator);
 
     IslNodeBuilder NodeBuilder(Builder, Annotator, this, *DL, *LI, *SE, *DT, S);

Modified: polly/trunk/lib/CodeGen/Utils.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/CodeGen/Utils.cpp?rev=244606&r1=244605&r2=244606&view=diff
==============================================================================
--- polly/trunk/lib/CodeGen/Utils.cpp (original)
+++ polly/trunk/lib/CodeGen/Utils.cpp Tue Aug 11 09:39:21 2015
@@ -21,68 +21,158 @@
 
 using namespace llvm;
 
+// Alternative to llvm::SplitCriticalEdge.
+//
+// Creates a new block which branches to Succ. The edge to split is redirected
+// to the new block.
+//
+// The issue with llvm::SplitCriticalEdge is that it does nothing if the edge is
+// not critical.
+// The issue with llvm::SplitEdge is that it does not always create the middle
+// block, but reuses Prev/Succ if it can. We always want a new middle block.
+static BasicBlock *splitEdge(BasicBlock *Prev, BasicBlock *Succ,
+                             const char *Suffix, DominatorTree *DT,
+                             LoopInfo *LI, RegionInfo *RI) {
+  assert(Prev && Succ);
+
+  // Before:
+  //   \    /     /   //
+  //    Prev     /    //
+  //     |  \___/     //
+  //     |   ___      //
+  //     |  /   \     //
+  //    Succ     \    //
+  //   /    \     \   //
+
+  // The algorithm to update DominatorTree and LoopInfo of
+  // llvm::SplitCriticalEdge is more efficient than
+  // llvm::SplitBlockPredecessors, which is more general. In the future we might
+  // either modify llvm::SplitCriticalEdge to allow skipping the critical edge
+  // check; or Copy&Pase it here.
+  BasicBlock *MiddleBlock = SplitBlockPredecessors(
+      Succ, ArrayRef<BasicBlock *>(Prev), Suffix, DT, LI);
+
+  if (RI) {
+    Region *PrevRegion = RI->getRegionFor(Prev);
+    Region *SuccRegion = RI->getRegionFor(Succ);
+    if (PrevRegion->contains(MiddleBlock)) {
+      RI->setRegionFor(MiddleBlock, PrevRegion);
+    } else {
+      RI->setRegionFor(MiddleBlock, SuccRegion);
+    }
+  }
+
+  // After:
+  //   \    /     /   //
+  //    Prev     /    //
+  //     |  \___/     //
+  //     |            //
+  // MiddleBlock      //
+  //     |   ___      //
+  //     |  /   \     //
+  //    Succ     \    //
+  //   /    \     \   //
+
+  return MiddleBlock;
+}
+
 BasicBlock *polly::executeScopConditionally(Scop &S, Pass *P, Value *RTC) {
-  BasicBlock *StartBlock, *SplitBlock, *NewBlock;
   Region &R = S.getRegion();
   PollyIRBuilder Builder(R.getEntry());
   DominatorTree &DT = P->getAnalysis<DominatorTreeWrapperPass>().getDomTree();
   RegionInfo &RI = P->getAnalysis<RegionInfoPass>().getRegionInfo();
   LoopInfo &LI = P->getAnalysis<LoopInfoWrapperPass>().getLoopInfo();
 
-  // Split the entry edge of the region and generate a new basic block on this
-  // edge. This function also updates ScopInfo and RegionInfo.
-  NewBlock = SplitEdge(R.getEnteringBlock(), R.getEntry(), &DT, &LI);
-  if (DT.dominates(R.getEntry(), NewBlock)) {
-    BasicBlock *OldBlock = R.getEntry();
-    std::string OldName = OldBlock->getName();
-
-    // Update ScopInfo.
-    for (ScopStmt &Stmt : S)
-      if (Stmt.getBasicBlock() == OldBlock) {
-        Stmt.setBasicBlock(NewBlock);
-        break;
-      }
-
-    // Update RegionInfo.
-    SplitBlock = OldBlock;
-    OldBlock->setName("polly.split");
-    NewBlock->setName(OldName);
-    R.replaceEntryRecursive(NewBlock);
-    RI.setRegionFor(NewBlock, &R);
-  } else {
-    RI.setRegionFor(NewBlock, R.getParent());
-    SplitBlock = NewBlock;
-  }
-
+  // Before:
+  //
+  //      \   /      //
+  //    EnteringBB   //
+  //   _____|_____   //
+  //  /  EntryBB  \  //
+  //  |  (region) |  //
+  //  \_ExitingBB_/  //
+  //        |        //
+  //      ExitBB     //
+  //      /    \     //
+
+  // Create a fork block.
+  BasicBlock *EnteringBB = R.getEnteringBlock();
+  BasicBlock *EntryBB = R.getEntry();
+  assert(EnteringBB && "Must be a simple region");
+  BasicBlock *SplitBlock =
+      splitEdge(EnteringBB, EntryBB, ".split_new_and_old", &DT, &LI, &RI);
   SplitBlock->setName("polly.split_new_and_old");
+
+  // Create a join block
+  BasicBlock *ExitingBB = R.getExitingBlock();
+  BasicBlock *ExitBB = R.getExit();
+  assert(ExitingBB && "Must be a simple region");
+  BasicBlock *MergeBlock =
+      splitEdge(ExitingBB, ExitBB, ".merge_new_and_old", &DT, &LI, &RI);
+  MergeBlock->setName("polly.merge_new_and_old");
+
+  // Exclude the join block from the region.
+  R.replaceExitRecursive(MergeBlock);
+  RI.setRegionFor(MergeBlock, R.getParent());
+
+  //      \   /      //
+  //    EnteringBB   //
+  //        |        //
+  //    SplitBlock   //
+  //   _____|_____   //
+  //  /  EntryBB  \  //
+  //  |  (region) |  //
+  //  \_ExitingBB_/  //
+  //        |        //
+  //    MergeBlock   //
+  //        |        //
+  //      ExitBB     //
+  //      /    \     //
+
+  // Create the start block.
   Function *F = SplitBlock->getParent();
-  StartBlock = BasicBlock::Create(F->getContext(), "polly.start", F);
+  BasicBlock *StartBlock =
+      BasicBlock::Create(F->getContext(), "polly.start", F);
   SplitBlock->getTerminator()->eraseFromParent();
   Builder.SetInsertPoint(SplitBlock);
   Builder.CreateCondBr(RTC, StartBlock, R.getEntry());
   if (Loop *L = LI.getLoopFor(SplitBlock))
     L->addBasicBlockToLoop(StartBlock, LI);
   DT.addNewBlock(StartBlock, SplitBlock);
-  Builder.SetInsertPoint(StartBlock);
-
-  BasicBlock *MergeBlock;
+  RI.setRegionFor(StartBlock, RI.getRegionFor(SplitBlock));
 
-  if (R.getExit()->getSinglePredecessor())
-    // No splitEdge required.  A block with a single predecessor cannot have
-    // PHI nodes that would complicate life.
-    MergeBlock = R.getExit();
-  else {
-    MergeBlock = SplitEdge(R.getExitingBlock(), R.getExit(), &DT, &LI);
-    // SplitEdge will never split R.getExit(), as R.getExit() has more than
-    // one predecessor. Hence, mergeBlock is always a newly generated block.
-    R.replaceExitRecursive(MergeBlock);
-    RI.setRegionFor(MergeBlock, &R);
-  }
+  //      \   /                    //
+  //    EnteringBB                 //
+  //        |                      //
+  //    SplitBlock---------\       //
+  //   _____|_____         |       //
+  //  /  EntryBB  \    StartBlock  //
+  //  |  (region) |                //
+  //  \_ExitingBB_/                //
+  //        |                      //
+  //    MergeBlock                 //
+  //        |                      //
+  //      ExitBB                   //
+  //      /    \                   //
 
+  // Connect start block to the join block.
+  Builder.SetInsertPoint(StartBlock);
   Builder.CreateBr(MergeBlock);
-  MergeBlock->setName("polly.merge_new_and_old");
+  DT.changeImmediateDominator(MergeBlock, SplitBlock);
+
+  //      \   /                    //
+  //    EnteringBB                 //
+  //        |                      //
+  //    SplitBlock---------\       //
+  //   _____|_____         |       //
+  //  /  EntryBB  \    StartBlock  //
+  //  |  (region) |        |       //
+  //  \_ExitingBB_/        |       //
+  //        |              |       //
+  //    MergeBlock---------/       //
+  //        |                      //
+  //      ExitBB                   //
+  //      /    \                   //
 
-  if (DT.dominates(SplitBlock, MergeBlock))
-    DT.changeImmediateDominator(MergeBlock, SplitBlock);
   return StartBlock;
 }

Modified: polly/trunk/lib/Support/ScopHelper.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Support/ScopHelper.cpp?rev=244606&r1=244605&r2=244606&view=diff
==============================================================================
--- polly/trunk/lib/Support/ScopHelper.cpp (original)
+++ polly/trunk/lib/Support/ScopHelper.cpp Tue Aug 11 09:39:21 2015
@@ -76,97 +76,131 @@ bool polly::hasInvokeEdge(const PHINode
   return false;
 }
 
-BasicBlock *polly::createSingleExitEdge(Region *R, Pass *P) {
-  BasicBlock *BB = R->getExit();
-
-  SmallVector<BasicBlock *, 4> Preds;
-  for (pred_iterator PI = pred_begin(BB), PE = pred_end(BB); PI != PE; ++PI)
-    if (R->contains(*PI))
-      Preds.push_back(*PI);
-
-  auto *DTWP = P->getAnalysisIfAvailable<DominatorTreeWrapperPass>();
-  auto *DT = DTWP ? &DTWP->getDomTree() : nullptr;
-  auto *LIWP = P->getAnalysisIfAvailable<LoopInfoWrapperPass>();
-  auto *LI = LIWP ? &LIWP->getLoopInfo() : nullptr;
-
-  return SplitBlockPredecessors(BB, Preds, ".region", DT, LI);
-}
-
-static void replaceScopAndRegionEntry(polly::Scop *S, BasicBlock *OldEntry,
-                                      BasicBlock *NewEntry) {
-  if (polly::ScopStmt *Stmt = S->getStmtForBasicBlock(OldEntry))
-    Stmt->setBasicBlock(NewEntry);
-
-  S->getRegion().replaceEntryRecursive(NewEntry);
-}
-
-BasicBlock *polly::simplifyRegion(Scop *S, Pass *P) {
-  Region *R = &S->getRegion();
-
-  // The entering block for the region.
+// Ensures that there is just one predecessor to the entry node from outside the
+// region.
+// The identity of the region entry node is preserved.
+static void simplifyRegionEntry(Region *R, DominatorTree *DT, LoopInfo *LI,
+                                RegionInfo *RI) {
   BasicBlock *EnteringBB = R->getEnteringBlock();
-  BasicBlock *OldEntry = R->getEntry();
-  BasicBlock *NewEntry = nullptr;
+  BasicBlock *Entry = R->getEntry();
 
-  auto *DTWP = P->getAnalysisIfAvailable<DominatorTreeWrapperPass>();
-  auto *DT = DTWP ? &DTWP->getDomTree() : nullptr;
-  auto *LIWP = P->getAnalysisIfAvailable<LoopInfoWrapperPass>();
-  auto *LI = LIWP ? &LIWP->getLoopInfo() : nullptr;
+  // Before (one of):
+  //
+  //                       \    /            //
+  //                      EnteringBB         //
+  //                        |    \------>    //
+  //   \   /                |                //
+  //   Entry <--\         Entry <--\         //
+  //   /   \    /         /   \    /         //
+  //        ....               ....          //
 
   // Create single entry edge if the region has multiple entry edges.
   if (!EnteringBB) {
-    NewEntry = SplitBlock(OldEntry, OldEntry->begin(), DT, LI);
-    EnteringBB = OldEntry;
-  }
-
-  // Create an unconditional entry edge.
-  if (EnteringBB->getTerminator()->getNumSuccessors() != 1) {
-    BasicBlock *EntryBB = NewEntry ? NewEntry : OldEntry;
-    BasicBlock *SplitEdgeBB = SplitEdge(EnteringBB, EntryBB, DT, LI);
-
-    // Once the edge between EnteringBB and EntryBB is split, two cases arise.
-    // The first is simple. The new block is inserted between EnteringBB and
-    // EntryBB. In this case no further action is needed. However it might
-    // happen (if the splitted edge is not critical) that the new block is
-    // inserted __after__ EntryBB causing the following situation:
-    //
-    // EnteringBB
-    //    _|_
-    //    | |
-    //    |  \-> some_other_BB_not_in_R
-    //    V
-    // EntryBB
-    //    |
-    //    V
-    // SplitEdgeBB
-    //
-    // In this case we need to swap the role of EntryBB and SplitEdgeBB.
-
-    // Check which case SplitEdge produced:
-    if (SplitEdgeBB->getTerminator()->getSuccessor(0) == EntryBB) {
-      // First (simple) case.
-      EnteringBB = SplitEdgeBB;
-    } else {
-      // Second (complicated) case.
-      NewEntry = SplitEdgeBB;
-      EnteringBB = EntryBB;
+    SmallVector<BasicBlock *, 4> Preds;
+    for (BasicBlock *P : predecessors(Entry))
+      if (!R->contains(P))
+        Preds.push_back(P);
+
+    BasicBlock *NewEntering =
+        SplitBlockPredecessors(Entry, Preds, ".region_entering", DT, LI);
+
+    if (RI) {
+      // The exit block of predecessing regions must be changed to NewEntering
+      for (BasicBlock *ExitPred : predecessors(NewEntering)) {
+        Region *RegionOfPred = RI->getRegionFor(ExitPred);
+        if (RegionOfPred->getExit() != Entry)
+          continue;
+
+        while (!RegionOfPred->isTopLevelRegion() &&
+               RegionOfPred->getExit() == Entry) {
+          RegionOfPred->replaceExit(NewEntering);
+          RegionOfPred = RegionOfPred->getParent();
+        }
+      }
+
+      // Make all ancestors use EnteringBB as entry; there might be edges to it
+      Region *AncestorR = R->getParent();
+      RI->setRegionFor(NewEntering, AncestorR);
+      while (!AncestorR->isTopLevelRegion() && AncestorR->getEntry() == Entry) {
+        AncestorR->replaceEntry(NewEntering);
+        AncestorR = AncestorR->getParent();
+      }
     }
 
-    EnteringBB->setName("polly.entering.block");
+    EnteringBB = NewEntering;
   }
+  assert(R->getEnteringBlock() == EnteringBB);
 
-  if (NewEntry)
-    replaceScopAndRegionEntry(S, OldEntry, NewEntry);
+  // After:
+  //
+  //    \    /       //
+  //  EnteringBB     //
+  //      |          //
+  //      |          //
+  //    Entry <--\   //
+  //    /   \    /   //
+  //         ....    //
+}
 
-  // Create single exit edge if the region has multiple exit edges.
-  if (!R->getExitingBlock()) {
-    BasicBlock *NewExiting = createSingleExitEdge(R, P);
-    (void)NewExiting;
-    assert(NewExiting == R->getExitingBlock() &&
-           "Did not create a single exiting block");
+// Ensure that the region has a single block that branches to the exit node.
+static void simplifyRegionExit(Region *R, DominatorTree *DT, LoopInfo *LI,
+                               RegionInfo *RI) {
+  BasicBlock *ExitBB = R->getExit();
+  BasicBlock *ExitingBB = R->getExitingBlock();
+
+  // Before:
+  //
+  //   (Region)   ______/  //
+  //      \  |   /         //
+  //       ExitBB          //
+  //       /    \          //
+
+  if (!ExitingBB) {
+    SmallVector<BasicBlock *, 4> Preds;
+    for (BasicBlock *P : predecessors(ExitBB))
+      if (R->contains(P))
+        Preds.push_back(P);
+
+    //  Preds[0] Preds[1]      otherBB //
+    //         \  |  ________/         //
+    //          \ | /                  //
+    //           BB                    //
+    ExitingBB =
+        SplitBlockPredecessors(ExitBB, Preds, ".region_exiting", DT, LI);
+    // Preds[0] Preds[1]      otherBB  //
+    //        \  /           /         //
+    // BB.region_exiting    /          //
+    //                  \  /           //
+    //                   BB            //
+
+    if (RI)
+      RI->setRegionFor(ExitingBB, R);
+
+    // Change the exit of nested regions, but not the region itself,
+    R->replaceExitRecursive(ExitingBB);
+    R->replaceExit(ExitBB);
   }
+  assert(ExitingBB == R->getExitingBlock());
+
+  // After:
+  //
+  //     \   /                //
+  //    ExitingBB     _____/  //
+  //          \      /        //
+  //           ExitBB         //
+  //           /    \         //
+}
 
-  return EnteringBB;
+void polly::simplifyRegion(Region *R, DominatorTree *DT, LoopInfo *LI,
+                           RegionInfo *RI) {
+  assert(R && !R->isTopLevelRegion());
+  assert(!RI || RI == R->getRegionInfo());
+  assert((!RI || DT) &&
+         "RegionInfo requires DominatorTree to be updated as well");
+
+  simplifyRegionEntry(R, DT, LI, RI);
+  simplifyRegionExit(R, DT, LI, RI);
+  assert(R->isSimple());
 }
 
 // Split the block into two successive blocks.

Modified: polly/trunk/test/Isl/CodeGen/loop_with_conditional_entry_edge_split_hard_case.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/Isl/CodeGen/loop_with_conditional_entry_edge_split_hard_case.ll?rev=244606&r1=244605&r2=244606&view=diff
==============================================================================
--- polly/trunk/test/Isl/CodeGen/loop_with_conditional_entry_edge_split_hard_case.ll (original)
+++ polly/trunk/test/Isl/CodeGen/loop_with_conditional_entry_edge_split_hard_case.ll Tue Aug 11 09:39:21 2015
@@ -19,22 +19,22 @@ define void @jd(i32 %b, i32* %A) {
 entry:
   br label %while.begin
 
-; CHECK: while.begin:
+; CHECK-LABEL: while.begin.region_exiting:
+; CHECK:         br label %polly.merge_new_and_old
+
+; CHECK-LABEL: while.begin:
 while.begin:
 ; CHECK:  %call = call i32 @f()
   %call = call i32 @f()
 ; CHECK:  %tobool = icmp eq i32 %call, 0
   %tobool = icmp eq i32 %call, 0
-; CHECK:  br i1 %tobool, label %while.end, label %polly.entering.block
+; CHECK:  br i1 %tobool, label %while.end, label %polly.split_new_and_old
   br i1 %tobool, label %while.end, label %if
 
-; CHECK: polly.entering.block:
-; CHECK:   br label %polly.split_new_and_old
-
 ; CHECK: polly.split_new_and_old:
-; CHECK:   br i1 true, label %polly.start, label %if.split
+; CHECK:   br i1 true, label %polly.start, label %if
 
-; CHECK: if.split:
+; CHECK: if:
 if:                                               ; preds = %while.begin
 ; CHECK: %tobool2 = icmp eq i32 %b, 0
   %tobool2 = icmp eq i32 %b, 0

Modified: polly/trunk/test/Isl/CodeGen/phi_loop_carried_float.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/Isl/CodeGen/phi_loop_carried_float.ll?rev=244606&r1=244605&r2=244606&view=diff
==============================================================================
--- polly/trunk/test/Isl/CodeGen/phi_loop_carried_float.ll (original)
+++ polly/trunk/test/Isl/CodeGen/phi_loop_carried_float.ll Tue Aug 11 09:39:21 2015
@@ -12,29 +12,29 @@
 ; CHECK-NOT:    %tmp7{{[.*]}} = alloca float
 ; CHECK-DAG:    %tmp.0.phiops = alloca float
 ; CHECK-NOT:    %tmp7{{[.*]}} = alloca float
-;
-; CHECK:      polly.merge_new_and_old:
-; CHECK-NEXT:  ret
-;
-; CHECK:      polly.start:
-; CHECK-NEXT:   store float 0.000000e+00, float* %tmp.0.phiops
-
-; CHECK:      polly.merge:
-; CHECK-NEXT:   br label %polly.merge_new_and_old
-
-; CHECK:      polly.stmt.bb1{{[0-9]*}}:
-; CHECK-NEXT:   %tmp.0.phiops.reload[[R1:[0-9]*]] = load float, float* %tmp.0.phiops
-; CHECK:        store float %tmp.0.phiops.reload[[R1]], float* %tmp.0.s2a
-
-; CHECK:      polly.stmt.bb1{{[0-9]*}}:
-; CHECK-NEXT:   %tmp.0.phiops.reload[[R2:[0-9]*]] = load float, float* %tmp.0.phiops
-; CHECK:        store float %tmp.0.phiops.reload[[R2]], float* %tmp.0.s2a
-
-; CHECK: polly.stmt.bb4:                                   ; preds = %polly.then3
-; CHECK:   %tmp[[R5:[0-9]*]]_p_scalar_ = load float, float* %scevgep, align 4, !alias.scope !0, !noalias !2
-; CHECK:   %tmp.0.s2a.reload[[R3:[0-9]*]] = load float, float* %tmp.0.s2a
-; CHECK:   %p_tmp[[R4:[0-9]*]] = fadd float %tmp.0.s2a.reload[[R3]], %tmp[[R5]]_p_scalar_
-; CHECK:   store float %p_tmp[[R4]], float* %tmp.0.phiops
+
+; CHECK-LABEL: exit:
+; CHECK-NEXT:    ret
+
+; CHECK-LABEL: polly.start:
+; CHECK-NEXT:    store float 0.000000e+00, float* %tmp.0.phiops
+
+; CHECK-LABEL: polly.merge:
+; CHECK-NEXT:    br label %polly.merge_new_and_old
+
+; CHECK-LABEL: polly.stmt.bb1{{[0-9]*}}:
+; CHECK-NEXT:    %tmp.0.phiops.reload[[R1:[0-9]*]] = load float, float* %tmp.0.phiops
+; CHECK:         store float %tmp.0.phiops.reload[[R1]], float* %tmp.0.s2a
+
+; CHECK-LABEL: polly.stmt.bb1{{[0-9]*}}:
+; CHECK-NEXT:    %tmp.0.phiops.reload[[R2:[0-9]*]] = load float, float* %tmp.0.phiops
+; CHECK:         store float %tmp.0.phiops.reload[[R2]], float* %tmp.0.s2a
+
+; CHECK-LABEL: polly.stmt.bb4:                                   ; preds = %polly.then3
+; CHECK:         %tmp[[R5:[0-9]*]]_p_scalar_ = load float, float* %scevgep, align 4, !alias.scope !0, !noalias !2
+; CHECK:         %tmp.0.s2a.reload[[R3:[0-9]*]] = load float, float* %tmp.0.s2a
+; CHECK:         %p_tmp[[R4:[0-9]*]] = fadd float %tmp.0.s2a.reload[[R3]], %tmp[[R5]]_p_scalar_
+; CHECK:         store float %p_tmp[[R4]], float* %tmp.0.phiops
 
 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
 

Modified: polly/trunk/test/Isl/CodeGen/phi_loop_carried_float_escape.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/Isl/CodeGen/phi_loop_carried_float_escape.ll?rev=244606&r1=244605&r2=244606&view=diff
==============================================================================
--- polly/trunk/test/Isl/CodeGen/phi_loop_carried_float_escape.ll (original)
+++ polly/trunk/test/Isl/CodeGen/phi_loop_carried_float_escape.ll Tue Aug 11 09:39:21 2015
@@ -6,31 +6,31 @@
 ;        tmp += A[i];
 ;      return tmp;
 ;    }
-;
-; CHECK:      polly.merge_new_and_old:
-; CHECK-NEXT:   %tmp.0.merge = phi float [ %tmp.0.final_reload, %polly.merge ], [ %tmp.0, %bb8 ]
-; CHECK-NEXT:   ret float %tmp.0.merge
-;
-; CHECK:      polly.start:
-; CHECK-NEXT:   store float 0.000000e+00, float* %tmp.0.phiops
-
-; CHECK:      polly.merge:
-; CHECK-NEXT:   %tmp.0.final_reload = load float, float* %tmp.0.s2a
-; CHECK-NEXT:   br label %polly.merge_new_and_old
-
-; CHECK:      polly.stmt.bb1{{[0-9]*}}:
-; CHECK-NEXT:   %tmp.0.phiops.reload[[R1:[0-9]*]] = load float, float* %tmp.0.phiops
-; CHECK-:       store float %tmp.0.phiops.reload[[R1]], float* %tmp.0.s2a
-
-; CHECK:      polly.stmt.bb1{{[0-9]*}}:
-; CHECK-NEXT:   %tmp.0.phiops.reload[[R2:[0-9]*]] = load float, float* %tmp.0.phiops
-; CHECK:        store float %tmp.0.phiops.reload[[R2]], float* %tmp.0.s2a
-
-; CHECK: polly.stmt.bb4:                                   ; preds = %polly.then3
-; CHECK:   %tmp[[R5:[0-9]*]]_p_scalar_ = load float, float* %scevgep, align 4, !alias.scope !0, !noalias !2
-; CHECK:   %tmp.0.s2a.reload[[R3:[0-9]*]] = load float, float* %tmp.0.s2a
-; CHECK:   %p_tmp[[R4:[0-9]*]] = fadd float %tmp.0.s2a.reload[[R3]], %tmp[[R5]]_p_scalar_
-; CHECK:   store float %p_tmp[[R4]], float* %tmp.0.phiops
+
+; CHECK-LABEL: polly.merge_new_and_old:
+; CHECK-NEXT:    %tmp.0.merge = phi float [ %tmp.0.final_reload, %polly.merge ], [ %tmp.0, %bb8 ]
+; CHECK-NEXT:    br label %exit
+
+; CHECK-LABEL: polly.start:
+; CHECK-NEXT:    store float 0.000000e+00, float* %tmp.0.phiops
+
+; CHECK-LABEL: polly.merge:
+; CHECK-NEXT:    %tmp.0.final_reload = load float, float* %tmp.0.s2a
+; CHECK-NEXT:    br label %polly.merge_new_and_old
+
+; CHECK-LABEL: polly.stmt.bb1{{[0-9]*}}:
+; CHECK-NEXT:    %tmp.0.phiops.reload[[R1:[0-9]*]] = load float, float* %tmp.0.phiops
+; CHECK-:        store float %tmp.0.phiops.reload[[R1]], float* %tmp.0.s2a
+
+; CHECK-LABEL: polly.stmt.bb1{{[0-9]*}}:
+; CHECK-NEXT:    %tmp.0.phiops.reload[[R2:[0-9]*]] = load float, float* %tmp.0.phiops
+; CHECK:         store float %tmp.0.phiops.reload[[R2]], float* %tmp.0.s2a
+
+; CHECK-LABEL: polly.stmt.bb4:                                   ; preds = %polly.then3
+; CHECK:         %tmp[[R5:[0-9]*]]_p_scalar_ = load float, float* %scevgep, align 4, !alias.scope !0, !noalias !2
+; CHECK:         %tmp.0.s2a.reload[[R3:[0-9]*]] = load float, float* %tmp.0.s2a
+; CHECK:         %p_tmp[[R4:[0-9]*]] = fadd float %tmp.0.s2a.reload[[R3]], %tmp[[R5]]_p_scalar_
+; CHECK:         store float %p_tmp[[R4]], float* %tmp.0.phiops
 
 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
 

Modified: polly/trunk/test/Isl/CodeGen/simple_non_single_entry.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/Isl/CodeGen/simple_non_single_entry.ll?rev=244606&r1=244605&r2=244606&view=diff
==============================================================================
--- polly/trunk/test/Isl/CodeGen/simple_non_single_entry.ll (original)
+++ polly/trunk/test/Isl/CodeGen/simple_non_single_entry.ll Tue Aug 11 09:39:21 2015
@@ -65,6 +65,6 @@ return:
   ret void
 }
 
-; CHECK: Create LLVM-IR from SCoPs' for region: 'next.split => polly.merge_new_and_old'
+; CHECK: Create LLVM-IR from SCoPs' for region: 'next => polly.merge_new_and_old'
 ; CHECK-CODE: polly.split_new_and_old
 ; CHECK-CODE: polly.merge_new_and_old




More information about the llvm-commits mailing list