[ScopInfo] Consider only write-free dereferencable loads as invariant
authorTobias Grosser <tobias@grosser.es>
Thu, 27 Apr 2017 20:08:16 +0000 (20:08 +0000)
committerTobias Grosser <tobias@grosser.es>
Thu, 27 Apr 2017 20:08:16 +0000 (20:08 +0000)
commitc96c1d8c87982f2341dba5fb31ee90ae41b31f4c
treedd4764730ce91d79d18c4fbc019837d04c531819
parent9a98df63f436213d89f4b3df351fb7602c6597ea
[ScopInfo] Consider only write-free dereferencable loads as invariant

When we introduced in r297375 support for hoisting loads that are known
to be dereferencable without any conditional guard, we forgot to keep the check
to verify that no other write into the very same location exists. This
change ensures now that dereferencable loads are allowed to access everything,
but can only be hoisted in case no conflicting write exists.

This resolves llvm.org/PR32778

Reported-by: Huihui Zhang <huihuiz@codeaurora.org>
llvm-svn: 301582
polly/lib/Analysis/ScopInfo.cpp
polly/test/Isl/CodeGen/reduction_2.ll