[llvm] f2ab8f4 - [llvm-reduce] Reduce global value linkage

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 20 06:25:42 PDT 2023




> On Jul 18, 2023, at 00:47, Arthur Eubanks via llvm-commits <llvm-commits at lists.llvm.org> wrote:
> 
> 
> Author: Arthur Eubanks
> Date: 2023-07-17T15:46:38-07:00
> New Revision: f2ab8f43800ff14051213bff40d35406691f29b0
> 
> URL: https://github.com/llvm/llvm-project/commit/f2ab8f43800ff14051213bff40d35406691f29b0
> DIFF: https://github.com/llvm/llvm-project/commit/f2ab8f43800ff14051213bff40d35406691f29b0.diff
> 
> LOG: [llvm-reduce] Reduce global value linkage
> 
> Added: 
>    llvm/test/tools/llvm-reduce/reduce-linkage.ll
> 
> Modified: 
>    llvm/tools/llvm-reduce/deltas/ReduceGlobalValues.cpp
> 
> Removed: 
> 
> 
> 
> ################################################################################
> diff  --git a/llvm/test/tools/llvm-reduce/reduce-linkage.ll b/llvm/test/tools/llvm-reduce/reduce-linkage.ll
> new file mode 100644
> index 00000000000000..e7f35245194c41
> --- /dev/null
> +++ b/llvm/test/tools/llvm-reduce/reduce-linkage.ll
> @@ -0,0 +1,22 @@
> +; Test that llvm-reduce can remove function linkage.
> +;
> +; RUN: llvm-reduce --abort-on-invalid-reduction --delta-passes=global-values --test FileCheck --test-arg --check-prefixes=CHECK-INTERESTINGNESS --test-arg %s --test-arg --input-file %s -o %t
> +; RUN: FileCheck --check-prefix=CHECK-FINAL --implicit-check-not=internal %s < %t
> +
> +; CHECK-INTERESTINGNESS: define
> +; CHECK-INTERESTINGNESS-SAME: void @f
> +
> +; CHECK-FINAL: define void @f()
> +
> +define void @f() {
> +  ret void
> +}
> +
> +; CHECK-INTERESTINGNESS: define
> +; CHECK-INTERESTINGNESS-SAME: void @g
> +
> +; CHECK-FINAL: define void @g()
> +
> +define internal void @g() {
> +  ret void
> +}




Unfortunately the added test will fail if the path to llvm-project contains any directory that contains internal.

IIUC --implicit-check-not could just be dropped, as you explicitly check the define void @g()?

Cheers,
Florian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230720/143d39f1/attachment.html>


More information about the llvm-commits mailing list