[llvm] [RelLookupTableConverter] Drop unnamed_addr to avoid generating GOTPCREL relocations (PR #142304)

LLVM Continuous Integration via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 1 07:34:12 PDT 2025


llvm-ci wrote:

LLVM Buildbot has detected a new failure on builder `llvm-clang-x86_64-sie-win` running on `sie-win-worker` while building `llvm` at step 7 "test-build-unified-tree-check-all".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/46/builds/17728

<details>
<summary>Here is the relevant piece of the build log for the reference</summary>

```
Step 7 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'LLVM :: Transforms/RelLookupTableConverter/unnamed_addr.ll' FAILED ********************
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 2
z:\b\llvm-clang-x86_64-sie-win\build\bin\opt.exe < Z:\b\llvm-clang-x86_64-sie-win\llvm-project\llvm\test\Transforms\RelLookupTableConverter\unnamed_addr.ll -passes=rel-lookup-table-converter -relocation-model=pic -mtriple=x86_64-apple-darwin -S | z:\b\llvm-clang-x86_64-sie-win\build\bin\filecheck.exe -check-prefix=x86_64-apple-darwin Z:\b\llvm-clang-x86_64-sie-win\llvm-project\llvm\test\Transforms\RelLookupTableConverter\unnamed_addr.ll
# executed command: 'z:\b\llvm-clang-x86_64-sie-win\build\bin\opt.exe' -passes=rel-lookup-table-converter -relocation-model=pic -mtriple=x86_64-apple-darwin -S
# note: command had no output on stdout or stderr
# executed command: 'z:\b\llvm-clang-x86_64-sie-win\build\bin\filecheck.exe' -check-prefix=x86_64-apple-darwin 'Z:\b\llvm-clang-x86_64-sie-win\llvm-project\llvm\test\Transforms\RelLookupTableConverter\unnamed_addr.ll'
# note: command had no output on stdout or stderr
# RUN: at line 3
z:\b\llvm-clang-x86_64-sie-win\build\bin\opt.exe < Z:\b\llvm-clang-x86_64-sie-win\llvm-project\llvm\test\Transforms\RelLookupTableConverter\unnamed_addr.ll -passes=rel-lookup-table-converter -relocation-model=pic -mtriple=aarch64 -S | z:\b\llvm-clang-x86_64-sie-win\build\bin\filecheck.exe -check-prefix=aarch64 Z:\b\llvm-clang-x86_64-sie-win\llvm-project\llvm\test\Transforms\RelLookupTableConverter\unnamed_addr.ll
# executed command: 'z:\b\llvm-clang-x86_64-sie-win\build\bin\opt.exe' -passes=rel-lookup-table-converter -relocation-model=pic -mtriple=aarch64 -S
# .---command stderr------------
# | z:\b\llvm-clang-x86_64-sie-win\build\bin\opt.exe: warning: failed to infer data layout: unable to get target for 'aarch64', see --version and --triple.
# | z:\b\llvm-clang-x86_64-sie-win\build\bin\opt.exe: WARNING: failed to create target machine for 'aarch64': unable to get target for 'aarch64', see --version and --triple.
# `-----------------------------
# executed command: 'z:\b\llvm-clang-x86_64-sie-win\build\bin\filecheck.exe' -check-prefix=aarch64 'Z:\b\llvm-clang-x86_64-sie-win\llvm-project\llvm\test\Transforms\RelLookupTableConverter\unnamed_addr.ll'
# .---command stderr------------
# | Z:\b\llvm-clang-x86_64-sie-win\llvm-project\llvm\test\Transforms\RelLookupTableConverter\unnamed_addr.ll:36:12: error: aarch64: expected string not found in input
# | ; aarch64: @a0 = private constant i32 0
# |            ^
# | <stdin>:1:1: note: scanning from here
# | ; ModuleID = '<stdin>'
# | ^
# | <stdin>:5:22: note: possible intended match here
# |  at a0 = private unnamed_addr constant i32 0
# |                      ^
# | Z:\b\llvm-clang-x86_64-sie-win\llvm-project\llvm\test\Transforms\RelLookupTableConverter\unnamed_addr.ll:73:17: error: aarch64-NEXT: expected string not found in input
# | ; aarch64-NEXT: [[RELTABLE_SHIFT:%.*]] = shl i64 [[OFFSET]], 2
# |                 ^
# | <stdin>:19:43: note: scanning from here
# | define ptr @load_relative_1(i64 %offset) {
# |                                           ^
# | <stdin>:19:43: note: with "OFFSET" equal to "%offset"
# | define ptr @load_relative_1(i64 %offset) {
# |                                           ^
# | <stdin>:20:59: note: possible intended match here
# |  %gep = getelementptr inbounds [3 x ptr], ptr @load_relative_1.table, i64 0, i64 %offset
# |                                                           ^
# | Z:\b\llvm-clang-x86_64-sie-win\llvm-project\llvm\test\Transforms\RelLookupTableConverter\unnamed_addr.ll:97:17: error: aarch64-NEXT: expected string not found in input
# | ; aarch64-NEXT: [[RELTABLE_SHIFT:%.*]] = shl i64 [[OFFSET]], 2
# |                 ^
# | <stdin>:25:43: note: scanning from here
# | define ptr @load_relative_2(i64 %offset) {
# |                                           ^
# | <stdin>:25:43: note: with "OFFSET" equal to "%offset"
# | define ptr @load_relative_2(i64 %offset) {
# |                                           ^
...

```

</details>

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


More information about the llvm-commits mailing list