1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-22 20:43:44 +02:00
llvm-mirror/lib/Analysis
Tom Stellard 390e5c25aa [Loads] Fix crash in is isDereferenceableAndAlignedPointer()
Summary:
We were trying to add APInt values with different bit sizes after
visiting an addrspacecast instruction which changed the bit width
of the pointer.

Reviewers: majnemer, hfinkel

Subscribers: hfinkel, wdng, llvm-commits

Differential Revision: https://reviews.llvm.org/D24774

llvm-svn: 285407
2016-10-28 15:32:28 +00:00
..
AliasAnalysis.cpp
AliasAnalysisEvaluator.cpp
AliasAnalysisSummary.cpp
AliasAnalysisSummary.h
AliasSetTracker.cpp Revert "[AliasSetTracker] Make AST smarter about intrinsics that don't actually affect memory." 2016-10-26 19:18:19 +00:00
Analysis.cpp [LCSSA] Perform LCSSA verification only for the current loop nest. 2016-10-28 12:57:20 +00:00
AssumptionCache.cpp
BasicAliasAnalysis.cpp [BasicAA] Fix - missed alias in GEP expressions 2016-10-22 02:41:39 +00:00
BlockFrequencyInfo.cpp Turn cl::values() (for enum) from a vararg function to using C++ variadic template 2016-10-08 19:41:06 +00:00
BlockFrequencyInfoImpl.cpp
BranchProbabilityInfo.cpp Enhance calcColdCallHeuristics for InvokeInst 2016-09-23 17:26:14 +00:00
CallGraph.cpp
CallGraphSCCPass.cpp Use StringRef in Pass/PassManager APIs (NFC) 2016-10-01 02:56:57 +00:00
CallPrinter.cpp
CaptureTracking.cpp
CFG.cpp
CFGPrinter.cpp
CFLAndersAliasAnalysis.cpp
CFLGraph.h
CFLSteensAliasAnalysis.cpp
CGSCCPassManager.cpp
CMakeLists.txt
CodeMetrics.cpp
ConstantFolding.cpp
CostModel.cpp
Delinearization.cpp
DemandedBits.cpp
DependenceAnalysis.cpp
DivergenceAnalysis.cpp
DominanceFrontier.cpp
DomPrinter.cpp
EHPersonalities.cpp
GlobalsModRef.cpp Fix regression from my recent GlobalsAA fix. 2016-10-24 21:47:44 +00:00
IndirectCallPromotionAnalysis.cpp
InlineCost.cpp Rename isHotFunction/isColdFunction to isFunctionEntryHot/isFunctionEntryCold. (NFC) 2016-10-10 21:47:28 +00:00
InstCount.cpp
InstructionSimplify.cpp Simplify x >=u x >> y and x >=u x udiv y 2016-10-26 19:18:43 +00:00
Interval.cpp
IntervalPartition.cpp
IteratedDominanceFrontier.cpp
IVUsers.cpp
LazyBlockFrequencyInfo.cpp
LazyBranchProbabilityInfo.cpp
LazyCallGraph.cpp [LCG] Add the necessary functionality to the LazyCallGraph to support inlining. 2016-10-12 07:59:56 +00:00
LazyValueInfo.cpp [LVI] Fix a bug with a guard being the very first instruction in a BB not taken into account 2016-10-21 15:02:21 +00:00
Lint.cpp
LLVMBuild.txt
Loads.cpp [Loads] Fix crash in is isDereferenceableAndAlignedPointer() 2016-10-28 15:32:28 +00:00
LoopAccessAnalysis.cpp [LAA, LV] Port to new streaming interface for opt remarks. Update LV 2016-09-30 00:01:30 +00:00
LoopInfo.cpp [LCSSA] Implement linear algorithm for the isRecursivelyLCSSAForm 2016-10-11 13:37:22 +00:00
LoopPass.cpp [LCSSA] Perform LCSSA verification only for the current loop nest. 2016-10-28 12:57:20 +00:00
LoopPassManager.cpp
LoopUnrollAnalyzer.cpp
MemDepPrinter.cpp
MemDerefPrinter.cpp
MemoryBuiltins.cpp
MemoryDependenceAnalysis.cpp Test commit access (NFC) 2016-10-06 10:58:41 +00:00
MemoryLocation.cpp
ModuleDebugInfoPrinter.cpp Re-commit "Use StringRef in Support/Darf APIs (NFC)" 2016-10-05 05:59:29 +00:00
ModuleSummaryAnalysis.cpp [ThinLTO] Create AliasSummary when building index 2016-10-28 02:39:38 +00:00
ObjCARCAliasAnalysis.cpp
ObjCARCAnalysisUtils.cpp
ObjCARCInstKind.cpp Create llvm.addressofreturnaddress intrinsic 2016-10-12 22:13:19 +00:00
OptimizationDiagnosticInfo.cpp Don't filter diagnostics written as YAML to the output file 2016-10-04 18:13:45 +00:00
OrderedBasicBlock.cpp
PHITransAddr.cpp
PostDominators.cpp
ProfileSummaryInfo.cpp Tune isHotFunction/isColdFunction 2016-10-11 05:19:00 +00:00
PtrUseVisitor.cpp
README.txt
RegionInfo.cpp Turn cl::values() (for enum) from a vararg function to using C++ variadic template 2016-10-08 19:41:06 +00:00
RegionPass.cpp
RegionPrinter.cpp
ScalarEvolution.cpp [LoopUnroll] Keep the loop test only on the first iteration of max-or-zero loops 2016-10-21 11:08:48 +00:00
ScalarEvolutionAliasAnalysis.cpp
ScalarEvolutionExpander.cpp
ScalarEvolutionNormalization.cpp
ScopedNoAliasAA.cpp
SparsePropagation.cpp
StratifiedSets.h Do a sweep over move ctors and remove those that are identical to the default. 2016-10-20 12:20:28 +00:00
TargetLibraryInfo.cpp Turn cl::values() (for enum) from a vararg function to using C++ variadic template 2016-10-08 19:41:06 +00:00
TargetTransformInfo.cpp [ARM] Don't convert switches to lookup tables of pointers with ROPI/RWPI 2016-10-07 08:48:24 +00:00
Trace.cpp
TypeBasedAliasAnalysis.cpp
TypeMetadataUtils.cpp
ValueTracking.cpp [ValueTracking] fix matchSelectPattern to allow vector splat folds of min/max/abs/nabs 2016-10-27 15:26:10 +00:00
VectorUtils.cpp

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

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