-
Notifications
You must be signed in to change notification settings - Fork 12k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[InstCombine] canonicalize a signum (spaceship) that ends in add
(A s>> (BW - 1)) + (zext (A s> 0)) --> (A s>> (BW - 1)) | (zext (A != 0)) https://alive2.llvm.org/ce/z/V-nM8N This is not the form that we currently match as m_Signum(), but I'm not sure if one is better than the other, so there's a follow-up patch needed either way. For this patch, it should be better for analysis to use a not-null test and bitwise logic rather than >0 with add. Codegen doesn't seem significantly different on any targets that I looked at. Also note that none of these variants is shown in issue #60012 - those generally include at least one 'select', so that's likely where these patterns will end up.
- Loading branch information
1 parent
625e666
commit dedc58d
Showing
2 changed files
with
42 additions
and
12 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