This is an archive of the discontinued LLVM Phabricator instance.

[LSV] Insert stores at the right point.
ClosedPublic

Authored by jlebar on Jul 19 2016, 2:18 PM.

Details

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.

Diff Detail

Repository
rL LLVM

Event Timeline

jlebar updated this revision to Diff 64563.Jul 19 2016, 2:18 PM
jlebar retitled this revision from to [LSV] Insert stores at the right point..
jlebar updated this object.
jlebar added a reviewer: asbirlea.
jlebar added subscribers: llvm-commits, arsenm.
asbirlea added inline comments.Jul 19 2016, 3:23 PM
lib/Transforms/Vectorize/LoadStoreVectorizer.cpp
772 ↗(On Diff #64563)

Can you add a FIXME to mark the possible performance penalty for calling this again?
Not a concern right now, but it would be good to keep a record of it.

asbirlea accepted this revision.Jul 19 2016, 3:27 PM
asbirlea edited edge metadata.

I like how this refactoring makes the bug resolved by the next patch more obvious.

This revision is now accepted and ready to land.Jul 19 2016, 3:27 PM
jlebar updated this revision to Diff 64595.Jul 19 2016, 4:11 PM
jlebar marked an inline comment as done.
jlebar edited edge metadata.

Update comment.

This revision was automatically updated to reflect the committed changes.