llvm-project/llvm/unittests/Analysis
Alon Kom 8e5aa969d0 [SCEV] Preserve divisibility and min/max information in applyLoopGuards
applyLoopGuards doesn't always preserve information when there are multiple assumes.

This patch tries to deal with multiple assumes regarding a SCEV's divisibility and min/max values, and rewrite it into a SCEV that still preserves all of the information.
For example, let the trip count of the loop be TC. Consider the 3 following assumes:

1. __builtin_assume(TC % 8 == 0);
2. __builtin_assume(TC > 0);
3. __builtin_assume(TC < 100);

Before this patch, depending on the assume processing order applyLoopGuards could create the following SCEV:
max(min((8 * (TC / 8)) , 99), 1)

Looking at this SCEV, it doesn't preserve the divisibility by 8 information.

After this patch, depending on the assume processing order applyLoopGuards could create the following SCEV:
max(min((8 * (TC / 8)) , 96), 8)

By aligning up 1 to 8, and aligning down 99 to 96, the new SCEV still preserves all of the original assumes.

Differential Revision: https://reviews.llvm.org/D144947
2023-03-20 12:04:05 +02:00
..
InlineAdvisorPlugin [InlineOrder] Plugin Inline Order 2023-03-15 13:15:14 -04:00
InlineOrderPlugin [gn] merge e46d8a7315 more 2023-03-18 21:19:27 +01:00
Inputs/ir2native_x86_64_model
AliasAnalysisTest.cpp
AliasSetTrackerTest.cpp
AssumeBundleQueriesTest.cpp [llvm] Use *{Set,Map}::contains (NFC) 2023-03-14 18:56:07 -07:00
BasicAliasAnalysisTest.cpp
BlockFrequencyInfoTest.cpp
BranchProbabilityInfoTest.cpp
CallGraphTest.cpp
CaptureTrackingTest.cpp
CFGTest.cpp
CGSCCPassManagerTest.cpp
CMakeLists.txt [InlineOrder] Plugin Inline Order 2023-03-15 13:15:14 -04:00
ConstraintSystemTest.cpp
DDGTest.cpp
DivergenceAnalysisTest.cpp
DomTreeUpdaterTest.cpp
FunctionPropertiesAnalysisTest.cpp
GlobalsModRefTest.cpp
InlineCostTest.cpp
IRSimilarityIdentifierTest.cpp
IVDescriptorsTest.cpp
LazyCallGraphTest.cpp
LoadsTest.cpp
LoopInfoTest.cpp
LoopNestTest.cpp
MemoryBuiltinsTest.cpp
MemoryProfileInfoTest.cpp [MemProf] Make hasSingleAllocType helper non-static 2023-02-21 12:00:03 -08:00
MemorySSATest.cpp
MLModelRunnerTest.cpp
PhiValuesTest.cpp
PluginInlineAdvisorAnalysisTest.cpp [InlineOrder] Plugin Inline Order 2023-03-15 13:15:14 -04:00
PluginInlineOrderAnalysisTest.cpp [InlineOrder] Plugin Inline Order 2023-03-15 13:15:14 -04:00
ProfileSummaryInfoTest.cpp
ScalarEvolutionTest.cpp [SCEV] Preserve divisibility and min/max information in applyLoopGuards 2023-03-20 12:04:05 +02:00
SparsePropagation.cpp
TargetLibraryInfoTest.cpp
TBAATest.cpp
TensorSpecTest.cpp
TFUtilsTest.cpp
UnrollAnalyzerTest.cpp
ValueLatticeTest.cpp
ValueTrackingTest.cpp ValueTracking: Handle nofpclass in computeKnownFPClass 2023-03-16 23:14:40 -04:00
VectorFunctionABITest.cpp
VectorUtilsTest.cpp