[RewriteStatepointsForGC] Move an expensive debugging check to XDEBUG
authorPhilip Reames <listmail@philipreames.com>
Mon, 13 Apr 2015 16:41:32 +0000 (16:41 +0000)
committerPhilip Reames <listmail@philipreames.com>
Mon, 13 Apr 2015 16:41:32 +0000 (16:41 +0000)
commit332adac427cadd5f047fe96af3783f1f5586327e
tree9fa838672b077b3419e56ad77de7932b74803af2
parent178edfea07a892984853c93c54aa349bb55cd6d8
[RewriteStatepointsForGC] Move an expensive debugging check to XDEBUG

The check in question is attempting to help find cases where we haven't relocated a pointer at a safepoint we should have.  It does this by coercing the value to null at any safepoint which doesn't relocate it.

Unfortunately, this turns out to be rather expensive in terms of memory usage and time.  The number of stores inserted can grow with O(number of values x number of statepoints).  On at least one example I looked at, over half of peak memory usage was coming from this check.

With this change, the check is no longer enabled by default in Asserts builds.  It is enabled for expensive asserts builds and has a command line option to enable it in both Asserts and non-Asserts builds.

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