[ScopDetect] Do not add loads out of the SCoP to required invariant loads.
commit83b8b2fc5da50e5560b6d32db9bfc2fd0bc3a556
authorMichael Kruse <llvm@meinersbur.de>
Sun, 1 Oct 2017 22:19:28 +0000 (1 22:19 +0000)
committerMichael Kruse <llvm@meinersbur.de>
Sun, 1 Oct 2017 22:19:28 +0000 (1 22:19 +0000)
tree9c5408525bf6043184e8e843db72cd407e8d0aeb
parent97eb691a5742ed216f15929c44e6fcafa734a1f6
[ScopDetect] Do not add loads out of the SCoP to required invariant loads.

Loads before the SCoP are always invariant within the SCoP and
therefore are no "required invariant loads". An assertion failes in
ScopBuilder when it finds such an invariant load.

Fix by not adding such loads to the required invariant load list. This
likely will cause the region to be not considered a valid SCoP.
We may want to unconditionally accept instructions defined before
the region as valid invariant conditions instead of rejecting them.

This fixes a compilation crash of SPEC CPU2006 453.povray's
render.cpp.

git-svn-id: https://llvm.org/svn/llvm-project/polly/trunk@314636 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/ScopDetection.cpp
test/ScopDetect/invariant-load-before-scop.ll [new file with mode: 0644]