BBVectorize: Add initial stores to the write set when tracking uses
authorHal Finkel <hfinkel@anl.gov>
Tue, 13 Aug 2013 23:34:32 +0000 (23:34 +0000)
committerHal Finkel <hfinkel@anl.gov>
Tue, 13 Aug 2013 23:34:32 +0000 (23:34 +0000)
commiteaa8f5533f9f678fe3c56aec0201a34e46eaaf54
tree2b3e2bae75aec2ec5d4cbfa89550320defd5c02d
parentfc2fc08b497df134e13e2bdeb66623d4c0bbf842
BBVectorize: Add initial stores to the write set when tracking uses

When computing the use set of a store, we need to add the store to the write
set prior to iterating over later instructions. Otherwise, if there is a later
aliasing load of that store, that load will not be tagged as a use, and bad
things will happen.

trackUsesOfI still adds later dependent stores of an instruction to that
instruction's write set, but it never sees the original instruction, and so
when tracking uses of a store, the store must be added to the write set by the
caller.

Fixes PR16834.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188329 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Vectorize/BBVectorize.cpp
test/Transforms/BBVectorize/X86/wr-aliases.ll [new file with mode: 0644]