1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 19:52:54 +01:00
llvm-mirror/lib/Analysis
Max Kazantsev 51a4fab74e Revert "[SCEV] Generalize no-self-wrap check in isLoopInvariantExitCondDuringFirstIterations"
This reverts commit 7dcc8899174f44b7447bc48a9f2ff27f5458f8b7.

This patch introduced a logical error that breaks whole logic of this analysis.
All checks we are making are supposed to be loop-independent, so that we could
safely remove the range check. The 'nw' fact is loop-dependent, so we can remove
the check basing on facts from this very check.

Motivating examples will follow-up.
2020-11-25 13:26:17 +07:00
..
models/inliner
AliasAnalysis.cpp [MemLoc] Require LocationSize argument (NFC) 2020-11-19 21:45:52 +01:00
AliasAnalysisEvaluator.cpp [BasicAA] Remove assert in AA evaluator 2020-11-18 20:04:38 +01:00
AliasAnalysisSummary.cpp
AliasAnalysisSummary.h
AliasSetTracker.cpp [CSSPGO] IR intrinsic for pseudo-probe block instrumentation 2020-11-20 10:39:24 -08:00
Analysis.cpp
AssumeBundleQueries.cpp
AssumptionCache.cpp
BasicAliasAnalysis.cpp [BasicAA] Avoid unnecessary cache update (NFC) 2020-11-22 20:10:45 +01:00
BlockFrequencyInfo.cpp
BlockFrequencyInfoImpl.cpp
BranchProbabilityInfo.cpp [BPI] Look through bitcasts in calcZeroHeuristic 2020-11-17 09:33:05 -08:00
CallGraph.cpp
CallGraphSCCPass.cpp [NPM] Share pass building options with legacy PM 2020-11-23 13:04:05 -08:00
CallPrinter.cpp
CaptureTracking.cpp [CaptureTracking] Add statistics (NFC) 2020-11-07 12:57:00 +01:00
CFG.cpp
CFGPrinter.cpp
CFLAndersAliasAnalysis.cpp [MemLoc] Use hasValue() method (NFC) 2020-11-19 21:53:50 +01:00
CFLGraph.h
CFLSteensAliasAnalysis.cpp
CGSCCPassManager.cpp Reland [CGSCC] Detect devirtualization in more cases 2020-11-23 21:28:59 -08:00
CMakeLists.txt llvmbuildectomy - replace llvm-build by plain cmake 2020-11-13 10:35:24 +01:00
CmpInstAnalysis.cpp
CodeMetrics.cpp
ConstantFolding.cpp [llvm][IR] Add dso_local_equivalent Constant 2020-11-19 10:26:17 -08:00
ConstraintSystem.cpp
CostModel.cpp
DDG.cpp
Delinearization.cpp
DemandedBits.cpp
DependenceAnalysis.cpp
DependenceGraphBuilder.cpp
DevelopmentModeInlineAdvisor.cpp [NFC][TFUtils] also include output specs lookup logic in loadOutputSpecs 2020-11-18 21:20:21 -08:00
DivergenceAnalysis.cpp [Analysis] Remove unused system header includes 2020-11-22 10:32:37 +00:00
DominanceFrontier.cpp
DomPrinter.cpp
DomTreeUpdater.cpp [Analysis] Use llvm::is_contained (NFC) 2020-11-20 18:08:05 -08:00
EHPersonalities.cpp
FunctionPropertiesAnalysis.cpp
GlobalsModRef.cpp Fix speling in comments. NFC. 2020-11-23 14:43:24 +00:00
GuardUtils.cpp
HeatUtils.cpp
IndirectCallPromotionAnalysis.cpp [Analysis] Remove unused system header includes 2020-11-22 10:32:37 +00:00
InlineAdvisor.cpp
InlineCost.cpp [Inline] Fix in handling of ptrtoint in InlineCost 2020-11-23 14:33:06 +01:00
InlineSizeEstimatorAnalysis.cpp
InstCount.cpp
InstructionPrecedenceTracking.cpp
InstructionSimplify.cpp [InstSimplify] allow vector folds for (Pow2C << X) == NonPow2C 2020-11-08 09:52:05 -05:00
Interval.cpp
IntervalPartition.cpp
IRSimilarityIdentifier.cpp
IVDescriptors.cpp Enable support for floating-point division reductions 2020-11-23 20:00:58 -05:00
IVUsers.cpp
LazyBlockFrequencyInfo.cpp
LazyBranchProbabilityInfo.cpp
LazyCallGraph.cpp
LazyValueInfo.cpp
LegacyDivergenceAnalysis.cpp [DivergenceAnalysis] Use addRequiredTransitive 2020-11-13 14:40:00 +01:00
Lint.cpp [Lint] Use MemoryLocation 2020-11-19 20:55:25 +01:00
Loads.cpp
LoopAccessAnalysis.cpp [SCEV] Use isa<> pattern for testing for CouldNotCompute [NFC] 2020-11-24 18:47:49 -08:00
LoopAnalysisManager.cpp
LoopCacheAnalysis.cpp
LoopInfo.cpp [LangRef] Adds llvm.loop.mustprogress loop metadata 2020-11-04 22:32:50 -05:00
LoopNestAnalysis.cpp
LoopPass.cpp
LoopUnrollAnalyzer.cpp
MemDepPrinter.cpp
MemDerefPrinter.cpp Port -print-memderefs to NPM 2020-11-23 11:56:22 -08:00
MemoryBuiltins.cpp
MemoryDependenceAnalysis.cpp [MemLoc] Require LocationSize argument (NFC) 2020-11-19 21:45:52 +01:00
MemoryLocation.cpp
MemorySSA.cpp [MemLoc] Require LocationSize argument (NFC) 2020-11-19 21:45:52 +01:00
MemorySSAUpdater.cpp
MLInlineAdvisor.cpp
ModuleDebugInfoPrinter.cpp
ModuleSummaryAnalysis.cpp
MustExecute.cpp Port print-must-be-executed-contexts and print-mustexecute to NPM 2020-11-03 21:06:46 -08:00
ObjCARCAliasAnalysis.cpp [MemLoc] Require LocationSize argument (NFC) 2020-11-19 21:45:52 +01:00
ObjCARCAnalysisUtils.cpp
ObjCARCInstKind.cpp
OptimizationRemarkEmitter.cpp
PHITransAddr.cpp
PhiValues.cpp
PostDominators.cpp
ProfileSummaryInfo.cpp
PtrUseVisitor.cpp
README.txt
RegionInfo.cpp
RegionPass.cpp
RegionPrinter.cpp
ReleaseModeModelRunner.cpp
ReplayInlineAdvisor.cpp
ScalarEvolution.cpp Revert "[SCEV] Generalize no-self-wrap check in isLoopInvariantExitCondDuringFirstIterations" 2020-11-25 13:26:17 +07:00
ScalarEvolutionAliasAnalysis.cpp
ScalarEvolutionDivision.cpp
ScalarEvolutionNormalization.cpp
ScopedNoAliasAA.cpp
StackLifetime.cpp
StackSafetyAnalysis.cpp
StratifiedSets.h
SyncDependenceAnalysis.cpp
SyntheticCountsUtils.cpp
TargetLibraryInfo.cpp
TargetTransformInfo.cpp [HardwareLoops] Change order of SCEV expression construction for InitLoopCount. 2020-11-24 18:01:42 +00:00
TFUtils.cpp [NFC][TFUtils] also include output specs lookup logic in loadOutputSpecs 2020-11-18 21:20:21 -08:00
Trace.cpp
TypeBasedAliasAnalysis.cpp
TypeMetadataUtils.cpp
ValueLattice.cpp
ValueLatticeUtils.cpp
ValueTracking.cpp [ValueTracking][MemCpyOpt] avoid crash on inttoptr with vector pointer type (PR48075) 2020-11-22 12:54:18 -05:00
VectorUtils.cpp [CSSPGO] IR intrinsic for pseudo-probe block instrumentation 2020-11-20 10:39:24 -08:00
VFABIDemangling.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))

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