[ScopBuilder] Prefer PHI Write accesses in the statement the incoming value is defined.
commit3fb336f4df16381ecf955d298c965c3d5614bc92
authorMichael Kruse <llvm@meinersbur.de>
Tue, 23 Jan 2018 23:56:36 +0000 (23 23:56 +0000)
committerMichael Kruse <llvm@meinersbur.de>
Tue, 23 Jan 2018 23:56:36 +0000 (23 23:56 +0000)
treece84b07e325ba6f2759ae26fa9c90843fb170f9e
parenta033aad4e062e201eaba111dfb4ca211c77f3069
[ScopBuilder] Prefer PHI Write accesses in the statement the incoming value is defined.

Theoretically, a PHI write can be added to any statement that represents
the incoming basic block. We previously always chose the last because
the incoming value's definition is guaranteed to be defined.

With this patch the PHI write is added to the statement that defines the
incoming value. It avoids the requirement for a scalar dependency between
the defining statement and the statement containing the write. As such the
logic for -polly-stmt-granularity=scalar-indep that ensures that there is
such scalar dependencies can be removed.

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

git-svn-id: https://llvm.org/svn/llvm-project/polly/trunk@323284 91177308-0d34-0410-b5e6-96231b3b80d8
include/polly/ScopInfo.h
lib/Analysis/ScopBuilder.cpp
lib/Analysis/ScopInfo.cpp
test/ScopInfo/granularity_scalar-indep_epilogue.ll
test/ScopInfo/granularity_scalar-indep_epilogue_last.ll