-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[InstCombine] Fold icmps comparing uadd_sat with a constant
This patch is a continuation of D154206. It introduces a fold for the operation "uadd_sat(X, C) pred C2" where "C" and "C2" are constants. The fold is: uadd_sat(X, C) pred C2 => (X >= ~C) || ((X + C) pred C2) -> when (UINT_MAX pred C2) is true => (X < ~C) && ((X + C) pred C2) -> when (UINT_MAX pred C2) is false This patch also generalizes the fold to work with any saturating intrinsic as long as the saturating value is known. Proofs: https://alive2.llvm.org/ce/z/wWeirP Differential Revision: https://reviews.llvm.org/D154565
- Loading branch information
Showing
3 changed files
with
69 additions
and
53 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
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