@@ -259,7 +259,7 @@ struct RemoveUnusedBrs : public WalkerPass<PostWalker<RemoveUnusedBrs>> {
259259 // so only do it if it looks useful, which it definitely is if
260260 // (a) $somewhere is straight out (so the br out vanishes), and
261261 // (b) this br_if is the only branch to that block (so the block will vanish)
262- if (brIf->name == block->name && BranchUtils::BranchSeeker::count (block, block->name ) == 1 ) {
262+ if (brIf->name == block->name && BranchUtils::BranchSeeker::countNamed (block, block->name ) == 1 ) {
263263 // note that we could drop the last element here, it is a br we know for sure is removable,
264264 // but telling stealSlice to steal all to the end is more efficient, it can just truncate.
265265 list[i] = builder.makeIf (brIf->condition , builder.makeBreak (brIf->name ), builder.stealSlice (block, i + 1 , list.size ()));
@@ -449,7 +449,7 @@ struct RemoveUnusedBrs : public WalkerPass<PostWalker<RemoveUnusedBrs>> {
449449 auto * br = list[0 ]->dynCast <Break>();
450450 if (br && br->condition && br->name == curr->name ) {
451451 assert (!br->value ); // can't, it would be dropped or last in the block
452- if (BranchUtils::BranchSeeker::count (curr, curr->name ) == 1 ) {
452+ if (BranchUtils::BranchSeeker::countNamed (curr, curr->name ) == 1 ) {
453453 // no other breaks to that name, so we can do this
454454 Builder builder (*getModule ());
455455 replaceCurrent (builder.makeIf (
0 commit comments