This is an archive of the discontinued LLVM Phabricator instance.

[LV] Fix PR33613 - retain order of insertelements per part
ClosedPublic

Authored by Ayal on Jun 28 2017, 9:04 AM.

Details

Summary

Packing scalar values into vectors was originally done by generating the insertelements for all parts as a single sequence, immediately following the last scalar being packed. When changing the interface of ValueMap to getOrCreateVectorValue per part in r306381 (D32871), these insertelements were still generated immediately following the same last scalar, but their order per part got reversed because of this. This in turn broke the shuffle of first-order-recurrence, which assumes the insertelements of the last part UF-1 appears after the insertelements of all other parts.

This patch places each set of insertelements following the last scalar of that part, effectively supporting the above assumption.

Diff Detail

Event Timeline

Ayal created this revision.Jun 28 2017, 9:04 AM
mssimpso accepted this revision.Jun 28 2017, 9:42 AM

Makes sense. Thanks, Ayal!

lib/Transforms/Vectorize/LoopVectorize.cpp
2719

valu -> value

This revision is now accepted and ready to land.Jun 28 2017, 9:42 AM
This revision was automatically updated to reflect the committed changes.