[llvm] r273713 - [PM] Port PreISelIntrinsicLowering to the new PM
Michael Kuperstein via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 24 13:13:42 PDT 2016
Author: mkuper
Date: Fri Jun 24 15:13:42 2016
New Revision: 273713
URL: http://llvm.org/viewvc/llvm-project?rev=273713&view=rev
Log:
[PM] Port PreISelIntrinsicLowering to the new PM
Added:
llvm/trunk/include/llvm/CodeGen/PreISelIntrinsicLowering.h
Modified:
llvm/trunk/include/llvm/InitializePasses.h
llvm/trunk/lib/CodeGen/CodeGen.cpp
llvm/trunk/lib/CodeGen/PreISelIntrinsicLowering.cpp
llvm/trunk/lib/Passes/PassBuilder.cpp
llvm/trunk/lib/Passes/PassRegistry.def
llvm/trunk/test/Transforms/PreISelIntrinsicLowering/load-relative.ll
llvm/trunk/tools/opt/opt.cpp
Added: llvm/trunk/include/llvm/CodeGen/PreISelIntrinsicLowering.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/PreISelIntrinsicLowering.h?rev=273713&view=auto
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/PreISelIntrinsicLowering.h (added)
+++ llvm/trunk/include/llvm/CodeGen/PreISelIntrinsicLowering.h Fri Jun 24 15:13:42 2016
@@ -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
Modified: llvm/trunk/include/llvm/InitializePasses.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/InitializePasses.h?rev=273713&r1=273712&r2=273713&view=diff
==============================================================================
--- llvm/trunk/include/llvm/InitializePasses.h (original)
+++ llvm/trunk/include/llvm/InitializePasses.h Fri Jun 24 15:13:42 2016
@@ -261,7 +261,7 @@ void initializePostMachineSchedulerPass(
void initializePostOrderFunctionAttrsLegacyPassPass(PassRegistry&);
void initializePostRAHazardRecognizerPass(PassRegistry&);
void initializePostRASchedulerPass(PassRegistry&);
-void initializePreISelIntrinsicLoweringPass(PassRegistry&);
+void initializePreISelIntrinsicLoweringLegacyPassPass(PassRegistry&);
void initializePrintBasicBlockPassPass(PassRegistry&);
void initializePrintFunctionPassWrapperPass(PassRegistry&);
void initializePrintModulePassWrapperPass(PassRegistry&);
Modified: llvm/trunk/lib/CodeGen/CodeGen.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/CodeGen.cpp?rev=273713&r1=273712&r2=273713&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/CodeGen.cpp (original)
+++ llvm/trunk/lib/CodeGen/CodeGen.cpp Fri Jun 24 15:13:42 2016
@@ -65,7 +65,7 @@ void llvm::initializeCodeGen(PassRegistr
initializePostMachineSchedulerPass(Registry);
initializePostRAHazardRecognizerPass(Registry);
initializePostRASchedulerPass(Registry);
- initializePreISelIntrinsicLoweringPass(Registry);
+ initializePreISelIntrinsicLoweringLegacyPassPass(Registry);
initializeProcessImplicitDefsPass(Registry);
initializeRegisterCoalescerPass(Registry);
initializeRenameIndependentSubregsPass(Registry);
Modified: llvm/trunk/lib/CodeGen/PreISelIntrinsicLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PreISelIntrinsicLowering.cpp?rev=273713&r1=273712&r2=273713&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/PreISelIntrinsicLowering.cpp (original)
+++ llvm/trunk/lib/CodeGen/PreISelIntrinsicLowering.cpp Fri Jun 24 15:13:42 2016
@@ -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)
+
+namespace llvm {
+ModulePass *createPreISelIntrinsicLoweringPass() {
+ return new PreISelIntrinsicLoweringLegacyPass;
+}
-ModulePass *llvm::createPreISelIntrinsicLoweringPass() {
- return new PreISelIntrinsicLowering;
+PreservedAnalyses PreISelIntrinsicLoweringPass::run(Module &M,
+ ModuleAnalysisManager &AM) {
+ if (!lowerIntrinsics(M))
+ return PreservedAnalyses::all();
+ else
+ return PreservedAnalyses::none();
}
+} // End llvm namespace
Modified: llvm/trunk/lib/Passes/PassBuilder.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Passes/PassBuilder.cpp?rev=273713&r1=273712&r2=273713&view=diff
==============================================================================
--- llvm/trunk/lib/Passes/PassBuilder.cpp (original)
+++ llvm/trunk/lib/Passes/PassBuilder.cpp Fri Jun 24 15:13:42 2016
@@ -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"
Modified: llvm/trunk/lib/Passes/PassRegistry.def
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Passes/PassRegistry.def?rev=273713&r1=273712&r2=273713&view=diff
==============================================================================
--- llvm/trunk/lib/Passes/PassRegistry.def (original)
+++ llvm/trunk/lib/Passes/PassRegistry.def Fri Jun 24 15:13:42 2016
@@ -53,6 +53,7 @@ MODULE_PASS("no-op-module", NoOpModulePa
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()))
Modified: llvm/trunk/test/Transforms/PreISelIntrinsicLowering/load-relative.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/PreISelIntrinsicLowering/load-relative.ll?rev=273713&r1=273712&r2=273713&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/PreISelIntrinsicLowering/load-relative.ll (original)
+++ llvm/trunk/test/Transforms/PreISelIntrinsicLowering/load-relative.ll Fri Jun 24 15:13:42 2016
@@ -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) {
Modified: llvm/trunk/tools/opt/opt.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/opt/opt.cpp?rev=273713&r1=273712&r2=273713&view=diff
==============================================================================
--- llvm/trunk/tools/opt/opt.cpp (original)
+++ llvm/trunk/tools/opt/opt.cpp Fri Jun 24 15:13:42 2016
@@ -361,7 +361,7 @@ int main(int argc, char **argv) {
initializeDwarfEHPreparePass(Registry);
initializeSafeStackPass(Registry);
initializeSjLjEHPreparePass(Registry);
- initializePreISelIntrinsicLoweringPass(Registry);
+ initializePreISelIntrinsicLoweringLegacyPassPass(Registry);
initializeGlobalMergePass(Registry);
initializeInterleavedAccessPass(Registry);
More information about the llvm-commits
mailing list