xref: /llvm-project/llvm/lib/Transforms/Vectorize/Vectorize.cpp (revision 6af4f232b5d1cf44d94f60fa29b3840218bed2b2)
1 //===-- Vectorize.cpp -----------------------------------------------------===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file implements common infrastructure for libLLVMVectorizeOpts.a, which
11 // implements several vectorization transformations over the LLVM intermediate
12 // representation, including the C bindings for that library.
13 //
14 //===----------------------------------------------------------------------===//
15 
16 #include "llvm/Transforms/Vectorize.h"
17 #include "llvm-c/Initialization.h"
18 #include "llvm-c/Transforms/Vectorize.h"
19 #include "llvm/Analysis/Passes.h"
20 #include "llvm/IR/LegacyPassManager.h"
21 #include "llvm/InitializePasses.h"
22 
23 using namespace llvm;
24 
25 /// initializeVectorizationPasses - Initialize all passes linked into the
26 /// Vectorization library.
27 void llvm::initializeVectorization(PassRegistry &Registry) {
28   initializeLoopVectorizePass(Registry);
29   initializeSLPVectorizerPass(Registry);
30   initializeLoadStoreVectorizerPass(Registry);
31 }
32 
33 void LLVMInitializeVectorization(LLVMPassRegistryRef R) {
34   initializeVectorization(*unwrap(R));
35 }
36 
37 // DEPRECATED: Remove after the LLVM 5 release.
38 void LLVMAddBBVectorizePass(LLVMPassManagerRef PM) {
39 }
40 
41 void LLVMAddLoopVectorizePass(LLVMPassManagerRef PM) {
42   unwrap(PM)->add(createLoopVectorizePass());
43 }
44 
45 void LLVMAddSLPVectorizePass(LLVMPassManagerRef PM) {
46   unwrap(PM)->add(createSLPVectorizerPass());
47 }
48