[InstCombine] Skip scalable vectors in combineLoadToOperationType
authorDiana Picus <diana.picus@linaro.org>
Thu, 7 Nov 2019 12:09:32 +0000 (13:09 +0100)
committerDiana Picus <diana.picus@linaro.org>
Tue, 12 Nov 2019 11:27:09 +0000 (12:27 +0100)
commit7f1dcc8952e6a1a4ba918159ab86bd787d584930
treeb6e147fd030704f5cb71ba2d50f36fc9a8167874
parent8794f6787685655223be8a029bf51a1565f7a231
[InstCombine] Skip scalable vectors in combineLoadToOperationType

Don't try to canonicalize loads to scalable vector types to loads
of integers.

This removes one assertion when trying to use a TypeSize as a parameter
to DataLayout::isLegalInteger. It does not handle the second part of the
function (which looks at bitcasts).

This patch also contains a NFC fix for Load Analysis, where a variable
initialization that would cause the same assertion is moved closer to
its use. This allows us to run the new test for InstCombine without
having to teach LocationSize to play nicely with scalable vectors.

Differential Revision: https://reviews.llvm.org/D70075
llvm/lib/Analysis/Loads.cpp
llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
llvm/test/Transforms/InstCombine/load.ll