[llvm-commits] Patch for add/sub expansion without addc in LegalizeDAG.cpp
Daniel M Gessel
gessel at apple.com
Tue Dec 9 13:27:08 PST 2008
We're not yet using Legalize Types in our project, and, with help from
Mon Ping, I found what looks like a bug in the add/sub expansion in
LegalizeDAG.cpp that's still in the SVN repository. Mon Ping checked
how it's done in LegalizeIntegerTypes.cpp and this updates
LegalizeDAG.cpp to reflect that.
IIUC, this code will soon be fully deprecated but I thought I'd post
the patch anyway.
Dan
Index: lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
===================================================================
--- lib/CodeGen/SelectionDAG/LegalizeDAG.cpp (revision 60773)
+++ lib/CodeGen/SelectionDAG/LegalizeDAG.cpp (working copy)
@@ -6865,8 +6865,8 @@
break;
} else {
if (Node->getOpcode() == ISD::ADD) {
- Lo = DAG.getNode(ISD::ADD, VTList, LoOps, 2);
- Hi = DAG.getNode(ISD::ADD, VTList, HiOps, 2);
+ Lo = DAG.getNode(ISD::ADD, NVT, LoOps, 2);
+ Hi = DAG.getNode(ISD::ADD, NVT, HiOps, 2);
SDValue Cmp1 = DAG.getSetCC(TLI.getSetCCResultType(Lo),
Lo, LoOps[0], ISD::SETULT);
SDValue Carry1 = DAG.getNode(ISD::SELECT, NVT, Cmp1,
@@ -6879,8 +6879,8 @@
Carry1);
Hi = DAG.getNode(ISD::ADD, NVT, Hi, Carry2);
} else {
- Lo = DAG.getNode(ISD::SUB, VTList, LoOps, 2);
- Hi = DAG.getNode(ISD::SUB, VTList, HiOps, 2);
+ Lo = DAG.getNode(ISD::SUB, NVT, LoOps, 2);
+ Hi = DAG.getNode(ISD::SUB, NVT, HiOps, 2);
SDValue Cmp = DAG.getSetCC(NVT, LoOps[0], LoOps[1],
ISD::SETULT);
SDValue Borrow = DAG.getNode(ISD::SELECT, NVT, Cmp,
DAG.getConstant(1, NVT),
More information about the llvm-commits
mailing list