[PATCH] D37690: [ARM] Fix typo when creating ISD::SUB nodes

Roger Ferrer Ibanez via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 11 07:45:28 PDT 2017


rogfer01 created this revision.
Herald added subscribers: kristof.beyls, javed.absar, aemerson.

In https://reviews.llvm.org/D35192, I accidentally introduced a typo when creating ISD::SUB nodes, giving them two values instead of one.

This fails when the `merge_values` combiner finds one of these nodes.


https://reviews.llvm.org/D37690

Files:
  lib/Target/ARM/ARMISelLowering.cpp


Index: lib/Target/ARM/ARMISelLowering.cpp
===================================================================
--- lib/Target/ARM/ARMISelLowering.cpp
+++ lib/Target/ARM/ARMISelLowering.cpp
@@ -4029,7 +4029,7 @@
     Overflow = ConvertCarryFlagToBooleanCarry(Value.getValue(1), VT, DAG);
     // ARMISD::SUBC returns 0 when we have to borrow, so make it an overflow
     // value. So compute 1 - C.
-    Overflow = DAG.getNode(ISD::SUB, dl, VTs,
+    Overflow = DAG.getNode(ISD::SUB, dl, VT,
                            DAG.getConstant(1, dl, MVT::i32), Overflow);
     break;
   }
@@ -7470,7 +7470,7 @@
     // ARMISD::SUBE expects a carry not a borrow like ISD::SUBCARRY so we
     // have to invert the carry first.
     Carry =
-        DAG.getNode(ISD::SUB, DL, VTs, DAG.getConstant(1, DL, MVT::i32), Carry);
+        DAG.getNode(ISD::SUB, DL, VT, DAG.getConstant(1, DL, MVT::i32), Carry);
     // This converts the boolean value carry into the carry flag.
     Carry = ConvertBooleanCarryToCarryFlag(Carry, DAG);
 
@@ -7483,7 +7483,7 @@
     // But the carry returned by ARMISD::SUBE is not a borrow as expected
     // by ISD::SUBCARRY, so compute 1 - C.
     Carry =
-        DAG.getNode(ISD::SUB, DL, VTs, DAG.getConstant(1, DL, MVT::i32), Carry);
+        DAG.getNode(ISD::SUB, DL, VT, DAG.getConstant(1, DL, MVT::i32), Carry);
   }
 
   // Return both values.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D37690.114609.patch
Type: text/x-patch
Size: 1369 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170911/43c9e277/attachment.bin>


More information about the llvm-commits mailing list