1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-26 04:32:44 +01:00
llvm-mirror/lib/Transforms
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
..
AggressiveInstCombine
CFGuard Add support for __declspec(guard(nocf)) 2020-01-10 16:04:12 +00:00
Coroutines [Coroutines] Remove corresponding phi values when apply simplifyTerminatorLeadingToRet 2020-01-05 18:26:30 -05:00
Hello
InstCombine [InstCombine] Refactor foldICmpAndShift(); NFCI 2020-02-08 22:27:43 +01:00
Instrumentation Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
IPO [VectorCombine] new IR transform pass for partial vector ops 2020-02-09 10:04:41 -05:00
ObjCARC [ObjC][ARC] Keep track of phis that have been discovered to avoid an 2020-02-07 20:33:11 -08:00
Scalar [IRCE] Use SCEVExpander to modify loop bound 2020-02-06 12:44:43 +03:00
Utils Introduce a CallGraph updater helper class 2020-02-08 14:16:48 -06:00
Vectorize [VectorCombine] new IR transform pass for partial vector ops 2020-02-09 10:04:41 -05:00
CMakeLists.txt
LLVMBuild.txt