llvm-project/llvm/lib/Analysis
Mircea Trofin 7d541eb4d4 [inliner] Mandatory inlining decisions produce remarks
This also removes the need to disable the mandatory inlining phase in
tests.

In a departure from the previous remark, we don't output a 'cost' in
this case, because there's no such thing. We just report that inlining
happened because of the attribute.

Differential Revision: https://reviews.llvm.org/D110891
2021-10-05 14:01:25 -07:00
..
models Unpack the CostEstimate feature in ML inlining models. 2021-07-02 16:57:16 +00:00
AliasAnalysis.cpp [Analysis, CodeGen] Migrate from arg_operands to args (NFC) 2021-10-03 08:22:20 -07:00
AliasAnalysisEvaluator.cpp
AliasAnalysisSummary.cpp
AliasAnalysisSummary.h
AliasSetTracker.cpp
Analysis.cpp
AssumeBundleQueries.cpp [Attributes] Replace doesAttrKindHaveArgument() (NFC) 2021-07-12 21:57:26 +02:00
AssumptionCache.cpp
BasicAliasAnalysis.cpp [BasicAA] Ignore CanBeFreed in minimal extent reasoning 2021-10-04 22:08:57 +02:00
BlockFrequencyInfo.cpp
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
CFG.cpp
CFGPrinter.cpp Use `-cfg-func-name` value as filter for `-view-cfg`, etc. 2021-06-16 23:54:51 +02:00
CFLAndersAliasAnalysis.cpp
CFLGraph.h
CFLSteensAliasAnalysis.cpp
CGSCCPassManager.cpp [NFC] Remove FIXMEs about calling LLVMContext::yield() 2021-09-17 14:59:34 -07:00
CMakeLists.txt [MLGO] Update the current model url for the Oz inliner model. 2021-08-04 03:09:00 +00:00
CallGraph.cpp
CallGraphSCCPass.cpp
CallPrinter.cpp
CaptureTracking.cpp Recommit "[DSE] Track earliest escape, use for loads in isReadClobber." 2021-09-24 17:13:27 +01:00
CmpInstAnalysis.cpp [APInt] Stop using soft-deprecated constructors and methods in llvm. NFC. 2021-10-04 08:57:44 +01:00
CodeMetrics.cpp
ConstantFolding.cpp [ConstantFold] Refactor load folding 2021-10-05 18:07:57 +02:00
ConstraintSystem.cpp
CostModel.cpp Port the cost model printer to New PM 2021-09-08 14:47:05 -07:00
DDG.cpp
DDGPrinter.cpp
Delinearization.cpp [SCEV] Move getIndexExpressionsFromGEP to delinearize [NFC] 2021-09-08 16:56:49 -07:00
DemandedBits.cpp [APInt] Normalize naming on keep constructors / predicate methods. 2021-09-09 09:50:24 -07:00
DependenceAnalysis.cpp [APInt] Normalize naming on keep constructors / predicate methods. 2021-09-09 09:50:24 -07:00
DependenceGraphBuilder.cpp
DevelopmentModeInlineAdvisor.cpp [MLGO] Make sure inliner logs when deleting callees 2021-08-23 14:54:46 -07:00
DivergenceAnalysis.cpp
DomPrinter.cpp
DomTreeUpdater.cpp
DominanceFrontier.cpp
EHPersonalities.cpp
FunctionPropertiesAnalysis.cpp
GlobalsModRef.cpp
GuardUtils.cpp
HeatUtils.cpp [llvm][clang][NFC] updates inline licence info 2021-08-11 02:48:53 +00:00
IRSimilarityIdentifier.cpp [IRSim] Adding support for recognizing branch similarity 2021-09-06 11:55:38 -07:00
IVDescriptors.cpp Revert "[LoopVectorize] Permit vectorisation of more select(cmp(), X, Y) reduction patterns" 2021-10-01 11:39:43 +02:00
IVUsers.cpp
ImportedFunctionsInliningStatistics.cpp
IndirectCallPromotionAnalysis.cpp
InlineAdvisor.cpp [inliner] Mandatory inlining decisions produce remarks 2021-10-05 14:01:25 -07:00
InlineCost.cpp [APInt] Normalize naming on keep constructors / predicate methods. 2021-09-09 09:50:24 -07:00
InlineSizeEstimatorAnalysis.cpp [llvm][clang][NFC] updates inline licence info 2021-08-11 02:48:53 +00:00
InstCount.cpp
InstructionPrecedenceTracking.cpp
InstructionSimplify.cpp [APInt] Stop using soft-deprecated constructors and methods in llvm. NFC. 2021-10-04 08:57:44 +01:00
Interval.cpp
IntervalPartition.cpp
LazyBlockFrequencyInfo.cpp
LazyBranchProbabilityInfo.cpp
LazyCallGraph.cpp Allow building for release with EXPENSIVE_CHECKS 2021-06-19 17:02:11 +01:00
LazyValueInfo.cpp [APInt] Stop using soft-deprecated constructors and methods in llvm. NFC. 2021-10-04 08:57:44 +01:00
LegacyDivergenceAnalysis.cpp
Lint.cpp [NFC] Remove AttributeList::hasParamAttribute() 2021-08-13 10:58:21 -07:00
Loads.cpp Fix incorrect GEP bitwidth in areNonOverlapSameBaseLoadAndStore() 2021-09-28 17:57:36 +01:00
LoopAccessAnalysis.cpp Recommit "[LAA] Support pointer phis in loop by analyzing each incoming pointer." 2021-09-14 11:19:12 +01:00
LoopAnalysisManager.cpp
LoopCacheAnalysis.cpp Move delinearization logic out of SCEV [NFC] 2021-09-08 12:28:35 -07:00
LoopInfo.cpp [OpenMP][OpenMPIRBuilder] Implement loop unrolling. 2021-09-04 19:18:58 -05:00
LoopNestAnalysis.cpp LoopNest Analysis expansion to return instructions that prevent a Loop 2021-08-17 22:25:49 +00:00
LoopPass.cpp
LoopUnrollAnalyzer.cpp [unroll] Use value domain for symbolic execution based cost model 2021-05-26 08:41:25 -07:00
MLInlineAdvisor.cpp Unpack the CostEstimate feature in ML inlining models. 2021-07-02 16:57:16 +00:00
MemDepPrinter.cpp
MemDerefPrinter.cpp
MemoryBuiltins.cpp MemoryBuiltins: update comment; NFC 2021-09-21 13:47:26 -07:00
MemoryDependenceAnalysis.cpp [NFC] MemoryDependenceAnalysis cleanup. 2021-05-31 18:07:55 +03:00
MemoryLocation.cpp [IR] Return AAMDNodes from Instruction::getMetadata() (NFC) 2021-09-16 21:06:57 +02:00
MemorySSA.cpp [MemorySSA] Fix "set but not used" warnings 2021-09-15 11:41:41 -07:00
MemorySSAUpdater.cpp [llvm] Use pop_back_val (NFC) 2021-09-19 13:44:23 -07:00
ModuleDebugInfoPrinter.cpp
ModuleSummaryAnalysis.cpp [ThinLTO] Add noRecurse and noUnwind thinlink function attribute propagation 2021-09-27 12:28:07 -07:00
MustExecute.cpp
ObjCARCAliasAnalysis.cpp
ObjCARCAnalysisUtils.cpp
ObjCARCInstKind.cpp
OptimizationRemarkEmitter.cpp
OverflowInstAnalysis.cpp
PHITransAddr.cpp [InstSimplify] Don't lose inbounds when simplifying a GEP 2021-09-23 09:25:06 +01:00
PhiValues.cpp
PostDominators.cpp
ProfileSummaryInfo.cpp
PtrUseVisitor.cpp
README.txt
RegionInfo.cpp
RegionPass.cpp
RegionPrinter.cpp
ReleaseModeModelRunner.cpp [NFC][MLGO] Fix vector sizing 2021-07-22 13:06:00 -07:00
ReplayInlineAdvisor.cpp [InlineAdvisor] Add single quotes around caller/callee names 2021-08-10 11:51:31 -07:00
ScalarEvolution.cpp [SCEV] Don't check if propagation safe if there are no flags (NFC) 2021-10-05 22:25:41 +02: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
StackLifetime.cpp [NPM] Added -print-pipeline-passes print params for a few passes. 2021-09-15 08:34:04 +02:00
StackSafetyAnalysis.cpp [hwasan] also omit safe mem[cpy|mov|set]. 2021-09-22 11:08:27 +01:00
StratifiedSets.h
SyncDependenceAnalysis.cpp
SyntheticCountsUtils.cpp
TFUtils.cpp [NFC][MLGO] Use std::move when moving protobufs 2021-08-20 13:40:35 -07:00
TargetLibraryInfo.cpp [TargetLibraryInfo] Refactor size_t checks in isValidProtoForLibFunc. NFC 2021-10-04 15:46:39 +02:00
TargetTransformInfo.cpp Reapply "[GlobalOpt][FIX] Do not embed initializers into AS!=0 globals"" 2021-09-10 15:22:56 -05:00
Trace.cpp
TypeBasedAliasAnalysis.cpp [IR] Re-group AAMDNodes relevant interfaces. NFC. 2021-09-21 14:29:33 -04:00
TypeMetadataUtils.cpp [GlobalDCE] In VFE support for relative pointers, allow GEP references to the base symbol 2021-09-13 15:22:11 -07: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
ValueLattice.cpp
ValueLatticeUtils.cpp
ValueTracking.cpp [APInt] Stop using soft-deprecated constructors and methods in llvm. NFC. 2021-10-04 08:57:44 +01:00
VectorUtils.cpp [LAA] Pass access type to getPtrStride() 2021-09-11 19:16:49 +02:00

README.txt

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))

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