[PATCH] D88356: [ConstantRange] Make exhaustive testing more principled (NFC)

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Sep 26 06:36:43 PDT 2020


nikic created this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
nikic requested review of this revision.

The current infrastructure for exhaustive ConstantRange testing is somewhat confusing in what exactly it tests (D88283 <https://reviews.llvm.org/D88283>) and currently cannot even be used for operations that produce precise results, rather than signed/unsigned approximations.

This patch tries to make the testing more principled by collecting the exact set of results of an operation into a bit set and then comparing it against the range approximation by:

- Checking conservative correctness: All elements in the set must be in the range.
- Checking optimality:


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D88356

Files:
  llvm/unittests/IR/ConstantRangeTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D88356.294494.patch
Type: text/x-patch
Size: 14919 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200926/4ed2a617/attachment.bin>


More information about the llvm-commits mailing list