]> granicus.if.org Git - llvm/commit
[PM] Fix a likely more critical infloop bug in the CGSCC pass manager.
authorChandler Carruth <chandlerc@gmail.com>
Tue, 8 Aug 2017 10:13:23 +0000 (10:13 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Tue, 8 Aug 2017 10:13:23 +0000 (10:13 +0000)
commit55e10a5d8259c2069af2944479f6cc29cacd6770
treef8ea178b37686721f70bc1c2bce4e80c6272c223
parentc445a93ef80748589dccdd9ea1b6ca6f1fd135bb
[PM] Fix a likely more critical infloop bug in the CGSCC pass manager.

This was just a bad oversight on my part. The code in question should
never have worked without this fix. But it turns out, there are
relatively few places that involve libfunctions that participate in
a single SCC, and unless they do, this happens to not matter.

The effect of not having this correct is that each time through this
routine, the edge from write_wrapper to write was toggled between a call
edge and a ref edge. First time through, it becomes a demoted call edge
and is turned into a ref edge. Next time it is a promoted call edge from
a ref edge. On, and on it goes forever.

I've added the asserts which should have always been here to catch silly
mistakes like this in the future as well as a test case that will
actually infloop without the fix.

The other (much scarier) infinite-inlining issue I think didn't actually
occur in practice, and I simply misdiagnosed this minor issue as that
much more scary issue. The other issue *is* still a real issue, but I'm
somewhat relieved that so far it hasn't happened in real-world code
yet...

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310342 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/CGSCCPassManager.cpp
test/Other/cgscc-libcall-update.ll