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

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 18 08:38:33 PST 2021


lebedev.ri accepted this revision.
lebedev.ri added a comment.
This revision is now accepted and ready to land.

Looks good to me FWIW.



================
Comment at: llvm/lib/Analysis/ScalarEvolution.cpp:5873
+    if (NS > 1)
+      ConservativeResult = ConservativeResult.intersectWith(
+          ConstantRange(APInt::getSignedMinValue(BitWidth).ashr(NS - 1),
----------------
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?


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

https://reviews.llvm.org/D96534



More information about the llvm-commits mailing list