forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[InstCombine] Canonicalize more saturated-add variants (llvm#100008)
LLVM is not evaluating X u > C, a, b the same way it evaluates X <= C, b, a. To fix this, let's move the folds to after the canonicalization of -1 to TrueVal. Let's allow splat vectors with poison elements to be recognized too! Finally, for completion, handle the one case that isn't caught by the above checks because it is canonicalized to eq: X == -1 ? -1 : X + 1 -> uadd.sat(X, 1) Alive2 Proof: https://alive2.llvm.org/ce/z/WEcgYH
- Loading branch information
Showing
2 changed files
with
49 additions
and
32 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