[DAGCombiner] improve throughput of shift+logic+shift

Authored by spatel on Sun, Sep 1, 11:38 AM.


[DAGCombiner] improve throughput of shift+logic+shift

The motivating case for this is a long way from here:
...but I think this is where we have to start.

We need to canonicalize/optimize sequences of shift and logic to ease
pattern matching for things like bswap and improve perf in general.
But without the artificial limit of '!LegalTypes' (early combining),
there are a lot of test diffs, and not all are good.

In the minimal tests added for this proposal, x86 should have better
throughput in all cases. AArch64 is neutral for scalar tests because
it can fold shifts into bitwise logic ops.

There are 3 shift opcodes and 3 logic opcodes for a total of 9 possible patterns:

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

llvm-svn: 370617