1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 04:02:41 +01:00
llvm-mirror/lib/Analysis
JF Bastien 4bd103b312 Merge clang's isRepeatedBytePattern with LLVM's isBytewiseValue
Summary:
his code was in CGDecl.cpp and really belongs in LLVM's isBytewiseValue. Teach isBytewiseValue the tricks clang's isRepeatedBytePattern had, including merging undef properly, and recursing on more types.

clang part of this patch: D51752

Subscribers: dexonsmith, llvm-commits

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

llvm-svn: 342709
2018-09-21 05:17:42 +00:00
..
AliasAnalysis.cpp [AA] Remove a needless variable [NFC] 2018-08-22 19:50:45 +00:00
AliasAnalysisEvaluator.cpp [MSSA] Print more optimization information 2018-06-14 19:55:53 +00:00
AliasAnalysisSummary.cpp
AliasAnalysisSummary.h
AliasSetTracker.cpp [AST] Visit memtransfer arguments in order 2018-09-10 16:00:27 +00:00
Analysis.cpp [NFC] Rename the DivergenceAnalysis to LegacyDivergenceAnalysis 2018-08-30 14:21:36 +00:00
AssumptionCache.cpp
BasicAliasAnalysis.cpp [BasicAA] Don't assume tail calls with byval don't alias allocas 2018-08-14 01:24:35 +00:00
BlockFrequencyInfo.cpp
BlockFrequencyInfoImpl.cpp [BFI] Use rounding while computing profile counts. 2018-08-16 00:26:59 +00:00
BranchProbabilityInfo.cpp [BPI] Remove unnecessary std::list 2018-06-15 21:06:43 +00:00
CallGraph.cpp Remove trailing space 2018-07-30 19:41:25 +00:00
CallGraphSCCPass.cpp Output per-function size-info remarks 2018-09-06 21:19:54 +00:00
CallPrinter.cpp Revert "Extend CFGPrinter and CallPrinter with Heat Colors" 2018-06-29 17:48:58 +00:00
CaptureTracking.cpp
CFG.cpp
CFGPrinter.cpp Remove trailing space 2018-07-30 19:41:25 +00:00
CFLAndersAliasAnalysis.cpp
CFLGraph.h [IR] Replace isa<TerminatorInst> with isTerminator(). 2018-08-26 09:51:22 +00:00
CFLSteensAliasAnalysis.cpp
CGSCCPassManager.cpp [New PM] Introducing PassInstrumentation framework 2018-09-20 17:08:45 +00:00
CMakeLists.txt Break LoopUtils into an Analysis file. 2018-09-12 01:59:43 +00:00
CmpInstAnalysis.cpp
CodeMetrics.cpp
ConstantFolding.cpp Prevent Constant Folding From Optimizing inrange GEP 2018-09-11 01:53:36 +00:00
CostModel.cpp
Delinearization.cpp
DemandedBits.cpp [IR] Replace isa<TerminatorInst> with isTerminator(). 2018-08-26 09:51:22 +00:00
DependenceAnalysis.cpp [DA] Delinearise AddRecs if we can prove they don't wrap 2018-06-25 15:13:26 +00:00
DominanceFrontier.cpp
DomPrinter.cpp Revert "Extend CFGPrinter and CallPrinter with Heat Colors" 2018-06-29 17:48:58 +00:00
EHPersonalities.cpp
GlobalsModRef.cpp Remove trailing space 2018-07-30 19:41:25 +00:00
GuardUtils.cpp Re-enable "[NFC] Unify guards detection" 2018-08-30 03:39:16 +00:00
IndirectCallPromotionAnalysis.cpp
InlineCost.cpp [inline Cost] Don't mark functions accessing varargs as non-inlinable 2018-09-20 18:39:34 +00:00
InstCount.cpp
InstructionPrecedenceTracking.cpp [NFC] Rename variable 2018-09-11 05:10:01 +00:00
InstructionSimplify.cpp [IR] Replace isa<TerminatorInst> with isTerminator(). 2018-08-26 09:51:22 +00:00
Interval.cpp
IntervalPartition.cpp
IteratedDominanceFrontier.cpp [IDF] Teach Iterated Dominance Frontier to use a snapshot CFG based on a GraphDiff. 2018-08-17 17:39:15 +00:00
IVDescriptors.cpp Remove unused include from IVDescriptors.cpp. 2018-09-12 07:22:46 +00:00
IVUsers.cpp
LazyBlockFrequencyInfo.cpp
LazyBranchProbabilityInfo.cpp
LazyCallGraph.cpp
LazyValueInfo.cpp Remove trailing space 2018-07-30 19:41:25 +00:00
LegacyDivergenceAnalysis.cpp [NFC] Rename the DivergenceAnalysis to LegacyDivergenceAnalysis 2018-08-30 14:21:36 +00:00
Lint.cpp
LLVMBuild.txt
Loads.cpp
LoopAccessAnalysis.cpp Remove trailing space 2018-07-30 19:41:25 +00:00
LoopAnalysisManager.cpp [LoopPassManager] MemorySSA should be preserved when enabled. 2018-09-06 20:54:24 +00:00
LoopInfo.cpp [Loopinfo] Remove one latch-case in getLoopID. NFC. 2018-09-17 18:40:29 +00:00
LoopPass.cpp Output per-function size-info remarks 2018-09-06 21:19:54 +00:00
LoopUnrollAnalyzer.cpp
MemDepPrinter.cpp Remove trailing space 2018-07-30 19:41:25 +00:00
MemDerefPrinter.cpp
MemoryBuiltins.cpp Reverting r340807. 2018-08-30 18:37:18 +00:00
MemoryDependenceAnalysis.cpp [IR] Replace isa<TerminatorInst> with isTerminator(). 2018-08-26 09:51:22 +00:00
MemoryLocation.cpp [AST] Generalize argument specific aliasing 2018-09-07 21:36:11 +00:00
MemorySSA.cpp API to update MemorySSA for cloned blocks and added CFG edges. 2018-09-10 20:13:01 +00:00
MemorySSAUpdater.cpp [MemorySSAUpdater] Avoid creating self-referencing MemoryDefs 2018-09-11 14:29:59 +00:00
ModuleDebugInfoPrinter.cpp
ModuleSummaryAnalysis.cpp [ThinLTO] Add string saver onto index for value names 2018-06-26 02:29:08 +00:00
MustExecute.cpp [NFC] Factor out predecessors collection into a separate method 2018-08-21 07:15:06 +00:00
ObjCARCAliasAnalysis.cpp
ObjCARCAnalysisUtils.cpp
ObjCARCInstKind.cpp
OptimizationRemarkEmitter.cpp
OrderedBasicBlock.cpp [NFC] Sanitizing asserts for OrderedBasicBlock 2018-09-11 08:46:19 +00:00
OrderedInstructions.cpp [NFC] Move OrderedInstructions and InstructionPrecedenceTracking to Analysis 2018-08-30 04:49:03 +00:00
PHITransAddr.cpp
PhiValues.cpp [PhiValues] Use callback value handles to invalidate deleted values 2018-08-24 15:48:30 +00:00
PostDominators.cpp
ProfileSummaryInfo.cpp [SampleFDO] Fix a bug in getOrCompHotCountThreshold/getOrCompColdCountThreshold 2018-08-07 18:13:10 +00:00
PtrUseVisitor.cpp
README.txt
RegionInfo.cpp Test commit, fix a minor typo. 2018-07-22 20:04:42 +00:00
RegionPass.cpp [NFC][PassTiming] factor out generic PassTimingInfo 2018-08-28 21:06:51 +00:00
RegionPrinter.cpp Revert "Extend CFGPrinter and CallPrinter with Heat Colors" 2018-06-29 17:48:58 +00:00
ScalarEvolution.cpp Revert "[SCEV][NFC] Check NoWrap flags before lexicographical comparison of SCEVs" 2018-08-27 21:41:37 +00:00
ScalarEvolutionAliasAnalysis.cpp
ScalarEvolutionExpander.cpp [SCEV] Don't expand Wrap predicate using inttoptr in ni addrspaces 2018-07-26 21:55:06 +00:00
ScalarEvolutionNormalization.cpp
ScopedNoAliasAA.cpp
StratifiedSets.h
SyntheticCountsUtils.cpp
TargetLibraryInfo.cpp Add Triple::isMIPS()/isMIPS32()/isMIPS64(). NFC 2018-06-25 16:49:20 +00:00
TargetTransformInfo.cpp Remove trailing space 2018-07-30 19:41:25 +00:00
Trace.cpp
TypeBasedAliasAnalysis.cpp
TypeMetadataUtils.cpp
ValueLattice.cpp
ValueLatticeUtils.cpp
ValueTracking.cpp Merge clang's isRepeatedBytePattern with LLVM's isBytewiseValue 2018-09-21 05:17:42 +00:00
VectorUtils.cpp Fix vectorization of canonicalize 2018-09-17 13:24:30 +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))

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