1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 03:33:20 +01:00
llvm-mirror/lib/Analysis
Brendon Cahoon ef0603b919 [DependenceAnalysis] Check if result of getConstantPart is null
A seg-fault occurs due to a reference of a null pointer, which is
the value returned by getConstantPart. This function returns
null if the constant part is not found. The code that calls this
function needs to check for the null return value.

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

llvm-svn: 265319
2016-04-04 18:13:18 +00:00
..
AliasAnalysis.cpp [PM] Implement the final conclusion as to how the analysis IDs should 2016-03-11 10:22:49 +00:00
AliasAnalysisEvaluator.cpp [PM] Make the AnalysisManager parameter to run methods a reference. 2016-03-11 11:05:24 +00:00
AliasSetTracker.cpp [AliasSetTracker] Do not strip pointer casts when processing MemSetInst 2016-03-14 18:34:29 +00:00
Analysis.cpp [CG] Actually hoist up the generic CallGraphPrinter pass from a weird 2016-03-10 11:08:44 +00:00
AssumptionCache.cpp [PM] Make the AnalysisManager parameter to run methods a reference. 2016-03-11 11:05:24 +00:00
BasicAliasAnalysis.cpp [AA] Make BasicAA just require domtree. 2016-03-11 13:53:18 +00:00
BlockFrequencyInfo.cpp Add getBlockProfileCount method to BlockFrequencyInfo 2016-03-23 18:18:26 +00:00
BlockFrequencyInfoImpl.cpp
BranchProbabilityInfo.cpp
CallGraph.cpp [PM] Make the AnalysisManager parameter to run methods a reference. 2016-03-11 11:05:24 +00:00
CallGraphSCCPass.cpp
CallPrinter.cpp [CG] Rename the DOT printing pass to actually reference "DOT". 2016-03-10 11:04:40 +00:00
CaptureTracking.cpp
CFG.cpp
CFGPrinter.cpp
CFLAliasAnalysis.cpp Rename DenseMap::resize() into DenseMap::reserve() (NFC) 2016-03-22 07:20:00 +00:00
CGSCCPassManager.cpp [PM] Implement the final conclusion as to how the analysis IDs should 2016-03-11 10:22:49 +00:00
CMakeLists.txt
CodeMetrics.cpp use range-based for loop; NFCI 2016-03-08 20:53:48 +00:00
ConstantFolding.cpp Fix Clang-tidy modernize-deprecated-headers warnings in some files; other minor fixes. 2016-03-28 17:40:08 +00:00
CostModel.cpp
Delinearization.cpp
DemandedBits.cpp
DependenceAnalysis.cpp [DependenceAnalysis] Check if result of getConstantPart is null 2016-04-04 18:13:18 +00:00
DivergenceAnalysis.cpp Introduce analysis pass to compute PostDominators in the new pass manager. NFC 2016-02-25 17:54:07 +00:00
DominanceFrontier.cpp [PM] Make the AnalysisManager parameter to run methods a reference. 2016-03-11 11:05:24 +00:00
DomPrinter.cpp Introduce analysis pass to compute PostDominators in the new pass manager. NFC 2016-02-25 17:54:07 +00:00
EHPersonalities.cpp Add Rust's personality function to the list of known personality functions 2016-03-15 20:35:45 +00:00
GlobalsModRef.cpp [PM] Make the AnalysisManager parameter to run methods a reference. 2016-03-11 11:05:24 +00:00
InlineCost.cpp Revert revisions 262636, 262643, 262679, and 262682. 2016-03-08 00:36:35 +00:00
InstCount.cpp
InstructionSimplify.cpp [InstSimplify] Restore fsub 0.0, (fsub 0.0, X) ==> X optzn 2016-02-29 12:18:25 +00:00
Interval.cpp
IntervalPartition.cpp
IteratedDominanceFrontier.cpp
IVUsers.cpp
LazyCallGraph.cpp [PM] Make the AnalysisManager parameter to run methods a reference. 2016-03-11 11:05:24 +00:00
LazyValueInfo.cpp [LVI] Fix a bug which prevented use of !range metadata within a query 2016-03-04 22:27:39 +00:00
Lint.cpp
LLVMBuild.txt
Loads.cpp
LoopAccessAnalysis.cpp [LAA] Formatting fix in previous change 2016-03-24 05:15:24 +00:00
LoopInfo.cpp IR: Reserve an MDKind for !llvm.loop; NFC 2016-03-25 00:35:38 +00:00
LoopPass.cpp
LoopPassManager.cpp [PM] Implement the final conclusion as to how the analysis IDs should 2016-03-11 10:22:49 +00:00
LoopUnrollAnalyzer.cpp [LoopUnrollAnalyzer] Check that we're using SCEV for the same loop we're simulating. 2016-02-26 02:57:05 +00:00
MemDepPrinter.cpp [PM] Port memdep to the new pass manager. 2016-03-10 00:55:30 +00:00
MemDerefPrinter.cpp
MemoryBuiltins.cpp
MemoryDependenceAnalysis.cpp Fix "warning: variabl 'XX’ set but not used" in release build (variable used in assertion, NFC) 2016-04-02 05:34:19 +00:00
MemoryLocation.cpp
ModuleDebugInfoPrinter.cpp
ObjCARCAliasAnalysis.cpp [PM] Make the AnalysisManager parameter to run methods a reference. 2016-03-11 11:05:24 +00:00
ObjCARCAnalysisUtils.cpp
ObjCARCInstKind.cpp
OrderedBasicBlock.cpp
PHITransAddr.cpp
PostDominators.cpp [PM] Make the AnalysisManager parameter to run methods a reference. 2016-03-11 11:05:24 +00:00
PtrUseVisitor.cpp
README.txt
RegionInfo.cpp [PM] Make the AnalysisManager parameter to run methods a reference. 2016-03-11 11:05:24 +00:00
RegionPass.cpp
RegionPrinter.cpp
ScalarEvolution.cpp [SCEV] Track NoWrap properties using MatchBinaryOp, NFC 2016-03-31 05:14:26 +00:00
ScalarEvolutionAliasAnalysis.cpp [PM] Make the AnalysisManager parameter to run methods a reference. 2016-03-11 11:05:24 +00:00
ScalarEvolutionExpander.cpp [IndVars] Fix PR26974: make sure replaceCongruentIVs doesn't break LCSSA 2016-03-21 12:44:29 +00:00
ScalarEvolutionNormalization.cpp
ScopedNoAliasAA.cpp [PM] Make the AnalysisManager parameter to run methods a reference. 2016-03-11 11:05:24 +00:00
SparsePropagation.cpp
StratifiedSets.h
TargetLibraryInfo.cpp [NVPTX] Infer __nvvm_reflect as nounwind, readnone 2016-03-31 21:29:57 +00:00
TargetTransformInfo.cpp [LoopDataPrefetch] Add TTI to limit the number of iterations to prefetch ahead 2016-03-18 00:27:43 +00:00
Trace.cpp
TypeBasedAliasAnalysis.cpp [PM] Make the AnalysisManager parameter to run methods a reference. 2016-03-11 11:05:24 +00:00
ValueTracking.cpp Mark some FP intrinsics as safe to speculatively execute 2016-04-03 12:30:46 +00:00
VectorUtils.cpp [VectorUtils] Don't try and truncate PHIs to a smaller bitwidth 2016-03-30 10:11:43 +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))

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