[PATCH] D35192: [ARM] Use ADDCARRY / SUBCARRY

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 10 15:22:34 PDT 2017


efriedma added inline comments.


================
Comment at: lib/Target/ARM/ARMISelLowering.cpp:9976
+      SDLoc DL(N);
+      return LHS->getOperand(2);
+    }
----------------
ARMISD::SUBC return two values.  The flags register will be the same, but the returned value might not.


================
Comment at: lib/Target/ARM/ARMISelLowering.cpp:10016
                                       const ARMSubtarget *Subtarget) {
+  // (ADDE 0, 0, (SUBC X, 1)) -> X
+  if (N->getOpcode() == ARMISD::ADDE) {
----------------
What is this combine trying to do?  X is an arbitrary i32; the numeric result of ADDE is either 0 or 1.


================
Comment at: lib/Target/ARM/ARMISelLowering.cpp:12823
+    }
     // These nodes' second result is a boolean
     Known.Zero |= APInt::getHighBitsSet(BitWidth, BitWidth - 1);
----------------
Is this true?


================
Comment at: test/CodeGen/ARM/intrinsics-overflow.ll:12
+  ; CHECK: mov r[[R2:[0-9]+]], #0
+  ; CHECK: adc r[[R0]], r[[R2]], #0
 }
----------------
Could you change this test to also show what happens in Thumb1 mode?


https://reviews.llvm.org/D35192





More information about the llvm-commits mailing list