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)
commit739e37a0d2ea8225792ac84769f47ae319e715a9
treef3bac408107feadcab1cff710483bd4c770281a4
parent2ee0b630dcde096ad899c24e5144f4b405929495
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.

llvm-svn: 176399
llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
llvm/test/Transforms/LoopVectorize/vectorize-once.ll [new file with mode: 0644]