OSDN Git Service

[LSV] Insert stores at the right point.
authorJustin Lebar <jlebar@google.com>
Tue, 19 Jul 2016 23:19:20 +0000 (23:19 +0000)
committerJustin Lebar <jlebar@google.com>
Tue, 19 Jul 2016 23:19:20 +0000 (23:19 +0000)
commit85ee7e948700a10a660236ff7814920fa3fa656d
treeb3fc27748ed88c5effc6d5fb100a17f01962e783
parentabcf9144a55fc415e6d7fc710361fbe66c3df178
[LSV] Insert stores at the right point.

Summary:
Previously, the insertion point for stores was the last instruction in
Chain *before calling getVectorizablePrefixEndIdx*.  Thus if
getVectorizablePrefixEndIdx didn't return Chain.size(), we still would
insert at the last instruction in Chain.

This patch changes our internal API a bit in an attempt to make it less
prone to this sort of error.  As a result, we end up recalculating the
Chain's boundary instructions, but I think worrying about the speed hit
of this is a premature optimization right now.

Reviewers: asbirlea, tstellarAMD

Subscribers: mzolotukhin, arsenm, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276056 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Vectorize/LoadStoreVectorizer.cpp
test/Transforms/LoadStoreVectorizer/AMDGPU/insertion-point.ll