[PATCH] D108992: [KnownBits] Add support for X+X and X*X self-addition/multiplication

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 31 06:13:30 PDT 2021


RKSimon created this revision.
RKSimon added reviewers: nikic, lebedev.ri, spatel.
Herald added subscribers: dexonsmith, hiraditya.
RKSimon requested review of this revision.
Herald added a project: LLVM.

Add KnownBits handling and unit tests for X+X and X*X self-addition/multiplication cases which guarantee that the bit0 (add) and bit1 (mul) of their results will be zero.

PR48683 raised X*X case and I've handled the X+X case as well.

https://alive2.llvm.org/ce/z/NN_eaR

The next step will be to add suitable test coverage so this can be enabled in ValueTracking/DAG/GlobalISel - currently only a single Analysis/ScalarEvolution test is affected.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D108992

Files:
  llvm/include/llvm/Support/KnownBits.h
  llvm/lib/Support/KnownBits.cpp
  llvm/unittests/Support/KnownBitsTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D108992.369687.patch
Type: text/x-patch
Size: 5175 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210831/f2eb9a35/attachment.bin>


More information about the llvm-commits mailing list