[PATCH] D45484: [Polly][NewPM] Update pass registration for the LLVM plugin interface

Phabricator via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 17 01:03:02 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL330181: [NewPM] Update pass registration for the LLVM plugin interface (authored by pfaffe, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D45484?vs=142615&id=142744#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D45484

Files:
  polly/trunk/lib/Support/RegisterPasses.cpp
  polly/trunk/test/Support/Plugins.ll
  polly/trunk/test/lit.site.cfg.in


Index: polly/trunk/lib/Support/RegisterPasses.cpp
===================================================================
--- polly/trunk/lib/Support/RegisterPasses.cpp
+++ polly/trunk/lib/Support/RegisterPasses.cpp
@@ -42,6 +42,7 @@
 #include "llvm/IR/LegacyPassManager.h"
 #include "llvm/IR/Verifier.h"
 #include "llvm/Passes/PassBuilder.h"
+#include "llvm/Passes/PassPlugin.h"
 #include "llvm/Support/TargetSelect.h"
 #include "llvm/Transforms/IPO.h"
 #include "llvm/Transforms/IPO/PassManagerBuilder.h"
@@ -703,3 +704,10 @@
   // FIXME else Error?
 }
 } // namespace polly
+
+// Plugin Entrypoint:
+extern "C" ::llvm::PassPluginLibraryInfo LLVM_ATTRIBUTE_WEAK LLVM_PLUGIN_EXPORT
+llvmGetPassPluginInfo() {
+  return {LLVM_PLUGIN_API_VERSION, "Polly", LLVM_VERSION_STRING,
+          polly::RegisterPollyPasses};
+}
Index: polly/trunk/test/Support/Plugins.ll
===================================================================
--- polly/trunk/test/Support/Plugins.ll
+++ polly/trunk/test/Support/Plugins.ll
@@ -0,0 +1,13 @@
+; RUN: opt %loadPolly -passes='polly-prepare,scop(print<polly-ast>)' -S < %s \
+; RUN: | FileCheck %s
+
+; This testcase tests plugin registration. Check-lines below serve to verify
+; that the passes actually ran.
+
+; CHECK-LABEL: void @foo
+; CHECK-NEXT: entry:
+; CHECK-NEXT: br label %entry.split
+define void @foo() {
+entry:
+  ret void
+}
Index: polly/trunk/test/lit.site.cfg.in
===================================================================
--- polly/trunk/test/lit.site.cfg.in
+++ polly/trunk/test/lit.site.cfg.in
@@ -46,6 +46,8 @@
    config.link_polly_into_tools.lower() == 'link_polly_into_tools-notfound':
     config.substitutions.append(('%loadPolly', '-load '
                                  + config.polly_lib_dir + '/LLVMPolly at LLVM_SHLIBEXT@'
+                                 + ' -load-pass-plugin '
+                                 + config.polly_lib_dir + '/LLVMPolly at LLVM_SHLIBEXT@'
                                  + ' -polly-process-unprofitable '
                                  + ' -polly-remarks-minimal '
                                  + ' -polly-use-llvm-names '


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D45484.142744.patch
Type: text/x-patch
Size: 2131 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180417/132a60c8/attachment.bin>


More information about the llvm-commits mailing list