-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Fix passes that introduce new branches on undef/poison #45489
Comments
It great to see that LLVM IR semantics is converging with MSan. |
For now, we decided to delay a few changes in LLVM until there's some progress on this. In particular https://reviews.llvm.org/D80875 and marking ranges from branch conditions as not containing undef in SCCP (was part of https://reviews.llvm.org/D81756) |
SimpleLoopUnswitch has been fixed, LoopUnswitch has been removed. |
I believe all known issues are fixed now. Let's open new issues if something more turns up. There's one more followup for CGP (https://reviews.llvm.org/D126638), but it's not a branch on poison issue anymore. |
Extended Description
Currently there are some passes that may introduce new branches on undef/poison, which h potentially introduces UB where there was none before.
While the LangRef was clear about branch on poison being UB, recently it was also clarified that this applies to branches on undef as well (https://reviews.llvm.org/rG05f0e598ab265a80fedb23225cde4176f11774ac).
There has been some discussion about problematic passes (https://reviews.llvm.org/D76973,
https://reviews.llvm.org/D80875.
Nuno mentioned "The passes we are aware that introduce branch on poison are: IndVarSimplify, LoopUnswitch, SimpleLoopUnswitch, and SimpifyCFG.
(https://web.ist.utl.pt/nuno.lopes/alive2/index.php?hash=4beb2b117e2fdd2c)"
Eli mentioned that some passes condition certain transforms on the
Attribute::SanitizeMemory
attribute, because of MemSAN does not like new branches on undef/poison values. See also #28428The text was updated successfully, but these errors were encountered: