forked from OSchip/llvm-project
				
			[NFC][CodeGen] Use the ExitBlock explicitly.
Before we would 'guess' the correct location for the MergeBlock that got introduced when executing a Scop conditionally. This implicitly depends on the situation that at this point during CodeGen there will be nothing between polly.start and polly.exiting. With this commit we explicitly state that we want the block that directly follows polly.exiting. llvm-svn: 306398
This commit is contained in:
		
							parent
							
								
									cdda23eb7c
								
							
						
					
					
						commit
						dbb0ef8e94
					
				| 
						 | 
					@ -178,6 +178,7 @@ static bool CodeGen(Scop &S, IslAstInfo &AI, LoopInfo &LI, DominatorTree &DT,
 | 
				
			||||||
  BBPair StartExitBlocks =
 | 
					  BBPair StartExitBlocks =
 | 
				
			||||||
      executeScopConditionally(S, Builder.getTrue(), DT, RI, LI);
 | 
					      executeScopConditionally(S, Builder.getTrue(), DT, RI, LI);
 | 
				
			||||||
  BasicBlock *StartBlock = std::get<0>(StartExitBlocks);
 | 
					  BasicBlock *StartBlock = std::get<0>(StartExitBlocks);
 | 
				
			||||||
 | 
					  BasicBlock *ExitBlock = std::get<1>(StartExitBlocks);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  removeLifetimeMarkers(R);
 | 
					  removeLifetimeMarkers(R);
 | 
				
			||||||
  auto *SplitBlock = StartBlock->getSinglePredecessor();
 | 
					  auto *SplitBlock = StartBlock->getSinglePredecessor();
 | 
				
			||||||
| 
						 | 
					@ -194,10 +195,7 @@ static bool CodeGen(Scop &S, IslAstInfo &AI, LoopInfo &LI, DominatorTree &DT,
 | 
				
			||||||
    P.initialize();
 | 
					    P.initialize();
 | 
				
			||||||
    P.insertRegionStart(SplitBlock->getTerminator());
 | 
					    P.insertRegionStart(SplitBlock->getTerminator());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    BasicBlock *MergeBlock = SplitBlock->getTerminator()
 | 
					    BasicBlock *MergeBlock = ExitBlock->getUniqueSuccessor();
 | 
				
			||||||
                                 ->getSuccessor(0)
 | 
					 | 
				
			||||||
                                 ->getUniqueSuccessor()
 | 
					 | 
				
			||||||
                                 ->getUniqueSuccessor();
 | 
					 | 
				
			||||||
    P.insertRegionEnd(MergeBlock->getTerminator());
 | 
					    P.insertRegionEnd(MergeBlock->getTerminator());
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue