diff options
Diffstat (limited to 'src/passes/RemoveUnusedBrs.cpp')
-rw-r--r-- | src/passes/RemoveUnusedBrs.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/passes/RemoveUnusedBrs.cpp b/src/passes/RemoveUnusedBrs.cpp index d8668196d..55f57302d 100644 --- a/src/passes/RemoveUnusedBrs.cpp +++ b/src/passes/RemoveUnusedBrs.cpp @@ -504,8 +504,7 @@ struct RemoveUnusedBrs : public WalkerPass<PostWalker<RemoveUnusedBrs>> { // (b) this br_if is the only branch to that block (so the block // will vanish) if (brIf->name == block->name && - BranchUtils::BranchSeeker::countNamed(block, block->name) == - 1) { + BranchUtils::BranchSeeker::count(block, block->name) == 1) { // note that we could drop the last element here, it is a br we // know for sure is removable, but telling stealSlice to steal all // to the end is more efficient, it can just truncate. @@ -566,16 +565,16 @@ struct RemoveUnusedBrs : public WalkerPass<PostWalker<RemoveUnusedBrs>> { worked = true; } else if (auto* iff = curr->list[0]->dynCast<If>()) { // The label can't be used in the condition. - if (BranchUtils::BranchSeeker::countNamed(iff->condition, - curr->name) == 0) { + if (BranchUtils::BranchSeeker::count(iff->condition, curr->name) == + 0) { // We can move the block into either arm, if there are no uses in // the other. Expression** target = nullptr; - if (!iff->ifFalse || BranchUtils::BranchSeeker::countNamed( + if (!iff->ifFalse || BranchUtils::BranchSeeker::count( iff->ifFalse, curr->name) == 0) { target = &iff->ifTrue; - } else if (BranchUtils::BranchSeeker::countNamed( - iff->ifTrue, curr->name) == 0) { + } else if (BranchUtils::BranchSeeker::count(iff->ifTrue, + curr->name) == 0) { target = &iff->ifFalse; } if (target) { @@ -874,7 +873,7 @@ struct RemoveUnusedBrs : public WalkerPass<PostWalker<RemoveUnusedBrs>> { // can ignore. if (br && br->condition && br->name == curr->name && br->type != unreachable) { - if (BranchUtils::BranchSeeker::countNamed(curr, curr->name) == 1) { + if (BranchUtils::BranchSeeker::count(curr, curr->name) == 1) { // no other breaks to that name, so we can do this if (!drop) { assert(!br->value); |