[LSV] Don't move stores across may-load instrs, and loosen restrictions on moving...
authorJustin Lebar <jlebar@google.com>
Wed, 20 Jul 2016 20:07:37 +0000 (20:07 +0000)
committerJustin Lebar <jlebar@google.com>
Wed, 20 Jul 2016 20:07:37 +0000 (20:07 +0000)
commita272c12b7351f741694bec2291491b16f12832c3
tree26ad7422f372dd4a2a7e10308b4acb21e2ffdd62
parent62b03e344eeb168d0ac87a442275b28d3e95016a
[LSV] Don't move stores across may-load instrs, and loosen restrictions on moving loads.

Summary:
Previously we wouldn't move loads/stores across instructions that had
side-effects, where that was defined as may-write or may-throw.  But
this is not sufficiently restrictive: Stores can't safely be moved
across instructions that may load.

This patch also adds a DEBUG check that all instructions in our chain
are either loads or stores.

Reviewers: asbirlea

Subscribers: llvm-commits, jholewinski, arsenm, mzolotukhin

Differential Revision: https://reviews.llvm.org/D22547

llvm-svn: 276171
llvm/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp
llvm/test/Transforms/LoadStoreVectorizer/NVPTX/merge-across-side-effects.ll