Small refactor on VectorizerHint for deduplication
authorRenato Golin <renato.golin@linaro.org>
Tue, 19 Aug 2014 17:30:43 +0000 (17:30 +0000)
committerRenato Golin <renato.golin@linaro.org>
Tue, 19 Aug 2014 17:30:43 +0000 (17:30 +0000)
commitdca126522d7c13d8f4e3a42dc191250bd567550d
tree0398c16cf36e2985b17a3eefcfae6a8ca4d7f0c2
parente3cea5fd9a8c275906eb059f844258ecd4cc6ca6
Small refactor on VectorizerHint for deduplication

Previously, the hint mechanism relied on clean up passes to remove redundant
metadata, which still showed up if running opt at low levels of optimization.
That also has shown that multiple nodes of the same type, but with different
values could still coexist, even if temporary, and cause confusion if the
next pass got the wrong value.

This patch makes sure that, if metadata already exists in a loop, the hint
mechanism will never append a new node, but always replace the existing one.
It also enhances the algorithm to cope with more metadata types in the future
by just adding a new type, not a lot of code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215994 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Vectorize/LoopVectorize.cpp
test/Transforms/LoopVectorize/duplicated-metadata.ll [new file with mode: 0644]