[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)
commitfa2fcf173b5749e402599090c363e091c3c572a2
tree0278841187d1f1ed6ecc8e93a5b8453619236640
parent8fdf78594eaa453de9b6c92f24ba297f482312d9
[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.

llvm-svn: 230047
llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp