[PATCH] D60522: [KnownBits] Add computeForAddCarry()

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 10 11:14:36 PDT 2019


nikic created this revision.
nikic added reviewers: lebedev.ri, spatel, RKSimon, bjope.
Herald added subscribers: llvm-commits, kristina, hiraditya, mgorny.
Herald added a project: LLVM.

This is for D60460 <https://reviews.llvm.org/D60460>. computeForAddSub() essentially already supports carries because it has to deal with subtractions. This revision extracts a lower-level computeForAddCarry() function, which allows computing the known bits for add (carry known zero), sub (carry known one) and addcarry (carry unknown).

As we don't seem to have any yet, I've added a unit test file for KnownBits and an exhaustive test for the computeForAddCarry functionality.


Repository:
  rL LLVM

https://reviews.llvm.org/D60522

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D60522.194548.patch
Type: text/x-patch
Size: 5833 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190410/11904db1/attachment.bin>


More information about the llvm-commits mailing list