1 //===-- Vectorize.cpp -----------------------------------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
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.
14 //===----------------------------------------------------------------------===//
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/Analysis/Verifier.h"
21 #include "llvm/InitializePasses.h"
22 #include "llvm/PassManager.h"
23 #include "llvm/Wrap.h"
27 /// initializeVectorizationPasses - Initialize all passes linked into the
28 /// Vectorization library.
29 void llvm::initializeVectorization(PassRegistry &Registry) {
30 initializeBBVectorizePass(Registry);
31 initializeLoopVectorizePass(Registry);
32 initializeSLPVectorizerPass(Registry);
35 void LLVMInitializeVectorization(LLVMPassRegistryRef R) {
36 initializeVectorization(*unwrap(R));
39 void LLVMAddBBVectorizePass(LLVMPassManagerRef PM) {
40 unwrap(PM)->add(createBBVectorizePass());
43 void LLVMAddLoopVectorizePass(LLVMPassManagerRef PM) {
44 unwrap(PM)->add(createLoopVectorizePass());
47 void LLVMAddSLPVectorizePass(LLVMPassManagerRef PM) {
48 unwrap(PM)->add(createSLPVectorizerPass());