I was investigating regressions in https://reviews.llvm.org/D62100#change-c0aDpsCUsZ0a
and it looked like this was the missing piece, but apparently there is something else missing..
Note that i have deleted AArch64TargetLowering::isDesirableToCommuteWithShift()
override, since this adds support for the pattern mentioned there.
And in general that hook is rather useless, since it is forgotten about in *many*
places in DAGCombine, e.g. shl (srl x, c1), c2 fold is not guarded with it.
This highlights a few missing opts:
lsl x8, x8, #3 ldr x0, [x9, x8]
isn't combined into ldr x0, [x9, x8, lsl #3]
lsl w9, w9, #12 lsr w9, w9, #26
should be just
lsr w9, w9, #14
- @no_extract_shrl in rotate-extract.ll means that BFXIL just picks the first opportunity?