1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 20:23:11 +01:00
llvm-mirror/unittests/IR
Nikita Popov 9bdd9a8130 [ConstantRangeTest] Make exhaustive testing more principled (NFC)
The current infrastructure for exhaustive ConstantRange testing is
somewhat confusing in what exactly it tests and currently cannot even
be used for operations that produce smallest-size results, rather than
signed/unsigned envelopes.

This patch makes 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 under a given preference function: None of the
   (slack-free) ranges that can be constructed from the set are
   preferred over the computed range.

Implemented preference functions are:

 * PreferSmallest: Smallest range regardless of signed/unsigned wrapping
   behavior. Probably what we would call "optimal" without further
   qualification.
 * PreferSmallestUnsigned/Signed: Smallest range that has no
   unsigned/signed wrapping. We use this if our calculation is precise
   only up to signed/unsigned envelope.
 * PreferSmallestNonFullUnsigned/Signed: Smallest range that has no
   unsigned/signed wrapping -- but preferring a smaller wrapping range
   over a (non-wrapping) full range. We use this if we have a fully
   precise calculation but apply a sign preference to the result
   (union/intersection). Even with a sign preference, returning a
   wrapping range is still "strictly better" than returning a full one.

This also addresses PR49273 by replacing the fragile manual range
construction logic in testBinarySetOperationExhaustive() with generic
code that isn't specialized to the particular form of ranges that set
operations can produces.

Differential Revision: https://reviews.llvm.org/D88356
2021-02-20 12:37:31 +01:00
..
AbstractCallSiteTest.cpp [AbstractCallSite] Look though constant cast expression when checking for callee use 2020-04-30 15:09:57 -07:00
AsmWriterTest.cpp
AttributesTest.cpp [IR] Short-circuit comparison with itself for Attributes 2020-07-03 16:07:14 +03:00
BasicBlockTest.cpp [test] Rewrite phi-empty.ll into a unittest 2020-12-08 09:59:31 -08:00
CFGBuilder.cpp Switch from llvm::is_trivially_copyable to std::is_trivially_copyable 2020-12-02 22:02:48 -08:00
CFGBuilder.h
CMakeLists.txt [NFC] Add missing dependency in the IR unittests 2020-11-18 10:10:44 +00:00
ConstantRangeTest.cpp [ConstantRangeTest] Make exhaustive testing more principled (NFC) 2021-02-20 12:37:31 +01:00
ConstantsTest.cpp Revert "[ConstantFold] Fold more operations to poison" 2021-02-04 00:24:02 +09:00
DataLayoutTest.cpp Add a default address space for globals to DataLayout 2020-11-20 15:46:52 +00:00
DebugInfoTest.cpp [DebugInfo] Expose Fortran array debug info attributes through DIBuilder. 2020-10-28 13:13:35 -07:00
DebugTypeODRUniquingTest.cpp [DebugInfo] Support for DWARF attribute DW_AT_rank 2020-10-10 17:51:12 +05:30
DemandedBitsTest.cpp [DemandedBits] Improve accuracy of Add propagator 2020-08-17 12:54:09 +01:00
DominatorTreeBatchUpdatesTest.cpp
DominatorTreeTest.cpp [DomTree] Accept Value as Def (NFC) 2020-10-22 18:32:03 +02:00
FunctionTest.cpp Make Value::getPointerAlignment() return an Align, not a MaybeAlign. 2020-05-20 16:37:20 -07:00
InstructionsTest.cpp [CallBase] Add hasRetAttr version that takes StringRef. 2020-12-10 17:00:16 +00:00
IntrinsicsTest.cpp
IRBuilderTest.cpp [FPEnv] Intrinsic for setting rounding mode 2021-02-01 11:28:14 +07:00
LegacyPassManagerTest.cpp [CallGraph] Preserve call records vector when replacing call edge 2020-07-27 06:02:55 -07:00
ManglerTest.cpp [XCOFF][AIX] Use 'L..' instead of '.L' for getPrivateGlobalPrefix in DataLayout 2020-07-03 18:25:14 +00:00
MDBuilderTest.cpp
MetadataTest.cpp [DebugInfo] Support Fortran 'use <external module>' statement. 2020-12-18 13:10:57 -05:00
ModuleTest.cpp [llvm][NFC] Add missing 'override's in unittests/ 2020-07-17 17:35:59 -07:00
PassBuilderCallbacksTest.cpp [LoopNest] Handle loop-nest passes in LoopPassManager 2020-12-16 17:07:14 +00:00
PassManagerTest.cpp [IR] PassManagerTest: Register DominatorTreeAnalysis before running SimplifyCFGPass 2021-01-02 01:01:18 +03:00
PatternMatch.cpp Use unary CreateShuffleVector if possible 2020-12-30 22:36:08 +09:00
TimePassesTest.cpp [NewPM][PassInstrumentation] Add PreservedAnalyses parameter to AfterPass* callbacks 2020-08-21 16:10:42 +07:00
TypesTest.cpp
UserTest.cpp [NFC] Edit the comment in User::replaceUsesOfWith 2020-07-29 10:02:04 +08:00
UseTest.cpp
ValueHandleTest.cpp Fixup Asserts+!AbiBreakingChecks fallout from db33f85c7124 2021-01-07 14:18:19 -08:00
ValueMapTest.cpp
ValueTest.cpp
VectorTypesTest.cpp [SVE] Remove reliance on TypeSize comparison operators in unit tests 2020-10-21 08:05:55 +01:00
VerifierTest.cpp Revert "Revert "[NFC][llvm] Make the contructors of ElementCount private."" 2020-08-19 17:26:36 +00:00
VPIntrinsicTest.cpp [VP][Fix] canIgnoreVectorLength for scalable types 2020-06-04 14:17:42 +02:00