1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 19:52:54 +01:00
llvm-mirror/lib/Analysis
Philip Reames ef49042798 [NFC] Factor out utilities for manipulating widenable branches
With the widenable condition construct, we have the ability to reason about branches which can be 'widened' (i.e. made to fail more often).  We've got a couple o transforms which leverage this.  This patch just cleans up the API a bit.

This is prep work for generalizing our definition of a widenable branch slightly.  At the moment "br i1 (and A, wc()), ..." is considered widenable, but oddly, neither "br i1 (and wc(), B), ..." or "br i1 wc(), ..." is.  That clearly needs addressed, so first, let's centralize the code in one place.
2019-11-19 14:43:13 -08:00
..
AliasAnalysis.cpp Sink all InitializePasses.h includes 2019-11-13 16:34:37 -08:00
AliasAnalysisEvaluator.cpp Sink all InitializePasses.h includes 2019-11-13 16:34:37 -08:00
AliasAnalysisSummary.cpp
AliasAnalysisSummary.h
AliasSetTracker.cpp Sink all InitializePasses.h includes 2019-11-13 16:34:37 -08:00
Analysis.cpp [MustExec] Add a generic "must-be-executed-context" explorer 2019-08-23 15:17:27 +00:00
AssumptionCache.cpp Sink all InitializePasses.h includes 2019-11-13 16:34:37 -08:00
BasicAliasAnalysis.cpp Sink all InitializePasses.h includes 2019-11-13 16:34:37 -08:00
BlockFrequencyInfo.cpp Sink all InitializePasses.h includes 2019-11-13 16:34:37 -08:00
BlockFrequencyInfoImpl.cpp
BranchProbabilityInfo.cpp Add missing includes needed to prune LLVMContext.h include, NFC 2019-11-14 15:23:15 -08:00
CallGraph.cpp Sink all InitializePasses.h includes 2019-11-13 16:34:37 -08:00
CallGraphSCCPass.cpp
CallPrinter.cpp Sink all InitializePasses.h includes 2019-11-13 16:34:37 -08:00
CaptureTracking.cpp [CaptureTracker] Let subclasses provide dereferenceability information 2019-08-19 21:56:38 +00:00
CFG.cpp Recommit "[GVN] Preserve loop related analysis/canonical forms." 2019-07-31 09:27:54 +00:00
CFGPrinter.cpp Add missing includes needed to prune LLVMContext.h include, NFC 2019-11-14 15:23:15 -08:00
CFLAndersAliasAnalysis.cpp Sink all InitializePasses.h includes 2019-11-13 16:34:37 -08:00
CFLGraph.h
CFLSteensAliasAnalysis.cpp Sink all InitializePasses.h includes 2019-11-13 16:34:37 -08:00
CGSCCPassManager.cpp Revert "[CallGraph] Refine call graph for indirect calls with !callees metadata" 2019-08-16 10:59:18 +00:00
CMakeLists.txt [SVFS] Vector Function ABI demangling. 2019-09-19 17:47:32 +00:00
CmpInstAnalysis.cpp
CodeMetrics.cpp
ConstantFolding.cpp [ConstantFolding] Fold constant calls to log2() 2019-09-30 20:53:23 +00:00
CostModel.cpp Sink all InitializePasses.h includes 2019-11-13 16:34:37 -08:00
DDG.cpp Add missing includes needed to prune LLVMContext.h include, NFC 2019-11-14 15:23:15 -08:00
Delinearization.cpp Sink all InitializePasses.h includes 2019-11-13 16:34:37 -08:00
DemandedBits.cpp Sink all InitializePasses.h includes 2019-11-13 16:34:37 -08:00
DependenceAnalysis.cpp Sink all InitializePasses.h includes 2019-11-13 16:34:37 -08:00
DependenceGraphBuilder.cpp [DDG] Data Dependence Graph - Pi Block 2019-11-08 15:46:08 -05:00
DivergenceAnalysis.cpp [DivergenceAnalysis] Add methods for querying divergence at use 2019-07-29 10:22:09 +00:00
DominanceFrontier.cpp Sink all InitializePasses.h includes 2019-11-13 16:34:37 -08:00
DomPrinter.cpp Sink all InitializePasses.h includes 2019-11-13 16:34:37 -08:00
DomTreeUpdater.cpp
EHPersonalities.cpp
GlobalsModRef.cpp Sink all InitializePasses.h includes 2019-11-13 16:34:37 -08:00
GuardUtils.cpp [NFC] Factor out utilities for manipulating widenable branches 2019-11-19 14:43:13 -08:00
IndirectCallPromotionAnalysis.cpp Add missing includes needed to prune LLVMContext.h include, NFC 2019-11-14 15:23:15 -08:00
InlineCost.cpp Add missing includes needed to prune LLVMContext.h include, NFC 2019-11-14 15:23:15 -08:00
InstCount.cpp Sink all InitializePasses.h includes 2019-11-13 16:34:37 -08:00
InstructionPrecedenceTracking.cpp Add missing includes needed to prune LLVMContext.h include, NFC 2019-11-14 15:23:15 -08:00
InstructionSimplify.cpp Revert 57dd4b0 "[ValueTracking] Allow context-sensitive nullness check for non-pointers" 2019-11-13 12:19:02 +01:00
Interval.cpp
IntervalPartition.cpp Sink all InitializePasses.h includes 2019-11-13 16:34:37 -08:00
IVDescriptors.cpp Revert f0c2a5a "[LV] Generalize conditions for sinking instrs for first order recurrences." 2019-11-07 11:00:02 +01:00
IVUsers.cpp Sink all InitializePasses.h includes 2019-11-13 16:34:37 -08:00
LazyBlockFrequencyInfo.cpp Sink all InitializePasses.h includes 2019-11-13 16:34:37 -08:00
LazyBranchProbabilityInfo.cpp Sink all InitializePasses.h includes 2019-11-13 16:34:37 -08:00
LazyCallGraph.cpp Second attempt to add iterator_range::empty() 2019-10-07 18:14:24 +00:00
LazyValueInfo.cpp Sink all InitializePasses.h includes 2019-11-13 16:34:37 -08:00
LegacyDivergenceAnalysis.cpp Add missing includes needed to prune LLVMContext.h include, NFC 2019-11-14 15:23:15 -08:00
Lint.cpp Sink all InitializePasses.h includes 2019-11-13 16:34:37 -08:00
LLVMBuild.txt
Loads.cpp [InstCombine] Skip scalable vectors in combineLoadToOperationType 2019-11-12 12:27:09 +01:00
LoopAccessAnalysis.cpp Sink all InitializePasses.h includes 2019-11-13 16:34:37 -08:00
LoopAnalysisManager.cpp [LoopPassManager + MemorySSA] Only enable use of MemorySSA for LPMs known to preserve it. 2019-08-21 17:00:57 +00:00
LoopCacheAnalysis.cpp [LoopCacheAnalysis]: Fix assertion failure during cost computation 2019-11-15 14:56:26 -05:00
LoopInfo.cpp Sink all InitializePasses.h includes 2019-11-13 16:34:37 -08:00
LoopPass.cpp Sink all InitializePasses.h includes 2019-11-13 16:34:37 -08:00
LoopUnrollAnalyzer.cpp [InstSimplify] Rename SimplifyFPUnOp and SimplifyFPBinOp 2019-07-24 12:50:10 +00:00
MemDepPrinter.cpp Sink all InitializePasses.h includes 2019-11-13 16:34:37 -08:00
MemDerefPrinter.cpp Sink all InitializePasses.h includes 2019-11-13 16:34:37 -08:00
MemoryBuiltins.cpp [Alignment][NFC] Remove unneeded llvm:: scoping on Align types 2019-09-27 12:54:21 +00:00
MemoryDependenceAnalysis.cpp [DependenceAnalysis] Dependecies for loads marked with "ivnariant.load" should not be shared with general accesses. Fix for https://bugs.llvm.org/show_bug.cgi?id=42151 2019-11-19 17:30:02 +07:00
MemoryLocation.cpp
MemorySSA.cpp Sink all InitializePasses.h includes 2019-11-13 16:34:37 -08:00
MemorySSAUpdater.cpp [MemorySSA] Update Phi simplification. 2019-10-10 23:27:21 +00:00
ModuleDebugInfoPrinter.cpp Sink all InitializePasses.h includes 2019-11-13 16:34:37 -08:00
ModuleSummaryAnalysis.cpp Sink all InitializePasses.h includes 2019-11-13 16:34:37 -08:00
MustExecute.cpp Sink all InitializePasses.h includes 2019-11-13 16:34:37 -08:00
ObjCARCAliasAnalysis.cpp
ObjCARCAnalysisUtils.cpp
ObjCARCInstKind.cpp [ObjC][ARC] Delete ObjC runtime calls on global variables annotated 2019-06-14 22:06:32 +00:00
OptimizationRemarkEmitter.cpp Sink all InitializePasses.h includes 2019-11-13 16:34:37 -08:00
OrderedBasicBlock.cpp
OrderedInstructions.cpp [llvm] Migrate llvm::make_unique to std::make_unique 2019-08-15 15:54:37 +00:00
PHITransAddr.cpp
PhiValues.cpp Sink all InitializePasses.h includes 2019-11-13 16:34:37 -08:00
PostDominators.cpp Sink all InitializePasses.h includes 2019-11-13 16:34:37 -08:00
ProfileSummaryInfo.cpp Add missing includes needed to prune LLVMContext.h include, NFC 2019-11-14 15:23:15 -08:00
PtrUseVisitor.cpp SROA: Allow eliminating addrspacecasted allocas 2019-06-14 21:38:31 +00:00
README.txt
RegionInfo.cpp Sink all InitializePasses.h includes 2019-11-13 16:34:37 -08:00
RegionPass.cpp
RegionPrinter.cpp Sink all InitializePasses.h includes 2019-11-13 16:34:37 -08:00
ScalarEvolution.cpp Sink all InitializePasses.h includes 2019-11-13 16:34:37 -08:00
ScalarEvolutionAliasAnalysis.cpp Sink all InitializePasses.h includes 2019-11-13 16:34:37 -08:00
ScalarEvolutionExpander.cpp [SCEV] Removing deprecated comment in ScalarEvolutionExpander 2019-10-18 13:33:45 +00:00
ScalarEvolutionNormalization.cpp
ScopedNoAliasAA.cpp Sink all InitializePasses.h includes 2019-11-13 16:34:37 -08:00
StackSafetyAnalysis.cpp Add missing includes needed to prune LLVMContext.h include, NFC 2019-11-14 15:23:15 -08:00
StratifiedSets.h
SyncDependenceAnalysis.cpp [SDA] Don't stop divergence propagation at the IPD. 2019-09-18 13:40:22 +00:00
SyntheticCountsUtils.cpp
TargetLibraryInfo.cpp [SVFS] Inject TLI Mappings in VFABI attribute. 2019-11-15 18:42:56 +00:00
TargetTransformInfo.cpp Sink all InitializePasses.h includes 2019-11-13 16:34:37 -08:00
Trace.cpp
TypeBasedAliasAnalysis.cpp Sink all InitializePasses.h includes 2019-11-13 16:34:37 -08:00
TypeMetadataUtils.cpp Reland: Dead Virtual Function Elimination 2019-10-17 09:58:57 +00:00
ValueLattice.cpp
ValueLatticeUtils.cpp
ValueTracking.cpp [ValueTracking] Add a basic version of isKnownNonInfinity and use it to detect more NoNaNs 2019-11-19 22:24:46 +01:00
VectorUtils.cpp [SVFS] Inject TLI Mappings in VFABI attribute. 2019-11-15 18:42:56 +00:00
VFABIDemangling.cpp [VFABI] Add LLVM internal mangling for vector functions. 2019-11-13 03:26:39 +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))

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