1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-26 12:43:36 +01:00
llvm-mirror/lib/Analysis
Anna Thomas d2aa341912 [LV] Teach vectorizer about variant value store into uniform address
Summary:
Teach vectorizer about vectorizing variant value stores to uniform
address. Similar to rL343028, we do not allow vectorization if we have
multiple stores to the same uniform address.

Cost model already has the change for considering the extract
instruction cost for a variant value store. See added test cases for how
vectorization is done.
The patch also contains changes to the ORE messages.

Reviewers: Ayal, mkuper, anemet, hsaito

Subscribers: rkruppe, llvm-commits

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

llvm-svn: 344613
2018-10-16 15:46:26 +00:00
..
AliasAnalysis.cpp
AliasAnalysisEvaluator.cpp
AliasAnalysisSummary.cpp
AliasAnalysisSummary.h
AliasSetTracker.cpp Replace most users of UnknownSize with LocationSize::unknown(); NFC 2018-10-10 21:28:44 +00:00
Analysis.cpp [NFC] Rename the DivergenceAnalysis to LegacyDivergenceAnalysis 2018-08-30 14:21:36 +00:00
AssumptionCache.cpp
BasicAliasAnalysis.cpp Replace most users of UnknownSize with LocationSize::unknown(); NFC 2018-10-10 21:28:44 +00:00
BlockFrequencyInfo.cpp
BlockFrequencyInfoImpl.cpp llvm::sort(C.begin(), C.end(), ...) -> llvm::sort(C, ...) 2018-09-27 02:13:45 +00:00
BranchProbabilityInfo.cpp [TI removal] Make variables declared as TerminatorInst and initialized 2018-10-15 10:04:59 +00:00
CallGraph.cpp llvm::sort(C.begin(), C.end(), ...) -> llvm::sort(C, ...) 2018-09-27 02:13:45 +00:00
CallGraphSCCPass.cpp [New PM][PassInstrumentation] IR printing support for New Pass Manager 2018-09-24 16:08:15 +00:00
CallPrinter.cpp
CaptureTracking.cpp
CFG.cpp [TI removal] Make variables declared as TerminatorInst and initialized 2018-10-15 10:04:59 +00:00
CFGPrinter.cpp [CFG Printer] Add support for writing the dot files with a custom 2018-10-09 04:30:23 +00:00
CFLAndersAliasAnalysis.cpp Replace most users of UnknownSize with LocationSize::unknown(); NFC 2018-10-10 21:28:44 +00:00
CFLGraph.h
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
DependenceAnalysis.cpp Replace most users of UnknownSize with LocationSize::unknown(); NFC 2018-10-10 21:28:44 +00:00
DominanceFrontier.cpp
DomPrinter.cpp
EHPersonalities.cpp [TI removal] Make variables declared as TerminatorInst and initialized 2018-10-15 10:04:59 +00:00
GlobalsModRef.cpp
GuardUtils.cpp Re-enable "[NFC] Unify guards detection" 2018-08-30 03:39:16 +00:00
IndirectCallPromotionAnalysis.cpp
InlineCost.cpp [TI removal] Make variables declared as TerminatorInst and initialized 2018-10-15 10:04:59 +00:00
InstCount.cpp
InstructionPrecedenceTracking.cpp [NFC] Rename variable 2018-09-11 05:10:01 +00:00
InstructionSimplify.cpp [FPEnv] PatternMatcher support for checking FNEG ignoring signed zeros 2018-10-09 21:48:00 +00:00
Interval.cpp
IntervalPartition.cpp
IteratedDominanceFrontier.cpp
IVDescriptors.cpp [LV] Add a new reduction pattern match 2018-10-10 18:49:49 +00:00
IVUsers.cpp
LazyBlockFrequencyInfo.cpp
LazyBranchProbabilityInfo.cpp
LazyCallGraph.cpp
LazyValueInfo.cpp
LegacyDivergenceAnalysis.cpp [NFC] Rename the DivergenceAnalysis to LegacyDivergenceAnalysis 2018-08-30 14:21:36 +00:00
Lint.cpp
LLVMBuild.txt
Loads.cpp
LoopAccessAnalysis.cpp [LV] Teach vectorizer about variant value store into uniform address 2018-10-16 15:46:26 +00:00
LoopAnalysisManager.cpp [LoopPassManager] MemorySSA should be preserved when enabled. 2018-09-06 20:54:24 +00:00
LoopInfo.cpp [TI removal] Make variables declared as TerminatorInst and initialized 2018-10-15 10:04:59 +00:00
LoopPass.cpp Output per-function size-info remarks 2018-09-06 21:19:54 +00:00
LoopUnrollAnalyzer.cpp
MemDepPrinter.cpp
MemDerefPrinter.cpp
MemoryBuiltins.cpp Reverting r340807. 2018-08-30 18:37:18 +00:00
MemoryDependenceAnalysis.cpp [Analysis] Make LocationSizes carry an 'imprecise' bit 2018-10-10 06:39:40 +00:00
MemoryLocation.cpp Replace most users of UnknownSize with LocationSize::unknown(); NFC 2018-10-10 21:28:44 +00:00
MemorySSA.cpp [cxx2a] Fix warning triggered by r343285 2018-09-29 02:17:12 +00:00
MemorySSAUpdater.cpp [TI removal] Make variables declared as TerminatorInst and initialized 2018-10-15 10:04:59 +00:00
ModuleDebugInfoPrinter.cpp
ModuleSummaryAnalysis.cpp [ThinLTO] Don't import GV which contains blockaddress 2018-10-12 07:24:02 +00:00
MustExecute.cpp [NFC] Introduce ICFLoopSafetyInfo 2018-10-16 09:58:09 +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
PostDominators.cpp
ProfileSummaryInfo.cpp
PtrUseVisitor.cpp
README.txt
RegionInfo.cpp
RegionPass.cpp [NFC][PassTiming] factor out generic PassTimingInfo 2018-08-28 21:06:51 +00:00
RegionPrinter.cpp
ScalarEvolution.cpp [SCEV] Limit AddRec "simplifications" to avoid combinatorial explosions 2018-10-16 05:26:21 +00:00
ScalarEvolutionAliasAnalysis.cpp Make LocationSize a proper Optional type; NFC 2018-10-09 03:18:56 +00:00
ScalarEvolutionExpander.cpp llvm::sort(C.begin(), C.end(), ...) -> llvm::sort(C, ...) 2018-09-27 02:13:45 +00:00
ScalarEvolutionNormalization.cpp
ScopedNoAliasAA.cpp
StratifiedSets.h
SyntheticCountsUtils.cpp
TargetLibraryInfo.cpp llvm::sort(C.begin(), C.end(), ...) -> llvm::sort(C, ...) 2018-09-27 02:13:45 +00:00
TargetTransformInfo.cpp recommit 344472 after fixing build failure on ARM and PPC. 2018-10-14 08:50:06 +00:00
Trace.cpp
TypeBasedAliasAnalysis.cpp
TypeMetadataUtils.cpp [WPD] Fix incorrect devirtualization after indirect call promotion 2018-09-27 14:55:32 +00:00
ValueLattice.cpp
ValueLatticeUtils.cpp
ValueTracking.cpp [ValueTracking] Allow select patterns to work on FP vectors 2018-09-28 21:36:43 +00:00
VectorUtils.cpp recommit 344472 after fixing build failure on ARM and PPC. 2018-10-14 08:50:06 +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))

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