1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 10:42:39 +01:00
llvm-mirror/lib/Analysis
Roman Lebedev 5a174914f6 Revert "[SCEV] Model ashr exact x, C as (abs(x) EXACT/u (1<<C)) * signum(x)"
As being discussed in https://reviews.llvm.org/D100721,
this modelling is lossy, we can't reconstruct `ash`/`ashr exact`
from it, which means that whenever we actually expand the IR,
we've just pessimized the code..

It would be good to model this pattern, after all it comes up every time
you want to compute a distance between two pointers, but not at this cost.

This reverts commit ec54867df5e7f20e12146e628af34f0384308bcb.
2021-04-18 16:26:45 +03:00
..
models/inliner [MLInliner] Simplify TFUTILS_SUPPORTED_TYPES 2020-08-25 14:19:39 -07:00
AliasAnalysis.cpp [AA] Updates for D95543. 2021-04-15 12:22:03 +03:00
AliasAnalysisEvaluator.cpp [AA] Updates for D95543. 2021-04-15 12:22:03 +03:00
AliasAnalysisSummary.cpp AliasAnalysisSummary.h - cleanup includes and forward declarations. NFC. 2020-04-21 11:32:58 +01:00
AliasAnalysisSummary.h AliasAnalysisSummary.h - cleanup includes and forward declarations. NFC. 2020-04-21 11:32:58 +01:00
AliasSetTracker.cpp [NFC][AA] Prepare to convert AliasResult to class with PartialAlias offset. 2021-04-09 12:54:22 +03:00
Analysis.cpp [NPM] Port module-debuginfo pass to the new pass manager 2020-10-19 14:31:17 -07:00
AssumeBundleQueries.cpp Plumb AssumeInst through operand bundle apis [nfc] 2021-04-06 12:53:53 -07:00
AssumptionCache.cpp Use AssumeInst in a few more places [nfc] 2021-04-06 13:18:53 -07:00
BasicAliasAnalysis.cpp [AA] Updates for D95543. 2021-04-15 12:22:03 +03:00
BlockFrequencyInfo.cpp [BFI][CGP] Add limited support for detecting missed BFI updates and fix one in CodeGenPrepare. 2020-05-07 11:58:00 -07:00
BlockFrequencyInfoImpl.cpp [BFI] Add a debug check for unknown block queries. 2020-02-04 10:05:28 -08:00
BranchProbabilityInfo.cpp [Analysis] Use range-based for loops (NFC) 2021-02-06 11:17:10 -08:00
CallGraph.cpp Set IgnoreLLVMUsed to false in CallGraph::addToCallGraph() 2021-04-08 11:14:09 -07:00
CallGraphSCCPass.cpp [Analysis] Use ListSeparator (NFC) 2021-02-22 20:17:15 -08:00
CallPrinter.cpp [Analysis] Use range-based for loops (NFC) 2021-02-06 11:17:10 -08:00
CaptureTracking.cpp Update basic deref API to account for possiblity of free [NFC] 2021-03-19 11:17:19 -07:00
CFG.cpp [Analysis] Use is_contained (NFC) 2020-12-11 21:19:31 -08:00
CFGPrinter.cpp Replace uses of std::iterator with explicit using 2021-04-12 10:47:14 -07:00
CFLAndersAliasAnalysis.cpp [NFC][AA] Prepare to convert AliasResult to class with PartialAlias offset. 2021-04-09 12:54:22 +03:00
CFLGraph.h [CFLGraph] Fix a crash due to missing handling of freeze 2021-03-21 02:14:13 +09:00
CFLSteensAliasAnalysis.cpp [NFC][AA] Prepare to convert AliasResult to class with PartialAlias offset. 2021-04-09 12:54:22 +03:00
CGSCCPassManager.cpp Reapply "[NPM][CGSCC] FunctionAnalysisManagerCGSCCProxy: do not clear immutable function passes" 2021-03-18 09:44:34 -07:00
CMakeLists.txt [mlgo] fix build rules 2021-04-03 12:49:03 -07:00
CmpInstAnalysis.cpp
CodeMetrics.cpp Revert "[AssumptionCache] Avoid dangling llvm.assume calls in the cache" 2021-02-11 12:17:38 -06:00
ConstantFolding.cpp [WebAssembly] Remove saturating fp-to-int target intrinsics 2021-04-16 12:11:20 -07:00
ConstraintSystem.cpp [llvm] Remove redundant string initialization (NFC) 2021-01-12 21:43:46 -08:00
CostModel.cpp [InstructionCost] Don't conflate Invalid costs with Unknown costs. 2021-03-30 09:29:42 +01:00
DDG.cpp [Analysis] Use llvm::append_range (NFC) 2021-01-22 23:25:01 -08:00
DDGPrinter.cpp [DDG] Data Dependence Graph - DOT printer - recommit 2020-12-16 12:37:36 -05:00
Delinearization.cpp [Analysis] Use range-based for loops (NFC) 2021-02-06 11:17:10 -08:00
DemandedBits.cpp [DCE] Don't remove non-willreturn calls 2021-02-19 12:35:40 +01:00
DependenceAnalysis.cpp [NFC][AA] Prepare to convert AliasResult to class with PartialAlias offset. 2021-04-09 12:54:22 +03:00
DependenceGraphBuilder.cpp [Analysis] Use llvm::append_range (NFC) 2021-01-22 23:25:01 -08:00
DevelopmentModeInlineAdvisor.cpp [MLGO] Fix use of AM.invalidate post D100519 2021-04-15 18:45:39 -07:00
DivergenceAnalysis.cpp [Analysis] Use range-based for loops (NFC) 2021-02-22 20:17:18 -08:00
DominanceFrontier.cpp
DomPrinter.cpp [CFGPrinter][CallPrinter][polly] Adding distinct structure for CFGDOTInfo 2020-04-06 17:42:54 +00:00
DomTreeUpdater.cpp [NFCI][DomTreeUpdater] applyUpdates(): reserve space for updates first 2021-04-11 23:56:22 +03:00
EHPersonalities.cpp [XCOFF][AIX] Generate LSDA data and compact unwind section on AIX 2020-12-02 18:42:44 +00:00
FunctionPropertiesAnalysis.cpp [llvm] Ensure newlines at the end of files (NFC) 2021-01-10 09:24:57 -08:00
GlobalsModRef.cpp [NFC][AA] Prepare to convert AliasResult to class with PartialAlias offset. 2021-04-09 12:54:22 +03:00
GuardUtils.cpp [NFC] Remove trailing space 2020-02-18 10:49:13 +08:00
HeatUtils.cpp [CallPrinter] Remove static constructor. 2020-06-17 13:02:58 +02:00
ImportedFunctionsInliningStatistics.cpp Reland "[NPM][Inliner] Factor ImportedFunctionStats in the InlineAdvisor" 2021-01-20 13:33:43 -08:00
IndirectCallPromotionAnalysis.cpp [SampleFDO] Another fix to prevent repeated indirect call promotion in 2021-03-04 18:44:12 -08:00
InlineAdvisor.cpp [NFC] Use llvm::raw_string_ostream instead of std::stringstream 2021-03-12 18:43:59 +01:00
InlineCost.cpp [Inliner] Propagate SROA analysis through invariant group intrinsics 2021-04-12 10:54:22 -07:00
InlineSizeEstimatorAnalysis.cpp [MLGO] Fix build break as result of new InstructionCost (D91174) 2020-12-11 20:28:39 -08:00
InstCount.cpp [NFC] Port InstCount pass to new pass manager 2020-08-21 12:39:42 +03:00
InstructionPrecedenceTracking.cpp [GVN] Properly invalidate ICF cache when we simplify a value 2021-04-08 14:01:57 -07:00
InstructionSimplify.cpp [InstSimplify] improve efficiency for detecting non-zero value 2021-04-14 09:04:15 -04:00
Interval.cpp [Analysis/Interval] Remove isLoop (NFC) 2020-12-12 10:09:35 -08:00
IntervalPartition.cpp
IRSimilarityIdentifier.cpp [Analysis] Use range-based for loops (NFC) 2021-02-22 20:17:18 -08:00
IVDescriptors.cpp Normalize interaction with boolean attributes 2021-04-17 08:17:33 +02:00
IVUsers.cpp [IVUsers] Check LoopSimplify cache earlier (NFC) 2021-04-10 22:58:13 +02:00
LazyBlockFrequencyInfo.cpp
LazyBranchProbabilityInfo.cpp
LazyCallGraph.cpp Only verify LazyCallGraph under expensive checks 2021-02-22 20:18:59 -08:00
LazyValueInfo.cpp [CVP] @llvm.[us]{min,max}() intrinsics handling 2021-04-11 00:33:47 +03:00
LegacyDivergenceAnalysis.cpp [NewPM] Introduce (GPU)DivergenceAnalysis in the new pass manager 2021-02-16 10:26:45 +05:30
Lint.cpp [NFC][AA] Prepare to convert AliasResult to class with PartialAlias offset. 2021-04-09 12:54:22 +03:00
Loads.cpp fix whitespace type 2021-04-13 19:02:41 -07:00
LoopAccessAnalysis.cpp Fix a miscompile introduced by 99203f2. 2021-03-25 16:53:58 -07:00
LoopAnalysisManager.cpp [NFC] Reduce include files dependency. 2020-12-03 18:25:05 +03:00
LoopCacheAnalysis.cpp [Analysis] Use llvm::append_range (NFC) 2021-01-22 23:25:01 -08:00
LoopInfo.cpp [NewPM] Cleanup IR printing instrumentation 2021-04-15 09:50:55 -07:00
LoopNestAnalysis.cpp Revert "[LoopInterchange] Replace tightly-nesting-ness check with the one from LoopNest" 2021-03-11 01:24:43 +08:00
LoopPass.cpp [Analysis] Use llvm::erase_value (NFC) 2020-12-14 22:40:13 -08:00
LoopUnrollAnalyzer.cpp ScalarEvolution.h - reduce LoopInfo.h include to forward declarations. NFC. 2020-06-17 15:48:23 +01:00
MemDepPrinter.cpp [Analysis] Remove dead function getInstTypePair (NFC) 2020-12-19 10:57:35 -08:00
MemDerefPrinter.cpp Minor format tweak to deref analysis printer 2021-03-22 18:44:18 -07:00
MemoryBuiltins.cpp [Analysis] Support AIX vec_malloc routines 2021-01-22 16:03:01 -05:00
MemoryDependenceAnalysis.cpp [NFC][AA] Prepare to convert AliasResult to class with PartialAlias offset. 2021-04-09 12:54:22 +03:00
MemoryLocation.cpp [MemLoc] Fix debug print for LocationSize 2020-12-20 17:52:48 +01:00
MemorySSA.cpp [AA][NFC] Convert AliasResult to class containing offset for PartialAlias case. 2021-04-09 13:26:09 +03:00
MemorySSAUpdater.cpp [MSSA] Rename uses in IDF regardless of new def position in basic block. 2021-04-09 12:32:37 -07:00
MLInlineAdvisor.cpp [MLGO] Fix use of AM.invalidate post D100519 2021-04-15 18:45:39 -07:00
ModuleDebugInfoPrinter.cpp [NPM] Port module-debuginfo pass to the new pass manager 2020-10-19 14:31:17 -07:00
ModuleSummaryAnalysis.cpp Use AssumeInst in a few more places [nfc] 2021-04-06 13:18:53 -07:00
MustExecute.cpp [MustExecute] Use ListSeparator (NFC) 2021-01-28 22:21:16 -08:00
ObjCARCAliasAnalysis.cpp [NFC][AA] Prepare to convert AliasResult to class with PartialAlias offset. 2021-04-09 12:54:22 +03:00
ObjCARCAnalysisUtils.cpp [NFC] Reduce include files dependency. 2020-12-03 18:25:05 +03:00
ObjCARCInstKind.cpp [ObjC][ARC] Use operand bundle 'clang.arc.attachedcall' instead of 2021-03-04 11:22:30 -08:00
OptimizationRemarkEmitter.cpp [BPI] Improve static heuristics for "cold" paths. 2020-12-23 22:47:36 +07:00
PHITransAddr.cpp
PhiValues.cpp [PhiValues] Use SetVector to avoid non-determinism 2020-10-23 20:14:02 +02:00
PostDominators.cpp
ProfileSummaryInfo.cpp [CSSPGO][llvm-profgen] Use profile summary based threshold for context trimming and merging 2021-03-22 08:56:59 -07:00
PtrUseVisitor.cpp
README.txt
RegionInfo.cpp RegionInfo.cpp - remove duplicate includes that already exist in RegionInfo.h. NFC. 2020-07-23 17:50:22 +01:00
RegionPass.cpp [NFC] Clean up always false variables 2020-10-21 10:54:55 -07:00
RegionPrinter.cpp [CFGPrinter][CallPrinter][polly] Adding distinct structure for CFGDOTInfo 2020-04-06 17:42:54 +00:00
ReleaseModeModelRunner.cpp static const char *const foo => const char foo[] 2020-12-01 10:33:18 -08:00
ReplayInlineAdvisor.cpp [InlineAdvisor] Allow replay of inline decisions for the CGSCC inliner from optimization remarks 2021-01-25 15:38:57 -08:00
ScalarEvolution.cpp Revert "[SCEV] Model ashr exact x, C as (abs(x) EXACT/u (1<<C)) * signum(x)" 2021-04-18 16:26:45 +03:00
ScalarEvolutionAliasAnalysis.cpp [NFC][AA] Prepare to convert AliasResult to class with PartialAlias offset. 2021-04-09 12:54:22 +03:00
ScalarEvolutionDivision.cpp [SCEV] Generalize SCEVParameterRewriter to accept SCEV expression as target. 2020-09-18 10:05:02 +01:00
ScalarEvolutionNormalization.cpp
ScopedNoAliasAA.cpp [NFC][AA] Prepare to convert AliasResult to class with PartialAlias offset. 2021-04-09 12:54:22 +03:00
StackLifetime.cpp When dumping results of StackLifetime, it will print the following 2020-09-07 11:43:16 +08:00
StackSafetyAnalysis.cpp [llvm] Drop unnecessary make_range (NFC) 2021-01-09 09:25:00 -08:00
StratifiedSets.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
SyncDependenceAnalysis.cpp [Analysis] Use ListSeparator (NFC) 2021-02-14 08:36:14 -08:00
SyntheticCountsUtils.cpp [CallSite removal] Remove unneeded includes of CallSite.h. NFC 2020-04-22 00:07:13 -07:00
TargetLibraryInfo.cpp Reland "Revert "[InstCombine] when calling conventions are compatible, don't convert the call to undef idiom"" 2021-04-12 14:50:54 -07:00
TargetTransformInfo.cpp [TTI] NFC: Change getArithmeticInstrCost to return InstructionCost 2021-04-14 17:20:36 +01:00
TFUtils.cpp [Analysis] Use ListSeparator (NFC) 2021-02-21 19:58:04 -08:00
Trace.cpp
TypeBasedAliasAnalysis.cpp [SROA][TBAA] Handle shift of regular TBAA nodes 2021-04-14 14:35:20 -04:00
TypeMetadataUtils.cpp Use AssumeInst in a few more places [nfc] 2021-04-06 13:18:53 -07:00
ValueLattice.cpp [ValueLattice] Distinguish between constant ranges with/without undef. 2020-03-31 12:50:20 +01:00
ValueLatticeUtils.cpp [ValueLattice] Simplify canTrackGlobalVariableInterprocedurally (NFC). 2020-07-09 18:33:09 +01:00
ValueTracking.cpp [ValueTracking] don't recursively compute known bits using multiple llvm.assumes 2021-04-16 08:43:35 -04:00
VectorUtils.cpp [Analysis] Use range-based for loops (NFC) 2021-02-22 20:17:18 -08:00
VFABIDemangling.cpp [llvm] Use the default value of drop_begin (NFC) 2021-01-18 10:16:36 -08:00

Analysis Opportunities:

//===---------------------------------------------------------------------===//

In test/Transforms/LoopStrengthReduce/quadradic-exit-value.ll, the
ScalarEvolution expression for %r is this:

  {1,+,3,+,2}<loop>

Outside the loop, this could be evaluated simply as (%n * %n), however
ScalarEvolution currently evaluates it as

  (-2 + (2 * (trunc i65 (((zext i64 (-2 + %n) to i65) * (zext i64 (-1 + %n) to i65)) /u 2) to i64)) + (3 * %n))

In addition to being much more complicated, it involves i65 arithmetic,
which is very inefficient when expanded into code.

//===---------------------------------------------------------------------===//

In formatValue in test/CodeGen/X86/lsr-delayed-fold.ll,

ScalarEvolution is forming this expression:

((trunc i64 (-1 * %arg5) to i32) + (trunc i64 %arg5 to i32) + (-1 * (trunc i64 undef to i32)))

This could be folded to

(-1 * (trunc i64 undef to i32))

//===---------------------------------------------------------------------===//