Previously we wouldn't move loads/stores across instructions that had
side-effects, where that was defined as may-write may-throw. But this
is both overly- and underly-restrictive:
- Stores can't safely be moved across instructions that may load.
- Loads can be moved across may-throw instructions; it's only may-write instructions that must be a barrier.
This patch also adds a DEBUG check that all instructions in our chain
are either loads or stores.
Could you double check the validation for these tests is done in getVectorizablePrefix, and there isn't an earlier exit on the data layout (just before the calls to getVectorizablePrefix)? Possibly add a data layout to avoid that, in case the defaults change?