[llvm-commits] [llvm] r57248 - /llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
Andrew Lenharth
alenhar2 at cs.uiuc.edu
Tue Oct 7 10:09:16 PDT 2008
Author: alenhar2
Date: Tue Oct 7 12:09:16 2008
New Revision: 57248
URL: http://llvm.org/viewvc/llvm-project?rev=57248&view=rev
Log:
Use ADDC if it is valid at any smaller size. Do it right this time
Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp?rev=57248&r1=57247&r2=57248&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Tue Oct 7 12:09:16 2008
@@ -6445,14 +6445,17 @@
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) {
More information about the llvm-commits
mailing list