Page MenuHomePhabricator

[AArch64] Bit-extract with shifted mask - shr+and (UBFX)
AbandonedPublic

Authored by lebedev.ri on Sat, May 18, 12:36 PM.

Details

Summary

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?

Diff Detail

Repository
rL LLVM

Event Timeline

lebedev.ri created this revision.Sat, May 18, 12:36 PM
lebedev.ri retitled this revision from [AArch64] Bit-extract with shifted mask (UBFX) to [AArch64] Bit-extract with shifted mask - shr+and (UBFX).Sat, May 18, 12:57 PM
lebedev.ri abandoned this revision.Sat, May 18, 2:13 PM

Hmm, this isn't it..
Something much more fine-grained missing.