mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-24 23:28:41 +00:00
InstCombine: fix fold "fcmp x, undef" to account for NaN
Summary: See the two test cases. ; Can fold fcmp with undef on one side by choosing NaN for the undef ; Can fold fcmp with undef on both side ; fcmp u_pred undef, undef -> true ; fcmp o_pred undef, undef -> false ; because whatever you choose for the first undef ; you can choose NaN for the other undef Reviewers: hfinkel, chandlerc, majnemer Reviewed By: majnemer Subscribers: majnemer, llvm-commits Differential Revision: http://reviews.llvm.org/D7617 From: Mehdi Amini <mehdi.amini@apple.com> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231626 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1201,11 +1201,15 @@ public:
|
||||
|
||||
/// @returns true if the predicate of this instruction is EQ or NE.
|
||||
/// \brief Determine if this is an equality predicate.
|
||||
bool isEquality() const {
|
||||
return getPredicate() == FCMP_OEQ || getPredicate() == FCMP_ONE ||
|
||||
getPredicate() == FCMP_UEQ || getPredicate() == FCMP_UNE;
|
||||
static bool isEquality(Predicate Pred) {
|
||||
return Pred == FCMP_OEQ || Pred == FCMP_ONE || Pred == FCMP_UEQ ||
|
||||
Pred == FCMP_UNE;
|
||||
}
|
||||
|
||||
/// @returns true if the predicate of this instruction is EQ or NE.
|
||||
/// \brief Determine if this is an equality predicate.
|
||||
bool isEquality() const { return isEquality(getPredicate()); }
|
||||
|
||||
/// @returns true if the predicate of this instruction is commutative.
|
||||
/// \brief Determine if this is a commutative predicate.
|
||||
bool isCommutative() const {
|
||||
|
Reference in New Issue
Block a user