[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)
commit5119cb9b0481cf2a91d519752b48a1754f26bb2c
tree2fc4f62eae035d5b31ef76d61ae396c67f459359
parent3f0c495bbb4786cbf1ee48a006753be1fdc22ecf
[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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244808 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
test/Transforms/RewriteStatepointsForGC/base-vector.ll [new file with mode: 0644]