llvm-6502/lib/Analysis
Sanjoy Das aabacb67c3 [CallGraph] Teach the CallGraph about non-leaf intrinsics.
Summary:
Currently intrinsics don't affect the creation of the call graph.
This is not accurate with respect to statepoint and patchpoint
intrinsics -- these do call (or invoke) LLVM level functions.

This change fixes this inconsistency by adding a call to the external
node for call sites that call these non-leaf intrinsics.  This coupled
with the fact that these intrinsics also escape the function pointer
they call gives us a conservatively correct call graph.

Reviewers: reames, chandlerc, atrick, pgavlin

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D10526

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240039 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-18 19:28:26 +00:00
..
IPA [CallGraph] Teach the CallGraph about non-leaf intrinsics. 2015-06-18 19:28:26 +00:00
AliasAnalysis.cpp [PM/AA] Remove the UnknownSize static member from AliasAnalysis. 2015-06-17 07:21:38 +00:00
AliasAnalysisCounter.cpp [PM/AA] Remove the Location typedef from the AliasAnalysis class now 2015-06-17 07:18:54 +00:00
AliasAnalysisEvaluator.cpp [PM/AA] Suffix lots of member variables that directly use enumeration 2015-06-17 07:21:41 +00:00
AliasDebugger.cpp [PM/AA] Remove the Location typedef from the AliasAnalysis class now 2015-06-17 07:18:54 +00:00
AliasSetTracker.cpp [PM/AA] Remove the UnknownSize static member from AliasAnalysis. 2015-06-17 07:21:38 +00:00
Analysis.cpp
AssumptionCache.cpp
BasicAliasAnalysis.cpp [PM/AA] Remove the UnknownSize static member from AliasAnalysis. 2015-06-17 07:21:38 +00:00
BlockFrequencyInfo.cpp
BlockFrequencyInfoImpl.cpp Add documentation for new backedge mass propagation in irregular loops. 2015-06-17 16:28:22 +00:00
BranchProbabilityInfo.cpp Add BranchProbabilityInfo::releaseMemory to clear the Weights field. 2015-05-28 19:43:06 +00:00
CaptureTracking.cpp
CFG.cpp
CFGPrinter.cpp
CFLAliasAnalysis.cpp [PM/AA] Remove the Location typedef from the AliasAnalysis class now 2015-06-17 07:18:54 +00:00
CGSCCPassManager.cpp
CMakeLists.txt [PM/AA] Start refactoring AliasAnalysis to remove the analysis group and 2015-06-04 02:03:15 +00:00
CodeMetrics.cpp
ConstantFolding.cpp [ConstantFolding] Fix wrong folding of intrinsic 'convert.from.fp16'. 2015-05-14 18:01:48 +00:00
CostModel.cpp
Delinearization.cpp
DependenceAnalysis.cpp [DependenceAnalysis] Extend unifySubscriptType for handling coupled subscript groups. 2015-05-29 16:58:08 +00:00
DivergenceAnalysis.cpp
DominanceFrontier.cpp
DomPrinter.cpp
InstCount.cpp
InstructionSimplify.cpp [InstSimplify] Allow folding of fdiv X, X with just NaNs ignored 2015-06-16 14:57:29 +00:00
Interval.cpp
IntervalPartition.cpp
IteratedDominanceFrontier.cpp
IVUsers.cpp
LazyCallGraph.cpp
LazyValueInfo.cpp Move logic from JumpThreading into LazyValue info to simplify caller. 2015-06-16 00:49:59 +00:00
LibCallAliasAnalysis.cpp [PM/AA] Remove the Location typedef from the AliasAnalysis class now 2015-06-17 07:18:54 +00:00
LibCallSemantics.cpp Move the personality function from LandingPadInst to Function 2015-06-17 20:52:32 +00:00
Lint.cpp [PM/AA] Remove the UnknownSize static member from AliasAnalysis. 2015-06-17 07:21:38 +00:00
LLVMBuild.txt
Loads.cpp
LoopAccessAnalysis.cpp [PM/AA] Remove the UnknownSize static member from AliasAnalysis. 2015-06-17 07:21:38 +00:00
LoopInfo.cpp Add llvm::all_of which wraps std::all_of. 2015-05-13 22:19:13 +00:00
LoopPass.cpp
Makefile
MemDepPrinter.cpp
MemDerefPrinter.cpp Test commit. Fix typo in MemDerefPrinter.cpp comment. 2015-05-21 11:57:38 +00:00
MemoryBuiltins.cpp
MemoryDependenceAnalysis.cpp [PM/AA] Remove the Location typedef from the AliasAnalysis class now 2015-06-17 07:18:54 +00:00
MemoryLocation.cpp [PM/AA] Split the location computation out of getArgLocation so the 2015-06-17 07:12:40 +00:00
ModuleDebugInfoPrinter.cpp
NoAliasAnalysis.cpp [PM/AA] Remove the Location typedef from the AliasAnalysis class now 2015-06-17 07:18:54 +00:00
PHITransAddr.cpp [GVN] Set proper debug locations for some instructions created by GVN. 2015-06-10 17:37:38 +00:00
PostDominators.cpp
PtrUseVisitor.cpp
README.txt
RegionInfo.cpp
RegionPass.cpp
RegionPrinter.cpp
ScalarEvolution.cpp [ScalarEvolution] refactor: extract interface getGEPExpr 2015-05-18 17:03:25 +00:00
ScalarEvolutionAliasAnalysis.cpp [PM/AA] Remove the UnknownSize static member from AliasAnalysis. 2015-06-17 07:21:38 +00:00
ScalarEvolutionExpander.cpp Replace push_back(Constructor(foo)) with emplace_back(foo) for non-trivial types 2015-05-29 19:43:39 +00:00
ScalarEvolutionNormalization.cpp
ScopedNoAliasAA.cpp [PM/AA] Remove the Location typedef from the AliasAnalysis class now 2015-06-17 07:18:54 +00:00
SparsePropagation.cpp
StratifiedSets.h
TargetLibraryInfo.cpp
TargetTransformInfo.cpp [LoopVectorize] Teach Loop Vectorizor about interleaved memory accesses. 2015-06-08 06:39:56 +00:00
Trace.cpp
TypeBasedAliasAnalysis.cpp [PM/AA] Remove the Location typedef from the AliasAnalysis class now 2015-06-17 07:18:54 +00:00
ValueTracking.cpp [ValueTracking] do not overwrite analysis results already computed 2015-06-15 05:46:29 +00: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))

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