2013-06-10 16:36:52 -04:00
|
|
|
//===-- Vectorize.cpp -----------------------------------------------------===//
|
2012-04-14 09:54:10 -04:00
|
|
|
//
|
2019-08-20 16:50:12 -04:00
|
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
2012-04-14 09:54:10 -04:00
|
|
|
//
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
//
|
2012-12-02 08:10:19 -05:00
|
|
|
// This file implements common infrastructure for libLLVMVectorizeOpts.a, which
|
2012-04-14 09:54:10 -04:00
|
|
|
// implements several vectorization transformations over the LLVM intermediate
|
|
|
|
|
// representation, including the C bindings for that library.
|
|
|
|
|
//
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
2013-04-08 14:41:23 -04:00
|
|
|
#include "llvm/Transforms/Vectorize.h"
|
2012-04-14 09:54:10 -04:00
|
|
|
#include "llvm-c/Initialization.h"
|
2013-04-08 14:41:23 -04:00
|
|
|
#include "llvm-c/Transforms/Vectorize.h"
|
2012-04-14 09:54:10 -04:00
|
|
|
#include "llvm/Analysis/Passes.h"
|
2017-06-10 09:44:06 -04:00
|
|
|
#include "llvm/IR/LegacyPassManager.h"
|
2013-04-08 14:41:23 -04:00
|
|
|
#include "llvm/InitializePasses.h"
|
2012-04-14 09:54:10 -04:00
|
|
|
|
|
|
|
|
using namespace llvm;
|
|
|
|
|
|
2012-12-02 08:10:19 -05:00
|
|
|
/// initializeVectorizationPasses - Initialize all passes linked into the
|
2012-04-14 09:54:10 -04:00
|
|
|
/// Vectorization library.
|
|
|
|
|
void llvm::initializeVectorization(PassRegistry &Registry) {
|
2012-12-02 08:10:19 -05:00
|
|
|
initializeLoopVectorizePass(Registry);
|
2013-06-10 16:36:52 -04:00
|
|
|
initializeSLPVectorizerPass(Registry);
|
2019-01-19 05:01:25 -05:00
|
|
|
initializeLoadStoreVectorizerLegacyPassPass(Registry);
|
2012-04-14 09:54:10 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void LLVMInitializeVectorization(LLVMPassRegistryRef R) {
|
|
|
|
|
initializeVectorization(*unwrap(R));
|
|
|
|
|
}
|
|
|
|
|
|
2012-12-02 08:10:19 -05:00
|
|
|
void LLVMAddLoopVectorizePass(LLVMPassManagerRef PM) {
|
|
|
|
|
unwrap(PM)->add(createLoopVectorizePass());
|
|
|
|
|
}
|
2013-06-10 16:36:52 -04:00
|
|
|
|
|
|
|
|
void LLVMAddSLPVectorizePass(LLVMPassManagerRef PM) {
|
|
|
|
|
unwrap(PM)->add(createSLPVectorizerPass());
|
|
|
|
|
}
|