[all-commits] [llvm/llvm-project] 5dbc0e: [SimplifyCFG] Avoid scanning functions multiple ti...
Yingwei Zheng via All-commits
all-commits at lists.llvm.org
Sun Aug 9 09:41:56 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 5dbc0ee93fc50ba02ac944c3403ad160aecccee4
https://github.com/llvm/llvm-project/commit/5dbc0ee93fc50ba02ac944c3403ad160aecccee4
Author: Yingwei Zheng <dtcxzyw2333 at gmail.com>
Date: 2026-08-10 (Mon, 10 Aug 2026)
Changed paths:
M llvm/include/llvm/Transforms/Utils/Local.h
M llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp
M llvm/lib/Transforms/Utils/Local.cpp
M llvm/test/Transforms/SimplifyCFG/unreachable-multi-basic-block-funclet.ll
Log Message:
-----------
[SimplifyCFG] Avoid scanning functions multiple times in `removeUnreachableBlocks` (#213416)
`markAliveBlocks` scans instructions first to convert unreachable
instructions into `unreachable`, then marks alive successors. When
`iterativelySimplifyCFG` makes some changes, `removeUnreachableBlocks`
will be called again and scan the whole function again, even if
`iterativelySimplifyCFG` is unlikely to introduce new interesting
patterns.
This patch adds a new option `SimplifyInsts` to
`removeUnreachableBlocks`. When it is disabled, `markAliveBlocks` only
performs a BFS traversal.
Although it is possible to cause regressions
(unreachable-multi-basic-block-funclet.ll), it doesn't affect the
optimization result in practice:
https://github.com/dtcxzyw/llvm-opt-benchmark-nightly/pull/877
Compile-time improvement (approx -0.05%):
https://llvm-compile-time-tracker.com/compare.php?from=6a898832ff382b1a288f9eb3bc5cd1f37d0fc29f&to=565856d52880ed13c697e921f498dc400bb76c17&stat=instructions:u
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list