diff options
author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2019-03-11 17:43:10 +0000 |
---|---|---|
committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2019-03-11 17:43:10 +0000 |
commit | 1bb5b564857eed24e13003af8392cb48d62ee14e (patch) | |
tree | b624ecde95c92a9b995667d58e68aa0c769a6f61 /llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp | |
parent | 85bbf57bf926ca4b7899ddba3569384065d21313 (diff) | |
download | bcm5719-llvm-1bb5b564857eed24e13003af8392cb48d62ee14e.tar.gz bcm5719-llvm-1bb5b564857eed24e13003af8392cb48d62ee14e.zip |
[DAG] Move SetCC NaN handling into FoldSetCC
llvm-svn: 355845
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp index 093e35b86cb..3fd0ca64313 100644 --- a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp @@ -2944,21 +2944,7 @@ SDValue TargetLowering::SimplifySetCC(EVT VT, SDValue N0, SDValue N1, if (!isa<ConstantFPSDNode>(N0) && isa<ConstantFPSDNode>(N1)) { auto *CFP = cast<ConstantFPSDNode>(N1); - - // If the RHS of an FP comparison is a constant, simplify it away in - // some cases. - if (CFP->getValueAPF().isNaN()) { - // If an operand is known to be a nan, we can fold it. - switch (ISD::getUnorderedFlavor(Cond)) { - default: llvm_unreachable("Unknown flavor!"); - case 0: // Known false. - return DAG.getBoolConstant(false, dl, VT, OpVT); - case 1: // Known true. - return DAG.getBoolConstant(true, dl, VT, OpVT); - case 2: // Undefined. - return DAG.getUNDEF(VT); - } - } + assert(!CFP->getValueAPF().isNaN() && "Unexpected NaN value"); // Otherwise, we know the RHS is not a NaN. Simplify the node to drop the // constant if knowing that the operand is non-nan is enough. We prefer to |