-
Notifications
You must be signed in to change notification settings - Fork 11.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DivRemPairs] Do not freeze poisons that can't be undef (#92627)
Per comments in DivRemPairs, the rewrite from ```llvm %div = div %X, %Y %rem = rem %X, %Y ``` to ```llvm %div = div %X, %Y %.mul = mul %div, %Y %rem = sub %X, %mul ``` is unsound when %X or %Y are undef. However, it is known to be sound if %X or %Y are poison but can't be undef, since both the pre- and post-rewrite %rem are `poison`. Additionally, proofs: https://alive2.llvm.org/ce/z/xtNQ8j A comment in the pass listed a TODO for changing a usage of isGuaranteedNotToBeUndefOrPoison() in the pass to something that only detects undef. Such a function has been implemented since the time that TODO was written, but has not been used. Therefore, this commit updates DivRemPairs to use isGuaranteedNotToBeUndef() instead.
- Loading branch information
Showing
2 changed files
with
17 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters