[GC, RewriteStatepointsForGC] Style cleanup and bug fix
authorPhilip Reames <listmail@philipreames.com>
Fri, 20 Feb 2015 19:51:56 +0000 (19:51 +0000)
committerPhilip Reames <listmail@philipreames.com>
Fri, 20 Feb 2015 19:51:56 +0000 (19:51 +0000)
commit16422b22bcba1bc45b84e2105171edf324c745e7
tree9eb007f394759104a18a077f08795aca033b8541
parenta68ce075bae3d3d2e0bdf40b0a4645f12834b6be
[GC, RewriteStatepointsForGC] Style cleanup and bug fix

When doing style cleanup, I noticed a minor bug in this code.  If we have a pointer that we think is unused after a statepoint and thus doesn't need relocation, we store a null pointer into the alloca we're about to promote.  This helps turn a mistake in liveness analysis into an easily debuggable crash.  It turned out this code had never been updated to handle invoke statepoints.

There's no test for this.  Without a bug in liveness, it appears impossible to make this trigger in a way which is visible in the resulting IR.  We might store the null, but when promoting the alloca, there will be no uses and thus nothing to test against.  Suggestions on how to test are very welcome.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230047 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/RewriteStatepointsForGC.cpp