forked from OSchip/llvm-project
[X86] Gate select->fmin/fmax transform on NoSignedZeros instead of UnsafeFPMath
This commit is contained in:
parent
42beb8ed79
commit
5f158d8e21
|
@ -36916,7 +36916,7 @@ static SDValue combineSelect(SDNode *N, SelectionDAG &DAG,
|
|||
// the operands would cause it to handle comparisons between positive
|
||||
// and negative zero incorrectly.
|
||||
if (!DAG.isKnownNeverNaN(LHS) || !DAG.isKnownNeverNaN(RHS)) {
|
||||
if (!DAG.getTarget().Options.UnsafeFPMath &&
|
||||
if (!DAG.getTarget().Options.NoSignedZerosFPMath &&
|
||||
!(DAG.isKnownNeverZeroFloat(LHS) ||
|
||||
DAG.isKnownNeverZeroFloat(RHS)))
|
||||
break;
|
||||
|
@ -36927,7 +36927,7 @@ static SDValue combineSelect(SDNode *N, SelectionDAG &DAG,
|
|||
case ISD::SETOLE:
|
||||
// Converting this to a min would handle comparisons between positive
|
||||
// and negative zero incorrectly.
|
||||
if (!DAG.getTarget().Options.UnsafeFPMath &&
|
||||
if (!DAG.getTarget().Options.NoSignedZerosFPMath &&
|
||||
!DAG.isKnownNeverZeroFloat(LHS) && !DAG.isKnownNeverZeroFloat(RHS))
|
||||
break;
|
||||
Opcode = X86ISD::FMIN;
|
||||
|
@ -36946,7 +36946,7 @@ static SDValue combineSelect(SDNode *N, SelectionDAG &DAG,
|
|||
case ISD::SETOGE:
|
||||
// Converting this to a max would handle comparisons between positive
|
||||
// and negative zero incorrectly.
|
||||
if (!DAG.getTarget().Options.UnsafeFPMath &&
|
||||
if (!DAG.getTarget().Options.NoSignedZerosFPMath &&
|
||||
!DAG.isKnownNeverZeroFloat(LHS) && !DAG.isKnownNeverZeroFloat(RHS))
|
||||
break;
|
||||
Opcode = X86ISD::FMAX;
|
||||
|
@ -36956,7 +36956,7 @@ static SDValue combineSelect(SDNode *N, SelectionDAG &DAG,
|
|||
// the operands would cause it to handle comparisons between positive
|
||||
// and negative zero incorrectly.
|
||||
if (!DAG.isKnownNeverNaN(LHS) || !DAG.isKnownNeverNaN(RHS)) {
|
||||
if (!DAG.getTarget().Options.UnsafeFPMath &&
|
||||
if (!DAG.getTarget().Options.NoSignedZerosFPMath &&
|
||||
!(DAG.isKnownNeverZeroFloat(LHS) ||
|
||||
DAG.isKnownNeverZeroFloat(RHS)))
|
||||
break;
|
||||
|
@ -36984,7 +36984,7 @@ static SDValue combineSelect(SDNode *N, SelectionDAG &DAG,
|
|||
// Converting this to a min would handle comparisons between positive
|
||||
// and negative zero incorrectly, and swapping the operands would
|
||||
// cause it to handle NaNs incorrectly.
|
||||
if (!DAG.getTarget().Options.UnsafeFPMath &&
|
||||
if (!DAG.getTarget().Options.NoSignedZerosFPMath &&
|
||||
!(DAG.isKnownNeverZeroFloat(LHS) ||
|
||||
DAG.isKnownNeverZeroFloat(RHS))) {
|
||||
if (!DAG.isKnownNeverNaN(LHS) || !DAG.isKnownNeverNaN(RHS))
|
||||
|
@ -36995,8 +36995,7 @@ static SDValue combineSelect(SDNode *N, SelectionDAG &DAG,
|
|||
break;
|
||||
case ISD::SETUGT:
|
||||
// Converting this to a min would handle NaNs incorrectly.
|
||||
if (!DAG.getTarget().Options.UnsafeFPMath &&
|
||||
(!DAG.isKnownNeverNaN(LHS) || !DAG.isKnownNeverNaN(RHS)))
|
||||
if (!DAG.isKnownNeverNaN(LHS) || !DAG.isKnownNeverNaN(RHS))
|
||||
break;
|
||||
Opcode = X86ISD::FMIN;
|
||||
break;
|
||||
|
@ -37021,7 +37020,7 @@ static SDValue combineSelect(SDNode *N, SelectionDAG &DAG,
|
|||
// Converting this to a max would handle comparisons between positive
|
||||
// and negative zero incorrectly, and swapping the operands would
|
||||
// cause it to handle NaNs incorrectly.
|
||||
if (!DAG.getTarget().Options.UnsafeFPMath &&
|
||||
if (!DAG.getTarget().Options.NoSignedZerosFPMath &&
|
||||
!DAG.isKnownNeverZeroFloat(LHS) &&
|
||||
!DAG.isKnownNeverZeroFloat(RHS)) {
|
||||
if (!DAG.isKnownNeverNaN(LHS) || !DAG.isKnownNeverNaN(RHS))
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
|
||||
; RUN: llc < %s -mtriple=x86_64-apple-macosx -mattr=+avx2 -enable-unsafe-fp-math | FileCheck %s
|
||||
; RUN: llc < %s -mtriple=x86_64-apple-macosx -mattr=+avx2 -enable-no-signed-zeros-fp-math | FileCheck %s
|
||||
|
||||
; Check that the ExeDepsFix pass correctly fixes the domain for broadcast instructions.
|
||||
; <rdar://problem/16354675>
|
||||
|
|
Loading…
Reference in New Issue