llvm-project/llvm/unittests/Analysis
Nikita Popov d86fff6ae7 [ValueTracking] Fix computeKnownBits() with bitwidth-changing ptrtoint
computeKnownBitsFromAssume() currently asserts if m_V matches a
ptrtoint that changes the bitwidth. Because InstCombine
canonicalizes ptrtoint instructions to use explicit zext/trunc,
we never ran into the issue in practice. I'm adding unit tests,
as I don't know if this can be triggered via IR anywhere.

Fix this by calling anyextOrTrunc(BitWidth) on the computed
KnownBits. Note that we are going from the KnownBits of the
ptrtoint result to the KnownBits of the ptrtoint operand,
so we need to truncate if the ptrtoint zexted and anyext if
the ptrtoint truncated.

Differential Revision: https://reviews.llvm.org/D79234
2020-05-16 14:17:11 +02:00
..
AliasAnalysisTest.cpp [unittests] Add InitializePasses.h includes 2019-11-13 19:42:58 -08:00
AliasSetTrackerTest.cpp
AssumeBundleQueriesTest.cpp [AssumeBundles] Refactor asssume builder 2020-04-25 13:43:52 +02:00
BasicAliasAnalysisTest.cpp [AliasAnalysis] Initialize a member variable that may be used by unit test. 2019-08-02 08:05:14 +00:00
BlockFrequencyInfoTest.cpp
BranchProbabilityInfoTest.cpp
CFGTest.cpp [unittests] Add InitializePasses.h includes 2019-11-13 19:42:58 -08:00
CGSCCPassManagerTest.cpp [NewPassManager] Add assertions when getting statefull cached analysis. 2020-05-13 12:38:38 -07:00
CMakeLists.txt [NFC] Split Knowledge retention and place it more appropriatly 2020-04-02 15:01:41 +02:00
CallGraphTest.cpp
CaptureTrackingTest.cpp [IR] Lazily number instructions for local dominance queries 2020-02-18 14:44:24 -08:00
DivergenceAnalysisTest.cpp [opaque pointer types] Add a FunctionCallee wrapper type, and use it. 2019-02-01 02:28:03 +00:00
DomTreeUpdaterTest.cpp [DTU] Refine the interface and logic of applyUpdates 2019-02-22 13:48:38 +00:00
GlobalsModRefTest.cpp Change TargetLibraryInfo analysis passes to always require Function 2019-09-07 03:09:36 +00:00
IVDescriptorsTest.cpp Save the induction binary operator in IVDescriptors for non FP induction variables. 2019-05-14 13:26:36 +00:00
LazyCallGraphTest.cpp Re-land "Add LazyCallGraph API to add function to RefSCC" 2020-02-17 16:59:25 -05:00
LoadsTest.cpp [Loads] Handle simple cases with same base pointer with constant offsets in FindAvailableLoadedValue when AA is null. 2020-01-29 13:05:46 -08:00
LoopInfoTest.cpp Rename LoopInfo::isRotated() to LoopInfo::isRotatedForm(). 2019-12-12 14:22:36 -05:00
LoopNestTest.cpp [LoopNest]: Analysis to discover properties of a loop nest. 2020-03-03 18:25:19 +00:00
MemoryBuiltinsTest.cpp
MemorySSATest.cpp [llvm] Migrate llvm::make_unique to std::make_unique 2019-08-15 15:54:37 +00:00
OrderedInstructionsTest.cpp [opaque pointer types] Pass value type to LoadInst creation. 2019-02-01 20:44:24 +00:00
PhiValuesTest.cpp [opaque pointer types] Pass value type to LoadInst creation. 2019-02-01 20:44:24 +00:00
ProfileSummaryInfoTest.cpp [llvm][NFC] Dereferencing before cast-ing in ProfileSummaryInfoTest 2020-04-18 17:47:37 -07:00
ScalarEvolutionTest.cpp [SVEV] Recognise hardware-loop intrinsic loop.decrement.reg 2020-01-10 09:35:00 +00:00
SparsePropagation.cpp [CallSite removal][Analysis] Use CallBase instead of CallSite in SparsePropagation unit test. NFC 2020-04-19 22:39:24 -07:00
TBAATest.cpp [opaque pointer types] Add a FunctionCallee wrapper type, and use it. 2019-02-01 02:28:03 +00:00
TargetLibraryInfoTest.cpp Introduce support for lib function aligned_alloc in TLI / memory builtins 2020-03-29 23:36:24 +05:30
UnrollAnalyzerTest.cpp [unittests] Add InitializePasses.h includes 2019-11-13 19:42:58 -08:00
ValueLatticeTest.cpp [ValueLattice] Remove unused DataLayout parameter of mergeIn, NFC 2020-04-14 13:32:53 +02:00
ValueTrackingTest.cpp [ValueTracking] Fix computeKnownBits() with bitwidth-changing ptrtoint 2020-05-16 14:17:11 +02:00
VectorFunctionABITest.cpp [VectorUtils] Expose vector-function-abi-variant mangling as a utility. 2020-05-15 11:42:20 -04:00
VectorUtilsTest.cpp [VFDatabase] Scalar functions are vector functions with VF =1 2020-04-29 17:20:37 +00:00