Paul Kirth
610fc5cbcc
[clang] Preliminary fat-lto-object support
...
Fat LTO objects contain both LTO compatible IR, as well as generated
object code. This allows users to defer the choice of whether to use LTO
or not to link-time. This is a feature available in GCC for some time,
and makes the existing -ffat-lto-objects flag functional in the same
way as GCC's.
This patch adds support for that flag in the driver, as well as setting the
necessary codegen options for the backend. Largely, this means we select
the newly added pass pipeline for generating fat objects.
Users are expected to pass -ffat-lto-objects to clang in addition to one
of the -flto variants. Without the -flto flag, -ffat-lto-objects has no
effect.
// Compile and link. Use the object code from the fat object w/o LTO.
clang -fno-lto -ffat-lto-objects -fuse-ld=lld foo.c
// Compile and link. Select full LTO at link time.
clang -flto -ffat-lto-objects -fuse-ld=lld foo.c
// Compile and link. Select ThinLTO at link time.
clang -flto=thin -ffat-lto-objects -fuse-ld=lld foo.c
// Compile and link. Use ThinLTO with the UnifiedLTO pipeline.
clang -flto=thin -ffat-lto-objects -funified-lto -fuse-ld=lld foo.c
// Compile and link. Use full LTO with the UnifiedLTO pipeline.
clang -flto -ffat-lto-objects -funified-lto -fuse-ld=lld foo.c
// Link separately, using ThinLTO.
clang -c -flto=thin -ffat-lto-objects foo.c
clang -flto=thin -fuse-ld=lld foo.o -ffat-lto-objects # pass --lto=thin --fat-lto-objects to ld.lld
// Link separately, using full LTO.
clang -c -flto -ffat-lto-objects foo.c
clang -flto -fuse-ld=lld foo.o # pass --lto=full --fat-lto-objects to ld.lld
Original RFC: https://discourse.llvm.org/t/rfc-ffat-lto-objects-support/63977
Depends on D146776
Reviewed By: tejohnson, MaskRay
Differential Revision: https://reviews.llvm.org/D146777
2023-07-17 16:26:21 +00:00
..
2023-06-13 00:53:31 -05:00
2023-05-28 21:08:13 -04:00
2023-06-13 00:53:31 -05:00
2023-05-31 15:57:44 +00:00
2023-05-16 17:44:24 +00:00
2023-01-11 14:08:06 +00:00
2023-06-13 12:43:46 +01:00
2023-03-15 16:44:49 +08:00
2023-05-19 08:44:12 -04:00
2023-06-13 00:53:31 -05:00
2023-07-10 14:14:16 +01:00
2023-07-17 08:58:29 -07:00
2023-06-13 17:12:04 +01:00
2023-02-16 15:48:10 +01:00
2023-06-10 15:53:13 +02:00
2023-07-11 21:34:53 +07:00
2022-12-14 17:03:27 +01:00
2022-12-06 06:58:39 -08:00
2023-01-19 18:04:00 -08:00
2022-12-06 13:15:48 -08:00
2023-07-07 08:41:11 -04:00
2023-07-07 08:41:11 -04:00
2023-07-07 08:41:11 -04:00
2023-07-07 08:41:11 -04:00
2023-07-07 08:41:11 -04:00
2023-07-07 08:41:11 -04:00
2023-07-07 08:41:11 -04:00
2023-07-07 08:41:11 -04:00
2023-07-07 08:41:11 -04:00
2023-07-07 08:41:11 -04:00
2023-06-23 11:54:29 +01:00
2023-06-27 20:02:52 -07:00
2023-06-27 19:21:41 -07:00
2023-06-27 19:21:41 -07:00
2023-06-29 09:06:00 +01:00
2023-06-27 19:21:41 -07:00
2023-06-27 19:21:41 -07:00
2023-06-29 09:06:00 +01:00
2023-03-07 14:43:50 +00:00
2023-03-20 12:53:24 +03:00
2023-06-13 00:53:31 -05:00
2023-02-01 13:07:47 -05:00
2023-06-27 20:02:52 -07:00
2022-12-21 11:54:05 +08:00
2022-12-21 11:54:05 +08:00
2022-12-15 12:00:53 +00:00
2023-07-07 12:31:55 +01:00
2022-12-21 11:54:05 +08:00
2022-12-21 11:54:05 +08:00
2022-12-21 11:54:05 +08:00
2022-12-12 17:24:40 +01:00
2022-12-21 11:54:05 +08:00
2022-12-15 12:00:53 +00:00
2022-12-21 11:54:05 +08:00
2022-12-21 11:02:27 -08:00
2023-06-23 11:54:29 +01:00
2023-07-11 21:34:53 +07:00
2023-03-07 14:43:50 +00:00
2023-01-11 14:08:06 +00:00
2023-01-11 14:08:06 +00:00
2023-01-11 14:08:06 +00:00
2023-01-11 14:08:06 +00:00
2023-01-11 14:08:06 +00:00
2023-01-23 15:24:30 +00:00
2023-01-19 15:37:50 +00:00
2023-03-30 16:46:47 +01:00
2023-02-01 09:21:07 +00:00
2022-12-15 12:00:53 +00:00
2023-04-04 09:01:24 -07:00
2023-04-04 09:01:24 -07:00
2023-01-20 20:47:43 +07:00
2023-02-17 09:29:12 +01:00
2023-02-06 19:53:13 +00:00
2023-02-17 09:29:12 +01:00
2023-02-17 09:29:12 +01:00
2023-06-30 09:07:23 -04:00
2023-02-16 15:48:10 +01:00
2023-03-06 08:59:02 -08:00
2023-07-07 08:41:11 -04:00
2022-12-08 20:44:40 +00:00
2022-12-08 20:44:40 +00:00
2022-12-07 18:29:18 +00:00
2023-02-17 09:49:03 +01:00
2023-02-13 19:26:11 +00:00
2023-06-08 17:41:27 +02:00
2023-03-16 07:16:41 -04:00
2023-07-07 08:41:11 -04:00
2023-03-16 07:16:41 -04:00
2023-07-07 08:41:11 -04:00
2023-02-17 11:56:00 +01:00
2023-07-11 10:42:25 -07:00
2023-01-16 12:19:29 +01:00
2023-03-16 07:16:41 -04:00
2023-07-07 08:41:11 -04:00
2023-07-07 08:41:11 -04:00
2023-07-07 08:41:11 -04:00
2023-07-07 08:41:11 -04:00
2023-06-27 19:21:41 -07:00
2023-06-27 19:21:41 -07:00
2023-02-17 11:16:35 +01:00
2023-06-27 19:21:41 -07:00
2023-07-07 08:41:11 -04:00
2022-12-08 23:54:03 +03:00
2023-01-17 10:05:38 +01:00
2023-02-17 11:16:35 +01:00
2023-03-16 07:16:41 -04:00
2022-12-12 17:11:46 +01:00
2023-03-16 07:16:41 -04:00
2023-07-07 08:41:11 -04:00
2023-03-16 07:16:41 -04:00
2023-07-11 15:13:57 -07:00
2023-07-07 08:41:11 -04:00
2023-02-16 17:58:34 -08:00
2023-02-16 17:58:34 -08:00
2023-07-07 08:41:11 -04:00
2023-07-07 08:41:11 -04:00
2023-07-07 08:41:11 -04:00
2023-04-04 13:44:45 +01:00
2023-02-17 11:56:00 +01:00
2023-02-17 11:56:00 +01:00
2023-07-07 08:41:11 -04:00
2023-03-23 16:30:07 -05:00
2022-12-12 17:24:40 +01:00
2023-06-13 00:53:31 -05:00
2023-06-12 18:38:47 +02:00
2023-07-07 08:41:11 -04:00
2023-07-05 17:32:00 +08:00
2023-07-07 13:47:33 +08:00
2023-07-05 17:32:00 +08:00
2023-05-17 16:09:12 -07:00
2023-03-06 08:59:02 -08:00
2023-03-06 08:59:02 -08:00
2023-06-27 01:15:45 +03:00
2023-01-05 14:36:36 -08:00
2023-04-28 15:41:17 -07:00
2023-07-13 10:45:31 -07:00
2023-06-13 00:53:31 -05:00
2023-06-08 09:13:43 -07:00
2023-04-28 15:41:17 -07:00
2023-06-16 16:41:15 -07:00
2023-05-23 13:42:55 +01:00
2023-06-30 13:19:15 +08:00
2023-02-17 11:56:00 +01:00
2023-01-05 20:27:32 +08:00
2023-05-23 13:42:55 +01:00
2023-06-30 13:19:15 +08:00
2023-06-30 13:19:15 +08:00
2023-07-07 08:41:11 -04:00
2023-02-16 15:48:10 +01:00
2023-02-17 11:56:00 +01:00
2023-07-07 08:41:11 -04:00
2023-02-17 09:29:12 +01:00
2023-07-07 08:41:11 -04:00
2023-07-07 08:41:11 -04:00
2023-07-07 08:41:11 -04:00
2023-07-07 08:41:11 -04:00
2023-07-07 08:41:11 -04:00
2023-07-07 08:41:11 -04:00
2023-02-17 11:56:00 +01:00
2023-02-17 11:56:00 +01:00
2023-02-17 14:26:07 +01:00
2023-02-17 14:26:07 +01:00
2023-02-17 14:26:07 +01:00
2023-02-17 14:26:07 +01:00
2023-02-17 14:26:07 +01:00
2023-02-17 14:26:07 +01:00
2023-01-06 22:48:52 -08:00
2023-01-21 22:33:15 -08:00
2023-07-11 21:34:53 +07:00
2023-07-11 21:34:53 +07:00
2023-03-15 11:13:55 +08:00
2023-03-23 16:35:30 -07:00
2023-07-07 08:41:11 -04:00
2023-02-16 15:48:10 +01:00
2023-07-07 08:41:11 -04:00
2023-07-07 08:41:11 -04:00
2023-02-17 11:56:00 +01:00
2023-02-17 11:56:00 +01:00
2023-02-17 11:56:00 +01:00
2023-02-17 11:56:00 +01:00
2022-12-16 14:42:27 +00:00
2023-02-17 11:56:00 +01:00
2023-02-17 11:56:00 +01:00
2023-06-23 19:52:06 -04:00
2022-12-05 11:42:41 +08:00
2023-02-17 14:26:07 +01:00
2022-12-19 15:22:39 +08:00
2023-06-20 11:38:37 +01:00
2023-05-23 08:29:52 +02:00
2023-03-28 08:48:10 +02:00
2023-03-15 08:41:45 +00:00
2023-02-16 15:48:10 +01:00
2023-06-28 11:57:13 -07:00
2023-07-07 08:41:11 -04:00
2023-02-17 18:48:48 -08:00
2022-12-24 11:41:17 +08:00
2023-07-11 21:34:53 +07:00
2023-04-27 14:41:10 +01:00
2023-07-07 08:41:11 -04:00
2023-07-07 08:41:11 -04:00
2023-02-17 14:26:07 +01:00
2022-12-20 13:59:16 +05:00
2023-07-07 08:41:11 -04:00
2023-02-17 14:26:07 +01:00
2023-02-17 14:26:07 +01:00
2023-02-17 14:26:07 +01:00
2023-02-17 14:26:07 +01:00
2023-02-17 14:26:07 +01:00
2023-06-12 17:39:44 -04:00
2023-06-12 17:39:44 -04:00
2023-02-17 14:26:07 +01:00
2023-02-17 14:26:07 +01:00
2023-02-17 14:26:07 +01:00
2023-02-17 14:26:07 +01:00
2023-02-17 14:26:07 +01:00
2023-02-17 14:26:07 +01:00
2023-02-17 14:26:07 +01:00
2023-03-10 14:43:42 +01:00
2023-02-08 22:24:19 +00:00
2023-02-08 22:24:19 +00:00
2023-07-07 08:41:11 -04:00
2023-07-07 08:41:11 -04:00
2022-12-05 22:58:29 -08:00
2022-12-12 17:24:40 +01:00
2023-01-26 11:33:19 +01:00
2023-05-17 16:09:12 -07:00
2023-05-18 11:31:39 -07:00
2023-06-29 09:06:00 +01:00
2023-07-07 08:41:11 -04:00
2022-12-12 17:11:46 +01:00
2023-03-15 01:13:08 -04:00
2023-01-24 16:40:11 +07:00
2023-07-07 08:41:11 -04:00
2023-03-10 14:43:42 +01:00
2023-07-07 08:41:11 -04:00
2023-07-07 08:41:11 -04:00
2023-03-10 14:43:42 +01:00
2023-06-06 17:07:19 -04:00
2023-03-28 10:07:32 +02:00
2023-07-07 08:41:11 -04:00
2023-03-07 13:22:18 +00:00
2023-05-09 09:49:42 +02:00
2023-06-20 13:08:47 +02:00
2023-07-07 08:41:11 -04:00
2023-07-06 12:59:05 -07:00
2023-07-07 08:41:11 -04:00
2023-07-07 08:41:11 -04:00
2023-06-14 15:28:33 -07:00
2022-12-12 22:36:23 +00:00
2022-12-25 21:01:02 -05:00
2023-07-07 08:41:11 -04:00
2023-04-17 13:07:42 -04:00
2023-05-19 08:44:12 -04:00
2023-06-20 13:08:47 +02:00
2023-06-20 13:08:47 +02:00
2023-07-07 08:41:11 -04:00
2023-04-25 15:12:17 -07:00
2023-05-02 11:56:23 -04:00
2023-07-07 08:41:11 -04:00
2023-04-29 08:44:59 -04:00
2023-04-29 08:44:59 -04:00
2023-07-07 08:41:11 -04:00
2023-06-08 17:41:27 +02:00
2023-05-24 20:16:42 +01:00
2023-06-08 17:41:27 +02:00
2023-07-07 08:41:11 -04:00
2023-05-23 09:49:57 -07:00
2023-02-21 14:54:23 -05:00
2023-07-11 15:13:57 -07:00
2023-03-10 14:43:42 +01:00
2023-07-07 08:41:11 -04:00
2023-07-07 08:41:11 -04:00
2023-07-07 08:41:11 -04:00
2022-12-06 11:02:27 +08:00
2023-05-02 08:23:22 -04:00
2023-07-07 08:41:11 -04:00
2023-03-10 14:43:42 +01:00
2023-07-17 16:26:21 +00:00
2023-02-23 09:05:59 -08:00
2023-07-07 15:28:21 -04:00
2023-03-15 01:13:08 -04:00
2023-03-15 01:13:08 -04:00
2023-07-13 11:49:00 +07:00
2023-07-07 08:41:11 -04:00
2023-03-15 01:13:08 -04:00
2023-07-07 08:41:11 -04:00
2023-07-07 08:41:11 -04:00
2023-07-07 08:41:11 -04:00
2023-02-16 15:48:10 +01:00
2023-07-07 08:41:11 -04:00
2023-03-10 14:43:42 +01:00
2023-07-10 14:14:16 +01:00
2023-03-10 14:43:42 +01:00
2023-07-07 08:41:11 -04:00
2023-03-10 14:43:42 +01:00
2022-12-21 08:27:24 -05:00
2023-03-10 14:43:42 +01:00
2023-02-06 14:26:32 -08:00
2023-07-07 08:41:11 -04:00
2023-04-27 09:39:08 -07:00
2023-05-29 10:02:18 +02:00
2023-07-07 08:41:11 -04:00
2022-12-12 17:11:46 +01:00
2023-07-07 08:41:11 -04:00
2023-07-11 21:34:53 +07:00
2023-02-08 22:24:19 +00:00
2023-07-07 16:50:30 +00:00
2023-07-15 16:13:48 -04:00
2023-03-17 09:23:34 +01:00
2023-07-07 08:41:11 -04:00
2023-01-03 19:42:46 -05:00
2023-06-09 11:28:14 -07:00
2023-06-20 08:02:58 -05:00
2023-06-20 08:02:58 -05:00
2023-01-03 19:42:46 -05:00
2023-03-15 13:07:55 -07:00
2023-03-10 14:43:42 +01:00
2023-06-30 09:07:23 -04:00
2023-06-30 09:07:23 -04:00
2023-02-17 15:08:50 +01:00
2023-03-10 14:43:42 +01:00
2023-03-15 01:13:08 -04:00
2023-03-10 14:43:42 +01:00
2023-03-10 14:43:42 +01:00
2023-05-30 10:58:06 -07:00
2022-12-08 23:54:03 +03:00
2023-05-31 21:13:07 +02:00
2023-04-13 09:03:58 +02:00
2023-07-11 13:16:20 -07:00
2023-01-31 13:03:37 -08:00
2023-03-10 14:43:42 +01:00
2023-03-10 14:43:42 +01:00
2023-03-16 07:16:41 -04:00
2023-05-04 09:42:25 -07:00
2023-02-17 09:49:03 +01:00
2023-02-17 09:49:03 +01:00
2023-07-07 08:41:11 -04:00
2023-07-07 08:41:11 -04:00
2023-07-07 08:41:11 -04:00
2023-07-07 08:41:11 -04:00
2023-07-07 08:41:11 -04:00
2023-07-07 08:41:11 -04:00
2023-05-04 09:42:25 -07:00
2023-06-08 22:41:00 +08:00
2023-05-09 00:07:40 +08:00
2023-06-08 22:41:00 +08:00
2023-07-07 08:41:11 -04:00
2023-02-16 17:05:26 +01:00
2023-03-10 14:43:42 +01:00
2022-12-05 22:58:29 -08:00
2022-12-04 19:10:17 -08:00
2023-06-13 00:53:31 -05:00
2023-02-17 15:08:50 +01:00
2022-12-12 17:11:46 +01:00
2023-05-17 16:09:12 -07:00
2023-03-10 14:43:42 +01:00
2023-03-10 14:43:42 +01:00
2023-07-07 08:41:11 -04:00
2023-02-23 14:40:58 +08:00
2023-06-13 00:53:31 -05:00
2023-07-07 08:41:11 -04:00
2023-05-03 16:05:27 -04:00
2023-03-24 14:42:25 -05:00
2023-05-23 14:41:46 -07:00
2023-01-18 08:51:21 -05:00
2023-07-07 08:41:11 -04:00
2023-05-01 10:02:15 -07:00
2023-03-10 14:43:42 +01:00
2023-07-07 08:41:11 -04:00
2023-06-10 10:40:43 -07:00
2023-01-26 11:33:19 +01:00
2023-07-07 08:41:11 -04:00
2023-07-11 11:52:07 -04:00
2023-02-16 15:48:10 +01:00
2023-04-13 09:03:58 +02:00
2023-04-12 06:44:45 -04:00
2023-07-07 08:41:11 -04:00
2023-07-07 08:41:11 -04:00
2023-04-07 01:37:36 +01:00
2023-04-07 01:37:36 +01:00
2023-07-07 08:41:11 -04:00
2022-12-21 08:27:24 -05:00
2023-07-07 08:41:11 -04:00
2023-01-03 19:42:46 -05:00
2022-12-31 22:24:37 -08:00
2023-04-28 15:41:17 -07:00
2023-04-28 15:41:17 -07:00
2023-04-28 15:41:17 -07:00
2023-04-28 15:41:17 -07:00
2023-04-28 15:41:17 -07:00
2023-01-17 11:32:29 -08:00
2023-07-07 08:41:11 -04:00
2022-12-04 22:47:56 -08:00
2023-02-11 00:33:13 +01:00
2023-04-19 14:49:56 +02:00
2023-02-08 13:12:34 +01:00
2022-12-12 17:11:46 +01:00
2023-02-28 15:23:07 +01:00
2023-03-10 14:43:42 +01:00
2023-03-10 14:43:42 +01:00
2023-02-17 09:29:12 +01:00
2023-03-10 14:43:42 +01:00
2023-07-11 16:25:07 -07:00
2023-03-10 14:43:42 +01:00
2023-07-11 21:34:53 +07:00
2023-07-11 19:51:38 -04:00
2023-07-07 08:41:11 -04:00
2023-03-14 10:16:51 +00:00
2023-03-14 10:16:51 +00:00
2023-07-07 08:41:11 -04:00
2023-07-07 08:41:11 -04:00
2023-01-05 20:27:32 +08:00
2023-05-03 19:43:56 +00:00
2023-03-10 14:43:42 +01:00
2023-01-26 11:33:19 +01:00
2022-12-02 09:44:15 -08:00
2023-04-25 13:33:09 -07:00
2023-05-10 14:58:35 -07:00
2022-12-02 09:44:15 -08:00
2023-01-25 12:18:50 +01:00
2022-12-12 17:11:46 +01:00
2023-02-08 10:34:56 -08:00
2023-07-07 08:41:11 -04:00
2023-06-30 13:19:15 +08:00
2023-06-02 13:01:05 -07:00
2023-05-22 10:11:30 -07:00
2023-05-25 09:22:45 +01:00
2022-12-12 17:11:46 +01:00
2023-07-11 15:13:57 -07:00
2023-07-07 08:41:11 -04:00
2023-03-15 23:55:52 +02:00
2023-03-10 14:43:42 +01:00
2023-07-07 08:41:11 -04:00
2023-07-07 08:41:11 -04:00
2023-01-11 14:08:06 +00:00
2023-07-07 08:41:11 -04:00
2023-06-22 08:51:29 -07:00
2023-07-07 08:41:11 -04:00
2023-07-07 08:41:11 -04:00
2022-12-12 09:58:38 -08:00
2023-02-16 15:48:10 +01:00
2023-02-16 15:48:10 +01:00
2023-03-10 14:43:42 +01:00
2023-05-17 14:42:39 -07:00
2023-04-12 14:44:11 +08:00
2023-03-10 14:43:42 +01:00
2023-03-16 07:16:41 -04:00
2023-02-16 16:32:29 +00:00
2023-01-03 19:42:46 -05:00
2023-02-16 16:32:29 +00:00
2023-06-19 20:38:16 -07:00
2023-06-19 20:28:39 -07:00
2023-06-19 20:38:16 -07:00
2023-06-20 22:40:56 -07:00
2023-06-19 20:38:16 -07:00
2023-06-19 20:28:39 -07:00