OSDN Git Service

[NewGVN] Break infinite recursion in singleReachablePHIPath().
authorDavide Italiano <davide@freebsd.org>
Thu, 18 May 2017 23:22:44 +0000 (23:22 +0000)
committerDavide Italiano <davide@freebsd.org>
Thu, 18 May 2017 23:22:44 +0000 (23:22 +0000)
commited2b8bd9f467135943cebba2fd27e1960bc2c569
tree4f8a1a5d64387370d10534d57b5db37dd9308135
parentbde49e308152b46409e50f75ba77e7ee39b72f35
[NewGVN] Break infinite recursion in singleReachablePHIPath().

We can have cycles between PHIs and this causes singleReachablePhi()
to call itself indefintely (until we run out of stack). The proper
solution would be that of computing SCCs, but it's not worth for
now, so just keep a visited set and give up when we find a cycle.
Thanks to Dan for the discussion/help with this.

Fixes PR33014.

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