1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 03:33:20 +01:00
llvm-mirror/lib/Analysis
Roman Lebedev b18f65657c [SCEV] Recognize @llvm.usub.sat as %x - (umin %x, %y)
----------------------------------------
define i32 @src(i32 %x, i32 %y) {
%0:
  %r = usub_sat i32 %x, %y
  ret i32 %r
}
=>
define i32 @tgt(i32 %x, i32 %y) {
%0:
  %t0 = umin i32 %x, %y
  %r = sub nuw i32 %x, %t0
  ret i32 %r
}
Transformation seems to be correct!
2020-09-21 20:25:54 +03:00
..
models/inliner [MLInliner] Simplify TFUTILS_SUPPORTED_TYPES 2020-08-25 14:19:39 -07:00
AliasAnalysis.cpp [opt][NewPM] Add basic-aa in legacy PM compatibility mode 2020-08-21 14:05:07 -07:00
AliasAnalysisEvaluator.cpp
AliasAnalysisSummary.cpp
AliasAnalysisSummary.h
AliasSetTracker.cpp [NewPM] Port -print-alias-sets to NPM 2020-09-16 18:34:56 -07:00
Analysis.cpp [NewPM][Lint] Port -lint to NewPM 2020-09-03 13:03:44 -07:00
AssumeBundleQueries.cpp Reland [AssumeBundles] Use operand bundles to encode alignment assumptions 2020-09-12 15:36:06 +02:00
AssumptionCache.cpp
BasicAliasAnalysis.cpp [LangRef] Adjust guarantee for llvm.memcpy to also allow equal arguments. 2020-09-05 19:18:23 +01:00
BlockFrequencyInfo.cpp
BlockFrequencyInfoImpl.cpp
BranchProbabilityInfo.cpp Revert "[BPI] Improve static heuristics for integer comparisons" 2020-08-17 20:44:33 +02:00
CallGraph.cpp
CallGraphSCCPass.cpp Skip analysis re-computation when no changes are reported 2020-08-28 21:41:01 +02:00
CallPrinter.cpp
CaptureTracking.cpp [NFC] GetUnderlyingObject -> getUnderlyingObject 2020-07-30 21:08:24 -07:00
CFG.cpp
CFGPrinter.cpp
CFLAndersAliasAnalysis.cpp
CFLGraph.h
CFLSteensAliasAnalysis.cpp
CGSCCPassManager.cpp [NewPM][PassInstrumentation] Add PreservedAnalyses parameter to AfterPass* callbacks 2020-08-21 16:10:42 +07:00
CMakeLists.txt [IRSim] Adding IR Instruction Mapper 2020-09-17 14:06:16 -05:00
CmpInstAnalysis.cpp
CodeMetrics.cpp
ConstantFolding.cpp [ConstantFolding] add undef handling for fmin/fmax intrinsics 2020-09-19 10:31:01 -04:00
ConstraintSystem.cpp [ConstraintSystem] Remove local variable that is set but not read [NFC] 2020-09-17 14:26:48 +02:00
CostModel.cpp
DDG.cpp
Delinearization.cpp
DemandedBits.cpp [DemandedBits][BDCE] Add support for min/max intrinsics 2020-09-10 22:13:31 +02:00
DependenceAnalysis.cpp [NFC] Remove unused GetUnderlyingObject paramenter 2020-07-31 02:10:03 -07:00
DependenceGraphBuilder.cpp
DevelopmentModeInlineAdvisor.cpp [MLInliner] Support training that doesn't require partial rewards 2020-08-24 17:36:29 -07:00
DivergenceAnalysis.cpp
DominanceFrontier.cpp
DomPrinter.cpp
DomTreeUpdater.cpp
EHPersonalities.cpp
FunctionPropertiesAnalysis.cpp
GlobalsModRef.cpp [NFC] Remove unused GetUnderlyingObject paramenter 2020-07-31 02:10:03 -07:00
GuardUtils.cpp
HeatUtils.cpp
IndirectCallPromotionAnalysis.cpp
InlineAdvisor.cpp [InlineAdvisor] New inliner advisor to replay inlining from optimization remarks 2020-08-15 20:17:21 -07:00
InlineCost.cpp [InlineCost] Fix scalable vectors in visitAlloca 2020-08-17 10:34:27 +00:00
InlineSizeEstimatorAnalysis.cpp [NFC][MLInliner] Presort instruction successions. 2020-09-10 21:40:49 -07:00
InstCount.cpp [NFC] Port InstCount pass to new pass manager 2020-08-21 12:39:42 +03:00
InstructionPrecedenceTracking.cpp
InstructionSimplify.cpp [InstSimplify] fix fmin/fmax miscompile for partial undef vectors (PR47567) 2020-09-18 10:05:44 -04:00
Interval.cpp
IntervalPartition.cpp
IRSimilarityIdentifier.cpp [IRSim] Adding ilist for IRInstructionData. 2020-09-19 00:18:39 -05:00
IVDescriptors.cpp [LoopVectorizer] Inloop vector reductions 2020-08-06 10:10:50 +01:00
IVUsers.cpp
LazyBlockFrequencyInfo.cpp
LazyBranchProbabilityInfo.cpp
LazyCallGraph.cpp [CGSCC][NewPM] Fix adding mutually recursive new functions 2020-09-15 16:44:08 -07:00
LazyValueInfo.cpp [LVI] Get value range from mask comparison 2020-09-20 21:13:57 +02:00
LegacyDivergenceAnalysis.cpp
Lint.cpp [Lint] Add check for intrinsic get.active.lane.mask 2020-09-17 09:22:03 +01:00
LLVMBuild.txt
Loads.cpp [NFC] Fix unused var in release build 2020-09-01 13:05:56 -07:00
LoopAccessAnalysis.cpp [NFC] Remove unused GetUnderlyingObject paramenter 2020-07-31 02:10:03 -07:00
LoopAnalysisManager.cpp
LoopCacheAnalysis.cpp LoopCacheAnalysis.h - remove unnecessary includes. NFCI. 2020-09-15 13:34:35 +01:00
LoopInfo.cpp
LoopNestAnalysis.cpp [LoopNest] False negative of arePerfectlyNested with LCSSA loops 2020-08-25 16:20:52 +00:00
LoopPass.cpp Skip analysis re-computation when no changes are reported 2020-08-28 21:41:01 +02:00
LoopUnrollAnalyzer.cpp
MemDepPrinter.cpp
MemDerefPrinter.cpp
MemoryBuiltins.cpp
MemoryDependenceAnalysis.cpp Handle masked loads and stores in MemoryLocation/Dependence 2020-09-08 19:08:44 -05:00
MemoryLocation.cpp [MemLoc] Support lllvm.memcpy.inline in MemoryLocation::getForArgument 2020-09-20 14:01:48 +02:00
MemorySSA.cpp [MemorySSA] Make sure PerformedPhiTrans is updated for each visited def. 2020-09-14 16:11:56 +01:00
MemorySSAUpdater.cpp [MemorySSA] Rename uses in blocks with Phis. 2020-09-16 17:24:17 -07:00
MLInlineAdvisor.cpp
ModuleDebugInfoPrinter.cpp
ModuleSummaryAnalysis.cpp [StackSafety] Use ValueInfo in ParamAccess::Call 2020-08-14 12:42:44 -07:00
MustExecute.cpp
ObjCARCAliasAnalysis.cpp [NFC] Remove unused GetUnderlyingObject paramenter 2020-07-31 02:10:03 -07:00
ObjCARCAnalysisUtils.cpp
ObjCARCInstKind.cpp
OptimizationRemarkEmitter.cpp
PHITransAddr.cpp
PhiValues.cpp
PostDominators.cpp
ProfileSummaryInfo.cpp
PtrUseVisitor.cpp
README.txt
RegionInfo.cpp
RegionPass.cpp Skip analysis re-computation when no changes are reported 2020-08-28 21:41:01 +02:00
RegionPrinter.cpp
ReleaseModeModelRunner.cpp
ReplayInlineAdvisor.cpp [InlineAdvisor] New inliner advisor to replay inlining from optimization remarks 2020-08-15 20:17:21 -07:00
ScalarEvolution.cpp [SCEV] Recognize @llvm.usub.sat as %x - (umin %x, %y) 2020-09-21 20:25:54 +03:00
ScalarEvolutionAliasAnalysis.cpp
ScalarEvolutionDivision.cpp [SCEV] Generalize SCEVParameterRewriter to accept SCEV expression as target. 2020-09-18 10:05:02 +01:00
ScalarEvolutionNormalization.cpp
ScopedNoAliasAA.cpp
StackLifetime.cpp When dumping results of StackLifetime, it will print the following 2020-09-07 11:43:16 +08:00
StackSafetyAnalysis.cpp [NFC][StackSafety] Replace auto with type 2020-09-18 17:10:28 -07:00
StratifiedSets.h
SyncDependenceAnalysis.cpp [sda][nfc] clang-formatting 2020-08-27 18:27:44 +02:00
SyntheticCountsUtils.cpp
TargetLibraryInfo.cpp Fix some clang-tidy bugprone-argument-comment issues 2020-09-19 20:41:25 -07:00
TargetTransformInfo.cpp [LV][ARM] Add preferInloopReduction target hook. 2020-09-12 17:47:04 +01:00
TFUtils.cpp [MLInliner] Simplify TFUTILS_SUPPORTED_TYPES 2020-08-25 14:19:39 -07:00
Trace.cpp
TypeBasedAliasAnalysis.cpp
TypeMetadataUtils.cpp
ValueLattice.cpp
ValueLatticeUtils.cpp
ValueTracking.cpp [ValueTracking] isKnownNonZero, computeKnownBits for freeze 2020-09-10 08:07:38 +09:00
VectorUtils.cpp [NFC] Fix compiler warnings due to integer comparison of different signedness 2020-09-11 15:32:03 +01:00
VFABIDemangling.cpp [SVE] Make ElementCount members private 2020-08-28 14:43:53 +01: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))

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