Skip to content

Commit e37cf05

Browse files
committed
add comments on callbr region handling and fix polly test
1 parent 535a3dc commit e37cf05

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

llvm/include/llvm/Analysis/RegionInfoImpl.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,9 @@ bool RegionInfoBase<Tr>::isRegion(BlockT *entry, BlockT *exit) const {
553553

554554
using DST = typename DomFrontierT::DomSetType;
555555

556+
// Make sure that a region involving a callbr contains every successor
557+
// blocks up to the ones that postdominate the callbr block. Otherwise,
558+
// StructurizeCFG will tear the callbr apart.
556559
// TODO? post domination frontier?
557560
if constexpr (std::is_same_v<BlockT, BasicBlock>) {
558561
if (DomTreeNodeT *PDTNode = PDT->getNode(exit); PDTNode) {

polly/test/ScopDetect/callbr.ll

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
; RUN: opt %loadNPMPolly '-passes=print<polly-detect>' -polly-detect-track-failures -disable-output -pass-remarks-missed=polly-detect < %s 2>&1 | FileCheck %s --check-prefix=REMARK
2-
; RUN: opt %loadNPMPolly '-passes=print<polly-detect>' -polly-detect-track-failures -disable-output -stats < %s 2>&1 | FileCheck %s --check-prefix=STAT
3-
; REQUIRES: asserts
1+
; RUN: opt %loadNPMPolly '-passes=print<polly-detect>' -disable-output < %s 2>&1 | FileCheck %s
42

5-
; REMARK: Branch from indirect terminator.
6-
7-
; STAT: 1 polly-detect - Number of rejected regions: Branch from indirect terminator
3+
; CHECK-LABEL: func
4+
; CHECK-NOT: Valid
85

96

107
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"

0 commit comments

Comments
 (0)