PR14448 - prevent the loop vectorizer from vectorizing the same loop twice.
authorNadav Rotem <nrotem@apple.com>
Sat, 2 Mar 2013 01:33:49 +0000 (01:33 +0000)
committerNadav Rotem <nrotem@apple.com>
Sat, 2 Mar 2013 01:33:49 +0000 (01:33 +0000)
commit5290baacb8ca4fb75d798e873a441cad11cbfb2c
tree25909512c21f2b3608f62052422fd3a0fbd5d1a6
parent328d1b65002e68ae65ffef05eed19122cbf721f5
PR14448 - prevent the loop vectorizer from vectorizing the same loop twice.
The LoopVectorizer often runs multiple times on the same function due to inlining.
When this happens the loop vectorizer often vectorizes the same loops multiple times, increasing code size and adding unneeded branches.
With this patch, the vectorizer during vectorization puts metadata on scalar loops and marks them as 'already vectorized' so that it knows to ignore them when it sees them a second time.

PR14448.

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