llvm-project/llvm/unittests/Analysis
Florian Hahn 0d966ae4b2 [Loads] Add canReplacePointersIfEqual helper.
This patch adds an initial, incomeplete and unsound implementation of
canReplacePointersIfEqual to check if a pointer value A can be replaced
by another pointer value B, that are deemed to be equivalent through
some means (e.g. information from conditions).

Note that is in general not sound to blindly replace pointers based on
equality, for example if they are based on different underlying objects.

LLVM's memory model is not completely settled as of now; see
https://bugs.llvm.org/show_bug.cgi?id=34548 for a more detailed
discussion.

The initial version of canReplacePointersIfEqual only rejects a very
specific case: replacing a pointer with a constant expression that is
not dereferenceable. Such a replacement is problematic and can be
restricted relatively easily without impacting most code. Using it to
limit replacements in GVN/SCCP/CVP only results in small differences in
7 programs out of MultiSource/SPEC2000/SPEC2006 on X86 with -O3 -flto.

This patch is supposed to be an initial step to improve the current
situation and the helper should be made stricter in the future. But this
will require careful analysis of the impact on performance.

Reviewed By: aqjune

Differential Revision: https://reviews.llvm.org/D85524
2020-09-01 20:57:41 +01:00
..
Inputs/ir2native_x86_64_model Reapply "[llvm] Native size estimator for training -Oz inliner" 2020-07-13 16:26:26 -07:00
AliasAnalysisTest.cpp [NFC] Adding the align attribute on Atomic{CmpXchg|RMW}Inst 2020-07-07 09:54:13 +00:00
AliasSetTrackerTest.cpp TargetLibraryInfo.h - reduce Triple.h include to forward declaration. NFC. 2020-06-05 14:35:30 +01:00
AssumeBundleQueriesTest.cpp Revert rG5dd566b7c7b78bd- "PassManager.h - remove unnecessary Function.h/Module.h includes. NFCI." 2020-07-24 13:02:33 +01: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 [NewPM] Avoid redundant CGSCC run for updated SCC 2020-06-14 19:54:52 -07:00
CMakeLists.txt Reapply "Rename InlineFeatureAnalysis to FunctionPropertiesAnalysis" 2020-07-22 10:07:35 -07:00
CallGraphTest.cpp
CaptureTrackingTest.cpp [IR] Lazily number instructions for local dominance queries 2020-02-18 14:44:24 -08:00
DDGTest.cpp ScalarEvolution.h - reduce LoopInfo.h include to forward declarations. NFC. 2020-06-17 15:48:23 +01:00
DivergenceAnalysisTest.cpp
DomTreeUpdaterTest.cpp
FunctionPropertiesAnalysisTest.cpp Add new function properties to FunctionPropertiesAnalysis 2020-07-23 12:46:47 -07:00
GlobalsModRefTest.cpp GlobalsModRef.h - reduce CallGraph.h include to forward declarations. NFC. 2020-06-25 16:00:43 +01:00
IVDescriptorsTest.cpp
LazyCallGraphTest.cpp TargetLibraryInfo.h - reduce Triple.h include to forward declaration. NFC. 2020-06-05 14:35:30 +01:00
LoadsTest.cpp [Loads] Add canReplacePointersIfEqual helper. 2020-09-01 20:57:41 +01:00
LoopInfoTest.cpp Rename LoopInfo::isRotated() to LoopInfo::isRotatedForm(). 2019-12-12 14:22:36 -05:00
LoopNestTest.cpp LoopAnalysisManager.h - reduce includes to forward declarations. NFC. 2020-06-06 14:06:46 +01:00
MemoryBuiltinsTest.cpp
MemorySSATest.cpp [llvm] Migrate llvm::make_unique to std::make_unique 2019-08-15 15:54:37 +00:00
PhiValuesTest.cpp
ProfileSummaryInfoTest.cpp ProfileSummaryInfoTest.cpp - fix implicit CommandLine.h dependency. NFC. 2020-06-23 13:07:18 +01:00
ScalarEvolutionTest.cpp [SCEV] Move ScalarEvolutionExpander.cpp to Transforms/Utils (NFC). 2020-05-20 10:53:40 +01: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
TFUtilsTest.cpp [MLInliner] Simplify TFUTILS_SUPPORTED_TYPES 2020-08-25 14:19:39 -07:00
TargetLibraryInfoTest.cpp [LLVM] Add libatomic load/store functions to TargetLibraryInfo 2020-07-18 03:18:48 +00:00
UnrollAnalyzerTest.cpp ScalarEvolution.h - reduce LoopInfo.h include to forward declarations. NFC. 2020-06-17 15:48:23 +01:00
ValueLatticeTest.cpp [ValueLattice] Remove unused DataLayout parameter of mergeIn, NFC 2020-04-14 13:32:53 +02:00
ValueTrackingTest.cpp [ValueTracking] Replace recursion with Worklist 2020-08-27 14:44:49 -07:00
VectorFunctionABITest.cpp Fix crash when getVFABIMappings is called with an indirect call instruction 2020-07-13 15:28:46 +01:00
VectorUtilsTest.cpp Revert "Revert "[NFC][llvm] Make the contructors of `ElementCount` private."" 2020-08-19 17:26:36 +00:00