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

Roger Ferrer Ibanez via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 12 08:47:50 PDT 2017


rogfer01 marked an inline comment as done.
rogfer01 added a comment.

Hi @efriedma, thanks for the review. I have updated with your suggestions.

Still pending to resolve is the change I did in `ARMTargetLowering::computeKnownBitsForTargetNode`, can you clarify your comment?

Thanks!



================
Comment at: lib/Target/ARM/ARMISelLowering.cpp:10016
                                       const ARMSubtarget *Subtarget) {
+  // (ADDE 0, 0, (SUBC X, 1)) -> X
+  if (N->getOpcode() == ARMISD::ADDE) {
----------------
efriedma wrote:
> What is this combine trying to do?  X is an arbitrary i32; the numeric result of ADDE is either 0 or 1.
My brain must have shorted when I wrote this. I will remove it because not only is wrong, apparently it has no effect.


================
Comment at: lib/Target/ARM/ARMISelLowering.cpp:12823
+    }
     // These nodes' second result is a boolean
     Known.Zero |= APInt::getHighBitsSet(BitWidth, BitWidth - 1);
----------------
efriedma wrote:
> Is this true?
Maybe I do not understand what this function computes.

The result of the first operand (`Op.getResNo() == 0`) should be either 0 or 1 in the given nodes so all bits are zero but the lowermost one.


https://reviews.llvm.org/D35192





More information about the llvm-commits mailing list