Skip to content

Conversation

@jhuber6
Copy link
Contributor

@jhuber6 jhuber6 commented Aug 6, 2024

This reverts commit 90ccf21.

Fixes: #100212

@llvmbot llvmbot added clang Clang issues not falling into any other category clang:driver 'clang' and 'clang++' user-facing binaries. Not 'clang-cl' labels Aug 6, 2024
@llvmbot
Copy link
Member

llvmbot commented Aug 6, 2024

@llvm/pr-subscribers-clang

@llvm/pr-subscribers-clang-driver

Author: Joseph Huber (jhuber6)

Changes

This reverts commit 90ccf21.

Fixes: #100212


Full diff: https://github.com/llvm/llvm-project/pull/102226.diff

3 Files Affected:

  • (removed) clang/test/Driver/linker-wrapper-passes.c (-75)
  • (modified) clang/test/lit.cfg.py (-12)
  • (modified) clang/test/lit.site.cfg.py.in (-4)
diff --git a/clang/test/Driver/linker-wrapper-passes.c b/clang/test/Driver/linker-wrapper-passes.c
deleted file mode 100644
index fb63ef7970ac7..0000000000000
--- a/clang/test/Driver/linker-wrapper-passes.c
+++ /dev/null
@@ -1,75 +0,0 @@
-// Check various clang-linker-wrapper pass options after -offload-opt.
-
-// REQUIRES: llvm-plugins, llvm-examples
-// REQUIRES: x86-registered-target
-// REQUIRES: amdgpu-registered-target
-
-// https://github.com/llvm/llvm-project/issues/100212
-// XFAIL: *
-
-// Setup.
-// RUN: mkdir -p %t
-// RUN: %clang -cc1 -emit-llvm-bc -o %t/host-x86_64-unknown-linux-gnu.bc \
-// RUN:     -disable-O0-optnone -triple=x86_64-unknown-linux-gnu %s
-// RUN: %clang -cc1 -emit-llvm-bc -o %t/openmp-amdgcn-amd-amdhsa.bc \
-// RUN:     -disable-O0-optnone -triple=amdgcn-amd-amdhsa %s
-// RUN: opt %t/openmp-amdgcn-amd-amdhsa.bc -o %t/openmp-amdgcn-amd-amdhsa.bc \
-// RUN:     -passes=forceattrs -force-remove-attribute=f:noinline
-// RUN: clang-offload-packager -o %t/openmp-x86_64-unknown-linux-gnu.out \
-// RUN:     --image=file=%t/openmp-amdgcn-amd-amdhsa.bc,arch=gfx90a,triple=amdgcn-amd-amdhsa
-// RUN: %clang -cc1 -S -o %t/host-x86_64-unknown-linux-gnu.s \
-// RUN:     -fopenmp -fopenmp-targets=amdgcn-amd-amdhsa \
-// RUN:     -fembed-offload-object=%t/openmp-x86_64-unknown-linux-gnu.out \
-// RUN:     %t/host-x86_64-unknown-linux-gnu.bc
-// RUN: %clang -cc1as -o %t/host-x86_64-unknown-linux-gnu.o \
-// RUN:     -triple x86_64-unknown-linux-gnu -filetype obj -target-cpu x86-64 \
-// RUN:     %t/host-x86_64-unknown-linux-gnu.s
-
-// Check plugin, -passes, and no remarks.
-// RUN: clang-linker-wrapper -o a.out --embed-bitcode \
-// RUN:     --linker-path=/usr/bin/true %t/host-x86_64-unknown-linux-gnu.o \
-// RUN:     %offload-opt-loadbye --offload-opt=-wave-goodbye \
-// RUN:     --offload-opt=-passes="function(goodbye),module(inline)" 2>&1 | \
-// RUN:   FileCheck -match-full-lines -check-prefixes=OUT %s
-
-// Check plugin, -p, and remarks.
-// RUN: clang-linker-wrapper -o a.out --embed-bitcode \
-// RUN:     --linker-path=/usr/bin/true %t/host-x86_64-unknown-linux-gnu.o \
-// RUN:     %offload-opt-loadbye --offload-opt=-wave-goodbye \
-// RUN:     --offload-opt=-p="function(goodbye),module(inline)" \
-// RUN:     --offload-opt=-pass-remarks=inline \
-// RUN:     --offload-opt=-pass-remarks-output=%t/remarks.yml \
-// RUN:     --offload-opt=-pass-remarks-filter=inline \
-// RUN:     --offload-opt=-pass-remarks-format=yaml 2>&1 | \
-// RUN:   FileCheck -match-full-lines -check-prefixes=OUT,REM %s
-// RUN: FileCheck -input-file=%t/remarks.yml -match-full-lines \
-// RUN:     -check-prefixes=YML %s
-
-// Check handling of bad plugin.
-// RUN: not clang-linker-wrapper \
-// RUN:     --offload-opt=-load-pass-plugin=%t/nonexistent.so 2>&1 | \
-// RUN:   FileCheck -match-full-lines -check-prefixes=BAD-PLUGIN %s
-
-//  OUT-NOT: {{.}}
-//      OUT: Bye: f
-// OUT-NEXT: Bye: test
-// REM-NEXT: remark: {{.*}} 'f' inlined into 'test' {{.*}}
-//  OUT-NOT: {{.}}
-
-//  YML-NOT: {{.}}
-//      YML: --- !Passed
-// YML-NEXT: Pass: inline
-// YML-NEXT: Name: Inlined
-// YML-NEXT: Function: test
-// YML-NEXT: Args:
-//      YML:  - Callee: f
-//      YML:  - Caller: test
-//      YML: ...
-//  YML-NOT: {{.}}
-
-// BAD-PLUGIN-NOT: {{.}}
-//     BAD-PLUGIN: {{.*}}Could not load library {{.*}}nonexistent.so{{.*}}
-// BAD-PLUGIN-NOT: {{.}}
-
-void f() {}
-void test() { f(); }
diff --git a/clang/test/lit.cfg.py b/clang/test/lit.cfg.py
index 2bd7501136a10..92a3361ce672e 100644
--- a/clang/test/lit.cfg.py
+++ b/clang/test/lit.cfg.py
@@ -110,15 +110,6 @@
 if config.clang_examples:
     config.available_features.add("examples")
 
-if config.llvm_examples:
-    config.available_features.add("llvm-examples")
-
-if config.llvm_linked_bye_extension:
-    config.substitutions.append(("%offload-opt-loadbye", ""))
-else:
-    loadbye = f"-load-pass-plugin={config.llvm_shlib_dir}/Bye{config.llvm_shlib_ext}"
-    config.substitutions.append(("%offload-opt-loadbye", f"--offload-opt={loadbye}"))
-
 
 def have_host_jit_feature_support(feature_name):
     clang_repl_exe = lit.util.which("clang-repl", config.clang_tools_dir)
@@ -223,9 +214,6 @@ def have_host_clang_repl_cuda():
 if config.has_plugins and config.llvm_plugin_ext:
     config.available_features.add("plugins")
 
-if config.llvm_has_plugins and config.llvm_plugin_ext:
-    config.available_features.add("llvm-plugins")
-
 if config.clang_default_pie_on_linux:
     config.available_features.add("default-pie-on-linux")
 
diff --git a/clang/test/lit.site.cfg.py.in b/clang/test/lit.site.cfg.py.in
index 2cc70e52f1aa1..1cbd876ac5bb9 100644
--- a/clang/test/lit.site.cfg.py.in
+++ b/clang/test/lit.site.cfg.py.in
@@ -7,7 +7,6 @@ config.llvm_obj_root = path(r"@LLVM_BINARY_DIR@")
 config.llvm_tools_dir = lit_config.substitute(path(r"@LLVM_TOOLS_DIR@"))
 config.llvm_libs_dir = lit_config.substitute(path(r"@LLVM_LIBS_DIR@"))
 config.llvm_shlib_dir = lit_config.substitute(path(r"@SHLIBDIR@"))
-config.llvm_shlib_ext = "@SHLIBEXT@"
 config.llvm_plugin_ext = "@LLVM_PLUGIN_EXT@"
 config.lit_tools_dir = path(r"@LLVM_LIT_TOOLS_DIR@")
 config.errc_messages = "@LLVM_LIT_ERRC_MESSAGES@"
@@ -40,10 +39,7 @@ config.python_executable = "@Python3_EXECUTABLE@"
 config.use_z3_solver = lit_config.params.get('USE_Z3_SOLVER', "@USE_Z3_SOLVER@")
 config.has_plugins = @CLANG_PLUGIN_SUPPORT@
 config.clang_vendor_uti = "@CLANG_VENDOR_UTI@"
-config.llvm_examples = @LLVM_BUILD_EXAMPLES@
-config.llvm_linked_bye_extension = @LLVM_BYE_LINK_INTO_TOOLS@
 config.llvm_external_lit = path(r"@LLVM_EXTERNAL_LIT@")
-config.llvm_has_plugins = @LLVM_ENABLE_PLUGINS@
 config.standalone_build = @CLANG_BUILT_STANDALONE@
 config.ppc_linux_default_ieeelongdouble = @PPC_LINUX_DEFAULT_IEEELONGDOUBLE@
 config.have_llvm_driver = @LLVM_TOOL_LLVM_DRIVER_BUILD@

@cachemeifyoucan
Copy link
Collaborator

Thanks! Can this be fixed on release/19.x too?

@jhuber6
Copy link
Contributor Author

jhuber6 commented Aug 6, 2024

Thanks! Can this be fixed on release/19.x too?

I'm still surprised this made it into the Release, since I'm pretty sure I only landed all of these changes after the fork. But we should be able to backport it from the existing issue.

@jhuber6 jhuber6 merged commit 030ee84 into llvm:main Aug 7, 2024
@haoNoQ
Copy link
Collaborator

haoNoQ commented Aug 28, 2024

Yeah I think we really gotta cherry-pick this revert, because failing tests on release branches are somewhat scary (cf. https://green.lab.llvm.org/job/llvm.org/job/clang-stage1-RA-release-branch/69/console).

I don't know how it's usually done but let me try to push some buttons, it's kind of semi-automatic I think.

@haoNoQ haoNoQ added this to the LLVM 19.X Release milestone Aug 28, 2024
@haoNoQ
Copy link
Collaborator

haoNoQ commented Aug 28, 2024

/cherry-pick 3ddd7a6

@llvmbot
Copy link
Member

llvmbot commented Aug 28, 2024

Failed to cherry-pick: 3ddd7a6

https://github.com/llvm/llvm-project/actions/runs/10588027221

Please manually backport the fix and push it to your github fork. Once this is done, please create a pull request

@haoNoQ
Copy link
Collaborator

haoNoQ commented Aug 28, 2024

/cherry-pick 030ee84

@llvmbot
Copy link
Member

llvmbot commented Aug 28, 2024

Failed to cherry-pick: 030ee84

https://github.com/llvm/llvm-project/actions/runs/10588122990

Please manually backport the fix and push it to your github fork. Once this is done, please create a pull request

@haoNoQ
Copy link
Collaborator

haoNoQ commented Aug 28, 2024

Oh that's just a whitespace change. Would you like me to make a manual PR or were you looking into it anyway?

@haoNoQ
Copy link
Collaborator

haoNoQ commented Aug 28, 2024

#106439

tru pushed a commit to haoNoQ/llvm-project that referenced this pull request Sep 1, 2024
…lvm#102226)

This reverts commit 90ccf21.

Fixes: llvm#100212
(cherry picked from commit 030ee84)

Conflicts:
	clang/test/Driver/linker-wrapper-passes.c
@jhuber6 jhuber6 deleted the DeleteTest branch September 23, 2024 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clang:driver 'clang' and 'clang++' user-facing binaries. Not 'clang-cl' clang Clang issues not falling into any other category release:cherry-pick-failed

Projects

Development

Successfully merging this pull request may close these issues.

[Clang] clang-linker-wrapper does not forward -fpass-plugin to the LTO invocation

5 participants