diff options
| author | Chris Lattner <sabre@nondot.org> | 2005-08-25 17:54:58 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2005-08-25 17:54:58 +0000 |
| commit | 9d28a56d55bc3f68b9607ffc19bfa5bca25fa485 (patch) | |
| tree | e460eaa238c073ca5a4e3471fa429e21df65b43e /llvm/lib/CodeGen | |
| parent | dc664570220c5582f7d60ccd33db624ea38af3c2 (diff) | |
| download | bcm5719-llvm-9d28a56d55bc3f68b9607ffc19bfa5bca25fa485.tar.gz bcm5719-llvm-9d28a56d55bc3f68b9607ffc19bfa5bca25fa485.zip | |
simplify the code a bit using isOperationLegal
llvm-svn: 23053
Diffstat (limited to 'llvm/lib/CodeGen')
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index 72352f10fde..9793478dba8 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -897,13 +897,12 @@ SDOperand SelectionDAG::SimplifySelectCC(SDOperand N1, SDOperand N2, // Check to see if this is the equivalent of setcc X, 0 if (N4C && N4C->isNullValue() && N3C && (N3C->getValue() == 1ULL)) { MVT::ValueType XType = N1.getValueType(); - if (TLI.getOperationAction(ISD::SETCC, TLI.getSetCCResultTy()) == - TargetLowering::Legal) { + if (TLI.isOperationLegal(ISD::SETCC, TLI.getSetCCResultTy())) return getSetCC(TLI.getSetCCResultTy(), N1, N2, CC); - } + // seteq X, 0 -> srl (ctlz X, log2(size(X))) if (N2C && N2C->isNullValue() && CC == ISD::SETEQ && - TLI.getOperationAction(ISD::CTLZ, XType) == TargetLowering::Legal) { + TLI.isOperationLegal(ISD::CTLZ, XType)) { SDOperand Ctlz = getNode(ISD::CTLZ, XType, N1); return getNode(ISD::SRL, XType, Ctlz, getConstant(Log2_32(MVT::getSizeInBits(XType)), |

