[PATCH] D84963: [ValueTracking] Add basic computeKnownBits support for llvm.abs intrinsic

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 30 16:02:24 PDT 2020


spatel added a comment.

The SelectionDAG version does the following, so it would make sense to adapt these here:

  // If the source's MSB is zero then we know the rest of the bits already.
  if (Known2.isNonNegative()) {
    Known.Zero = Known2.Zero;
    Known.One = Known2.One;
    break;
  }
  
  // We only know that the absolute values's MSB will be zero iff there is
  // a set bit that isn't the sign bit (otherwise it could be INT_MIN).
  Known2.One.clearSignBit();
  if (Known2.One.getBoolValue()) {
    Known.Zero = APInt::getSignMask(BitWidth);
    break;
  }


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D84963/new/

https://reviews.llvm.org/D84963



More information about the llvm-commits mailing list