1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 03:33:20 +01:00
llvm-mirror/lib/Analysis
Sanjoy Das 3f12ce1fd4 [SCEVExpander] Fix a failed cast<> assertion
SCEVExpander::replaceCongruentIVs assumes the backedge value of an
SCEV-analysable PHI to always be an instruction, when this is not
necessarily true.  For now address this by bailing out of the
optimization if the backedge value of the PHI is a non-Instruction.

llvm-svn: 269213
2016-05-11 17:41:41 +00:00
..
AliasAnalysis.cpp
AliasAnalysisEvaluator.cpp
AliasSetTracker.cpp
Analysis.cpp
AssumptionCache.cpp
BasicAliasAnalysis.cpp [BasicAA] Compare GEP indices based on value (Fix PR27418) 2016-05-11 15:45:43 +00:00
BitSetUtils.cpp Re-apply r269081 and r269082 with a fix for MSVC. 2016-05-10 18:07:21 +00:00
BlockFrequencyInfo.cpp [PM] port Branch Frequency Analaysis pass to new PM 2016-05-05 21:13:27 +00:00
BlockFrequencyInfoImpl.cpp fix spelling; NFC 2016-05-09 16:07:45 +00:00
BranchProbabilityInfo.cpp [PM] Port Branch Probability Analysis pass to the new pass manager. 2016-05-05 02:59:57 +00:00
CallGraph.cpp
CallGraphSCCPass.cpp
CallPrinter.cpp
CaptureTracking.cpp Fold compares irrespective of whether allocation can be elided 2016-05-03 14:58:21 +00:00
CFG.cpp
CFGPrinter.cpp
CFLAliasAnalysis.cpp
CGSCCPassManager.cpp
CMakeLists.txt Re-apply r269081 and r269082 with a fix for MSVC. 2016-05-10 18:07:21 +00:00
CodeMetrics.cpp
ConstantFolding.cpp [ConstantFolding, ValueTracking] Fold constants involving bitcasts of ConstantVector 2016-05-04 06:13:33 +00:00
CostModel.cpp
Delinearization.cpp
DemandedBits.cpp
DependenceAnalysis.cpp
DivergenceAnalysis.cpp DivergenceAnalysis: Fix crash with no return blocks 2016-05-09 16:57:08 +00:00
DominanceFrontier.cpp
DomPrinter.cpp
EHPersonalities.cpp
GlobalsModRef.cpp
InlineCost.cpp Revert r269131 2016-05-10 23:26:04 +00:00
InstCount.cpp
InstructionSimplify.cpp [InstSimplify] use computeKnownBits on shift amount operands 2016-05-10 20:46:54 +00:00
Interval.cpp
IntervalPartition.cpp
IteratedDominanceFrontier.cpp
IVUsers.cpp
LazyCallGraph.cpp
LazyValueInfo.cpp
Lint.cpp
LLVMBuild.txt Revert r269131 2016-05-10 23:26:04 +00:00
Loads.cpp NFC. Introduce Value::isPointerDereferenceable 2016-05-11 14:43:28 +00:00
LoopAccessAnalysis.cpp [LAA] Use re-written SCEV expressions when computing distances 2016-05-10 12:28:49 +00:00
LoopInfo.cpp
LoopPass.cpp
LoopPassManager.cpp PM: Check that loop passes preserve a basic set of analyses 2016-05-03 21:35:08 +00:00
LoopUnrollAnalyzer.cpp
MemDepPrinter.cpp
MemDerefPrinter.cpp
MemoryBuiltins.cpp
MemoryDependenceAnalysis.cpp
MemoryLocation.cpp
ModuleDebugInfoPrinter.cpp
ModuleSummaryAnalysis.cpp ThinLTO: fix assertion and refactor check for hidden use from inline ASM in a helper function 2016-05-06 08:25:33 +00:00
ObjCARCAliasAnalysis.cpp
ObjCARCAnalysisUtils.cpp
ObjCARCInstKind.cpp
OrderedBasicBlock.cpp
PHITransAddr.cpp
PostDominators.cpp
PtrUseVisitor.cpp
README.txt
RegionInfo.cpp
RegionPass.cpp
RegionPrinter.cpp
ScalarEvolution.cpp [SCEV] Be more aggressive around proving no-wrap 2016-05-11 17:41:26 +00:00
ScalarEvolutionAliasAnalysis.cpp
ScalarEvolutionExpander.cpp [SCEVExpander] Fix a failed cast<> assertion 2016-05-11 17:41:41 +00:00
ScalarEvolutionNormalization.cpp
ScopedNoAliasAA.cpp
SparsePropagation.cpp
StratifiedSets.h
TargetLibraryInfo.cpp [X86] Promote several single precision FP libcalls on Windows 2016-05-08 08:15:50 +00:00
TargetTransformInfo.cpp
Trace.cpp
TypeBasedAliasAnalysis.cpp
ValueTracking.cpp [ValueTracking] Use guards to prove non-nullness of a value 2016-05-10 02:35:44 +00:00
VectorUtils.cpp Revert "[VectorUtils] Query number of sign bits to allow more truncations" 2016-05-10 12:27:23 +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))

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