Skip to content

Commit c6caddb

Browse files
author
Serguei Katkov
committed
[LoopInfo] Update getExitEdges to accept vector of pairs for non const BasicBlock
D63921 requires getExitEdges fills a vector of Edge pairs where BasicBlocks are not constant. The rest Loop API mostly returns non-const BasicBlocks, so to be more consistent with other Loop API getExitEdges is modified to return non-const BasicBlocks as well. This is an alternative solution to D64060. Reviewers: reames, fhahn Reviewed By: reames, fhahn Subscribers: hiraditya, llvm-commits Differential Revision: https://reviews.llvm.org/D64309 llvm-svn: 365437
1 parent e085b40 commit c6caddb

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

llvm/include/llvm/Analysis/LoopInfo.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ template <class BlockT, class LoopT> class LoopBase {
279279
BlockT *getUniqueExitBlock() const;
280280

281281
/// Edge type.
282-
typedef std::pair<const BlockT *, const BlockT *> Edge;
282+
typedef std::pair<BlockT *, BlockT *> Edge;
283283

284284
/// Return all pairs of (_inside_block_,_outside_block_).
285285
void getExitEdges(SmallVectorImpl<Edge> &ExitEdges) const;

llvm/lib/Transforms/Scalar/LoopPredication.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -903,7 +903,7 @@ bool LoopPredication::isLoopProfitableToPredicate() {
903903
if (SkipProfitabilityChecks || !BPI)
904904
return true;
905905

906-
SmallVector<std::pair<const BasicBlock *, const BasicBlock *>, 8> ExitEdges;
906+
SmallVector<std::pair<BasicBlock *, BasicBlock *>, 8> ExitEdges;
907907
L->getExitEdges(ExitEdges);
908908
// If there is only one exiting edge in the loop, it is always profitable to
909909
// predicate the loop.

0 commit comments

Comments
 (0)