[flang-commits] [clang] [flang] [lld] [llvm] Test entry-points for pass-plugins with Bye in clang, flang and lld (PR #172463)

Nikita Popov via flang-commits flang-commits at lists.llvm.org
Tue Dec 16 03:48:47 PST 2025


================
@@ -0,0 +1,66 @@
+// REQUIRES: plugins, llvm-examples
+
+// Entry-points in default and -O0 pipeline
+//
+// RUN: %clang -fpass-plugin=%llvmshlibdir/Bye%pluginext \
+// RUN:        -Xclang -load -Xclang %llvmshlibdir/Bye%pluginext \
+// RUN:        -mllvm -print-ep-callbacks -o /dev/null -S -emit-llvm %s | FileCheck --check-prefix=EP %s
+//
+// RUN: %clang -fpass-plugin=%llvmshlibdir/Bye%pluginext -flto=full -O0 \
+// RUN:        -Xclang -load -Xclang %llvmshlibdir/Bye%pluginext \
+// RUN:        -mllvm -print-ep-callbacks -o /dev/null -S -emit-llvm %s | FileCheck --check-prefix=EP %s
+//
+// RUN: %clang -fpass-plugin=%llvmshlibdir/Bye%pluginext -flto=thin -O0 \
+// RUN:        -Xclang -load -Xclang %llvmshlibdir/Bye%pluginext \
+// RUN:        -mllvm -print-ep-callbacks -o /dev/null -S -emit-llvm %s | FileCheck --check-prefix=EP %s
+//
+// EP:     PipelineStart
+// EP:     PipelineEarlySimplification
+// EP-NOT: Peephole
+// EP-NOT: ScalarOptimizerLate
+// EP-NOT: Peephole
+// EP:     OptimizerEarly
+// EP-NOT: Vectorizer
+// EP:     OptimizerLast
+
+// Entry-points in optimizer pipeline
+//
+// RUN: %clang -fpass-plugin=%llvmshlibdir/Bye%pluginext -O2 \
+// RUN:        -Xclang -load -Xclang %llvmshlibdir/Bye%pluginext \
+// RUN:        -mllvm -print-ep-callbacks -o /dev/null -S -emit-llvm %s | FileCheck --check-prefix=EP-OPT %s
+//
+// RUN: %clang -fpass-plugin=%llvmshlibdir/Bye%pluginext -O2 -flto=full \
+// RUN:        -Xclang -load -Xclang %llvmshlibdir/Bye%pluginext \
+// RUN:        -mllvm -print-ep-callbacks -o /dev/null -S -emit-llvm %s | FileCheck --check-prefix=EP-OPT %s
+//
+// RUN: %clang -fpass-plugin=%llvmshlibdir/Bye%pluginext -O2 -ffat-lto-objects \
+// RUN:        -Xclang -load -Xclang %llvmshlibdir/Bye%pluginext \
+// RUN:        -mllvm -print-ep-callbacks -o /dev/null -S -emit-llvm %s | FileCheck --check-prefix=EP-OPT %s
+//
+// EP-OPT: PipelineStart
+// EP-OPT: PipelineEarlySimplification
+// EP-OPT: Peephole
+// EP-OPT: ScalarOptimizerLate
+// EP-OPT: Peephole
+// EP-OPT: OptimizerEarly
+// EP-OPT: VectorizerStart
+// EP-OPT: VectorizerEnd
+// EP-OPT: OptimizerLast
+
+// FIXME: Thin-LTO does not invoke vectorizer callbacks
----------------
nikic wrote:

This is correct, ThinLTO should not invoke vectorizer callbacks pre-link. 

https://github.com/llvm/llvm-project/pull/172463


More information about the flang-commits mailing list