2013-04-11 19:36:36 +08:00
|
|
|
//===-- Vectorize.cpp -----------------------------------------------------===//
|
2012-02-01 11:51:43 +08:00
|
|
|
//
|
2019-01-19 16:50:56 +08: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-02-01 11:51:43 +08:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
2012-10-18 02:25:06 +08:00
|
|
|
// This file implements common infrastructure for libLLVMVectorizeOpts.a, which
|
2012-02-01 11:51:43 +08:00
|
|
|
// implements several vectorization transformations over the LLVM intermediate
|
|
|
|
// representation, including the C bindings for that library.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2012-12-04 00:50:05 +08:00
|
|
|
#include "llvm/Transforms/Vectorize.h"
|
2012-02-01 11:51:43 +08:00
|
|
|
#include "llvm-c/Initialization.h"
|
2012-12-04 00:50:05 +08:00
|
|
|
#include "llvm-c/Transforms/Vectorize.h"
|
2012-02-01 11:51:43 +08:00
|
|
|
#include "llvm/Analysis/Passes.h"
|
2017-06-06 19:49:48 +08:00
|
|
|
#include "llvm/IR/LegacyPassManager.h"
|
2012-12-04 00:50:05 +08:00
|
|
|
#include "llvm/InitializePasses.h"
|
2012-02-01 11:51:43 +08:00
|
|
|
|
|
|
|
using namespace llvm;
|
|
|
|
|
2012-10-18 02:25:06 +08:00
|
|
|
/// initializeVectorizationPasses - Initialize all passes linked into the
|
2012-02-01 11:51:43 +08:00
|
|
|
/// Vectorization library.
|
|
|
|
void llvm::initializeVectorization(PassRegistry &Registry) {
|
2012-10-18 02:25:06 +08:00
|
|
|
initializeLoopVectorizePass(Registry);
|
2013-04-10 03:44:35 +08:00
|
|
|
initializeSLPVectorizerPass(Registry);
|
2018-12-07 16:23:37 +08:00
|
|
|
initializeLoadStoreVectorizerLegacyPassPass(Registry);
|
2012-02-01 11:51:43 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void LLVMInitializeVectorization(LLVMPassRegistryRef R) {
|
|
|
|
initializeVectorization(*unwrap(R));
|
|
|
|
}
|
|
|
|
|
2012-10-18 02:25:06 +08:00
|
|
|
void LLVMAddLoopVectorizePass(LLVMPassManagerRef PM) {
|
2012-12-13 03:29:45 +08:00
|
|
|
unwrap(PM)->add(createLoopVectorizePass());
|
2012-10-18 02:25:06 +08:00
|
|
|
}
|
2013-04-10 03:44:35 +08:00
|
|
|
|
2013-04-11 19:36:36 +08:00
|
|
|
void LLVMAddSLPVectorizePass(LLVMPassManagerRef PM) {
|
2013-04-10 03:44:35 +08:00
|
|
|
unwrap(PM)->add(createSLPVectorizerPass());
|
|
|
|
}
|