[LICM] Hoist calls to readonly argmemonly functions even with stores in the loop
authorPhilip Reames <listmail@philipreames.com>
Mon, 21 Sep 2015 22:27:59 +0000 (22:27 +0000)
committerPhilip Reames <listmail@philipreames.com>
Mon, 21 Sep 2015 22:27:59 +0000 (22:27 +0000)
commit8ea1f82142873429c8d09fb0b5a1ce2f16ac6c9c
tree6af26523644beb454c36097e6fce2c5de8b1cc0e
parent270b82ade03ceb551dd077f17282e5a385d5e43b
[LICM] Hoist calls to readonly argmemonly functions even with stores in the loop

We know that an argmemonly function can only access memory pointed to by it's pointer arguments. Rather than needing to consider all possible stores as aliasing (as we do for a readonly function), we can only consider the aliasing of the pointer arguments.

Note that this change only addresses hoisting. I'm thinking about how to address speculation safety as well, but that will be a different change.

FYI, argmemonly disallows accessing memory through non-pointer typed arguments.

Differential Revision: http://reviews.llvm.org/D12771

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248220 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/LICM.cpp
test/Transforms/LICM/argmemonly-call.ll [new file with mode: 0644]