1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-26 04:32:44 +01:00
llvm-mirror/lib/Transforms/IPO
Sanjay Patel 35167a94b8 [VectorCombine] new IR transform pass for partial vector ops
We have several bug reports that could be characterized as "reducing scalarization",
and this topic was also raised on llvm-dev recently:
http://lists.llvm.org/pipermail/llvm-dev/2020-January/138157.html
...so I'm proposing that we deal with these patterns in a new, lightweight IR vector
pass that runs before/after other vectorization passes.

There are 4 alternate options that I can think of to deal with this kind of problem
(and we've seen various attempts at all of these), but they all have flaws:

    InstCombine - can't happen without TTI, but we don't want target-specific
                  folds there.
    SDAG - too late to assist other vectorization passes; TLI is not equipped
           for these kind of cost queries; limited to a single basic block.
    CGP - too late to assist other vectorization passes; would need to re-implement
          basic cleanups like CSE/instcombine.
    SLP - doesn't fit with existing transforms; limited to a single basic block.

This initial patch/transform is based on existing code in AggressiveInstCombine:
we walk backwards through the function looking for a pattern match. But we diverge
from that cost-independent IR canonicalization pass by using TTI to decide if the
vector alternative is profitable.

We probably have at least 10 similar bug reports/patterns (binops, constants,
inserts, cheap shuffles, etc) that would fit in this pass as follow-up enhancements.
It's possible that we could iterate on a worklist to fix-point like InstCombine does,
but it's safer to start with a most basic case and evolve from there, so I didn't
try to do anything fancy with this initial implementation.

Differential Revision: https://reviews.llvm.org/D73480
2020-02-09 10:04:41 -05:00
..
AlwaysInliner.cpp [NFC] Refactor InlineResult for readability 2020-01-15 13:34:20 -08:00
ArgumentPromotion.cpp [Attributor] Pointer privatization attribute (argument promotion) 2020-01-29 21:31:04 -06:00
Attributor.cpp [Attributor] Add an Attributor CGSCC pass and run it 2020-02-08 21:27:34 -06:00
BarrierNoopPass.cpp Sink all InitializePasses.h includes 2019-11-13 16:34:37 -08:00
BlockExtractor.cpp Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
CalledValuePropagation.cpp Add missing includes needed to prune LLVMContext.h include, NFC 2019-11-14 15:23:15 -08:00
CMakeLists.txt [OpenMP] Introduce the OpenMPOpt transformation pass 2020-02-08 14:47:03 -06:00
ConstantMerge.cpp Sink all InitializePasses.h includes 2019-11-13 16:34:37 -08:00
CrossDSOCFI.cpp Sink all InitializePasses.h includes 2019-11-13 16:34:37 -08:00
DeadArgumentElimination.cpp Sink all InitializePasses.h includes 2019-11-13 16:34:37 -08:00
ElimAvailExtern.cpp Sink all InitializePasses.h includes 2019-11-13 16:34:37 -08:00
ExtractGV.cpp [llvm-extract] Add -keep-const-init commandline option 2020-02-03 14:30:28 +09:00
ForceFunctionAttrs.cpp Add missing includes needed to prune LLVMContext.h include, NFC 2019-11-14 15:23:15 -08:00
FunctionAttrs.cpp Sink all InitializePasses.h includes 2019-11-13 16:34:37 -08:00
FunctionImport.cpp [ThinLTO] More efficient export computation (NFC) 2020-02-03 09:15:33 -08:00
GlobalDCE.cpp [WPD/VFE] Always emit vcall_visibility metadata for -fwhole-program-vtables 2020-01-23 11:36:01 -08:00
GlobalOpt.cpp Revert "Recommit "[GlobalOpt] Pass DTU to removeUnreachableBlocks instead of recomputing."" 2020-01-14 14:50:07 +00:00
GlobalSplit.cpp [WPD/VFE] Always emit vcall_visibility metadata for -fwhole-program-vtables 2020-01-23 11:36:01 -08:00
HotColdSplitting.cpp HotColdSplitting: Do not outline within noreturn functions 2019-12-19 14:06:24 -08:00
InferFunctionAttrs.cpp Sink all InitializePasses.h includes 2019-11-13 16:34:37 -08:00
Inliner.cpp [NFC] Refactor InlineResult for readability 2020-01-15 13:34:20 -08:00
InlineSimple.cpp Sink all InitializePasses.h includes 2019-11-13 16:34:37 -08:00
Internalize.cpp Sink all InitializePasses.h includes 2019-11-13 16:34:37 -08:00
IPConstantPropagation.cpp Sink all InitializePasses.h includes 2019-11-13 16:34:37 -08:00
IPO.cpp [Attributor] Add an Attributor CGSCC pass and run it 2020-02-08 21:27:34 -06:00
LLVMBuild.txt [OpenMP] Introduce the OpenMPOpt transformation pass 2020-02-08 14:47:03 -06:00
LoopExtractor.cpp [LoopExtractor] Convert LoopExtractor from LoopPass to ModulePass 2020-02-09 12:25:21 +02:00
LowerTypeTests.cpp Revert "[WPD/LowerTypeTests] Delay lowering/removal of type tests until after ICP" 2020-02-05 19:27:32 -08:00
MergeFunctions.cpp [NewPM] Port MergeFunctions pass 2020-01-14 20:55:41 +01:00
OpenMPOpt.cpp [OpenMP][Opt] Delete terminating and read-only parallel regions 2020-02-08 18:52:04 -06:00
PartialInlining.cpp [NFC] Refactor InlineResult for readability 2020-01-15 13:34:20 -08:00
PassManagerBuilder.cpp [VectorCombine] new IR transform pass for partial vector ops 2020-02-09 10:04:41 -05:00
PruneEH.cpp Sink all InitializePasses.h includes 2019-11-13 16:34:37 -08:00
SampleProfile.cpp Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
SCCP.cpp Sink all InitializePasses.h includes 2019-11-13 16:34:37 -08:00
StripDeadPrototypes.cpp Sink all InitializePasses.h includes 2019-11-13 16:34:37 -08:00
StripSymbols.cpp Sink all InitializePasses.h includes 2019-11-13 16:34:37 -08:00
SyntheticCountsPropagation.cpp
ThinLTOBitcodeWriter.cpp Sink all InitializePasses.h includes 2019-11-13 16:34:37 -08:00
WholeProgramDevirt.cpp Revert "[WPD/LowerTypeTests] Delay lowering/removal of type tests until after ICP" 2020-02-05 19:27:32 -08:00