1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 03:33:20 +01:00
llvm-mirror/lib/Analysis
David Majnemer 774e517b3f [ConstantFolding] Fold masked loads
We can constant fold a masked load if the operands are appropriately
constant.

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

llvm-svn: 275352
2016-07-14 00:29:50 +00:00
..
AliasAnalysis.cpp AliasAnalysis: unify getModRefInfo(I, CS) semantics with other overloads 2016-07-11 14:11:45 +00:00
AliasAnalysisEvaluator.cpp Apply clang-tidy's modernize-loop-convert to lib/Analysis. 2016-06-26 17:27:42 +00:00
AliasAnalysisSummary.cpp [CFLAA] Split out more things from CFLSteens. NFC. 2016-07-06 00:47:21 +00:00
AliasAnalysisSummary.h [CFLAA] Simplify CFLGraphBuilder. NFC. 2016-07-11 22:59:09 +00:00
AliasSetTracker.cpp Apply clang-tidy's modernize-loop-convert to lib/Analysis. 2016-06-26 17:27:42 +00:00
Analysis.cpp [BFI] Add new LazyBFI analysis pass 2016-07-13 05:01:48 +00:00
AssumptionCache.cpp
BasicAliasAnalysis.cpp BasicAA should look through functions with returned arguments 2016-07-11 01:32:20 +00:00
BlockFrequencyInfo.cpp [BFI] Add new LazyBFI analysis pass 2016-07-13 05:01:48 +00:00
BlockFrequencyInfoImpl.cpp [BFI]: NFC refactoring 2016-06-22 17:12:12 +00:00
BranchProbabilityInfo.cpp [PPC] Strength-reduce SmallVectors into arrays. 2016-06-17 13:15:10 +00:00
CallGraph.cpp Apply clang-tidy's modernize-loop-convert to lib/Analysis. 2016-06-26 17:27:42 +00:00
CallGraphSCCPass.cpp Apply clang-tidy's modernize-loop-convert to lib/Analysis. 2016-06-26 17:27:42 +00:00
CallPrinter.cpp
CaptureTracking.cpp
CFG.cpp
CFGPrinter.cpp
CFLAndersAliasAnalysis.cpp [CFLAA] Split the CFL graph out from CFLSteens. NFC. 2016-07-06 00:36:12 +00:00
CFLGraph.h Attempt to make buildbots happy. 2016-07-11 23:18:32 +00:00
CFLSteensAliasAnalysis.cpp [CFLAA] Simplify CFLGraphBuilder. NFC. 2016-07-11 22:59:09 +00:00
CGSCCPassManager.cpp
CMakeLists.txt [BFI] Add new LazyBFI analysis pass 2016-07-13 05:01:48 +00:00
CodeMetrics.cpp
ConstantFolding.cpp [ConstantFolding] Fold masked loads 2016-07-14 00:29:50 +00:00
CostModel.cpp Apply clang-tidy's modernize-loop-convert to lib/Analysis. 2016-06-26 17:27:42 +00:00
Delinearization.cpp
DemandedBits.cpp
DependenceAnalysis.cpp Apply clang-tidy's modernize-loop-convert to lib/Analysis. 2016-06-26 17:27:42 +00:00
DivergenceAnalysis.cpp
DominanceFrontier.cpp
DomPrinter.cpp
EHPersonalities.cpp
GlobalsModRef.cpp
IndirectCallPromotionAnalysis.cpp Remove another unused variable from r275216 2016-07-12 23:49:17 +00:00
InlineCost.cpp Implement callsite-hotness based inline cost for Sample-based PGO 2016-07-11 16:48:54 +00:00
InstCount.cpp
InstructionSimplify.cpp Move a transform from InstCombine to InstSimplify. 2016-07-13 23:32:53 +00:00
Interval.cpp Apply clang-tidy's modernize-loop-convert to lib/Analysis. 2016-06-26 17:27:42 +00:00
IntervalPartition.cpp Apply clang-tidy's modernize-loop-convert to lib/Analysis. 2016-06-26 17:27:42 +00:00
IteratedDominanceFrontier.cpp
IVUsers.cpp Apply clang-tidy's modernize-loop-convert to lib/Analysis. 2016-06-26 17:27:42 +00:00
LazyBlockFrequencyInfo.cpp [BFI] Add new LazyBFI analysis pass 2016-07-13 05:01:48 +00:00
LazyCallGraph.cpp [LCG] Hoist the definitions of the stream operator friends to be inline 2016-07-07 07:52:07 +00:00
LazyValueInfo.cpp Reformat blank lines. 2016-07-04 01:26:33 +00:00
Lint.cpp
LLVMBuild.txt Refactor indirect call promotion profitability analysis (NFC) 2016-07-12 21:13:44 +00:00
Loads.cpp Teach isDereferenceablePointer to look through returned-argument functions 2016-07-11 03:08:49 +00:00
LoopAccessAnalysis.cpp [LAA] Don't hold on to DominatorTree in the analysis result 2016-07-13 22:36:35 +00:00
LoopInfo.cpp Apply clang-tidy's modernize-loop-convert to lib/Analysis. 2016-06-26 17:27:42 +00:00
LoopPass.cpp Apply clang-tidy's modernize-loop-convert to lib/Analysis. 2016-06-26 17:27:42 +00:00
LoopPassManager.cpp
LoopUnrollAnalyzer.cpp [LoopUnrollAnalyzer] Fix a bug in UnrolledInstAnalyzer::visitLoad. 2016-06-23 14:31:31 +00:00
MemDepPrinter.cpp Apply clang-tidy's modernize-loop-convert to lib/Analysis. 2016-06-26 17:27:42 +00:00
MemDerefPrinter.cpp
MemoryBuiltins.cpp fix formatting; NFC 2016-07-07 16:19:09 +00:00
MemoryDependenceAnalysis.cpp Typos. NFC. 2016-06-28 17:19:10 +00:00
MemoryLocation.cpp
ModuleDebugInfoPrinter.cpp
ModuleSummaryAnalysis.cpp Apply clang-tidy's modernize-loop-convert to lib/Analysis. 2016-06-26 17:27:42 +00:00
ObjCARCAliasAnalysis.cpp
ObjCARCAnalysisUtils.cpp
ObjCARCInstKind.cpp
OrderedBasicBlock.cpp
PHITransAddr.cpp
PostDominators.cpp [PM] Remove support for omitting the AnalysisManager argument to new 2016-06-17 00:11:01 +00:00
ProfileSummaryInfo.cpp [PM] Remove support for omitting the AnalysisManager argument to new 2016-06-17 00:11:01 +00:00
PtrUseVisitor.cpp
README.txt
RegionInfo.cpp
RegionPass.cpp
RegionPrinter.cpp Apply clang-tidy's modernize-loop-convert to lib/Analysis. 2016-06-26 17:27:42 +00:00
ScalarEvolution.cpp Teach SCEV to look through returned-argument functions 2016-07-11 02:48:23 +00:00
ScalarEvolutionAliasAnalysis.cpp
ScalarEvolutionExpander.cpp Fix ScalarEvolutionExpander step scaling bug 2016-07-13 01:28:12 +00:00
ScalarEvolutionNormalization.cpp
ScopedNoAliasAA.cpp
SparsePropagation.cpp Apply clang-tidy's modernize-loop-convert to lib/Analysis. 2016-06-26 17:27:42 +00:00
StratifiedSets.h [CFLAA] Simplify CFLGraphBuilder. NFC. 2016-07-11 22:59:09 +00:00
TargetLibraryInfo.cpp Reverting r275284 due to platform-specific test failures 2016-07-13 19:09:16 +00:00
TargetTransformInfo.cpp Add TLI.allowsMisalignedMemoryAccesses to LoadStoreVectorizer 2016-07-11 20:46:17 +00:00
Trace.cpp
TypeBasedAliasAnalysis.cpp
TypeMetadataUtils.cpp [IR] Make getIndexedOffsetInType return a signed result 2016-07-13 03:42:38 +00:00
ValueTracking.cpp Teach computeKnownBits to look through returned-argument functions 2016-07-11 02:25:14 +00:00
VectorUtils.cpp SLPVectorizer: Move propagateMetadata to VectorUtils 2016-06-30 21:17:59 +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))

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