Commit Graph

3083 Commits

Author SHA1 Message Date
Nico Weber 6148c79a64 [gn build] (manually) port 9ee97ce3b8 2022-07-06 21:33:45 +02:00
Nico Weber 8f83f8f999 [gn build] (manually) port 484b1aa611 2022-07-06 21:23:17 +02:00
Nico Weber 67d82b50cf [gn build] (manually) port e0b5208650 2022-07-06 21:19:59 +02:00
LLVM GN Syncbot 8a668671a0 [gn build] Port f8cbe3cdf0 2022-07-06 17:46:18 +00:00
LLVM GN Syncbot f8e026457e [gn build] Port 08e4fe6c61 2022-07-06 14:24:15 +00:00
LLVM GN Syncbot 6bb17d7fac [gn build] Port 05130a6ba7 2022-07-05 21:04:41 +00:00
LLVM GN Syncbot 7b1ff859fe [gn build] Port b8dbc6ffea 2022-07-05 16:35:01 +00:00
LLVM GN Syncbot cccc03df3c [gn build] Port d1af09ad96 2022-07-05 13:57:20 +00:00
Peter Waller 220366d5b5 [gn build] (manually) port 6b3956e123
Differential Revision: https://reviews.llvm.org/D129080
2022-07-05 09:12:30 +00:00
Nico Weber b6ad8cbb35 [gn build] (manually) port dfb77f2e99 2022-07-05 10:59:41 +02:00
LLVM GN Syncbot 3912928aa8 [gn build] Port 25607d143d 2022-07-04 12:44:50 +00:00
LLVM GN Syncbot e1f61d8642 [gn build] Port 2aea8af251 2022-07-03 16:05:49 +00:00
LLVM GN Syncbot 0dbf0ba033 [gn build] Port d2d8b0aa4f 2022-07-02 01:13:41 +00:00
LLVM GN Syncbot 9c4d301ddd [gn build] Port 228c8f9cc0 2022-07-02 01:13:40 +00:00
LLVM GN Syncbot 17c8119564 [gn build] Port 94c7b89fe5 2022-07-01 23:35:58 +00:00
Arthur Eubanks 3d7aeb3c73 [gn build] Manually port 43dc3190 2022-07-01 11:39:04 -07:00
LLVM GN Syncbot 372a26acfd [gn build] Port 554aea52d7 2022-07-01 17:14:07 +00:00
Nico Weber 12109a3b40 [gn build] (manually) port fe66aebd75 (PseudoCLI) 2022-07-01 10:45:35 +02:00
Nico Weber bacb56cdc5 [gn build] (manually) port cd2292ef82 (PseudoCXX)
This target will be used in the next commit.
2022-07-01 10:45:35 +02:00
LLVM GN Syncbot acab4b69a4 [gn build] Port 0f94d2b385 2022-06-30 21:13:26 +00:00
LLVM GN Syncbot 7903b35a71 [gn build] Port a591c7ca0d 2022-06-30 13:27:00 +00:00
LLVM GN Syncbot 364673dbe7 [gn build] Port cfb7ffdec0 2022-06-30 10:11:58 +00:00
LLVM GN Syncbot a5a3b5178d [gn build] Port 72cd6b6c83 2022-06-30 10:11:58 +00:00
Sam Estep 6a97be27a1 [clang][dataflow] Delete SourceLocationsLattice
This patch deletes the now-unused `SourceLocationsLattice` class, along with its containing files and surrounding helper functions and tests.

Reviewed By: xazax.hun, ymandel, sgatev, gribozavr2

Differential Revision: https://reviews.llvm.org/D128448
2022-06-29 20:14:07 +00:00
Zequan Wu bed15f16d6 [gn] Manual port a7d6c3effe 2022-06-29 13:11:45 -07:00
LLVM GN Syncbot 906f52f2c4 [gn build] Port 77df3be0de 2022-06-28 21:25:13 +00:00
LLVM GN Syncbot 403466860b [gn build] Port 03975b7f0e 2022-06-28 09:52:16 +00:00
LLVM GN Syncbot 03859994b3 [gn build] Port eb5af0acf0 2022-06-27 17:44:48 +00:00
LLVM GN Syncbot e84674f7ac [gn build] Port 633d1d0df7 2022-06-27 12:35:34 +00:00
LLVM GN Syncbot 475d722ace [gn build] Port 9ed2e68c9a 2022-06-26 02:21:47 +00:00
LLVM GN Syncbot 303b214699 [gn build] Port c92056d038 2022-06-25 17:03:46 +00:00
LLVM GN Syncbot 73709fe09c [gn build] Port b847692ed8 2022-06-25 01:03:12 +00:00
Nico Weber 012412d192 [gn build] (manually) port 97579dcc6d (LLVMMCATests)
The CMake code makes a number of imho strange choices. I pointed those
out on https://reviews.llvm.org/D127083.

The GN build mirrors the CMake build's choices for now.
2022-06-24 21:02:35 -04:00
LLVM GN Syncbot 05558c0692 [gn build] Port 7a3918b540 2022-06-24 11:33:41 +00:00
LLVM GN Syncbot f09dad0c85 [gn build] Port 6546fdbe36 2022-06-24 11:18:35 +00:00
LLVM GN Syncbot 57b0d940d5 [gn build] Port 4045b62d4c 2022-06-23 15:49:40 +00:00
LLVM GN Syncbot af41955a49 [gn build] Port 2c3bbac0c7 2022-06-23 11:53:18 +00:00
LLVM GN Syncbot 1cb8c87c13 [gn build] Port 2962f9df7c 2022-06-23 02:41:57 +00:00
Nico Weber 1af1e91bba [gn build] Port c3574ef739 slightly better
The name of the host binary changed from make_confusable_table to
make-confusable-table, so match that.
2022-06-22 10:44:09 -04:00
Nico Weber 721875db2b Reland "[gn build] (manually) port b94db7ed7e (Confusables.inc)"
b94db7ed7e relanded in c3574ef739.

This relands commit 180bae08a0, rebased across the new version of
commit c3574ef739, and rebased across 10f7255d32.
2022-06-22 10:38:14 -04:00
LLVM GN Syncbot bc74bca536 [gn build] Port 77ad77c071 2022-06-22 05:44:50 +00:00
LLVM GN Syncbot 8b8d126598 [gn build] Port 79fbee3cc5 2022-06-21 21:53:32 +00:00
LLVM GN Syncbot beb8580544 [gn build] Port 6a4056ab2a 2022-06-21 14:01:32 +00:00
LLVM GN Syncbot 6904309c3a [gn build] Port 6ede652050 2022-06-21 11:45:40 +00:00
LLVM GN Syncbot b89f483064 [gn build] Port a71fe49bb5 2022-06-21 02:57:40 +00:00
LLVM GN Syncbot 809999aabb [gn build] Port 60f3b07118 2022-06-20 08:23:18 +00:00
LLVM GN Syncbot 7022e6d0f2 [gn build] Port 3adc908b26 2022-06-18 02:23:50 +00:00
Nico Weber 527395bd10 [gn build] (manually) port 2040b6df0a (DebugInfoSymbolizerTests) 2022-06-17 13:37:11 -04:00
LLVM GN Syncbot fd5a26e610 [gn build] Port 971e9c80e9 2022-06-17 17:10:15 +00:00
Nico Weber c2bb2e5973 [gn build] (manually) port 7cca33b40f
Not really needed for anything as far as I can tell (?),
more for completeness.
2022-06-17 11:51:10 -04:00
Nico Weber 0d16d9bff8 [gn build] (semi-manually) port 232bd331cb 2022-06-17 08:35:51 -04:00
LLVM GN Syncbot 6f1a7eb9e7 [gn build] Port eea11e7369 2022-06-17 00:40:13 +00:00
LLVM GN Syncbot 21f557e13a [gn build] Port ff3989e6ae 2022-06-16 22:31:40 +00:00
LLVM GN Syncbot 8eefbd2a57 [gn build] Port 61fac2c370 2022-06-16 22:31:39 +00:00
LLVM GN Syncbot decb600b02 [gn build] Port 6ff49af33d 2022-06-16 20:34:45 +00:00
Nico Weber 52554f7315 [gn build] Allow use_ubsan=true on mac and unbreak use_asan, use_tsan, use_ubsan
`use_ubsan=true` seems to Just Work on macOS, so allow it.

https://reviews.llvm.org/D122862 broke use_asan=true, use_tsan=true, and
use_ubsan=true builds on Linux too. This makes this go again by explicitly
disabling asan, tsan, and ubsan for the baremetal part of the build. See
discussion on https://reviews.llvm.org/D122862 for other possible approaches.

Differential Revision: https://reviews.llvm.org/D127906
2022-06-15 19:34:35 -04:00
Nico Weber 0083a02839 [gn build] Slighly nicer `gn args --list` output for is_debug and symbol_level 2022-06-15 19:24:32 -04:00
LLVM GN Syncbot ef44588202 [gn build] Port afd5a4f2dc 2022-06-15 21:57:03 +00:00
Arthur Eubanks bab0910f77 [gn build] Add missing BLAKE3 dependency 2022-06-15 13:16:40 -07:00
Nico Weber 794d080e2e [gn build] (semi-automatically) port fb34d531af 2022-06-15 07:42:40 -04:00
Nico Weber 650c0b6e39 [gn build] (semi-automatically) port 8bc0bb9564 2022-06-15 07:42:19 -04:00
LLVM GN Syncbot b5e9241eba [gn build] Port 48ebc1af29 2022-06-15 05:24:12 +00:00
LLVM GN Syncbot 1ca2730ca1 [gn build] Port 435897b41d 2022-06-15 00:32:13 +00:00
Peter Collingbourne 0e3c8bdd4b Revert "gn build: Add support for building the standalone ubsan runtime."
As well as followup commits.
Build is still failing on mac. I'll debug it locally.
http://45.33.8.238/macm1/37269/step_4.txt

This reverts commit ee21411107.
This reverts commit 6ef9af6386.
This reverts commit b49bd8e07f.
2022-06-13 14:06:14 -07:00
Peter Collingbourne ee21411107 gn build: Don't define an action for gen_version_script on mac/win.
Nothing should depend on the action on those platforms,
as they don't use version scripts.

Should fix mac build:
http://45.33.8.238/macm1/37264/step_4.txt
2022-06-13 13:54:57 -07:00
Peter Collingbourne 6ef9af6386 gn build: Disable ubsan build on mac/win.
Build failures:
http://45.33.8.238/macm1/37263/step_4.txt
http://45.33.8.238/win/60034/step_4.txt
2022-06-13 13:45:14 -07:00
Peter Collingbourne 7316b0d54c gn build: Add support for building the AArch64 LSE builtins.
Differential Revision: https://reviews.llvm.org/D127560
2022-06-13 13:15:29 -07:00
Peter Collingbourne b49bd8e07f gn build: Add support for building the standalone ubsan runtime.
Differential Revision: https://reviews.llvm.org/D127556
2022-06-13 13:15:28 -07:00
LLVM GN Syncbot be232979bc [gn build] Port ea9ff9fac3 2022-06-13 20:04:00 +00:00
LLVM GN Syncbot c39b76ae2e [gn build] Port 3abaefe64c 2022-06-13 19:41:30 +00:00
LLVM GN Syncbot 5a0ec6ff68 [gn build] Port e183bf8e15 2022-06-13 12:03:48 +00:00
LLVM GN Syncbot d59809de16 [gn build] Port 988682a389 2022-06-13 10:23:45 +00:00
LLVM GN Syncbot f90cbfe4fd [gn build] Port ff6d5dee71 2022-06-10 10:37:02 +00:00
LLVM GN Syncbot 9e931b3c57 [gn build] Port 1972d1e86a 2022-06-10 10:37:01 +00:00
Nico Weber ceef00d33d [gn build] (manually) port 6bc8163c79 2022-06-10 06:26:31 -04:00
Nico Weber f8144700eb [gn build] (manually) port 25c8a061c5 2022-06-09 18:07:14 -04:00
LLVM GN Syncbot 51d84737b5 [gn build] Port 976f37050d 2022-06-09 19:04:54 +00:00
Nico Weber 1efe354088 [gn build] (manually) port 4ff5e8184c
Fixes link of many binaries if RISCV is enabled but most other targets aren't.
2022-06-09 12:29:56 -04:00
Nico Weber f4da30ba68 [gn build] (manually) port 0e9a01dcac (libcxx module.modulemap gen) 2022-06-08 19:51:07 -04:00
LLVM GN Syncbot e21c1b4706 [gn build] Port 916e9052ba 2022-06-08 10:19:18 +00:00
LLVM GN Syncbot c6d6535a26 [gn build] Port 638b0fb4d6 2022-06-08 07:20:40 +00:00
Nico Weber 28c078e2c7 [gn build] (manually) port f3966eaf86 (_LIBCPP_ENABLE_DEBUG_MODE) 2022-06-07 18:13:13 -04:00
Reid Kleckner 570e76bb6c [config] Remove vestigial LLVM_VERSION_INFO
This has been superseded by the llvm/Support/VCSRevision.h header. So
far as I can tell, nothing in the CMake build sets LLVM_VERSION_INFO. It
was always undefined, and the ifdefs using it were dead. However, CMake
is very flexible, so it's possible that I missed some ways to set this
variable. One could, for example, probably pass -DLLVM_VERSION_INFO=x on
the command line and get that through to configure_file, or set the
variable in an obscure way (`set(${proj}_VERSION_INFO "x")`). I'm
reasonably confident that isn't happening, but I'd like a second
opinion.

Update the Bazel and gn builds accordingly.

Differential Revision: https://reviews.llvm.org/D126977
2022-06-07 11:36:26 -07:00
Reid Kleckner b1c7889f32 [config] Remove RETSIGTYPE from config.h.cmake, NFC
This doesn't need to be configurable. It was hardcoded to void in all
LLVM build systems.
2022-06-07 11:35:25 -07:00
LLVM GN Syncbot c39fdc84aa [gn build] Port 47c8ec811f 2022-06-07 14:38:58 +00:00
LLVM GN Syncbot 0b7291796d [gn build] Port b79b2b6772 2022-06-06 20:32:38 +00:00
LLVM GN Syncbot 51914d5a52 [gn build] Port 352c395fb6 2022-06-06 18:25:14 +00:00
LLVM GN Syncbot 0f5fc4c9a6 [gn build] Port 8171586176 2022-06-06 11:33:45 +00:00
Nico Weber 7ed089153c [gn build] port f06abbb393 a bit (create main() functions for GENERATE_DRIVER targets) 2022-06-06 06:28:52 -04:00
Nico Weber 460151e61d [gn build] set LLVM_TOOL_LLVM_DRIVER_BUILD to 0 for now 2022-06-06 05:52:37 -04:00
Peter Collingbourne a739f4d083 gn build: Fix build when not building the native target.
Differential Revision: https://reviews.llvm.org/D127068
2022-06-05 14:12:51 -07:00
Sam McCall a43fef05d4 [pseudo] rename pseudo-gen -> clang-pseudo-gen. NFC
This name is not namespaced. Requested in D126717

Differential Revision: https://reviews.llvm.org/D126725
2022-06-03 20:45:48 +02:00
Reid Kleckner 0a832ba5c2 [config] Remove LLVM_DEFAULT_TARGET_TRILE from config.h
It is redundant with llvm-config.h, which is always included by
config.h.

Port D12660 / d178f4fc89 from config.h to
llvm-config.h.

Update the gn build accordingly.

NFCI
2022-06-03 10:15:46 -07:00
Nico Weber 10f7255d32 [gn build] Extract compiled_action.gni from tablegen.gni
After years of tablegen being the only host binary we run as part
of the build, we're now in the process of growing at least two more:
- make_confusable_table (https://reviews.llvm.org/rG180bae08a04d)
- pseudo-gen (not yet fully hooked up in the GN build, but I have
  a local branch that hooks it up)

Factor out the few lines we need for running a host binary as part of the
build.

No behavior change.

Differential Revision: https://reviews.llvm.org/D126963
2022-06-03 10:22:15 -04:00
Nico Weber 371e6f8b7f Revert "[clang-tidy] Confusable identifiers detection"
This reverts commit b94db7ed7e.
See comments on https://reviews.llvm.org/D112916:
- breaks `check-clangd`, and makes clang-tidy crash on simple inputs
- likely does the wrong thing in cross builds

Also revert follow-up "[gn build] (manually) port b94db7ed7e (Confusables.inc)"
This reverts commit 180bae08a0.
2022-06-03 09:30:01 -04:00
Nico Weber 180bae08a0 [gn build] (manually) port b94db7ed7e (Confusables.inc) 2022-06-03 07:49:28 -04:00
LLVM GN Syncbot 1523e8bb19 [gn build] Port a29a1a33ac 2022-06-03 08:36:05 +00:00
LLVM GN Syncbot 883b09b664 [gn build] Port f9b8f422e7 2022-06-02 14:47:37 +00:00
LLVM GN Syncbot 11d8bc98d1 [gn build] Port a15ae4139c 2022-06-02 06:04:25 +00:00
LLVM GN Syncbot 4bc63858fc [gn build] Port 129c056d62 2022-06-01 20:34:21 +00:00
LLVM GN Syncbot b0f868f007 [gn build] Port a0dcbe45bd 2022-06-01 13:19:42 +00:00
LLVM GN Syncbot b9b13a5645 [gn build] Port 2011052150 2022-06-01 13:19:41 +00:00
LLVM GN Syncbot d3eadbe40d [gn build] Port d157019482 2022-06-01 08:37:55 +00:00
Reid Kleckner 17296607a7 Revert "[Bazel][GN] Reuse the GN LLVM config file generation code"
This reverts commit e2ee8bf981.

This change is beyond my ability to integrate into Google's internal
build configuration tonight.
2022-05-31 21:15:46 -07:00
Reid Kleckner e2ee8bf981 [Bazel][GN] Reuse the GN LLVM config file generation code
Currently, the Bazel build uses static, checked in [llvm-]config.h files
in combination with global macro definitions to mimic CMake's generated
headers. This change reuses the write_cmake_config.py script from the GN
build to generate the headers from source in the same way. The purpose
is to ensure that the Bazel build stays up to date with any changes to
the CMake config files. The write_cmake_config.py script has good error
checking to ensure that unneeded, stale variables are not passed, and
that any missing variables are reported as errors.

I tried to closely follow the logic in the GN build here:
  llvm/utils/gn/secondary/llvm/include/Config/BUILD.gn
The duplication between this file and config.bzl is significant, and we
could consider going further, but I'd like to hold off on it for now.

The GN build changes are to move the write_cmake_config.py script up to
//llvm/utils/write_cmake_config.py, and update the paths accordingly.

The next logical change is to generate Clang's config.h header.

Differential Revision: https://reviews.llvm.org/D126581
2022-05-31 19:40:05 -07:00
LLVM GN Syncbot d0d985c196 [gn build] Port 13e1a65327 2022-05-31 21:00:23 +00:00
LLVM GN Syncbot 3bdcf3bfc1 [gn build] Port 2e61dfb124 2022-05-31 17:57:18 +00:00
Nico Weber c4eb8035ed Revert "[HLSL] Enable vector types for hlsl."
This reverts commit e576280380.
Breaks tests on mac/arm, see comment on https://reviews.llvm.org/D125052

Also revert follow-up "[gn build] Port e576280380d3"
This reverts commit 1e01b1ec72.
2022-05-30 14:11:07 -04:00
LLVM GN Syncbot 1e01b1ec72 [gn build] Port e576280380 2022-05-30 16:11:40 +00:00
LLVM GN Syncbot b16460bb48 [gn build] Port 751c7be5b2 2022-05-30 06:27:55 +00:00
LLVM GN Syncbot 936e9bf4bd [gn build] Port 30c37fb89c 2022-05-28 08:16:52 +00:00
LLVM GN Syncbot cde101d022 [gn build] Port 11e3ad299f 2022-05-27 08:29:03 +00:00
LLVM GN Syncbot 827fa2c419 [gn build] Port 08cc058518 2022-05-27 02:54:55 +00:00
LLVM GN Syncbot 75ac914b14 [gn build] Port b58a420ff4 2022-05-26 20:01:22 +00:00
LLVM GN Syncbot ec0ef6809a [gn build] Port 0e3dc1a52f 2022-05-26 14:50:15 +00:00
LLVM GN Syncbot 51f63589ae [gn build] Port 569d663020 2022-05-26 08:51:13 +00:00
Arthur Eubanks 3d546191ad [gn build] Fix D126415 to only set `llvm_have_mallinfo2 = true` on linux
Otherwise mac builds are broken, e.g. http://45.33.8.238/macm1/36056/step_4.txt

../../llvm/lib/Support/Unix/Process.inc:35:10: fatal error: 'malloc.h' file not found
 #include <malloc.h>
2022-05-25 14:48:56 -07:00
Arthur Eubanks 534b19fbaa [gn build] Manually port bed9efed71 2022-05-25 14:36:42 -07:00
Arthur Eubanks 67e2e6e66d [gn build] Set llvm_have_mallinfo2 to true by default
If you are using an old enough glibc which doesn't have mallinfo2, set
`llvm_have_mallinfo2 = false`.

At this point it's likely that most people using the gn build are
compiling against a recent enough glibc (glibc 2.33 which was released
in Feb 2021).

Reviewed By: peterwaller-arm

Differential Revision: https://reviews.llvm.org/D126415
2022-05-25 13:56:05 -07:00
Nico Weber c85688a22b [gn build] (manually) port some of cd2292ef82 2022-05-25 07:19:41 -04:00
LLVM GN Syncbot 9ffb5944a6 [gn build] Port 7af89a379c 2022-05-25 08:31:45 +00:00
LLVM GN Syncbot b81171ce19 [gn build] Port 29a5a7c6d4 2022-05-25 08:31:44 +00:00
Nico Weber 1b976f2cb2 [gn build] Reformat all build files
Ran:

    git ls-files '*.gn' '*.gni' | xargs llvm/utils/gn/gn.py format
2022-05-24 12:16:55 -04:00
Nico Weber 154f93ca90 [gn build] (semi-automatically) port 0360b9f159 2022-05-24 11:41:28 -04:00
Sylvestre Ledru 1e2b746390 Revert "[TableGen] Remove code beads"
It is breaking the build with:

/build/llvm-toolchain-snapshot-15~++20220524114008+96323c9f4c10/llvm/lib/Target/M68k/MCTargetDesc/M68kMCCodeEmitter.cpp:478:10: fatal error: 'M68kGenMCCodeBeads.inc' file not found
         ^~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

Remove the #include causes:
error: undefined reference to 'llvm::M68k::getMCInstrBeads(unsigned int)'

This reverts commit f50be3d218.
2022-05-24 14:17:49 +02:00
Sheng f50be3d218 [TableGen] Remove code beads
Code beads is useless since the only user, M68k, has moved on to
a new encoding/decoding infrastructure.
2022-05-24 17:39:51 +08:00
LLVM GN Syncbot 3245e2edd5 [gn build] Port 1d1a191edc 2022-05-24 08:37:12 +00:00
LLVM GN Syncbot 1868f3c17d [gn build] Port 496156ac57 2022-05-24 05:44:48 +00:00
LLVM GN Syncbot 7ffc99bedc [gn build] Port eebc1fb772 2022-05-23 18:52:16 +00:00
Andre Vieira 572fc7d2fd [AArch64] Order STP Q's by ascending address
This patch adds an AArch64 specific PostRA MachineScheduler to try to schedule
STP Q's to the same base-address in ascending order of offsets. We have found
this to improve performance on Neoverse N1 and should not hurt other AArch64
cores.

Differential Revision: https://reviews.llvm.org/D125377
2022-05-23 09:50:44 +01:00
Nico Weber 98d141481e [gn build] (manually) port 480dcdc897 (llvm-ifs OptTable) 2022-05-20 13:13:37 -04:00
Nico Weber e0b98902a2 [gn build] (manually) port 505ddb6b74 (remove Unit/lit.site.cfg.py) 2022-05-19 15:18:56 -04:00
Heejin Ahn cde083e010 [WebAssembly] Fix register use-def in FixIrreducibleControlFlow
FixIrreducibleControlFlow pass adds dispatch blocks with a `br_table`
that has multiple predecessors and successors, because it serves as
something like a traffic hub for BBs. As a result of this, there can be
register uses that are not dominated by a def in every path from the
entry block. For example, suppose register %a is defined in BB1 and used
in BB2, and there is a single path from BB1 and BB2:
```
BB1 -> ... -> BB2
```
After FixIrreducibleControlFlow runs, there can be a dispatch block
between these two BBs:
```
BB1 -> ... -> Dispatch -> ... -> BB2
```
And this dispatch block has multiple predecessors, now
there is a path to BB2 that does not first visit BB1, and in that path
%a is not dominated by a def anymore.

To fix this problem, we have been adding `IMPLICIT_DEF`s to all
registers in PrepareForLiveInternals pass, and then remove unnecessary
ones in OptimizeLiveIntervals pass after computing `LiveIntervals`. But
FixIrreducibleControlFlow pass itself ends up violating register use-def
relationship, resulting in invalid code. This was OK so far because
MIR verifier apparently didn't check this in validation. But @arsenm
fixed this and it caught this bug in validation
(https://github.com/llvm/llvm-project/issues/55249).

This CL moves the `IMPLICIT_DEF` adding routine from
PrepareForLiveInternals to FixIrreducibleControlFlow. We only run it
when FixIrreducibleControlFlow changes the code. And then
PrepareForLiveInternals doesn't do anything other than setting
`TracksLiveness` property, which is a prerequisite for running
`LiveIntervals` analysis, which is required by the next pass
OptimizeLiveIntervals.

But in our backend we don't seem to do anything that invalidates this up
until OptimizeLiveIntervals, and I'm not sure why we are calling
`invalidateLiveness` in ReplacePhysRegs pass, because what that pass
does is to replace physical registers with virtual ones 1-to-1. I
deleted the `invalidateLiveness` call there and we don't need to set
that flag explicitly, which obviates all the need for
PrepareForLiveInternals.

(By the way, This 'Liveness' here is different from `LiveIntervals`
analysis. Setting this only means BBs' live-in info is correct, all uses
are dominated by defs, `kill` flag is conservatively correct, which
means if there is a `kill` flag set it should be the last use. See
2a0837aab1/llvm/include/llvm/CodeGen/MachineFunction.h (L125-L134)
for details.)

So this CL removes PrepareForLiveInternals pass altogether. Something
similar to this was attempted by D56091 long ago but that came short of
actually removing the pass, and I couldn't land it because
FixIrreducibleControlFlow violated use-def relationship, which this CL
fixes.

This doesn't change output in any meaningful way. All test changes
except `irreducible-cfg.mir` are register numbering.

Also this will likely to reduce compilation time, because we have been
adding `IMPLICIT_DEF` for all registers every time `-O2` is given, but
now we do that only when there is irreducible control flow, which is
rare.

Fixes https://github.com/llvm/llvm-project/issues/55249.

Reviewed By: dschuff, kripken

Differential Revision: https://reviews.llvm.org/D125515
2022-05-19 11:13:37 -07:00
LLVM GN Syncbot a49d3055c7 [gn build] Port ca7c307d18 2022-05-19 16:42:14 +00:00
LLVM GN Syncbot 3948962b45 [gn build] Port 4df795bff7 2022-05-19 08:04:45 +00:00
LLVM GN Syncbot dfd3a385d6 [gn build] Port 03ea140b3a 2022-05-19 06:13:53 +00:00
LLVM GN Syncbot e60c8c301c [gn build] Port 4d8268fbf4 2022-05-18 18:23:14 +00:00
LLVM GN Syncbot d8de7244f2 [gn build] Port 15c809e8e7 2022-05-18 18:05:17 +00:00
Nico Weber 91a8caa831 [gn build] port 6694491aff
Needed to link llvm-debuginfod-find after eafa053041.
2022-05-18 13:16:50 -04:00
LLVM GN Syncbot 66dfa36e7d [gn build] Port 29e556fc2b 2022-05-18 15:49:22 +00:00
LLVM GN Syncbot ca302f07b4 [gn build] Port 77533ea443 2022-05-18 15:43:23 +00:00
LLVM GN Syncbot 0990d5b549 [gn build] Port ca875539f7 2022-05-18 13:39:15 +00:00
LLVM GN Syncbot 6947945080 [gn build] Port 1f49714d3e 2022-05-17 19:47:10 +00:00
LLVM GN Syncbot 6f803caa6d [gn build] Port 1188faa7ab 2022-05-17 19:47:09 +00:00
LLVM GN Syncbot 8d53f2fc0d [gn build] Port 6aabf60f2f 2022-05-17 19:38:35 +00:00
LLVM GN Syncbot d910508a65 [gn build] Port ccdb56ac10 2022-05-17 19:07:18 +00:00
LLVM GN Syncbot f032690a7c [gn build] Port 76ddbb1ca7 2022-05-17 15:17:39 +00:00
LLVM GN Syncbot c8cb644185 [gn build] Port ecaa4d9662 2022-05-17 14:51:11 +00:00
LLVM GN Syncbot c71f6376eb [gn build] Port 0a0d6489ef 2022-05-16 06:42:42 +00:00
Nico Weber 1f7f11b951 [gn build] (semi-manually) port 5122738331 2022-05-13 21:41:17 -04:00
LLVM GN Syncbot 87d88c5b29 [gn build] Port 3a24df992c 2022-05-13 09:48:26 +00:00
Tobias Ribizel b1aed14bfe [llvm][lldb] use FindLibEdit.cmake everywhere
Currently, LLVM's LineEditor and LLDB both use libedit, but find them in different (inconsistent) ways.
This causes issues e.g. when you are using a locally installed version of libedit, which will not be used
by clang-query, but by lldb if picked up by FindLibEdit.cmake

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D124673
2022-05-12 15:59:41 -07:00
Arthur Eubanks f37e6faf52 [gn build] Use llvm-ar when clang_base_path is specified
Only applies linux for now.

This prevents warnings with use_thinlto like
  bfd plugin: LLVM gold plugin has failed to create LTO module: Not an int attribute (Producer: 'LLVM15.0.0git' Reader: 'LLVM 13.0.1')

Reviewed By: thakis

Differential Revision: https://reviews.llvm.org/D125399
2022-05-11 10:40:54 -07:00
Nico Weber 53342c6bcf [gn build] (manually) port 26eb04268f (clang-offload-packager) 2022-05-11 15:14:00 +01:00
LLVM GN Syncbot a0f3ef42b0 [gn build] Port f822db7670 2022-05-10 21:06:25 +00:00
LLVM GN Syncbot f6d4769894 [gn build] Port 059e03476c 2022-05-10 01:06:44 +00:00
LLVM GN Syncbot ee0e00b198 [gn build] Port 7b73de9ec2 2022-05-09 23:05:57 +00:00
Nico Weber 42915e2be2 [gn build] (manually) port a2f2dfde48 (clang-fuzzer-dictionary) 2022-05-09 18:28:58 -04:00
LLVM GN Syncbot 679ee517c6 [gn build] Port 9924d8d66a 2022-05-06 21:16:49 +00:00
Nico Weber 68609d4641 [gn build] (semi-manually) port 7e63a0d479 2022-05-06 15:56:30 -04:00
LLVM GN Syncbot 1df36d5616 [gn build] Port 586efd52b9 2022-05-06 13:54:41 +00:00
LLVM GN Syncbot 6d74721a07 [gn build] Port 37ba1b9d1a 2022-05-06 13:54:40 +00:00
Nico Weber 07a83b5564 [gn build] try to (manually) port 9ef451d1fd (hwasan_symbolize)
needed by check-hwasan as of 4af9392e13
2022-05-06 09:33:33 -04:00
Nico Weber 21ab2b6ca8 [gn build] (semi-manually) port 70a66c08fc 2022-05-05 20:34:49 -04:00
LLVM GN Syncbot 892b205c97 [gn build] Port 80045e9afa 2022-05-04 18:28:43 +00:00
LLVM GN Syncbot 88962f536f [gn build] Port 9f38da258e 2022-05-03 18:28:46 +00:00
LLVM GN Syncbot 3e8aca5324 [gn build] Port 860eabb395 2022-05-03 13:55:41 +00:00
LLVM GN Syncbot 5a64bc4d3e [gn build] Port eac22d0754 2022-05-03 13:47:14 +00:00
LLVM GN Syncbot 24901ac6d0 [gn build] Port 41c0ff1e74 2022-05-03 00:35:04 +00:00
LLVM GN Syncbot 4f5d525b1d [gn build] Port 4070aa0156 2022-05-02 22:32:10 +00:00
Sheng df3765bfdc [NFC] Rename `FixedLenDecoderEmitter` as `DecoderEmitter`
Since now we are able to handle both fixed length & variable
length instructions.

Reviewed By: myhsu

Differential Revision: https://reviews.llvm.org/D123451
2022-05-03 03:37:13 +08:00
LLVM GN Syncbot aa69cb7695 [gn build] Port 5de0a3e9da 2022-05-02 15:51:27 +00:00
Nico Weber d21289e042 [gn build] (manually) port fb7a435492 2022-05-02 07:23:10 -04:00
LLVM GN Syncbot 1790e2976b [gn build] Port 3939e99aae 2022-05-01 22:32:29 +00:00
LLVM GN Syncbot 616dd4fe4e [gn build] Port 73417c5176 2022-04-30 00:44:51 +00:00
Dimitry Andric 7abfaa0a81 [lldb] Define LLDB_VERSION_PATCH correctly
In commit ccf1469a4c lldb got its own generated Version.inc file, with
`LLDB_VERSION` macros. However, it used `LLDB_VERSION_PATCHLEVEL`
instead of the actually correct `LLDB_VERSION_PATCH`. Correct this.

Reviewed By: JDevlieghere

Differential Revision: https://reviews.llvm.org/D124672
2022-04-29 19:29:51 +02:00
LLVM GN Syncbot b0db5a72f7 [gn build] Port fb4113ef0c 2022-04-29 09:40:01 +00:00
Nico Weber de7e539432 [gn build] (manually) port 0f1b5f115a 2022-04-28 08:39:12 -04:00
LLVM GN Syncbot 74ddcc2b27 [gn build] Port 6ddf2a824d 2022-04-27 13:44:43 +00:00
LLVM GN Syncbot 224386679d [gn build] Port 7b81192d46 2022-04-26 17:42:25 +00:00
LLVM GN Syncbot 86312461b8 [gn build] Port 854c33946f 2022-04-26 09:06:40 +00:00
LLVM GN Syncbot b0d119b583 [gn build] Port b1fa5ac3ba 2022-04-26 01:46:12 +00:00
Nico Weber 31456ff191 [gn build] Kind of port e6f44a3cd2 (DirectXTests) 2022-04-25 20:25:39 -04:00
LLVM GN Syncbot ea8cbd5c58 [gn build] Port 042dc3c46d 2022-04-25 10:26:57 +00:00
Nico Weber 3fdc3d63f6 [gn build] (manually) port a7691dee2d (TestAST)
This makes clang/lib/Testing the very first non-test()-target that includes
gtest headers, which means it needs an explicit dep on gtest.
2022-04-21 21:37:48 -04:00
Nico Weber 59bd20526c [gn build] (manually) port f26c41e8dd (lib/clang/Support) 2022-04-20 09:28:04 -04:00
LLVM GN Syncbot f493fe34bf [gn build] Port 6c69427e88 2022-04-20 04:12:02 +00:00
Nico Weber 9973075274 [gn build] port clang-linker-wrapper build file
Tests now try to run it, so we need a build file for it.
2022-04-20 00:11:34 -04:00
LLVM GN Syncbot 858e40d8f3 [gn build] Port bac6cd5bf8 2022-04-19 21:23:58 +00:00
LLVM GN Syncbot b5e962a510 [gn build] Port c57f03415f 2022-04-19 20:13:49 +00:00
Nico Weber bf59cd7244 [gn build] (manually) port f2526c1a5c 2022-04-16 12:58:04 -04:00
LLVM GN Syncbot 73110f1306 [gn build] Port 721651be24 2022-04-15 19:23:18 +00:00
LLVM GN Syncbot 4dba3d4c53 [gn build] Port 1d83750f63 2022-04-15 11:44:38 +00:00
Nico Weber f097885b07 [gn build] (manually) port 6d45558c1a (MipsGenPostLegalizeGICombiner) 2022-04-15 07:05:15 -04:00
LLVM GN Syncbot 234678fbf9 [gn build] Port b9ca972b1f 2022-04-14 18:36:20 +00:00
LLVM GN Syncbot f80e47884c [gn build] Port 1fdf952dee 2022-04-14 15:22:09 +00:00
LLVM GN Syncbot 4f1065156b [gn build] Port e471ba3d01 2022-04-14 14:51:17 +00:00
LLVM GN Syncbot 5bf9aa38ab [gn build] Port 58d9ab70ae 2022-04-14 13:37:28 +00:00
LLVM GN Syncbot 65fcd31ef1 [gn build] Port dd47ab750b 2022-04-14 13:21:19 +00:00
LLVM GN Syncbot 33ab2e3c84 [gn build] Port 73da7eed8f 2022-04-14 13:06:13 +00:00
Nico Weber a29d9ba1f5 Revert "[gn build] Port 73da7eed8fac"
This reverts commit bd4463bebf.
Breaks check-clang-tools on Windows, see comment on
https://reviews.llvm.org/D123655
2022-04-14 09:05:11 -04:00
LLVM GN Syncbot 04a3f3f167 [gn build] Port 6ba1b9075d 2022-04-14 09:08:24 +00:00
LLVM GN Syncbot bd4463bebf [gn build] Port 73da7eed8f 2022-04-14 05:36:21 +00:00
Nico Weber 65d3850efe [gn build] (manually) port ab8abeaf48 2022-04-13 20:58:10 -04:00
Arthur Eubanks 2f70fe1b59 [gn build] Set CLANG_ENABLE_OPAQUE_POINTERS_INTERNAL=1
Matches official cmake build.
2022-04-13 16:29:52 -07:00
LLVM GN Syncbot 1203a24764 [gn build] Port a85da649b9 2022-04-13 15:05:20 +00:00
LLVM GN Syncbot d1e5854805 [gn build] Port 2fb026ee4d 2022-04-13 13:52:22 +00:00
LLVM GN Syncbot 0242ffd9c0 [gn build] Port 2b424f4ea8 2022-04-13 13:04:50 +00:00
LLVM GN Syncbot 05256c8d95 [gn build] Port e53c461bf3 2022-04-13 05:30:23 +00:00
Nico Weber 2ac876c52c [gn build] Fix a URL in a comment 2022-04-12 11:38:12 -04:00
LLVM GN Syncbot dbf1557359 [gn build] Port 95f0f69f1f 2022-04-12 09:55:37 +00:00
LLVM GN Syncbot dbd80d7d27 [gn build] Port 5a5be4044f 2022-04-12 08:49:06 +00:00
LLVM GN Syncbot ff84cb1660 [gn build] Port 203a1e36ed 2022-04-11 23:49:30 +00:00
Fangrui Song a8ef1647aa [CMake][gn][Bazel] Remove HAVE_PTHREAD_GETSPECIFIC
The only user was removed by d351f54a07.
2022-04-11 14:44:45 -07:00
LLVM GN Syncbot 5ef0ed7d5a [gn build] Port c292b6066c 2022-04-11 14:58:55 +00:00
LLVM GN Syncbot f5d6d13d72 [gn build] Port b4ad28da19 2022-04-11 12:47:08 +00:00
Patryk Wychowaniec d16a631c12 [AVR] Merge AVRRelaxMemOperations into AVRExpandPseudoInsts
This commit contains a refactoring that merges AVRRelaxMemOperations
into AVRExpandPseudoInsts, so that we have a single place in code that
expands the STDWPtrQRr opcode.

Seizing the day, I've also fixed a couple of potential bugs with our
previous implementation (e.g. when the destination register was killed,
the previous implementation would try to .addDef() that killed
register, crashing LLVM in the process - that's fixed now, as proved by
the test).

Reviewed By: benshi001

Differential Revision: https://reviews.llvm.org/D122533
2022-04-11 02:42:13 +00:00
LLVM GN Syncbot a099bc3c77 [gn build] Port 7aa8c38a9e 2022-04-09 20:16:19 +00:00
LLVM GN Syncbot c6f37ab250 [gn build] Port a96443edde 2022-04-09 14:04:27 +00:00
LLVM GN Syncbot a31cd8c8f2 [gn build] Port 889302292b 2022-04-09 07:40:37 +00:00
Fangrui Song ca68038d12 Reland "[Driver] Default CLANG_DEFAULT_PIE_ON_LINUX to ON""
(With C++ exceptions, `clang++ --target=mips64{,el}-linux-gnu -fpie -pie
-fuse-ld=lld` has link errors (lld does not implement some strange R_MIPS_64
.eh_frame handling in GNU ld). However, sanitizer-x86_64-linux-qemu used this to
build ScudoUnitTests. Pined ScudoUnitTests to -no-pie.)

Default the option introduced in D113372 to ON to match all(?) major Linux
distros. This matches GCC and improves consistency with Android and linux-musl
which always default to PIE.
Note: CLANG_DEFAULT_PIE_ON_LINUX may be removed in the future.

Differential Revision: https://reviews.llvm.org/D120305
2022-04-08 23:40:18 -07:00
Fangrui Song a58d0af058 Revert D121556 "[randstruct] Add randomize structure layout support"
This reverts commit 3f0587d0c6.

Not all tests pass after a few rounds of fixes.

I spot one failure that std::shuffle (potentially different results with
different STL implementations) was misused and replaced it with llvm::shuffle,
but there appears to be another failure in a Windows build.

The latest failure is reported on https://reviews.llvm.org/D121556#3440383
2022-04-08 18:37:26 -07:00
LLVM GN Syncbot 62c8b185ff [gn build] Port 46b2a463bd 2022-04-09 01:14:57 +00:00
LLVM GN Syncbot 6bf7c1b6ac [gn build] Port 2a2149c754 2022-04-09 00:50:44 +00:00
LLVM GN Syncbot c807141d27 [gn build] Port 3f0587d0c6 2022-04-08 20:26:24 +00:00
LLVM GN Syncbot 59308b4b79 [gn build] Port 2aa575fd7f 2022-04-08 20:26:23 +00:00
LLVM GN Syncbot c8084fd907 [gn build] Port 08920cc043 2022-04-08 11:20:14 +00:00
Nico Weber 26b3a1ea34 [gn build] (manually) port bf2dc4b376 2022-04-08 07:07:32 -04:00
LLVM GN Syncbot a5daf81df0 [gn build] Port 690085c9b7 2022-04-08 04:04:28 +00:00
Nico Weber e22a60b1c8 Revert "Reland "[Driver] Default CLANG_DEFAULT_PIE_ON_LINUX to ON"""
This reverts commit 2aca33baf1.
Broke tests on several bots, see comments on https://reviews.llvm.org/D120305
2022-04-07 10:07:07 -04:00
LLVM GN Syncbot 1c1d477ce3 [gn build] Port 1306b1025c 2022-04-07 13:18:45 +00:00
Nico Weber 79e5e086a2 [gn build] (manually) port 3031fa88f0 2022-04-07 08:15:41 -04:00
Nico Weber 23ce89a5a2 [gn build] (manually) port 5390606aa9 2022-04-07 08:13:26 -04:00
Fangrui Song 2aca33baf1 Reland "[Driver] Default CLANG_DEFAULT_PIE_ON_LINUX to ON""
(The upgrade of the ppc64le bot and D121257 have fixed compiler-rt failures. Tested by nemanjai.)

Default the option introduced in D113372 to ON to match all(?) major Linux
distros. This matches GCC and improves consistency with Android and linux-musl
which always default to PIE.
Note: CLANG_DEFAULT_PIE_ON_LINUX may be removed in the future.

Differential Revision: https://reviews.llvm.org/D120305
2022-04-06 20:19:07 -07:00
LLVM GN Syncbot 7ac2e30fe1 [gn build] Port 39f1568633 2022-04-07 00:55:44 +00:00
Peter Collingbourne 38f9200945 gn build: Fix some tests for host_os to instead check current_os.
Should fix Windows build:
http://45.33.8.238/win/55809/step_4.txt
2022-04-06 15:45:51 -07:00
Peter Collingbourne 02a7b1754f Reland "gn build: Fix support for building the builtins for baremetal."
Our support for building for baremetal was conditional on a default
off arg and would have failed to build if you had somehow arranged
to pass the correct --target flag; presumably nobody noticed because
nobody was turning it on. A better approach is to model baremetal
as a separate "OS" called "baremetal" and build it in the same way
as we cross-compile for other targets. That's what this patch does.
I only hooked up the arm64 target but others can be added.

Relanding after fixing Mac build breakage in D123244.

Differential Revision: https://reviews.llvm.org/D122862
2022-04-06 13:45:40 -07:00
Peter Collingbourne 096477e25e gn build: Use target OS to control whether to use/depend on llvm-ar.
When cross-compiling from Mac to non-Mac, we need to use the just-built
llvm-ar instead of libtool. We're currently doing the right thing
when determining which archiver command to use, but the path to ar
and the toolchain dependencies were being set based on the host OS
(current_os evaluated in host OS toolchain), instead of the target
OS. Fix the problem by looking up current_os inside toolchain_args.

Differential Revision: https://reviews.llvm.org/D123244
2022-04-06 13:45:40 -07:00
LLVM GN Syncbot ee5fda1ff8 [gn build] Port c03d6257c5 2022-04-06 19:38:53 +00:00
Peter Collingbourne d384f2b253 Revert "gn build: Fix support for building the builtins for baremetal."
This reverts commit b02b9b3dac.

Broke Mac build: http://45.33.8.238/macm1/32578/step_4.txt
2022-04-06 12:16:06 -07:00
LLVM GN Syncbot 2232d35f82 [gn build] Port 9fc45ca00a 2022-04-06 18:21:38 +00:00
Nico Weber 25b7efc9d1 Revert "[gn build] (manually) port 83a798d4b0 (abi_breaking_checks in tests)"
This reverts commit edddf384c2.
83a798d4b0 was reverted in 62a983ebc5.
2022-04-06 14:02:09 -04:00
Peter Collingbourne b02b9b3dac gn build: Fix support for building the builtins for baremetal.
Our support for building for baremetal was conditional on a default
off arg and would have failed to build if you had somehow arranged
to pass the correct --target flag; presumably nobody noticed because
nobody was turning it on. A better approach is to model baremetal
as a separate "OS" called "baremetal" and build it in the same way
as we cross-compile for other targets. That's what this patch does.
I only hooked up the arm64 target but others can be added.

Differential Revision: https://reviews.llvm.org/D122862
2022-04-06 11:01:21 -07:00
LLVM GN Syncbot 324ac838ae [gn build] Port d78624975b 2022-04-06 15:52:20 +00:00
LLVM GN Syncbot c59e833942 [gn build] Port afa94306a8 2022-04-06 14:24:39 +00:00
LLVM GN Syncbot bb47e1fe3d [gn build] Port 68eac9a6e7 2022-04-06 14:15:16 +00:00
Nico Weber edddf384c2 [gn build] (manually) port 83a798d4b0 (abi_breaking_checks in tests) 2022-04-06 08:31:20 -04:00
Nikita Popov ed4e6e0398 [cmake] Remove LLVM_ENABLE_NEW_PASS_MANAGER cmake option
Or rather, error out if it is set to something other than ON. This
removes the ability to enable the legacy pass manager by default,
but does not remove the ability to explicitly enable it through
various flags like -flegacy-pass-manager or -enable-new-pm=0.

I checked, and our test suite definitely doesn't pass with
LLVM_ENABLE_NEW_PASS_MANAGER=OFF anymore.

Differential Revision: https://reviews.llvm.org/D123126
2022-04-06 09:52:21 +02:00
LLVM GN Syncbot 6847081160 [gn build] Port 97e496054a 2022-04-06 03:38:24 +00:00
Nico Weber bf0f5e72bd [gn build] (semi-automatically) Port 4661a65f4b
...and follow-up 970ae8376e.
2022-04-05 09:02:16 -04:00