[ScopBuilder] scalar-indep: Fix mutually referencing PHIs.
commitf6d29b68c667c29fbd74a709652440daf235328a
authorMichael Kruse <llvm@meinersbur.de>
Mon, 12 Feb 2018 21:09:40 +0000 (12 21:09 +0000)
committerMichael Kruse <llvm@meinersbur.de>
Mon, 12 Feb 2018 21:09:40 +0000 (12 21:09 +0000)
tree3d72f97135168d199709c46d1d5ebf5f93663865
parentb484e25d12755c9433bb822be12bdad94bc6f98f
[ScopBuilder] scalar-indep: Fix mutually referencing PHIs.

Two or more PHIs mutually using each other directly or indirectly as
incoming value could cause that a PHI WRITE be added before the PHI READ
(i.e. it overwrites the current incoming value with the next incoming
value before it being read).

Fix by ensuring that the PHI WRITE and PHI READ are in the same statement.

This should fix the miscompile of SingleSource/Benchmark/Misc/whetstone
from the test-suite.

git-svn-id: https://llvm.org/svn/llvm-project/polly/trunk@324934 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/ScopBuilder.cpp
test/ScopInfo/granularity_scalar-indep_cross-referencing-phi1.ll [new file with mode: 0644]
test/ScopInfo/granularity_scalar-indep_cross-referencing-phi2.ll [new file with mode: 0644]