[AArch64] Fold tree of offset loads combine
This attempts to fold trees of add(ext(load p), shl(ext(load p+4)) into a single load of twice the size, that we extract the bottom part and top part so that the shl can start to use a shll2 instruction. The two loads in that example can also be larger trees of instructions, which are identical except for the leaves which are all loads offset from the LHS, including buildvectors of multiple loads. For example: sub(zext(buildvec(load p+4, load q+4)), zext(buildvec(load r+4, load s+4))) Whilst it can be common for the larger loads to replace LDP instructions (which doesn't gain anything on its own), the larger loads in buildvectors can help create more efficient code, and prevent the need for ld1 lane inserts which can be more expensive than continuous loads. This creates a fairly niche, fairly large combine that attempts to be fairly general where it is beneficial. It helps some SLP vectorized code to avoid the use of the more expensive ld1 lane inserting loads. Differential Revision: https://reviews.llvm.org/D153972
Loading
Please sign in to comment