forked from OSchip/llvm-project
[PM] Port PreISelIntrinsicLowering to the new PM
llvm-svn: 273713
This commit is contained in:
parent
3b3e954ea2
commit
82d5da5aac
|
@ -0,0 +1,26 @@
|
|||
//===--- PreISelIntrinsicLowering.h - Pre-ISel intrinsic lowering pass ----===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// This pass implements IR lowering for the llvm.load.relative intrinsic.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
#ifndef LLVM_CODEGEN_PREISELINTRINSICLOWERING_H
|
||||
#define LLVM_CODEGEN_PREISELINTRINSICLOWERING_H
|
||||
|
||||
#include "llvm/IR/PassManager.h"
|
||||
|
||||
namespace llvm {
|
||||
|
||||
struct PreISelIntrinsicLoweringPass
|
||||
: PassInfoMixin<PreISelIntrinsicLoweringPass> {
|
||||
PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
|
||||
};
|
||||
}
|
||||
|
||||
#endif // LLVM_CODEGEN_PREISELINTRINSICLOWERING_H
|
|
@ -261,7 +261,7 @@ void initializePostMachineSchedulerPass(PassRegistry&);
|
|||
void initializePostOrderFunctionAttrsLegacyPassPass(PassRegistry&);
|
||||
void initializePostRAHazardRecognizerPass(PassRegistry&);
|
||||
void initializePostRASchedulerPass(PassRegistry&);
|
||||
void initializePreISelIntrinsicLoweringPass(PassRegistry&);
|
||||
void initializePreISelIntrinsicLoweringLegacyPassPass(PassRegistry&);
|
||||
void initializePrintBasicBlockPassPass(PassRegistry&);
|
||||
void initializePrintFunctionPassWrapperPass(PassRegistry&);
|
||||
void initializePrintModulePassWrapperPass(PassRegistry&);
|
||||
|
|
|
@ -65,7 +65,7 @@ void llvm::initializeCodeGen(PassRegistry &Registry) {
|
|||
initializePostMachineSchedulerPass(Registry);
|
||||
initializePostRAHazardRecognizerPass(Registry);
|
||||
initializePostRASchedulerPass(Registry);
|
||||
initializePreISelIntrinsicLoweringPass(Registry);
|
||||
initializePreISelIntrinsicLoweringLegacyPassPass(Registry);
|
||||
initializeProcessImplicitDefsPass(Registry);
|
||||
initializeRegisterCoalescerPass(Registry);
|
||||
initializeRenameIndependentSubregsPass(Registry);
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "llvm/CodeGen/PreISelIntrinsicLowering.h"
|
||||
#include "llvm/CodeGen/Passes.h"
|
||||
#include "llvm/IR/Function.h"
|
||||
#include "llvm/IR/IRBuilder.h"
|
||||
|
@ -63,23 +64,31 @@ bool lowerIntrinsics(Module &M) {
|
|||
return Changed;
|
||||
}
|
||||
|
||||
class PreISelIntrinsicLowering : public ModulePass {
|
||||
class PreISelIntrinsicLoweringLegacyPass : public ModulePass {
|
||||
public:
|
||||
static char ID;
|
||||
PreISelIntrinsicLowering() : ModulePass(ID) {}
|
||||
PreISelIntrinsicLoweringLegacyPass() : ModulePass(ID) {}
|
||||
|
||||
bool runOnModule(Module &M) {
|
||||
return lowerIntrinsics(M);
|
||||
}
|
||||
bool runOnModule(Module &M) { return lowerIntrinsics(M); }
|
||||
};
|
||||
|
||||
char PreISelIntrinsicLowering::ID;
|
||||
|
||||
char PreISelIntrinsicLoweringLegacyPass::ID;
|
||||
}
|
||||
|
||||
INITIALIZE_PASS(PreISelIntrinsicLowering, "pre-isel-intrinsic-lowering",
|
||||
"Pre-ISel Intrinsic Lowering", false, false)
|
||||
INITIALIZE_PASS(PreISelIntrinsicLoweringLegacyPass,
|
||||
"pre-isel-intrinsic-lowering", "Pre-ISel Intrinsic Lowering",
|
||||
false, false)
|
||||
|
||||
ModulePass *llvm::createPreISelIntrinsicLoweringPass() {
|
||||
return new PreISelIntrinsicLowering;
|
||||
namespace llvm {
|
||||
ModulePass *createPreISelIntrinsicLoweringPass() {
|
||||
return new PreISelIntrinsicLoweringLegacyPass;
|
||||
}
|
||||
|
||||
PreservedAnalyses PreISelIntrinsicLoweringPass::run(Module &M,
|
||||
ModuleAnalysisManager &AM) {
|
||||
if (!lowerIntrinsics(M))
|
||||
return PreservedAnalyses::all();
|
||||
else
|
||||
return PreservedAnalyses::none();
|
||||
}
|
||||
} // End llvm namespace
|
||||
|
|
|
@ -44,6 +44,7 @@
|
|||
#include "llvm/Analysis/TargetLibraryInfo.h"
|
||||
#include "llvm/Analysis/TargetTransformInfo.h"
|
||||
#include "llvm/Analysis/TypeBasedAliasAnalysis.h"
|
||||
#include "llvm/CodeGen/PreISelIntrinsicLowering.h"
|
||||
#include "llvm/IR/Dominators.h"
|
||||
#include "llvm/IR/IRPrintingPasses.h"
|
||||
#include "llvm/IR/PassManager.h"
|
||||
|
|
|
@ -53,6 +53,7 @@ MODULE_PASS("no-op-module", NoOpModulePass())
|
|||
MODULE_PASS("pgo-icall-prom", PGOIndirectCallPromotion())
|
||||
MODULE_PASS("pgo-instr-gen", PGOInstrumentationGen())
|
||||
MODULE_PASS("pgo-instr-use", PGOInstrumentationUse())
|
||||
MODULE_PASS("pre-isel-intrinsic-lowering", PreISelIntrinsicLoweringPass())
|
||||
MODULE_PASS("print-profile-summary", ProfileSummaryPrinterPass(dbgs()))
|
||||
MODULE_PASS("print-callgraph", CallGraphPrinterPass(dbgs()))
|
||||
MODULE_PASS("print", PrintModulePass(dbgs()))
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
; RUN: opt -pre-isel-intrinsic-lowering -S -o - %s | FileCheck %s
|
||||
; RUN: opt -passes='pre-isel-intrinsic-lowering' -S -o - %s | FileCheck %s
|
||||
|
||||
; CHECK: define i8* @foo32(i8* [[P:%.*]], i32 [[O:%.*]])
|
||||
define i8* @foo32(i8* %p, i32 %o) {
|
||||
|
|
|
@ -361,7 +361,7 @@ int main(int argc, char **argv) {
|
|||
initializeDwarfEHPreparePass(Registry);
|
||||
initializeSafeStackPass(Registry);
|
||||
initializeSjLjEHPreparePass(Registry);
|
||||
initializePreISelIntrinsicLoweringPass(Registry);
|
||||
initializePreISelIntrinsicLoweringLegacyPassPass(Registry);
|
||||
initializeGlobalMergePass(Registry);
|
||||
initializeInterleavedAccessPass(Registry);
|
||||
|
||||
|
|
Loading…
Reference in New Issue