1c34e5113SHal Finkel //===-- Vectorize.cpp -----------------------------------------------------===//
2c34e5113SHal Finkel //
32946cd70SChandler Carruth // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
42946cd70SChandler Carruth // See https://llvm.org/LICENSE.txt for license information.
52946cd70SChandler Carruth // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6c34e5113SHal Finkel //
7c34e5113SHal Finkel //===----------------------------------------------------------------------===//
8c34e5113SHal Finkel //
9c34e5113SHal Finkel // This file implements common infrastructure for libLLVMVectorizeOpts.a, which
10c34e5113SHal Finkel // implements several vectorization transformations over the LLVM intermediate
11c34e5113SHal Finkel // representation, including the C bindings for that library.
12c34e5113SHal Finkel //
13c34e5113SHal Finkel //===----------------------------------------------------------------------===//
14c34e5113SHal Finkel 
15ed0881b2SChandler Carruth #include "llvm/Transforms/Vectorize.h"
16c34e5113SHal Finkel #include "llvm-c/Initialization.h"
17ed0881b2SChandler Carruth #include "llvm-c/Transforms/Vectorize.h"
186bda14b3SChandler Carruth #include "llvm/IR/LegacyPassManager.h"
19ed0881b2SChandler Carruth #include "llvm/InitializePasses.h"
20*e188aae4Sserge-sans-paille #include "llvm/PassRegistry.h"
21c34e5113SHal Finkel 
22c34e5113SHal Finkel using namespace llvm;
23c34e5113SHal Finkel 
24a17f03bdSSanjay Patel /// Initialize all passes linked into the Vectorization library.
initializeVectorization(PassRegistry & Registry)25c34e5113SHal Finkel void llvm::initializeVectorization(PassRegistry &Registry) {
266b94c2a0SNadav Rotem   initializeLoopVectorizePass(Registry);
272d9dec32SNadav Rotem   initializeSLPVectorizerPass(Registry);
284dc4ebd6SMarkus Lavin   initializeLoadStoreVectorizerLegacyPassPass(Registry);
29a17f03bdSSanjay Patel   initializeVectorCombineLegacyPassPass(Registry);
30c34e5113SHal Finkel }
31c34e5113SHal Finkel 
LLVMInitializeVectorization(LLVMPassRegistryRef R)32c34e5113SHal Finkel void LLVMInitializeVectorization(LLVMPassRegistryRef R) {
33c34e5113SHal Finkel   initializeVectorization(*unwrap(R));
34c34e5113SHal Finkel }
35c34e5113SHal Finkel 
LLVMAddLoopVectorizePass(LLVMPassManagerRef PM)366b94c2a0SNadav Rotem void LLVMAddLoopVectorizePass(LLVMPassManagerRef PM) {
37d0bb22bbSNadav Rotem   unwrap(PM)->add(createLoopVectorizePass());
386b94c2a0SNadav Rotem }
392d9dec32SNadav Rotem 
LLVMAddSLPVectorizePass(LLVMPassManagerRef PM)40c86fdf12SBenjamin Kramer void LLVMAddSLPVectorizePass(LLVMPassManagerRef PM) {
412d9dec32SNadav Rotem   unwrap(PM)->add(createSLPVectorizerPass());
422d9dec32SNadav Rotem }
43