[RewriteStatepointsForGC] Handle extractelement fully in the base pointer algorithm
authorPhilip Reames <listmail@philipreames.com>
Wed, 12 Aug 2015 21:00:20 +0000 (21:00 +0000)
committerPhilip Reames <listmail@philipreames.com>
Wed, 12 Aug 2015 21:00:20 +0000 (21:00 +0000)
commit9ac4e38a16bd3f7695ec474deeb91c2eec858480
tree520c54b8f57c47a9fb447b134723335ec57ec87f
parent2211cfe0a339b7d2eb6424e18e4d1b0b4932affd
[RewriteStatepointsForGC] Handle extractelement fully in the base pointer algorithm

When rewriting the IR such that base pointers are available for every live pointer, we potentially need to duplicate instructions to propagate the base. The original code had only handled PHI and Select under the belief those were the only instructions which would need duplicated. When I added support for vector instructions, I'd added a collection of hacks for ExtractElement which caught most of the common cases. Of course, I then found the one test case my hacks couldn't cover. :)

This change removes all of the early hacks for extract element. By defining extractelement as a BDV (rather than trying to look through it), we can extend the rewriting algorithm to duplicate the extract as needed.  Note that a couple of peephole optimizations were left in for the moment, because while we now handle extractelement as a first class citizen, we're not yet handling insertelement.  That change will follow in the near future.

llvm-svn: 244808
llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
llvm/test/Transforms/RewriteStatepointsForGC/base-vector.ll [new file with mode: 0644]