[all-commits] [llvm/llvm-project] 3c639b: [Clang] Simplify specifying passes via -Xoffload-l...

Joel E. Denny via All-commits all-commits at lists.llvm.org
Fri Aug 9 07:42:04 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 3c639b83a6071d3e6ec9f44da7a7788165a65d45
      https://github.com/llvm/llvm-project/commit/3c639b83a6071d3e6ec9f44da7a7788165a65d45
  Author: Joel E. Denny <jdenny.ornl at gmail.com>
  Date:   2024-08-09 (Fri, 09 Aug 2024)

  Changed paths:
    M clang/test/Driver/linker-wrapper.c
    M clang/test/Driver/nvlink-wrapper.c
    M clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp
    M clang/tools/clang-nvlink-wrapper/ClangNVLinkWrapper.cpp
    M clang/tools/clang-nvlink-wrapper/NVLinkOpts.td

  Log Message:
  -----------
  [Clang] Simplify specifying passes via -Xoffload-linker (#102483)

Make it possible to do things like the following, regardless of whether
the offload target is nvptx or amdgpu:

```
$ clang -O1 -g -fopenmp --offload-arch=native test.c                       \
    -Xoffload-linker -mllvm=-pass-remarks=inline                           \
    -Xoffload-linker -mllvm=-force-remove-attribute=g.internalized:noinline\
    -Xoffload-linker --lto-newpm-passes='forceattrs,default<O1>'           \
    -Xoffload-linker --lto-debug-pass-manager                              \
    -foffload-lto
```

To accomplish that:

- In clang-linker-wrapper, do not forward options via `-Wl` if they
might have literal commas. Use `-Xlinker` instead.
- In clang-nvlink-wrapper, accept `--lto-debug-pass-manager` and
`--lto-newpm-passes`.
- In clang-nvlink-wrapper, drop `-passes` because it's inconsistent with
the interface of `lld`, which is used instead of clang-nvlink-wrapper
when the target is amdgpu. Without this patch, `-passes` is passed to
`nvlink`, producing an error anyway.

---------

Co-authored-by: Joseph Huber <huberjn at outlook.com>



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list