2012-12-12 01:11:46 +00:00
|
|
|
//===-- Vectorize.cpp -----------------------------------------------------===//
|
2012-02-01 03:51:43 +00:00
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
2012-10-17 18:25:06 +00:00
|
|
|
// This file implements common infrastructure for libLLVMVectorizeOpts.a, which
|
2012-02-01 03:51:43 +00:00
|
|
|
// implements several vectorization transformations over the LLVM intermediate
|
|
|
|
// representation, including the C bindings for that library.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2012-12-03 16:50:05 +00:00
|
|
|
#include "llvm/Transforms/Vectorize.h"
|
2012-02-01 03:51:43 +00:00
|
|
|
#include "llvm-c/Initialization.h"
|
2012-12-03 16:50:05 +00:00
|
|
|
#include "llvm-c/Transforms/Vectorize.h"
|
2012-02-01 03:51:43 +00:00
|
|
|
#include "llvm/Analysis/Passes.h"
|
|
|
|
#include "llvm/Analysis/Verifier.h"
|
2012-12-03 16:50:05 +00:00
|
|
|
#include "llvm/InitializePasses.h"
|
|
|
|
#include "llvm/PassManager.h"
|
2012-02-01 03:51:43 +00:00
|
|
|
|
|
|
|
using namespace llvm;
|
|
|
|
|
2012-10-17 18:25:06 +00:00
|
|
|
/// initializeVectorizationPasses - Initialize all passes linked into the
|
2012-02-01 03:51:43 +00:00
|
|
|
/// Vectorization library.
|
|
|
|
void llvm::initializeVectorization(PassRegistry &Registry) {
|
|
|
|
initializeBBVectorizePass(Registry);
|
2012-10-17 18:25:06 +00:00
|
|
|
initializeLoopVectorizePass(Registry);
|
2012-02-01 03:51:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void LLVMInitializeVectorization(LLVMPassRegistryRef R) {
|
|
|
|
initializeVectorization(*unwrap(R));
|
|
|
|
}
|
|
|
|
|
|
|
|
void LLVMAddBBVectorizePass(LLVMPassManagerRef PM) {
|
|
|
|
unwrap(PM)->add(createBBVectorizePass());
|
|
|
|
}
|
|
|
|
|
2012-10-17 18:25:06 +00:00
|
|
|
void LLVMAddLoopVectorizePass(LLVMPassManagerRef PM) {
|
2012-12-12 19:29:45 +00:00
|
|
|
unwrap(PM)->add(createLoopVectorizePass());
|
2012-10-17 18:25:06 +00:00
|
|
|
}
|