[llvm] r262896 - [GlobalISel] Introduce initializer method to support start/stop-after features.
Quentin Colombet via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 7 17:38:55 PST 2016
Author: qcolombet
Date: Mon Mar 7 19:38:55 2016
New Revision: 262896
URL: http://llvm.org/viewvc/llvm-project?rev=262896&view=rev
Log:
[GlobalISel] Introduce initializer method to support start/stop-after features.
Added:
llvm/trunk/lib/CodeGen/GlobalISel/GlobalISel.cpp
Removed:
llvm/trunk/lib/CodeGen/GlobalISel/EmptyFile.cpp
Modified:
llvm/trunk/include/llvm/InitializePasses.h
llvm/trunk/lib/CodeGen/GlobalISel/CMakeLists.txt
llvm/trunk/lib/CodeGen/GlobalISel/IRTranslator.cpp
Modified: llvm/trunk/include/llvm/InitializePasses.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/InitializePasses.h?rev=262896&r1=262895&r2=262896&view=diff
==============================================================================
--- llvm/trunk/include/llvm/InitializePasses.h (original)
+++ llvm/trunk/include/llvm/InitializePasses.h Mon Mar 7 19:38:55 2016
@@ -56,6 +56,9 @@ void initializeAnalysis(PassRegistry&);
/// initializeCodeGen - Initialize all passes linked into the CodeGen library.
void initializeCodeGen(PassRegistry&);
+/// Initialize all passes linked into the GlobalISel library.
+void initializeGlobalISel(PassRegistry &Registry);
+
/// initializeCodeGen - Initialize all passes linked into the CodeGen library.
void initializeTarget(PassRegistry&);
@@ -151,6 +154,7 @@ void initializeInstCountPass(PassRegistr
void initializeInstNamerPass(PassRegistry&);
void initializeInternalizePassPass(PassRegistry&);
void initializeIntervalPartitionPass(PassRegistry&);
+void initializeIRTranslatorPass(PassRegistry &);
void initializeJumpThreadingPass(PassRegistry&);
void initializeLCSSAPass(PassRegistry&);
void initializeLICMPass(PassRegistry&);
Modified: llvm/trunk/lib/CodeGen/GlobalISel/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/GlobalISel/CMakeLists.txt?rev=262896&r1=262895&r2=262896&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/GlobalISel/CMakeLists.txt (original)
+++ llvm/trunk/lib/CodeGen/GlobalISel/CMakeLists.txt Mon Mar 7 19:38:55 2016
@@ -18,7 +18,7 @@ endif()
# not ask for it.
add_llvm_library(LLVMGlobalISel
${GLOBAL_ISEL_BUILD_FILES}
- EmptyFile.cpp
+ GlobalISel.cpp
)
add_dependencies(LLVMGlobalISel intrinsics_gen)
Removed: llvm/trunk/lib/CodeGen/GlobalISel/EmptyFile.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/GlobalISel/EmptyFile.cpp?rev=262895&view=auto
==============================================================================
--- llvm/trunk/lib/CodeGen/GlobalISel/EmptyFile.cpp (original)
+++ llvm/trunk/lib/CodeGen/GlobalISel/EmptyFile.cpp (removed)
@@ -1,24 +0,0 @@
-//===-- llvm/CodeGen/GlobalISel/EmptyFile.cpp ------ EmptyFile ---*- C++ -*-==//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-/// \file
-/// The purpose of this file is to please cmake by not creating an
-/// empty library when we do not build GlobalISel.
-/// \todo This file should be removed when GlobalISel is not optional anymore.
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Support/Compiler.h"
-
-
-namespace llvm {
-// Export a global symbol so that ranlib does not complain
-// about the TOC being empty for the global-isel library when
-// we do not build global-isel.
-LLVM_ATTRIBUTE_UNUSED void DummyFunctionToSilenceRanlib(void) {
-}
-}
Added: llvm/trunk/lib/CodeGen/GlobalISel/GlobalISel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/GlobalISel/GlobalISel.cpp?rev=262896&view=auto
==============================================================================
--- llvm/trunk/lib/CodeGen/GlobalISel/GlobalISel.cpp (added)
+++ llvm/trunk/lib/CodeGen/GlobalISel/GlobalISel.cpp Mon Mar 7 19:38:55 2016
@@ -0,0 +1,29 @@
+//===-- llvm/CodeGen/GlobalISel/GlobalIsel.cpp --- GlobalISel ----*- C++ -*-==//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+/// \file
+// This file implements the common initialization routines for the
+// GlobalISel library.
+//===----------------------------------------------------------------------===//
+
+#include "llvm/InitializePasses.h"
+#include "llvm/PassRegistry.h"
+
+using namespace llvm;
+
+#ifndef LLVM_BUILD_GLOBAL_ISEL
+
+void llvm::initializeGlobalISel(PassRegistry &Registry) {
+}
+
+#else
+
+void llvm::initializeGlobalISel(PassRegistry &Registry) {
+ initializeIRTranslatorPass(Registry);
+}
+#endif // LLVM_BUILD_GLOBAL_ISEL
Modified: llvm/trunk/lib/CodeGen/GlobalISel/IRTranslator.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/GlobalISel/IRTranslator.cpp?rev=262896&r1=262895&r2=262896&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/GlobalISel/IRTranslator.cpp (original)
+++ llvm/trunk/lib/CodeGen/GlobalISel/IRTranslator.cpp Mon Mar 7 19:38:55 2016
@@ -27,8 +27,11 @@
using namespace llvm;
char IRTranslator::ID = 0;
+INITIALIZE_PASS(IRTranslator, "irtranslator", "IRTranslator LLVM IR -> MI",
+ false, false);
IRTranslator::IRTranslator() : MachineFunctionPass(ID), MRI(nullptr) {
+ initializeIRTranslatorPass(*PassRegistry::getPassRegistry());
}
unsigned IRTranslator::getOrCreateVReg(const Value *Val) {
More information about the llvm-commits
mailing list