[LICM] Add a diagnostic analysis for identifying alias information
authorAnna Thomas <anna@azul.com>
Fri, 17 Aug 2018 13:44:00 +0000 (13:44 +0000)
committerAnna Thomas <anna@azul.com>
Fri, 17 Aug 2018 13:44:00 +0000 (13:44 +0000)
commit1962621a7e3350ed3677645dba6d0f20a765db4f
treeb6db006cff9fe62d5f34e23eab9f3b7b1ff131fd
parenteaca3883089a1ebbdc9eb430933cd5981b413c99
[LICM] Add a diagnostic analysis for identifying alias information

Summary:
Currently, in LICM, we use the alias set tracker to identify if the
instruction (we're interested in hoisting) aliases with instruction that
modifies that memory location.

This patch adds an LICM alias analysis diagnostic tool that checks the
mod ref info of the instruction we are interested in hoisting/sinking,
with every instruction in the loop.  Because of O(N^2) complexity this
is now only a diagnostic tool to show the limitation we have with the
alias set tracker and is OFF by default.

Test cases show the difference with the diagnostic analysis tool, where
we're able to hoist out loads and readonly + argmemonly calls from the
loop, where the alias set tracker analysis is not able to hoist these
instructions out.

Reviewers: reames, mkazantsev, fedor.sergeev, hfinkel

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D50854

llvm-svn: 340026
llvm/lib/Transforms/Scalar/LICM.cpp
llvm/test/Transforms/LICM/argmemonly-call.ll
llvm/test/Transforms/LICM/invariant.start.ll
llvm/test/Transforms/LICM/read-only-calls.ll [new file with mode: 0644]