[AggressiveInstCombine] Fix invalid TypeSize conversion when combining loads.
authorPaul Walker <paul.walker@arm.com>
Thu, 15 Dec 2022 14:59:51 +0000 (14:59 +0000)
committerPaul Walker <paul.walker@arm.com>
Sat, 17 Dec 2022 15:34:27 +0000 (15:34 +0000)
commitf53234cbfd0053f744f4825b10f56e108b2b8673
tree088a0dd37d4b7fc50b743aa20cb2041b1f09a65f
parent815fddfa1782ac2bb416f6c878e0c0c7f4f3575f
[AggressiveInstCombine] Fix invalid TypeSize conversion when combining loads.

Much of foldLoadsRecursive relies on knowing the size of loaded
data, which is not possible for scalable vector types.  However,
the logic of combining two small loads into one bigger load does
not apply for vector types so rather than converting the algorithm
to use TypeSize I've simply added an early exit for vectors.

Fixes #59510

Differential Revision: https://reviews.llvm.org/D140106
llvm/lib/Transforms/AggressiveInstCombine/AggressiveInstCombine.cpp
llvm/test/Transforms/AggressiveInstCombine/vector-or-load.ll [new file with mode: 0644]