]> granicus.if.org Git - llvm/commitdiff
[AVR] Re-enable expansion of ADDE/ADDC/SUBE/SUBC in ISel
authorDylan McKay <me@dylanmckay.io>
Sun, 29 Jul 2018 11:38:36 +0000 (11:38 +0000)
committerDylan McKay <me@dylanmckay.io>
Sun, 29 Jul 2018 11:38:36 +0000 (11:38 +0000)
This was disabled in r333748, which broke four tests.

In the future, these need to be updated to UADDO/ADDCARRY or
USUBO/SUBCARRY.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@338212 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/AVR/AVRISelLowering.cpp

index c1515571aae5782b43f108b54d6e0db432aa706c..1b412a9c6813c7c6618aa219f2cd10618353d6c3 100644 (file)
@@ -63,6 +63,13 @@ AVRTargetLowering::AVRTargetLowering(AVRTargetMachine &tm)
 
   setTruncStoreAction(MVT::i16, MVT::i8, Expand);
 
+  for (MVT VT : MVT::integer_valuetypes()) {
+    setOperationAction(ISD::ADDC, VT, Legal);
+    setOperationAction(ISD::SUBC, VT, Legal);
+    setOperationAction(ISD::ADDE, VT, Legal);
+    setOperationAction(ISD::SUBE, VT, Legal);
+  }
+
   // sub (x, imm) gets canonicalized to add (x, -imm), so for illegal types
   // revert into a sub since we don't have an add with immediate instruction.
   setOperationAction(ISD::ADD, MVT::i32, Custom);