1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-21 18:22:53 +01:00
llvm-mirror/lib/Analysis
Chen Zheng 921995afd5 Revert "[HardwareLoops] Change order of SCEV expression construction for InitLoopCount."
This causes https://bugs.llvm.org/show_bug.cgi?id=51714 and
is not a right patch according to comments in D91724

This reverts commit 42eaf4fe0adef3344adfd9fbccd49f325cb549ef.

(cherry picked from commit 34badc409cc452575c538c4b6449546adc38f121)
2021-09-08 20:46:17 -07:00
..
models Unpack the CostEstimate feature in ML inlining models. 2021-07-02 16:57:16 +00:00
AliasAnalysis.cpp [AA] Support callCapturesBefore() on BatchAA (NFCI) 2021-05-14 21:48:08 +02: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
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 [Attributes] Replace doesAttrKindHaveArgument() (NFC) 2021-07-12 21:57:26 +02:00
AssumptionCache.cpp Use AssumeInst in a few more places [nfc] 2021-04-06 13:18:53 -07:00
BasicAliasAnalysis.cpp [BasicAA] Fix typo ScaleForGDC -> ScaleForGCD. 2021-07-01 09:58:38 +01:00
BlockFrequencyInfo.cpp Internalize some cl::opt global variables or move them under namespace llvm 2021-05-07 11:15:43 -07:00
BlockFrequencyInfoImpl.cpp [CSSPGO][NFC] Allow cl::ZeroOrMore for use-iterative-bfi-inference 2021-07-18 13:22:32 -07:00
BranchProbabilityInfo.cpp [Analaysis, CodeGen] Remove getHotSucc (NFC) 2021-07-17 07:31:36 -07:00
CallGraph.cpp Set IgnoreLLVMUsed to false in CallGraph::addToCallGraph() 2021-04-08 11:14:09 -07:00
CallGraphSCCPass.cpp Internalize some cl::opt global variables or move them under namespace llvm 2021-05-07 11:15:43 -07:00
CallPrinter.cpp Support: Stop using F_{None,Text,Append} compatibility synonyms, NFC 2021-04-30 11:00:03 -07:00
CaptureTracking.cpp [CaptureTracking] Simplify reachability check (NFCI) 2021-05-16 16:04:10 +02:00
CFG.cpp [CFG] Move reachable from entry checks into basic block variant 2021-05-15 15:42:02 +02:00
CFGPrinter.cpp Use -cfg-func-name value as filter for -view-cfg, etc. 2021-06-16 23:54:51 +02: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 [NewPM] Bail out of devirtualization wrapper if the current SCC is invalidated 2021-07-19 15:07:30 -07:00
CMakeLists.txt [MLGO] Use binary protobufs for improved training performance. 2021-07-19 13:59:28 -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 [ConstantFolding] Fold constrained arithmetic intrinsics 2021-07-23 14:39:51 +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 Support: Stop using F_{None,Text,Append} compatibility synonyms, NFC 2021-04-30 11:00:03 -07:00
Delinearization.cpp [Analysis] Use range-based for loops (NFC) 2021-02-06 11:17:10 -08:00
DemandedBits.cpp [IR] Consider non-willreturn as side effect (PR50511) 2021-07-26 16:35:14 +02:00
DependenceAnalysis.cpp [DependenceAnalysis] Guard analysis using getPointerBase(). 2021-07-15 14:57:32 -07:00
DependenceGraphBuilder.cpp [Analysis] Use llvm::append_range (NFC) 2021-01-22 23:25:01 -08:00
DevelopmentModeInlineAdvisor.cpp [NFC][MLGO] Just use the underlying protobuf object for logging 2021-07-23 10:56:48 -07:00
DivergenceAnalysis.cpp [Analysis] Use range-based for loops (NFC) 2021-02-22 20:17:18 -08:00
DominanceFrontier.cpp
DomPrinter.cpp
DomTreeUpdater.cpp [NFCI][DomTreeUpdater] applyUpdates(): reserve space for updates first 2021-04-11 23:56:22 +03:00
EHPersonalities.cpp [XCOFF] Handle the case when personality routine is an alias 2021-04-29 22:03:30 +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 [Analysis] ImportedFunctionsInliningStatistics.h - add <memory> and remove unused <string> include. NFCI. 2021-04-19 16:20:56 +01:00
IndirectCallPromotionAnalysis.cpp [SampleFDO] Another fix to prevent repeated indirect call promotion in 2021-03-04 18:44:12 -08:00
InlineAdvisor.cpp [MLGO] fix silly LLVM_DEBUG misuse 2021-07-27 15:10:28 -07:00
InlineCost.cpp [Inliner] Make the CallPenalty configurable 2021-07-26 12:07:49 +01: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] fold min/max with limit constant 2021-08-16 11:35:29 -07:00
Interval.cpp [Analysis/Interval] Remove isLoop (NFC) 2020-12-12 10:09:35 -08:00
IntervalPartition.cpp Sink all InitializePasses.h includes 2019-11-13 16:34:37 -08:00
IRSimilarityIdentifier.cpp [IRSim] Strip out the findSimilarity call from the constructor 2021-06-11 18:41:28 -05:00
IVDescriptors.cpp [IVDescriptors] Fix bug in checkOrderedReduction 2021-07-27 09:31:44 -04:00
IVUsers.cpp [IVUsers] Check LoopSimplify cache earlier (NFC) 2021-04-10 22:58:13 +02:00
LazyBlockFrequencyInfo.cpp Make dependency between certain analysis passes transitive (reapply) 2021-05-05 15:17:55 +02:00
LazyBranchProbabilityInfo.cpp Make dependency between certain analysis passes transitive (reapply) 2021-05-05 15:17:55 +02:00
LazyCallGraph.cpp Allow building for release with EXPENSIVE_CHECKS 2021-06-19 17:02:11 +01:00
LazyValueInfo.cpp [LVI] Remove recursion from getValueForCondition (NFCI) 2021-06-24 09:58:22 +09: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 [CSSPGO] Unblock optimizations with pseudo probe instrumentation part 2. 2021-04-26 16:52:33 -07:00
LoopAccessAnalysis.cpp [LAA] Remove RuntimeCheckingPtrGroup::RtCheck member (NFC). 2021-07-26 17:38:10 +01:00
LoopAnalysisManager.cpp [NewPM] Don't mark AA analyses as preserved 2021-05-18 13:49:03 -07:00
LoopCacheAnalysis.cpp [SCEV] Add a utility for converting from "exit count" to "trip count" 2021-05-26 10:41:49 -07:00
LoopInfo.cpp [LoopFlatten][LoopInfo] Use Loop to identify latch compare instruction 2021-07-21 10:14:18 +01:00
LoopNestAnalysis.cpp [LoopNest] Consider loop nest with inner loop guard using outer loop 2021-05-07 16:04:18 +00:00
LoopPass.cpp [Analysis] Use llvm::erase_value (NFC) 2020-12-14 22:40:13 -08:00
LoopUnrollAnalyzer.cpp [unroll] Use value domain for symbolic execution based cost model 2021-05-26 08:41:25 -07: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 [OpenMP] Change __kmpc_free_shared to include the paired allocation size 2021-07-21 20:56:21 -04:00
MemoryDependenceAnalysis.cpp [NFC] MemoryDependenceAnalysis cleanup. 2021-05-31 18:07:55 +03:00
MemoryLocation.cpp [MemLoc] Fix debug print for LocationSize 2020-12-20 17:52:48 +01:00
MemorySSA.cpp [IR] Add BasicBlock::isEntryBlock() (NFC) 2021-05-15 12:41:58 +02:00
MemorySSAUpdater.cpp [Analysis] Remove changeCondBranchToUnconditionalTo (NFC) 2021-07-10 17:31:43 -07:00
MLInlineAdvisor.cpp Unpack the CostEstimate feature in ML inlining models. 2021-07-02 16:57:16 +00:00
ModuleDebugInfoPrinter.cpp
ModuleSummaryAnalysis.cpp [Support] Don't include VirtualFileSystem.h in CommandLine.h 2021-04-21 10:19:01 -04: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
OverflowInstAnalysis.cpp Fix MSan crash after 1977c53b 2021-05-02 13:44:43 +09:00
PHITransAddr.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
PhiValues.cpp
PostDominators.cpp [CodeMoverUtils] Added an API to check if an instruction can be safely 2019-11-22 21:29:08 +00:00
ProfileSummaryInfo.cpp [CSSPGO][llvm-profdata] Support trimming cold context when merging profiles 2021-04-22 00:42:37 -07:00
PtrUseVisitor.cpp
README.txt
RegionInfo.cpp
RegionPass.cpp
RegionPrinter.cpp [CFGPrinter][CallPrinter][polly] Adding distinct structure for CFGDOTInfo 2020-04-06 17:42:54 +00:00
ReleaseModeModelRunner.cpp [NFC][MLGO] Fix vector sizing 2021-07-22 13:06:00 -07: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 [SCEV] Fix applyLoopGuards() with range check idiom (PR51760) 2021-09-07 22:34:39 -07:00
ScalarEvolutionAliasAnalysis.cpp Recommit [ScalarEvolution] Make getMinusSCEV() fail for unrelated pointers. 2021-07-06 12:16:05 -07:00
ScalarEvolutionDivision.cpp
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 Recommit [ScalarEvolution] Make getMinusSCEV() fail for unrelated pointers. 2021-07-06 12:16:05 -07: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
TargetLibraryInfo.cpp [Analysis] improve function signature checking for snprintf 2021-08-02 22:58:39 -07:00
TargetTransformInfo.cpp Revert "[HardwareLoops] Change order of SCEV expression construction for InitLoopCount." 2021-09-08 20:46:17 -07:00
TFUtils.cpp [NFC][MLGO] Just use the underlying protobuf object for logging 2021-07-23 10:56:48 -07:00
Trace.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
TypeBasedAliasAnalysis.cpp [Metadata] Decorate methods with 'const'. NFC. 2021-07-08 14:11:14 -04:00
TypeMetadataUtils.cpp Revert "Allow invokable sub-classes of IntrinsicInst" 2021-04-20 15:38:38 -07:00
ValueLattice.cpp
ValueLatticeUtils.cpp [ValueLattice] Simplify canTrackGlobalVariableInterprocedurally (NFC). 2020-07-09 18:33:09 +01:00
ValueTracking.cpp [InstSimplify] fold min/max with limit constant 2021-08-16 11:35:29 -07:00
VectorUtils.cpp [NFC] Fix a few whitespace issues and typos. 2021-07-04 11:49:58 +01:00
VFABIDemangling.cpp [NFC] Change VFShape so it contains an ElementCount rather than seperate VF and IsScalable properties. 2021-07-26 12:25:46 +01: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))

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