Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[InstSimplify] fold fcmp using isKnownNeverInfinity + isKnownNeverNaN
Follow-up to D84035 / rG7393d7574c09. This sidesteps a question of FMF/poison on fcmp raised in PR46077: http://bugs.llvm.org/PR46077 https://alive2.llvm.org/ce/z/TCsyzD define i1 @src(float %x) { %0: %x42 = fadd nnan ninf float %x, 42.000000 %r = fcmp ueq float %x42, inf ret i1 %r } => define i1 @tgt(float %x) { %0: ret i1 0 } Transformation seems to be correct! https://alive2.llvm.org/ce/z/FQaH7a define i1 @src(i8 %x) { %0: %cast = uitofp i8 %x to float %r = fcmp one float inf, %cast ret i1 %r } => define i1 @tgt(i8 %x) { %0: ret i1 1 } Transformation seems to be correct!
- Loading branch information
1 parent
912e9e5
commit b89ae10
Showing
2 changed files
with
12 additions
and
13 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