Fix the fabs regression on x86 by abstracting the select_cc optimization

out into SimplifySelectCC.  This allows both ISD::SELECT and ISD::SELECT_CC
to use the same set of simplifying folds.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22779 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Nate Begeman
2005-08-13 06:00:21 +00:00
parent 8f331325a2
commit 32c392a3a5
2 changed files with 92 additions and 71 deletions

View File

@@ -214,12 +214,18 @@ public:
private:
void DeleteNodeIfDead(SDNode *N, void *NodeSet);
// Try to simplify a setcc built with the specified operands and cc. If
// unable to simplify it, return a null SDOperand.
/// SimplifySetCC - Try to simplify a setcc built with the specified operands
/// and cc. If unable to simplify it, return a null SDOperand.
SDOperand SimplifySetCC(MVT::ValueType VT, SDOperand N1,
SDOperand N2, ISD::CondCode Cond);
/// SimplifySelectCC - Try to simplify a select_cc built with the specified
/// operands and cc. This can be used to simplify both the select_cc node,
/// and a select node whose first operand is a setcc.
SDOperand SimplifySelectCC(MVT::ValueType VT, ISD::CondCode CC,
SDOperand N1, SDOperand N2, SDOperand N3,
SDOperand N4);
// Maps to auto-CSE operations.
std::map<std::pair<unsigned, std::pair<SDOperand, MVT::ValueType> >,
SDNode *> UnaryOps;