yonghong-song
3e05ab6322
[ThinLTO] Reduce the number of renaming due to promotions ( #183793 )
...
Currently for thin-lto, the imported static global values (functions,
variables, etc) will be promoted/renamed from e.g., foo() to
foo.llvm.(). Such a renaming caused difficulties in live patching
since function name is changed ([1]).
It is possible that some global value names have to be promoted to avoid
name collision and linker failure. But in practice, majority of name
promotions can be avoided.
In [2], the suggestion is that thin-lto pre-link decides whether
a particular global value needs name promotion or not. If yes, later on
in thinBackend() the name will be promoted.
I compiled a particular linux kernel version (latest bpf-next tree)
and found 1216 global values with suffix .llvm.. With this patch,
the number of promoted functions is 2, 98% reduction from the
original kernel build.
If some native objects are not participating with LTO, name promotions
have to be done to avoid potential linker issues. So the current
implementation cannot be on by default. But in certain cases, e.g., linux kernel
build, people can enable lld flag --lto-whole-program-visibility to reduce the
number of functions like foo.llvm.().
For ThinLTOCodeGenerator.cpp which is used by llvm-lto tool and a
few other rare cases, reducing the number of renaming due to promotion,
is not implemented as lld flag '-lto-whole-program-visibility' is not
supported in ThinLTOCodeGenerator.cpp for now. In summary, this pull
request only supports llvm-lto2 style workflow.
The feature is off by default. To enable the future, lld flag
'-lto-whole-program-visibility' and llvm flag
'-always-rename-promoted-locals=false' are needed.
The link [3] has more context for the pull request discussions.
[1] https://lpc.events/event/19/contributions/2212
[2] https://discourse.llvm.org/t/rfc-avoid-functions-like-foo-llvm-for-kernel-live-patch/89400
[3] https://github.com/llvm/llvm-project/pull/178587
2026-02-28 12:44:25 -08:00
..
2026-02-18 18:38:14 +00:00
2026-02-04 13:09:32 -05:00
2026-02-05 12:42:37 +00:00
2025-12-14 12:12:45 +00:00
2025-04-23 18:42:07 +08:00
2026-02-28 12:44:25 -08:00
2025-11-10 14:19:12 -08:00
2026-01-21 08:22:05 -08:00
2026-01-27 22:07:10 +00:00
2026-01-21 08:22:05 -08:00
2026-02-24 04:44:07 +00:00
2026-01-21 08:22:05 -08:00
2026-02-13 14:44:44 -05:00
2026-02-04 09:55:36 -08:00
2026-02-23 14:03:57 +00:00
2025-07-18 11:50:18 +02:00
2025-01-18 19:16:33 +01:00
2025-01-18 19:16:33 +01:00
2025-03-31 09:42:34 -07:00
2025-01-18 19:16:33 +01:00
2025-01-18 19:16:33 +01:00
2025-01-18 19:16:33 +01:00
2024-10-31 09:04:48 -07:00
2025-01-18 19:16:33 +01:00
2025-01-18 19:16:33 +01:00
2025-01-18 19:16:33 +01:00
2025-01-18 19:16:33 +01:00
2025-01-18 19:16:33 +01:00
2025-08-14 17:02:52 +02:00
2025-12-11 08:57:26 +01:00
2025-08-08 13:29:00 -07:00
2025-09-15 16:55:00 +00:00
2025-01-18 19:16:33 +01:00
2024-10-14 16:32:24 -07:00
2025-01-18 19:16:33 +01:00
2024-10-14 16:32:24 -07:00
2025-01-18 19:16:33 +01:00
2025-01-18 19:16:33 +01:00
2025-01-18 19:16:33 +01:00
2024-10-14 16:32:24 -07:00
2025-01-18 19:16:33 +01:00
2026-01-21 08:22:05 -08:00
2025-02-20 17:07:16 +00:00
2025-06-16 12:55:12 -07:00
2025-03-10 09:26:53 +00:00
2025-08-29 09:52:07 +08:00
2025-08-08 11:09:34 +02:00
2026-02-26 22:09:53 +00:00
2025-03-11 14:55:33 +00:00
2025-06-11 22:19:31 -07:00
2024-12-02 18:16:47 +02:00
2025-01-18 19:16:33 +01:00
2024-10-02 11:14:05 +01:00
2025-07-17 09:57:32 -07:00
2025-10-08 20:59:24 +02:00
2026-02-24 14:22:38 +01:00
2025-12-02 16:13:45 +01:00
2025-10-09 09:31:16 +02:00
2025-10-09 09:31:16 +02:00
2025-10-22 13:20:18 -07:00
2025-01-30 09:37:16 -08:00
2025-10-21 11:38:45 +02:00
2026-02-04 13:09:32 -05:00
2025-03-28 07:35:16 -05:00
2025-09-29 20:24:59 +05:30
2024-12-05 14:36:40 +01:00
2025-04-01 09:45:16 +01:00
2025-04-01 09:45:16 +01:00
2026-01-21 08:22:05 -08:00
2026-01-21 08:22:05 -08:00
2025-06-04 14:41:59 +00:00
2025-06-04 14:41:59 +00:00
2026-01-21 08:22:05 -08:00
2026-02-20 17:41:28 +00:00
2025-07-02 10:17:01 -07:00
2025-04-01 09:45:16 +01:00
2025-04-01 09:45:16 +01:00
2026-01-21 08:22:05 -08:00
2025-08-05 08:45:54 +01:00
2026-02-10 10:12:52 +00:00
2025-04-01 09:45:16 +01:00
2026-01-21 08:22:05 -08:00
2026-01-21 08:22:05 -08:00
2025-11-05 16:29:05 +02:00
2025-12-19 11:04:50 -08:00
2025-04-01 09:45:16 +01:00
2025-04-01 09:45:16 +01:00
2025-10-22 09:29:06 +02:00
2025-01-29 16:56:47 +01:00
2025-01-18 19:16:33 +01:00
2025-01-18 19:16:33 +01:00
2025-01-31 09:03:01 +00:00
2025-06-04 14:41:59 +00:00
2025-06-04 14:41:59 +00:00
2025-04-22 14:31:29 -05:00
2025-04-22 14:31:29 -05:00
2025-05-15 14:01:41 +01:00
2025-06-04 14:41:59 +00:00
2025-04-01 11:42:22 +01:00
2025-07-04 15:27:33 +01:00
2025-03-04 08:10:22 +00:00
2025-04-01 09:45:16 +01:00
2025-04-01 09:45:16 +01:00
2024-11-06 11:53:33 +00:00
2025-04-01 09:45:16 +01:00
2025-04-01 09:45:16 +01:00
2025-04-01 11:42:22 +01:00
2025-07-03 13:44:38 -07:00
2025-07-18 11:50:18 +02:00
2025-10-27 08:55:28 +00:00
2025-04-01 11:42:22 +01:00
2025-04-01 11:42:22 +01:00
2025-07-04 15:27:33 +01:00
2025-04-01 11:42:22 +01:00
2025-04-18 02:11:02 +01:00
2025-01-29 16:56:47 +01:00
2026-01-21 08:22:05 -08:00
2025-06-02 17:47:12 -04:00
2025-08-28 16:49:16 +01:00
2026-02-14 15:59:04 +01:00
2026-01-21 08:22:05 -08:00
2025-08-01 11:03:21 -07:00
2025-04-14 14:26:10 -07:00
2026-01-22 08:02:45 -06:00
2025-09-26 23:58:45 +08:00
2024-10-09 09:16:55 +08:00
2025-10-21 11:38:45 +02:00
2026-01-21 08:22:05 -08:00
2024-12-10 15:57:55 +00:00
2025-10-21 11:38:45 +02:00
2025-06-10 09:50:46 -07:00
2025-09-23 20:35:43 -07:00
2025-12-10 15:18:09 -08:00
2026-02-20 13:34:17 -08:00
2024-10-17 20:28:47 -05:00
2025-10-21 11:38:45 +02:00
2025-11-06 19:10:36 -08:00
2026-01-06 10:54:55 -08:00
2025-11-12 10:39:30 +00:00
2026-02-03 14:15:16 -05:00
2026-02-03 14:15:16 -05:00
2025-02-27 08:06:58 -08:00
2025-12-03 11:24:56 -08:00
2026-02-18 10:16:31 -08:00
2025-01-18 19:16:33 +01:00
2025-01-18 19:16:33 +01:00
2026-01-21 08:22:05 -08:00
2025-11-12 10:39:30 +00:00
2025-11-12 10:39:30 +00:00
2025-11-24 18:49:41 +00:00
2025-11-12 10:39:30 +00:00
2025-11-12 10:39:30 +00:00
2024-10-08 16:26:55 +08:00
2025-11-12 10:39:30 +00:00
2025-11-15 15:51:06 +01:00
2025-10-10 15:56:29 +08:00
2025-11-10 14:19:12 -08:00
2025-07-01 09:06:41 +02:00
2025-06-26 17:20:27 -07:00
2025-01-18 19:16:33 +01:00
2026-01-06 10:57:59 +00:00
2025-02-05 15:15:36 -08:00
2024-11-14 14:35:40 -08:00
2024-12-20 10:07:44 -08:00
2025-12-30 14:49:30 -08:00
2026-01-21 10:04:24 +01:00
2024-11-04 16:45:05 +08:00
2025-02-20 10:56:02 +01:00
2025-06-19 13:24:39 +01:00
2026-01-05 19:38:44 +01:00
2026-01-05 19:38:44 +01:00
2025-09-05 14:51:54 +00:00
2025-09-15 16:55:00 +00:00
2025-08-09 05:06:53 -03:00
2025-03-08 06:06:14 +01:00
2026-02-20 13:34:17 -08:00
2025-10-20 08:50:09 +00:00
2025-10-21 11:38:45 +02:00
2025-10-21 11:38:45 +02:00
2025-01-18 19:16:33 +01:00
2025-11-17 06:32:26 +00:00
2025-09-15 16:55:00 +00:00
2026-01-25 16:29:23 +00:00
2025-11-04 12:00:44 +00:00
2026-01-12 10:01:57 +01:00
2026-02-10 10:12:52 +00:00
2025-10-27 08:03:33 -07:00
2025-06-04 14:41:59 +00:00
2024-10-22 17:03:51 +08:00
2025-11-06 07:31:30 +08:00
2026-02-04 13:09:32 -05:00
2026-02-04 13:09:32 -05:00
2025-10-10 15:26:08 +05:30
2025-11-01 17:51:17 +00:00
2025-11-01 17:51:17 +00:00
2026-02-10 18:11:54 +00:00
2026-02-10 18:11:54 +00:00
2025-06-25 10:57:48 +02:00
2026-02-25 10:10:59 +00:00
2025-08-07 13:07:04 -07:00
2025-11-27 11:36:43 +00:00
2026-02-12 17:39:22 +00:00
2024-11-06 11:53:33 +00:00
2025-10-19 19:25:00 +01:00
2026-02-27 13:36:06 +02:00
2025-08-13 21:57:00 +03:00
2025-10-21 08:02:52 -07:00
2025-10-21 08:02:52 -07:00
2025-10-21 08:02:52 -07:00
2025-10-21 08:02:52 -07:00
2025-10-21 08:02:52 -07:00
2025-09-14 10:09:46 -07:00
2025-04-12 15:35:45 +08:00
2025-04-12 15:35:45 +08:00
2025-04-12 15:35:45 +08:00
2025-04-12 15:35:45 +08:00
2025-04-12 15:35:45 +08:00
2025-04-12 15:35:45 +08:00
2025-04-12 15:35:45 +08:00
2025-04-12 15:35:45 +08:00
2025-04-12 15:35:45 +08:00
2025-04-12 15:35:45 +08:00
2025-04-12 15:35:45 +08:00
2025-04-12 15:35:45 +08:00
2025-04-11 09:04:23 +08:00
2025-01-09 09:23:23 +01:00
2025-10-07 17:19:48 +02:00
2025-01-09 09:23:23 +01:00
2025-01-09 09:23:23 +01:00
2025-01-18 19:16:33 +01:00
2025-04-09 19:46:59 -07:00
2025-04-04 10:58:08 -07:00
2025-04-09 19:46:59 -07:00
2025-04-04 10:58:08 -07:00
2025-09-13 02:18:58 +00:00
2025-09-13 02:18:58 +00:00
2025-11-26 17:29:48 -08:00
2026-02-26 09:02:24 -08:00
2025-12-04 15:22:22 -08:00
2025-06-04 11:19:26 -07:00
2025-06-04 11:19:26 -07:00
2025-01-18 19:16:33 +01:00
2025-09-12 18:37:59 +02:00
2025-01-02 23:01:28 -08:00
2026-01-07 09:49:30 +00:00
2024-10-15 10:37:36 -07:00
2025-09-02 11:16:21 -05:00
2025-11-19 11:41:06 -08:00
2025-09-26 18:19:21 +02:00
2026-02-06 15:46:19 +00:00
2024-11-06 11:53:33 +00:00
2025-01-18 19:16:33 +01:00
2024-11-12 13:34:29 -08:00
2025-10-06 10:41:46 -07:00
2025-10-06 10:41:46 -07:00
2025-10-06 10:41:46 -07:00
2025-03-26 06:07:41 +01:00
2026-01-21 08:22:05 -08:00
2024-10-14 16:32:24 -07:00
2025-12-11 05:54:09 +01:00
2025-12-11 05:54:09 +01:00
2025-12-11 05:54:09 +01:00
2025-12-11 05:54:09 +01:00
2026-02-05 13:31:26 +00:00
2026-02-05 13:31:26 +00:00
2024-10-14 16:32:24 -07:00
2025-05-14 22:21:09 +03:00
2025-05-14 22:21:09 +03:00
2025-08-08 11:09:34 +02:00
2025-05-14 22:21:09 +03:00
2025-10-08 17:48:46 +01:00
2025-11-03 22:09:09 +00:00
2025-01-18 19:16:33 +01:00
2025-07-11 07:28:03 -04:00
2025-06-16 15:06:41 -07:00
2025-10-21 11:38:45 +02:00
2025-01-18 19:16:33 +01:00
2025-03-05 11:04:52 +01:00
2025-11-07 09:30:53 -05:00
2026-01-29 07:16:14 -08:00
2026-01-09 15:32:13 +01:00
2025-07-17 09:57:32 -07:00
2025-01-28 22:51:30 +00:00
2025-01-28 12:30:31 +00:00
2025-01-28 19:34:41 +00:00
2025-03-19 08:29:04 +07:00
2025-01-28 12:30:31 +00:00
2025-01-28 12:30:31 +00:00
2025-01-28 19:34:41 +00:00
2025-01-28 18:25:32 +00:00
2025-01-28 12:30:31 +00:00
2025-01-28 19:34:41 +00:00
2025-01-28 12:30:31 +00:00
2025-06-27 13:46:54 -07:00
2025-02-28 12:26:29 -08:00
2026-01-06 13:09:20 +02:00
2024-10-14 16:32:24 -07:00
2024-10-14 15:49:01 +08:00
2026-01-21 10:04:24 +01:00
2024-10-28 12:48:42 -04:00
2026-02-09 08:43:33 +08:00
2025-10-10 15:56:29 +08:00
2025-12-12 19:22:40 +02:00
2025-12-12 19:22:40 +02:00
2025-12-12 19:22:40 +02:00
2025-05-09 19:23:48 +08:00
2024-10-14 16:32:24 -07:00
2025-12-08 21:56:35 +05:30
2026-02-11 07:19:43 -06:00
2025-02-21 12:49:32 -08:00
2024-11-14 17:34:00 +01:00
2026-02-03 14:15:16 -05:00
2024-12-05 10:17:15 -08:00
2025-01-18 19:16:33 +01:00
2025-01-30 09:51:43 -08:00
2024-10-14 16:32:24 -07:00
2025-10-14 11:53:42 +02:00
2025-09-18 14:44:04 +00:00
2025-09-04 09:29:31 -07:00
2025-01-28 09:57:00 +01:00
2025-04-07 09:18:47 +02:00
2026-01-21 08:22:05 -08:00
2025-08-28 07:04:21 +02:00
2025-02-06 10:54:22 +08:00
2025-09-13 02:18:58 +00:00
2025-12-03 15:09:04 -08:00
2025-09-13 02:18:58 +00:00
2025-12-04 15:22:22 -08:00
2025-09-02 16:37:19 +00:00
2025-11-04 12:00:44 +00:00
2025-08-08 11:09:34 +02:00
2025-08-08 11:09:34 +02:00
2026-01-22 14:22:44 +00:00
2025-08-08 11:09:34 +02:00
2026-01-20 14:49:35 -05:00
2024-10-14 16:32:24 -07:00
2024-10-14 16:32:24 -07:00
2025-05-09 14:56:38 -07:00
2025-06-25 11:22:59 +01:00
2025-07-15 13:22:33 -04:00
2025-12-02 16:13:45 +01:00
2026-02-19 13:54:33 -08:00
2025-09-14 00:40:12 +03:00
2026-02-11 08:33:29 +08:00
2026-01-21 08:22:05 -08:00
2025-10-21 11:38:45 +02:00
2025-11-04 12:00:44 +00:00
2025-12-20 17:21:04 -05:00
2024-12-04 10:53:04 +00:00
2024-11-06 11:53:33 +00:00
2024-10-21 12:30:03 +02:00
2025-11-25 17:21:57 +01:00
2025-04-17 09:55:41 -07:00
2025-04-17 09:52:41 -07:00
2026-01-21 08:22:05 -08:00
2025-01-20 12:41:02 +01:00
2025-01-20 12:41:02 +01:00
2025-12-12 19:22:40 +02:00
2026-01-21 08:22:05 -08:00
2025-07-29 10:01:43 -07:00
2025-11-05 14:43:40 +08:00
2025-01-20 12:38:38 +01:00
2025-09-15 16:55:00 +00:00
2025-12-16 09:40:34 +08:00
2024-11-20 19:15:23 -08:00
2025-01-18 19:16:33 +01:00
2025-01-18 19:16:33 +01:00
2024-10-25 09:34:08 +01:00
2024-11-06 11:53:33 +00:00
2025-07-16 16:51:58 -07:00
2025-08-08 11:09:34 +02:00
2026-02-10 18:11:54 +00:00
2025-01-18 19:16:33 +01:00
2025-08-18 11:12:33 +02:00
2025-03-07 08:05:19 -08:00
2025-10-06 10:41:46 -07:00
2026-02-19 13:54:33 -08:00
2026-02-19 13:54:33 -08:00
2026-02-19 13:54:33 -08:00
2026-02-19 13:54:33 -08:00
2026-02-19 13:54:33 -08:00
2026-02-19 13:54:33 -08:00
2025-04-18 12:48:16 +02:00
2025-08-25 20:08:32 +08:00
2025-08-14 17:02:52 +02:00
2026-02-08 05:00:29 +00:00
2025-02-27 09:03:17 +07:00
2026-01-21 08:22:05 -08:00
2026-01-07 09:49:30 +00:00
2025-04-02 21:53:55 +00:00
2024-10-31 21:28:13 -07:00
2025-10-06 10:41:46 -07:00
2025-10-21 11:38:45 +02:00
2025-04-10 00:48:18 +08:00
2024-11-06 11:53:33 +00:00
2025-11-05 16:29:05 +02:00
2025-06-25 06:44:19 -04:00
2026-01-23 14:46:31 -05:00
2026-01-23 14:46:31 -05:00
2025-04-08 11:36:48 +02:00
2026-02-24 14:15:15 -08:00
2025-02-08 17:25:07 -05:00
2025-05-08 10:51:38 -07:00
2025-11-24 07:51:55 -05:00
2024-12-05 11:34:29 +03:00
2026-01-21 08:22:05 -08:00
2026-02-03 18:03:37 +01:00
2024-12-16 10:24:09 +03:00
2025-08-13 22:01:24 -07:00
2025-04-15 12:54:25 -07:00
2025-04-15 12:54:25 -07:00
2025-04-15 12:54:25 -07:00
2025-05-09 13:12:09 -07:00
2026-01-21 08:22:05 -08:00
2026-01-21 08:22:05 -08:00
2026-01-21 08:22:05 -08:00
2026-02-05 10:53:54 +01:00
2025-08-20 14:51:40 +01:00
2024-10-26 13:06:11 +01:00
2024-10-26 13:06:11 +01:00
2024-11-25 07:22:45 -08:00
2025-04-02 16:05:44 +03:00
2025-06-02 17:48:59 -04:00
2025-10-21 11:38:45 +02:00
2025-11-18 11:10:58 +00:00
2024-12-17 15:13:42 +00:00
2025-01-07 15:06:26 +00:00
2025-11-22 02:10:49 +03:00
2026-02-04 13:09:32 -05:00
2025-10-21 05:47:26 -05:00
2025-03-31 09:42:34 -07:00
2025-02-14 11:20:45 +00:00
2024-10-17 19:06:47 -07:00
2026-01-27 19:28:32 +00:00
2025-01-18 19:16:33 +01:00
2025-01-18 19:16:33 +01:00
2025-11-17 10:18:22 -05:00
2025-01-29 16:56:47 +01:00
2025-09-23 16:14:26 -07:00
2025-01-18 19:16:33 +01:00
2025-09-14 10:09:46 -07:00
2026-02-04 13:09:32 -05:00
2025-09-05 14:08:59 +00:00
2025-09-11 11:06:20 -05:00
2026-02-07 09:38:10 +05:30
2026-01-20 09:54:47 -06:00
2025-08-25 17:10:00 +05:30
2025-08-25 17:10:00 +05:30
2025-08-25 17:10:00 +05:30
2025-08-25 17:10:00 +05:30
2025-06-05 13:37:18 +02:00
2025-10-21 11:38:45 +02:00
2025-10-21 11:38:45 +02:00
2024-12-04 20:55:18 +00:00
2025-10-21 11:38:45 +02:00
2025-10-21 11:38:45 +02:00
2025-10-21 11:38:45 +02:00
2025-10-21 11:38:45 +02:00
2025-08-08 11:09:34 +02:00
2025-08-08 11:09:34 +02:00
2025-08-02 20:08:53 +00:00
2025-10-06 10:41:46 -07:00
2026-02-28 12:44:25 -08:00
2025-01-29 16:56:47 +01:00
2025-06-02 17:08:04 -04:00
2026-02-05 12:42:37 +00:00
2026-02-05 12:42:37 +00:00
2025-09-15 16:55:00 +00:00
2025-01-09 09:23:23 +01:00
2025-05-28 11:12:53 -04:00
2025-04-04 10:58:08 -07:00
2025-05-29 19:38:33 -04:00
2024-11-03 23:57:47 -08:00
2024-11-04 16:00:22 -08:00
2025-10-15 13:46:39 -07:00
2025-08-28 16:49:16 +01:00
2024-10-14 16:32:24 -07:00
2025-10-06 13:44:05 -07:00
2025-09-10 16:51:58 +02:00
2025-01-18 19:16:33 +01:00
2025-06-05 10:52:01 -07:00
2026-01-19 12:19:15 -06:00
2025-03-15 11:01:53 -04:00
2024-11-06 11:53:33 +00:00
2025-01-18 19:16:33 +01:00
2024-11-06 11:53:33 +00:00
2025-09-15 10:09:10 -05:00
2024-11-06 11:53:33 +00:00
2025-03-07 10:09:06 -06:00
2026-01-21 08:22:05 -08:00
2025-06-26 14:54:15 +02:00
2025-09-15 16:55:00 +00:00
2025-09-15 16:55:00 +00:00
2025-08-12 16:12:49 -07:00
2026-01-21 10:04:24 +01:00
2026-01-21 08:22:05 -08:00
2026-01-21 08:22:05 -08:00
2026-01-21 08:22:05 -08:00
2025-04-10 08:12:14 -04:00
2025-02-03 09:37:16 +00:00
2026-01-23 14:46:31 -05:00
2026-01-23 14:46:31 -05:00