forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[InstCombine] Fold
fcmp pred sqrt(X), 0.0 -> fcmp pred2 X, 0.0
(llv…
…m#101626) Proof (Please run alive-tv with larger smt-to): https://alive2.llvm.org/ce/z/-aqixk FMF propagation: https://alive2.llvm.org/ce/z/zyKK_p ``` sqrt(X) < 0.0 --> false sqrt(X) u>= 0.0 --> true sqrt(X) u< 0.0 --> X u< 0.0 sqrt(X) u<= 0.0 --> X u<= 0.0 sqrt(X) > 0.0 --> X > 0.0 sqrt(X) >= 0.0 --> X >= 0.0 sqrt(X) == 0.0 --> X == 0.0 sqrt(X) u!= 0.0 --> X u!= 0.0 sqrt(X) <= 0.0 --> X == 0.0 sqrt(X) u> 0.0 --> X u!= 0.0 sqrt(X) u== 0.0 --> X u<= 0.0 sqrt(X) != 0.0 --> X > 0.0 !isnan(sqrt(X)) --> X >= 0.0 isnan(sqrt(X)) --> X u< 0.0 ``` In most cases, `sqrt` cannot be eliminated since it has multiple uses. But this patch will break data dependencies and allow optimizer to sink expensive `sqrt` calls into successor blocks.
- Loading branch information
Showing
3 changed files
with
298 additions
and
3 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