aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
diff options
context:
space:
mode:
authorBjorn Pettersson <bjorn.a.pettersson@ericsson.com>2021-09-23 12:13:28 +0200
committerBjorn Pettersson <bjorn.a.pettersson@ericsson.com>2021-09-23 13:03:26 +0200
commit85a586501bcc5b556d34a566b9d256d56d6fc5ba (patch)
tree8ac8e32291de4772bba01e1a198f047faa00ef55 /llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
parent5685eb950da7c6901c8b264a3c93e8ea63b34d3d (diff)
downloadllvm-85a586501bcc5b556d34a566b9d256d56d6fc5ba.zip
llvm-85a586501bcc5b556d34a566b9d256d56d6fc5ba.tar.gz
llvm-85a586501bcc5b556d34a566b9d256d56d6fc5ba.tar.bz2
[BasicBlockUtils] Fixup of an assumed typo in MergeBlockIntoPredecessor
The NFC commit e5692a564a73ef63b7b changed the logic for DomTreeUpdates to use the range [succ_begin, succ_begin) when looking for SuccsOfPredBB rather than using [succ_begin, succ_end). As the commit was NFC this is identified as a typo (it has been discussed briefly in phabricator). The typo was found when inspecting the code, so I've got no idea if changing back to the old range has any significant impact (such as solving any PR:s or causing some new problems). But at least this restores the code to the originally indented behavior.
Diffstat (limited to 'llvm/lib/Transforms/Utils/BasicBlockUtils.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/BasicBlockUtils.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp b/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
index ee933b6..1a07697 100644
--- a/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
+++ b/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
@@ -230,7 +230,7 @@ bool llvm::MergeBlockIntoPredecessor(BasicBlock *BB, DomTreeUpdater *DTU,
if (DTU) {
SmallPtrSet<BasicBlock *, 2> SuccsOfBB(succ_begin(BB), succ_end(BB));
SmallPtrSet<BasicBlock *, 2> SuccsOfPredBB(succ_begin(PredBB),
- succ_begin(PredBB));
+ succ_end(PredBB));
Updates.reserve(Updates.size() + 2 * SuccsOfBB.size() + 1);
// Add insert edges first. Experimentally, for the particular case of two
// blocks that can be merged, with a single successor and single predecessor