[PATCH] D125603: [ConstantRange] Improve the implementation of binaryAnd

Alexander Shaposhnikov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 16 14:52:05 PDT 2022


alexander-shaposhnikov added inline comments.


================
Comment at: llvm/test/Transforms/SCCP/range-and.ll:160
   %p = phi i64 [ %r.1, %bb1 ], [ %r.2, %bb2 ]
-  %p.and = and i64 %p, 512
+  %p.and = and i64 %p, 255
   %c = icmp ult i64 %p.and, 256
----------------
alexander-shaposhnikov wrote:
> nikic wrote:
> > Why is this change being made?
> that's because SCCP sees that regardless of the predecessor the value of %p is less or equal than 255,
> thus 'AND' with 512 is always equal to 0  (because of the changes in 'binaryAnd') (previously it was using the conservative estimate
> [0, min(255, 512)] for %p).
typo: (previously it was using the conservative estimate [0, min(255, 512)] for %p.and)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D125603



More information about the llvm-commits mailing list