diff options
author | Andrew Lenharth <andrewl@lenharth.org> | 2008-10-07 17:09:16 +0000 |
---|---|---|
committer | Andrew Lenharth <andrewl@lenharth.org> | 2008-10-07 17:09:16 +0000 |
commit | 6d409f08bec4ff5e4b390fcd990b4b76dd88a8ef (patch) | |
tree | 9cc3485a44c02151528721c5e5e291cd28adaf46 /llvm/lib | |
parent | 6606f17e505f2b2b34b29a7dfe1b04c41d49f84d (diff) | |
download | bcm5719-llvm-6d409f08bec4ff5e4b390fcd990b4b76dd88a8ef.tar.gz bcm5719-llvm-6d409f08bec4ff5e4b390fcd990b4b76dd88a8ef.zip |
Use ADDC if it is valid at any smaller size. Do it right this time
llvm-svn: 57248
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index 428e161f996..b353569c1fc 100644 --- a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp @@ -6445,14 +6445,17 @@ void SelectionDAGLegalize::ExpandOp(SDValue Op, SDValue &Lo, SDValue &Hi){ unsigned OpV = Node->getOpcode() == ISD::ADD ? ISD::ADDC : ISD::SUBC; bool hasCarry = false; if (NVT == MVT::i64) - hasCarry |= TLI.isOperationLegal(OpV, MVT::i32) + hasCarry |= TLI.isOperationLegal(OpV, MVT::i64) + | TLI.isOperationLegal(OpV, MVT::i32) | TLI.isOperationLegal(OpV, MVT::i16) | TLI.isOperationLegal(OpV, MVT::i8); if (NVT == MVT::i32) - hasCarry |= TLI.isOperationLegal(OpV, MVT::i16) + hasCarry |= TLI.isOperationLegal(OpV, MVT::i32) + | TLI.isOperationLegal(OpV, MVT::i16) | TLI.isOperationLegal(OpV, MVT::i8); if (NVT == MVT::i16) - hasCarry |= TLI.isOperationLegal(OpV, MVT::i8); + hasCarry |= TLI.isOperationLegal(OpV, MVT::i16) + | TLI.isOperationLegal(OpV, MVT::i8); if(hasCarry) { if (Node->getOpcode() == ISD::ADD) { |