[PATCH] D96534: [SCEV] Use both known bits and sign bits when computing range of SCEV unknowns

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 18 08:58:03 PST 2021


reames added inline comments.


================
Comment at: llvm/lib/Analysis/ScalarEvolution.cpp:5873
+    if (NS > 1)
+      ConservativeResult = ConservativeResult.intersectWith(
+          ConstantRange(APInt::getSignedMinValue(BitWidth).ashr(NS - 1),
----------------
lebedev.ri wrote:
> If `computeKnownBits()`-returned `KnownBits` claims to know one of the `NS` high (sign) bits,
> would we get better results if instead of doing this here,
> if we'd merge `NS` knowledge into `Known`, and repeated lines 5856-5858?
Yes actually.  I'll do that in a follow up, thanks for the idea.


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

https://reviews.llvm.org/D96534



More information about the llvm-commits mailing list