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 I'm removing several peephole optimizations which were possible with the old scheme, but hard to express with the new one. I plan on adding these back as a separate change since it'll need to be structured rather differently. I want to get the code correct first. :)
w.r.t. testing, this is mostly covered by existing tests (live-vector.ll). I've added a couple of new ones to show the failing case (test2 in base-vector.ll). With the removal of the early peepholes, the new code should be reasonably well tested by the existing tests.
Update this comment please.