[RewriteStatepointsForGC] Add tests for the base pointer identification algorithm
authorPhilip Reames <listmail@philipreames.com>
Sat, 28 Feb 2015 00:20:48 +0000 (00:20 +0000)
committerPhilip Reames <listmail@philipreames.com>
Sat, 28 Feb 2015 00:20:48 +0000 (00:20 +0000)
commita3f59e44cdb58f363ef1333f9f39726a733a01cc
treedd8266f8057a8a5259d1a7d77dd4b00e86c6caca
parentdcd2094389d607cac1c2de1dd417bcd87298596f
[RewriteStatepointsForGC] Add tests for the base pointer identification algorithm

These tests cover the 'base object' identification and rewritting portion of RewriteStatepointsForGC.  These aren't completely exhaustive, but they've proven to be reasonable effective over time at finding regressions.

In the process of porting these tests over, I found my first "cleanup per llvm code style standards" bug.  We were relying on the order of iteration when testing the base pointers found for a derived pointer.  When we switched from std::set to DenseSet, this stopped being a safe assumption.  I'm suspecting I'm going to find more of those.  In particular, I'm now really wondering about the main iteration loop for this algorithm.  I need to go take a closer look at the assumptions there.

I'm not really happy with the fact these are testing what is essentially debug output (i.e. enabled via command line flags).  Suggestions for how to structure this better are very welcome.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230818 91177308-0d34-0410-b5e6-96231b3b80d8
13 files changed:
lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
test/Transforms/RewriteStatepointsForGC/base-pointers-1.ll [new file with mode: 0644]
test/Transforms/RewriteStatepointsForGC/base-pointers-10.ll [new file with mode: 0644]
test/Transforms/RewriteStatepointsForGC/base-pointers-11.ll [new file with mode: 0644]
test/Transforms/RewriteStatepointsForGC/base-pointers-2.ll [new file with mode: 0644]
test/Transforms/RewriteStatepointsForGC/base-pointers-3.ll [new file with mode: 0644]
test/Transforms/RewriteStatepointsForGC/base-pointers-4.ll [new file with mode: 0644]
test/Transforms/RewriteStatepointsForGC/base-pointers-5.ll [new file with mode: 0644]
test/Transforms/RewriteStatepointsForGC/base-pointers-6.ll [new file with mode: 0644]
test/Transforms/RewriteStatepointsForGC/base-pointers-7.ll [new file with mode: 0644]
test/Transforms/RewriteStatepointsForGC/base-pointers-8.ll [new file with mode: 0644]
test/Transforms/RewriteStatepointsForGC/base-pointers-9.ll [new file with mode: 0644]
test/Transforms/RewriteStatepointsForGC/base-pointers.ll [new file with mode: 0644]