[PATCH] D90479: [WIP][ValueTracking] ComputeKnownBits - minimum leading/trailing zero bits in LSHR/SHL (PR44526)

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 30 10:33:49 PDT 2020


RKSimon created this revision.
RKSimon added reviewers: spatel, regehr, efriedma, lebedev.ri.
Herald added a subscriber: hiraditya.
Herald added a project: LLVM.
RKSimon requested review of this revision.

Followup to D72573 <https://reviews.llvm.org/D72573> - as detailed in https://blog.regehr.org/archives/1709 we don't make use of the known leading/trailing zeros for shifted values in cases where we don't know the shift amount value.

This patch adds support to ValueTracking ComputeKnownBits to use KnownBits::countMinTrailingZeros and countMinLeadingZeros to set the minimum guaranteed leading/trailing known zero bits.

This patch is a WIP - and is initially just a way to track the changes necessary to some existing tests.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D90479

Files:
  llvm/lib/Analysis/ValueTracking.cpp
  llvm/test/Transforms/InstCombine/and2.ll
  llvm/test/Transforms/InstCombine/lshr-and-negC-icmpeq-zero.ll
  llvm/test/Transforms/InstCombine/signbit-shl-and-icmpeq-zero.ll
  llvm/test/Transforms/InstCombine/zext-or-icmp.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D90479.301948.patch
Type: text/x-patch
Size: 8329 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201030/110ef5b7/attachment.bin>


More information about the llvm-commits mailing list