2013-06-10 16:36:52 -04:00
|
|
|
//===-- Vectorize.cpp -----------------------------------------------------===//
|
2012-04-14 09:54:10 -04:00
|
|
|
//
|
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
|
//
|
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
|
//
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
//
|
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);
|
2016-07-23 16:41:05 -04:00
|
|
|
initializeLoadStoreVectorizerPass(Registry);
|
2012-04-14 09:54:10 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void LLVMInitializeVectorization(LLVMPassRegistryRef R) {
|
|
|
|
|
initializeVectorization(*unwrap(R));
|
|
|
|
|
}
|
|
|
|
|
|
2017-07-01 09:22:02 -04:00
|
|
|
// DEPRECATED: Remove after the LLVM 5 release.
|
2012-04-14 09:54:10 -04:00
|
|
|
void LLVMAddBBVectorizePass(LLVMPassManagerRef PM) {
|
|
|
|
|
}
|
|
|
|
|
|
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());
|
|
|
|
|
}
|