Skip to content

Commit 283ed7d

Browse files
committed
Revert "[Polly] Reject reject regions entered by an indirectbr/callbr."
This reverts commit 91f46bb which causes test failures when assertions are off.
1 parent 6fe2e9a commit 283ed7d

File tree

4 files changed

+1
-105
lines changed

4 files changed

+1
-105
lines changed

polly/include/polly/ScopDetectionDiagnostic.h

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ enum class RejectReasonKind {
7373
InvalidTerminator,
7474
IrreducibleRegion,
7575
UnreachableInExit,
76-
IndirectPredecessor,
7776
LastCFG,
7877

7978
// Non-Affinity
@@ -276,32 +275,6 @@ class ReportUnreachableInExit : public ReportCFG {
276275
//@}
277276
};
278277

279-
//===----------------------------------------------------------------------===//
280-
/// Captures regions with an IndirectBr predecessor.
281-
class ReportIndirectPredecessor : public ReportCFG {
282-
Instruction *Inst;
283-
DebugLoc DbgLoc;
284-
285-
public:
286-
ReportIndirectPredecessor(Instruction *Inst, DebugLoc DbgLoc)
287-
: ReportCFG(RejectReasonKind::IndirectPredecessor), Inst(Inst),
288-
DbgLoc(DbgLoc) {}
289-
290-
/// @name LLVM-RTTI interface
291-
//@{
292-
static bool classof(const RejectReason *RR);
293-
//@}
294-
295-
/// @name RejectReason interface
296-
//@{
297-
std::string getRemarkName() const override;
298-
const Value *getRemarkBB() const override;
299-
std::string getMessage() const override;
300-
std::string getEndUserMessage() const override;
301-
const DebugLoc &getDebugLoc() const override;
302-
//@}
303-
};
304-
305278
//===----------------------------------------------------------------------===//
306279
/// Base class for non-affine reject reasons.
307280
///

polly/lib/Analysis/ScopDetection.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1757,13 +1757,6 @@ bool ScopDetection::isValidRegion(DetectionContext &Context) {
17571757
return false;
17581758
}
17591759

1760-
for (BasicBlock *Pred : predecessors(CurRegion.getEntry())) {
1761-
Instruction *PredTerm = Pred->getTerminator();
1762-
if (isa<IndirectBrInst>(PredTerm) || isa<CallBrInst>(PredTerm))
1763-
return invalid<ReportIndirectPredecessor>(
1764-
Context, /*Assert=*/true, PredTerm, PredTerm->getDebugLoc());
1765-
}
1766-
17671760
// SCoP cannot contain the entry block of the function, because we need
17681761
// to insert alloca instruction there when translate scalar to array.
17691762
if (!PollyAllowFullFunction &&

polly/lib/Analysis/ScopDetectionDiagnostic.cpp

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,8 @@ using namespace llvm;
5050
static Statistic RejectStatistics[] = {
5151
SCOP_STAT(CFG, ""),
5252
SCOP_STAT(InvalidTerminator, "Unsupported terminator instruction"),
53-
SCOP_STAT(IrreducibleRegion, "Irreducible loops"),
5453
SCOP_STAT(UnreachableInExit, "Unreachable in exit block"),
55-
SCOP_STAT(IndirectPredecessor, "Branch from indirect terminator"),
54+
SCOP_STAT(IrreducibleRegion, "Irreducible loops"),
5655
SCOP_STAT(LastCFG, ""),
5756
SCOP_STAT(AffFunc, ""),
5857
SCOP_STAT(UndefCond, "Undefined branch condition"),
@@ -240,37 +239,6 @@ bool ReportUnreachableInExit::classof(const RejectReason *RR) {
240239
return RR->getKind() == RejectReasonKind::UnreachableInExit;
241240
}
242241

243-
//===----------------------------------------------------------------------===//
244-
// IndirectPredecessor.
245-
246-
std::string ReportIndirectPredecessor::getRemarkName() const {
247-
return "IndirectPredecessor";
248-
}
249-
250-
const Value *ReportIndirectPredecessor::getRemarkBB() const {
251-
if (Inst)
252-
return Inst->getParent();
253-
return nullptr;
254-
}
255-
256-
std::string ReportIndirectPredecessor::getMessage() const {
257-
if (Inst)
258-
return "Branch from indirect terminator: " + *Inst;
259-
return getEndUserMessage();
260-
}
261-
262-
const DebugLoc &ReportIndirectPredecessor::getDebugLoc() const {
263-
return DbgLoc;
264-
}
265-
266-
std::string ReportIndirectPredecessor::getEndUserMessage() const {
267-
return "Branch from indirect terminator.";
268-
}
269-
270-
bool ReportIndirectPredecessor::classof(const RejectReason *RR) {
271-
return RR->getKind() == RejectReasonKind::IndirectPredecessor;
272-
}
273-
274242
//===----------------------------------------------------------------------===//
275243
// ReportIrreducibleRegion.
276244

polly/test/ScopDetect/callbr.ll

Lines changed: 0 additions & 38 deletions
This file was deleted.

0 commit comments

Comments
 (0)