[SLPVectorizer] Make aliasing check more precise
authorNikita Popov <nikita.ppv@gmail.com>
Tue, 31 Aug 2021 18:10:50 +0000 (20:10 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Tue, 31 Aug 2021 20:35:30 +0000 (22:35 +0200)
commit48ebe427c9c516c406f6fc1e4883bafaf5f4f992
treec2cbe2ee50ea79f690360eea17923f65fc8b3be6
parent964053d56f9b4aeca8950c0835c9e52be0f1d007
[SLPVectorizer] Make aliasing check more precise

SLPVectorizer currently uses AA::isNoAlias() to determine whether
two locations alias. This does not work if one of the instructions
is a call. Instead, we should check getModRefInfo(), which
determines whether an arbitrary instruction modifies or references
a given location.

Among other things, this prevents @llvm.experimental.noalias.scope.decl()
and other inaccessiblmemonly intrinsics from interfering with SLP
vectorization.

Differential Revision: https://reviews.llvm.org/D109012
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
llvm/test/Transforms/SLPVectorizer/int_sideeffect.ll