Skip to content

llvm-reduce: Fix introducing unreachable code in simplify conditionals #133842

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

arsenm
Copy link
Contributor

@arsenm arsenm commented Apr 1, 2025

After replacing the branch condition, this was calling simplifyCFG to
perform the cleanups of the branch. This is far too heavy of a hammer.
We do not want all of the extra optimizations in simplifyCFG, and
this could also leave behind dead code. Instead, minimally fold the
terminator and try to delete the newly dead code.

This is pretty much a direct copy of what bugpoint does.

Copy link
Contributor Author

arsenm commented Apr 1, 2025

@arsenm arsenm added the llvm-reduce label Apr 1, 2025 — with Graphite App
@arsenm arsenm requested review from aeubanks, fhahn and regehr April 1, 2025 02:36
@arsenm arsenm marked this pull request as ready for review April 1, 2025 02:36
Base automatically changed from users/arsenm/llvm-reduce/ignore-constant-condition-branches-in-reduce-conditionals to main April 2, 2025 04:41
After replacing the branch condition, this was calling simplifyCFG to
perform the cleanups of the branch. This is far too heavy of a hammer.
We do not want all of the extra optimizations in simplifyCFG, and
this could also leave behind dead code. Instead, minimally fold the
terminator and try to delete the newly dead code.

This is pretty much a direct copy of what bugpoint does.
@arsenm arsenm force-pushed the users/arsenm/llvm-reduce/avoid-introducing-unreachable-code-simplify-conditionals branch from 80eec06 to 2fabdfa Compare April 8, 2025 00:33
@arsenm arsenm merged commit 3a0c95f into main Apr 8, 2025
9 of 10 checks passed
@arsenm arsenm deleted the users/arsenm/llvm-reduce/avoid-introducing-unreachable-code-simplify-conditionals branch April 8, 2025 01:51
@llvm-ci
Copy link
Collaborator

llvm-ci commented Apr 8, 2025

LLVM Buildbot has detected a new failure on builder clang-cmake-x86_64-avx512-win running on avx512-intel64-win while building llvm at step 4 "cmake stage 1".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/81/builds/6082

Here is the relevant piece of the build log for the reference
Step 4 (cmake stage 1) failure: 'cmake -G ...' (failure)
'cmake' is not recognized as an internal or external command,
operable program or batch file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants