1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 02:52:53 +02:00
llvm-mirror/lib/Analysis
Johannes Doerfert aad9f9ab3e [CaptureTracking] Allow null to be in either icmp operand
Summary:
Before we required the comparison against null to be "canonical", hence
null to be operand #1. This patch allows null to be in either operand,
similar to the handling of loaded globals that follows.

Reviewers: sanjoy, hfinkel, aykevl, sstefan1, uenoku

Subscribers: hiraditya, bollu, llvm-commits

Tags: #llvm

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

llvm-svn: 369158
2019-08-16 21:53:49 +00:00
..
AliasAnalysis.cpp
AliasAnalysisEvaluator.cpp
AliasAnalysisSummary.cpp
AliasAnalysisSummary.h
AliasSetTracker.cpp
Analysis.cpp
AssumptionCache.cpp AssumptionCache: remove old affected values after RAUW. 2019-08-16 09:34:27 +00:00
BasicAliasAnalysis.cpp [ValueTracking] Look through ptrmask intrinsics during getUnderlyingObject. 2019-08-15 18:39:56 +00:00
BlockFrequencyInfo.cpp
BlockFrequencyInfoImpl.cpp
BranchProbabilityInfo.cpp
CallGraph.cpp Revert "[CallGraph] Refine call graph for indirect calls with !callees metadata" 2019-08-16 10:59:18 +00:00
CallGraphSCCPass.cpp
CallPrinter.cpp
CaptureTracking.cpp [CaptureTracking] Allow null to be in either icmp operand 2019-08-16 21:53:49 +00:00
CFG.cpp Recommit "[GVN] Preserve loop related analysis/canonical forms." 2019-07-31 09:27:54 +00:00
CFGPrinter.cpp Rename F_{None,Text,Append} to OF_{None,Text,Append}. NFC 2019-08-05 05:43:48 +00:00
CFLAndersAliasAnalysis.cpp
CFLGraph.h
CFLSteensAliasAnalysis.cpp
CGSCCPassManager.cpp Revert "[CallGraph] Refine call graph for indirect calls with !callees metadata" 2019-08-16 10:59:18 +00:00
CMakeLists.txt Title: Loop Cache Analysis 2019-08-09 13:56:29 +00:00
CmpInstAnalysis.cpp
CodeMetrics.cpp
ConstantFolding.cpp [SCCP] Update condition to avoid overflow. 2019-07-31 18:22:22 +00:00
CostModel.cpp
Delinearization.cpp
DemandedBits.cpp
DependenceAnalysis.cpp [llvm] Migrate llvm::make_unique to std::make_unique 2019-08-15 15:54:37 +00:00
DivergenceAnalysis.cpp [DivergenceAnalysis] Add methods for querying divergence at use 2019-07-29 10:22:09 +00:00
DominanceFrontier.cpp
DomPrinter.cpp
DomTreeUpdater.cpp
EHPersonalities.cpp
GlobalsModRef.cpp
GuardUtils.cpp
IndirectCallPromotionAnalysis.cpp [llvm] Migrate llvm::make_unique to std::make_unique 2019-08-15 15:54:37 +00:00
InlineCost.cpp [InstSimplify] Rename SimplifyFPUnOp and SimplifyFPBinOp 2019-07-24 12:50:10 +00:00
InstCount.cpp
InstructionPrecedenceTracking.cpp
InstructionSimplify.cpp [InstCombine] fold cmp+select using select operand equivalence 2019-08-02 17:39:32 +00:00
Interval.cpp
IntervalPartition.cpp
IVDescriptors.cpp
IVUsers.cpp
LazyBlockFrequencyInfo.cpp
LazyBranchProbabilityInfo.cpp [llvm] Migrate llvm::make_unique to std::make_unique 2019-08-15 15:54:37 +00:00
LazyCallGraph.cpp Revert "[CallGraph] Refine call graph for indirect calls with !callees metadata" 2019-08-16 10:59:18 +00:00
LazyValueInfo.cpp [llvm] Migrate llvm::make_unique to std::make_unique 2019-08-15 15:54:37 +00:00
LegacyDivergenceAnalysis.cpp [llvm] Migrate llvm::make_unique to std::make_unique 2019-08-15 15:54:37 +00:00
Lint.cpp
LLVMBuild.txt
Loads.cpp [ValueTracking] Add MustPreserveNullness arg to functions analyzing calls. (NFC) 2019-08-15 12:13:02 +00:00
LoopAccessAnalysis.cpp [llvm] Migrate llvm::make_unique to std::make_unique 2019-08-15 15:54:37 +00:00
LoopAnalysisManager.cpp Only passes that preserve MemorySSA must mark it as preserved. 2019-06-11 18:27:49 +00:00
LoopCacheAnalysis.cpp [llvm] Migrate llvm::make_unique to std::make_unique 2019-08-15 15:54:37 +00:00
LoopInfo.cpp [LOOPINFO] Introduce the loop guard API. 2019-07-25 16:13:18 +00:00
LoopPass.cpp
LoopUnrollAnalyzer.cpp [InstSimplify] Rename SimplifyFPUnOp and SimplifyFPBinOp 2019-07-24 12:50:10 +00:00
MemDepPrinter.cpp
MemDerefPrinter.cpp OpaquePtr: add Type parameter to Loads analysis API. 2019-07-09 11:35:35 +00:00
MemoryBuiltins.cpp OpaquePtr: switch to GlobalValue::getValueType in a few places. NFC. 2019-07-11 13:13:02 +00:00
MemoryDependenceAnalysis.cpp [MemDep] allow to select block-scan-limit when constructing MemoryDependenceAnalysis 2019-08-10 01:23:38 +00:00
MemoryLocation.cpp
MemorySSA.cpp [MemorySSA] Remove restrictive asserts. 2019-08-15 21:20:08 +00:00
MemorySSAUpdater.cpp [IR] Value: add replaceUsesWithIf() utility 2019-08-01 12:32:08 +00:00
ModuleDebugInfoPrinter.cpp
ModuleSummaryAnalysis.cpp [llvm] Migrate llvm::make_unique to std::make_unique 2019-08-15 15:54:37 +00:00
MustExecute.cpp
ObjCARCAliasAnalysis.cpp
ObjCARCAnalysisUtils.cpp
ObjCARCInstKind.cpp [ObjC][ARC] Delete ObjC runtime calls on global variables annotated 2019-06-14 22:06:32 +00:00
OptimizationRemarkEmitter.cpp [llvm] Migrate llvm::make_unique to std::make_unique 2019-08-15 15:54:37 +00:00
OrderedBasicBlock.cpp
OrderedInstructions.cpp [llvm] Migrate llvm::make_unique to std::make_unique 2019-08-15 15:54:37 +00:00
PHITransAddr.cpp
PhiValues.cpp
PostDominators.cpp
ProfileSummaryInfo.cpp Cleanup: llvm::bsearch -> llvm::partition_point after r364719 2019-06-30 11:19:56 +00:00
PtrUseVisitor.cpp SROA: Allow eliminating addrspacecasted allocas 2019-06-14 21:38:31 +00:00
README.txt
RegionInfo.cpp
RegionPass.cpp
RegionPrinter.cpp
ScalarEvolution.cpp [SCEV] Rename getMaxBackedgeTakenCount to getConstantMaxBackedgeTakenCount [NFC] 2019-08-14 21:58:13 +00:00
ScalarEvolutionAliasAnalysis.cpp
ScalarEvolutionExpander.cpp [SCEV] Fix for PR42397. SCEVExpander wrongly adds nsw to shl instruction. 2019-07-08 18:03:43 +00:00
ScalarEvolutionNormalization.cpp
ScopedNoAliasAA.cpp
StackSafetyAnalysis.cpp
StratifiedSets.h
SyncDependenceAnalysis.cpp
SyntheticCountsUtils.cpp
TargetLibraryInfo.cpp [AMDGPU] Printf runtime binding pass 2019-08-12 17:12:29 +00:00
TargetTransformInfo.cpp InferAddressSpaces: Move target intrinsic handling to TTI 2019-08-14 18:13:00 +00:00
Trace.cpp
TypeBasedAliasAnalysis.cpp
TypeMetadataUtils.cpp
ValueLattice.cpp
ValueLatticeUtils.cpp
ValueTracking.cpp [ValueTracking] Fix recurrence detection to check both PHI operands. 2019-08-16 09:15:02 +00:00
VectorUtils.cpp [LV] Avoid building interleaved group in presence of WAW dependency 2019-08-02 06:31:50 +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))

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