Commit Graph

1762 Commits

Author SHA1 Message Date
Nico Weber 900f076113 hack to unbreak check-llvm on win after https://reviews.llvm.org/D97335
fix attempt http://reviews.llvm.org/rGbbdb4c8c9bcef0e didn't work

The problem is that the test tries to look up
llvm_orc_registerJITLoaderGDBWrapper from the llvm-jitlink.exe
executable, but the symbol wasn't exported. Just manually export it
for now. There's a FIXME with a suggestion for a real fix.
2021-03-02 18:10:28 -05:00
Nico Weber 253a6606fa [gn build] fix llvm-jitlink tests on linux after ef2389235c 2021-03-02 13:41:09 -05:00
Nico Weber 31b1e94a6e [gn build] (manually) port 99a6d003ed 2021-03-02 10:31:59 -05:00
Nico Weber 31d516f183 [gn build] Port f47ff8cff1 2021-03-02 10:31:59 -05:00
Nico Weber 5182a7901a [gn build] Port ef2389235c 2021-03-02 10:31:59 -05:00
David Green e880f8b88a [ARM] Rename pass to MVETPAndVPTOptimisationsPass
This pass has for a while performed Tail predication as well as VPT
block optimizations. Rename the pass to make that clear.
2021-03-01 21:57:19 +00:00
Nico Weber 52b8e10597 [libclang] Remove LIBCLANG_INCLUDE_CLANG_TOOLS_EXTRA
LIBCLANG_INCLUDE_CLANG_TOOLS_EXTRA causes clang-tools-extra tools
to be included in libclang, which caused a dependency cycle. The option
has been off by default for two releases now, and (based on a web search
and mailing list feedback) nobody seems to turn it on. Remove it, like
planned on https://reviews.llvm.org/D79599

Differential Revision: https://reviews.llvm.org/D97693
2021-03-01 13:21:59 -05:00
Jez Ng 415c0cd698 [lld-macho] Switch default to new Darwin backend
The new Darwin backend for LLD is now able to link reasonably large
real-world programs on x86_64. For instance, we have achieved
self-hosting for the X86_64 target, where all LLD tests pass when
building lld with itself on macOS. As such, we would like to make it the
default back-end.

The new port is now named `ld64.lld`, and the old port remains
accessible as `ld64.lld.darwinold`

This [annoucement email][1] has some context. (But note that, unlike
what the email says, we are no longer doing this as part of the LLVM 12
branch cut -- instead we will go into LLVM 13.)

Numerous mechanical test changes were required to make this change; in
the interest of creating something that's reviewable on Phabricator,
I've split out the boring changes into a separate diff (D95905). I plan to
merge its contents with those in this diff before landing.

(@gkm made the original draft of this diff, and he has agreed to let me
take over.)

[1]: https://lists.llvm.org/pipermail/llvm-dev/2021-January/147665.html

Reviewed By: #lld-macho, thakis

Differential Revision: https://reviews.llvm.org/D95204
2021-03-01 12:30:10 -05:00
Nico Weber 72b18a86e1 [libcxxabi] Fewer assumptions about path from libcxx to libcxxabi
This is useful for projects that pull in libcxx and libcxxabi and build
them using out-of-tree build files, but don't make them sibling
directories (or don't call the sibling directories libcxx and libcxxabi
for some reason).

Fixes PR49313.

Differential Revision: https://reviews.llvm.org/D97379
2021-02-26 09:10:18 -05:00
LLVM GN Syncbot 52c781f6f1 [gn build] Port 4753a69a31 2021-02-25 23:16:39 +00:00
Ryan Prichard 729899f7b6 [libunwind] unw_* alias fixes for ELF and Mach-O
Rename the CMake option, LIBUNWIND_HERMETIC_STATIC_LIBRARY, to
LIBUNWIND_HIDE_SYMBOLS. Rename the C macro define,
_LIBUNWIND_DISABLE_VISIBILITY_ANNOTATIONS, to _LIBUNWIND_HIDE_SYMBOLS,
because now the macro adds a .hidden directive rather than merely
suppress visibility annotations.

For ELF, when LIBUNWIND_HIDE_SYMBOLS is enabled, mark unw_getcontext as
hidden. This symbol is the only one defined using src/assembly.h's
WEAK_ALIAS macro. Other unw_* weak aliases are defined in C++ and are
already hidden.

Mach-O doesn't support weak aliases, so remove .weak_reference and
weak_import. When LIBUNWIND_HIDE_SYMBOLS is enabled, output
.private_extern for the unw_* aliases.

In assembly.h, add missing SYMBOL_NAME macro invocations, which are
used to prefix symbol names with '_' on some targets.

Fixes PR46709.

Reviewed By: #libunwind, phosek, compnerd, steven_wu

Differential Revision: https://reviews.llvm.org/D93003
2021-02-22 16:54:05 -08:00
LLVM GN Syncbot 3322701e35 [gn build] Port 8f48ddd193 2021-02-22 23:50:19 +00:00
LLVM GN Syncbot 0046aadd7f [gn build] Port e64fcdf8d5 2021-02-22 20:19:04 +00:00
LLVM GN Syncbot 7af9ea548c [gn build] Port 7dc7f0c2ec 2021-02-22 11:35:19 +00:00
LLVM GN Syncbot ad375ac5d2 [gn build] Port 6e3071007b 2021-02-22 10:35:33 +00:00
Nico Weber 3b7580951c [gn build] Port 1a2b3536ef 2021-02-19 07:23:48 -05:00
Nico Weber afdfdc4bcf [gn build] assert that goma_dir and sysroot are set for goma builds 2021-02-18 18:30:26 -05:00
Nico Weber 4cf3c35c10 [gn build] kind of merge f020544601
Fixes check-llvm with a clean build dir.
2021-02-18 16:12:32 -05:00
Nico Weber 9fa1120161 [gn build] try to fix libxml2 include path on mac after 0ec448194e 2021-02-18 14:40:14 -05:00
Nico Weber c9c17144c1 [gn build] fix mistake in 0ec448194e 2021-02-18 11:58:19 -05:00
Nico Weber 0ec448194e sysroot.py: add support for darwin
This is a tiny bit messy because compiler-rt needs different sysroots for
macOS, iOS, etc. We want sysroot.py to create something that is a hermetic
representation of all build deps, so it needs to create a directory that
contains all needed SDKs, and these subdirectories are then passed to
cmake which passes each of these _subdirectories_ as different -isysroot
flags while building the runtime libraries.

Differential Revision: https://reviews.llvm.org/D96958
2021-02-18 10:48:18 -05:00
Nico Weber 2f0f67afb2 [gn build] add a comment to the goma_dir arg 2021-02-17 19:36:36 -05:00
LLVM GN Syncbot ebcf921e4a [gn build] Port 7397905ab0 2021-02-17 23:33:31 +00:00
Nico Weber 0dd2ffb392 [gn build] make WindowsManifestMerger.cpp build fine with sysroot
This already works in the cmake build.

Differential Revision: https://reviews.llvm.org/D96889
2021-02-17 15:03:46 -05:00
Nico Weber 6073f87d7f sysroot.py: add support for non-darwin platforms
CMAKE_SYSROOT works fine here, and `sysroot.py make-fake`
borders on trivial here, but I suppose it's still nice
to have a consistent script to set these up across platforms.

And these are the platforms where we can do real sysroot management one
day.

Differential Revision: https://reviews.llvm.org/D96882
2021-02-17 13:57:16 -05:00
LLVM GN Syncbot 14bda035ab [gn build] Port c28622fbf3 2021-02-17 18:30:02 +00:00
Nico Weber 44ea794cf9 build: Add LLVM_WINSYSROOT to make setting /winsysroot easy on Win
Also add a script for sysroot management. For now, it can only create
fake sysroots that just symlink to local folders. This is useful for
testing.

Differential Revision: https://reviews.llvm.org/D96868
2021-02-17 10:27:25 -05:00
LLVM GN Syncbot f456959a93 [gn build] Port 6fd5ccff72 2021-02-17 00:53:56 +00:00
LLVM GN Syncbot 76609f17ce [gn build] Port c761fe77bd 2021-02-16 22:13:03 +00:00
LLVM GN Syncbot f350fe8c55 [gn build] Port ecea7218fb 2021-02-16 19:23:52 +00:00
LLVM GN Syncbot abb7570235 [gn build] Port 310b35304c 2021-02-16 19:23:52 +00:00
LLVM GN Syncbot b2db4934ed [gn build] Port 40cc63ea6e 2021-02-16 14:23:58 +00:00
LLVM GN Syncbot 72af70127c [gn build] Port 9510b09402 2021-02-16 09:12:07 +00:00
LLVM GN Syncbot dfa6fdb0b6 [gn build] Port 5786f64a4e 2021-02-15 09:52:10 +00:00
Arlo Siemsen 080866470d Add ehcont section support
In the future Windows will enable Control-flow Enforcement Technology (CET aka shadow stacks). To protect the path where the context is updated during exception handling, the binary is required to enumerate valid unwind entrypoints in a dedicated section which is validated when the context is being set during exception handling.

This change allows llvm to generate the section that contains the appropriate symbol references in the form expected by the msvc linker.

This feature is enabled through a new module flag, ehcontguard, which was modelled on the cfguard flag.

The change includes a test that when the module flag is enabled the section is correctly generated.

The set of exception continuation information includes returns from exceptional control flow (catchret in llvm).

In order to collect catchret we:
1) Includes an additional flag on machine basic blocks to indicate that the given block is the target of a catchret operation,
2) Introduces a new machine function pass to insert and collect symbols at the start of each block, and
3) Combines these targets with the other EHCont targets that were already being collected.

Change originally authored by Daniel Frampton <dframpto@microsoft.com>

For more details, see MSVC documentation for `/guard:ehcont`
  https://docs.microsoft.com/en-us/cpp/build/reference/guard-enable-eh-continuation-metadata

Reviewed By: pengfei

Differential Revision: https://reviews.llvm.org/D94835
2021-02-15 14:27:12 +08:00
LLVM GN Syncbot 28315df073 [gn build] Port 656ead1fb7 2021-02-14 19:23:24 +00:00
Arthur Eubanks 242304f3e2 [gn build] Add missing llvm-profgen dependency
Or else a clean build fails with missing Attributes.inc.
2021-02-12 12:44:17 -08:00
LLVM GN Syncbot 7ff0cbe41d [gn build] Port cb2d2ae56a 2021-02-12 18:40:40 +00:00
Lukas Sommer 6577cef9b0 [CodeGen] New pass: Replace vector intrinsics with call to vector library
This patch adds a pass to replace calls to vector intrinsics (i.e., LLVM
intrinsics operating on vector operands) with calls to a vector library.

Currently, calls to LLVM intrinsics are only replaced with calls to vector
libraries when scalar calls to intrinsics are vectorized by the Loop- or
SLP-Vectorizer.

With this pass, it is now possible to replace calls to LLVM intrinsics
already operating on vector operands, e.g., if such code was generated
by MLIR. For the replacement, information from the TargetLibraryInfo,
e.g., as specified via -vector-library is used.

This is a re-try of the original commit 2303e93e66 that was reverted
due to pass manager problems. Other minor changes have also been made.

Differential Revision: https://reviews.llvm.org/D95373
2021-02-12 12:53:27 -05:00
LLVM GN Syncbot ac2627fd9a [gn build] Port ba3ea9c60f 2021-02-12 16:56:34 +00:00
Peter Collingbourne e434fc0dde gn build: Support cross-compiling libunwind for Android.
- Usual cross-compilation fix: s/target_/current_/g

- Define _LIBUNWIND_IS_NATIVE_ONLY to enable unwinding past
  functions with return pointer authentication.

- Android needs two libunwind static libraries: one with symbols exported and
  one without. These both need to be in the same build tree so
  the libunwind_hermetic_static_library configuration option doesn't
  help here. Replace it with build rules that build both libraries.

- Install the libraries in the location that Android expects them to be.

Differential Revision: https://reviews.llvm.org/D96563
2021-02-11 21:47:33 -08:00
Nico Weber 18d38b2403 [gn build] port ed98676fa4 2021-02-11 12:41:29 -05:00
Nico Weber 1739e7ed69 [gn build] Port 7e3b9aba60 2021-02-11 11:54:51 -05:00
Nico Weber 78717f56ba [gn build] Port b4993cf54d 2021-02-11 07:20:21 -05:00
Nico Weber ec4fb5bcd3 [gn build] (manually) port e89fcbfad6 2021-02-10 08:59:07 -05:00
LLVM GN Syncbot 76748b67d1 [gn build] Port 40c261c41c 2021-02-09 09:19:31 +00:00
LLVM GN Syncbot 71a79e7b4b [gn build] Port 87104faac4 2021-02-09 01:14:44 +00:00
Nico Weber 69f5bd2ec5 [gn build] reformat all gn files
$ git ls-files '*.gn' '*.gni' | xargs llvm/utils/gn/gn.py format
2021-02-08 16:11:01 -05:00
LLVM GN Syncbot 4af73572c7 [gn build] Port be0efa1f23 2021-02-06 16:40:55 +00:00
Nico Weber 5f76044c25 [gn build] enable new pass manager more, follow-up to 39ceb5c9cf 2021-02-05 16:15:14 -05:00
Sanjay Patel c981f6f8e1 Revert "[Codegen][ReplaceWithVecLib] add pass to replace vector intrinsics with calls to vector library"
This reverts commit 2303e93e66.
Investigating bot failures.
2021-02-05 15:10:11 -05:00
Lukas Sommer 2303e93e66 [Codegen][ReplaceWithVecLib] add pass to replace vector intrinsics with calls to vector library
This patch adds a pass to replace calls to vector intrinsics
(i.e., LLVM intrinsics operating on vector operands) with
calls to a vector library.

Currently, calls to LLVM intrinsics are only replaced with
calls to vector libraries when scalar calls to intrinsics are
vectorized by the Loop- or SLP-Vectorizer.

With this pass, it is now possible to replace calls to LLVM
intrinsics already operating on vector operands, e.g., if
such code was generated by MLIR. For the replacement,
information from the TargetLibraryInfo, e.g., as specified
via -vector-library is used.

Differential Revision: https://reviews.llvm.org/D95373
2021-02-05 14:25:19 -05:00
Arthur Eubanks 39ceb5c9cf [gn build] Turn on new pass manager by default
Matches cmake build
2021-02-05 09:11:07 -08:00
Louis Dionne b51756819a [libc++] Rename include/support to include/__support
We do ship those headers, so the directory name should not be something
that can potentially conflict with user-defined directories.

Differential Revision: https://reviews.llvm.org/D95956
2021-02-04 10:16:33 -05:00
Nico Weber 26ca503bd2 [gn build] (manually) port 0609f257dc 2021-02-04 06:52:55 -05:00
Arthur Eubanks f020544601 [NewPM][HelloWorld] Move HelloWorld to Utils
To prevent creating a new component, which creates a new library.

Reviewed By: ychen

Differential Revision: https://reviews.llvm.org/D95907
2021-02-03 12:59:40 -08:00
LLVM GN Syncbot b86e9c83a6 [gn build] Port fcf03e7280 2021-02-03 05:46:53 +00:00
LLVM GN Syncbot 2569ab4deb [gn build] Port 4f58b1bd29 2021-02-02 22:57:59 +00:00
LLVM GN Syncbot 313a36130f [gn build] Port b63cd4db91 2021-02-01 14:24:45 +00:00
Nico Weber 229c1cff51 [gn build] port e90e455d2a 2021-01-29 08:36:19 -05:00
Nico Weber 64ced3ce89 [gn build] (semi-manually) port 2ff8662b5d 2021-01-29 06:48:17 -05:00
Nico Weber eae50bb210 [gn build] (manually) port 081c1db02d more 2021-01-28 13:32:49 -05:00
Nico Weber 8c54583b2e [gn build] (manually) port 3b625060fc 2021-01-28 13:26:37 -05:00
Nico Weber 658398c842 [gn build] (semi-manually) port 081c1db02d 2021-01-28 13:05:10 -05:00
LLVM GN Syncbot e19ec9ca41 [gn build] Port 0b50fa9945 2021-01-27 18:55:59 +00:00
Tom Stellard 5369517d20 Bump the trunk major version to 13
and clear the release notes.
2021-01-26 19:37:55 -08:00
LLVM GN Syncbot 1458987407 [gn build] Port bb9eb19829 2021-01-27 01:23:23 +00:00
Nico Weber 65e2fa5060 [gn build] fix get.py change 2021-01-26 19:20:23 -05:00
Nico Weber 4dcb5c4403 [gn build] restore build command removed in 9595a7ff55 for platforms without prebuilts 2021-01-26 19:19:31 -05:00
LLVM GN Syncbot da9a3540e2 [gn build] Port 1e634f3952 2021-01-26 20:48:31 +00:00
LLVM GN Syncbot 96f09aa2fb [gn build] Port 4edf35f11a 2021-01-26 19:12:09 +00:00
LLVM GN Syncbot 12b34ffc35 [gn build] Port e123cd674c 2021-01-25 20:11:10 +00:00
LLVM GN Syncbot d5c4de40c6 [gn build] Port 0057cc5a21 2021-01-23 14:07:39 +00:00
LLVM GN Syncbot dbf87da739 [gn build] Port 2325157c05 2021-01-23 13:38:51 +00:00
LLVM GN Syncbot 083088d136 [gn build] Port 622eaa4a4c 2021-01-22 21:40:40 +00:00
LLVM GN Syncbot 509741382f [gn build] Port 8214982b50 2021-01-22 10:24:45 +00:00
Arthur Eubanks a11bf9a7fb [AMDGPU][Inliner] Remove amdgpu-inline and add a new TTI inline hook
Having a custom inliner doesn't really fit in with the new PM's
pipeline. It's also extra technical debt.

amdgpu-inline only does a couple of custom things compared to the normal
inliner:
1) It disables inlining if the number of BBs in a function would exceed
   some limit
2) It increases the threshold if there are pointers to private arrays(?)

These can all be handled as TTI inliner hooks.
There already exists a hook for backends to multiply the inlining
threshold.

This way we can remove the custom amdgpu-inline pass.

This caused inline-hint.ll to fail, and after some investigation, it
looks like getInliningThresholdMultiplier() was previously getting
applied twice in amdgpu-inline (https://reviews.llvm.org/D62707 fixed it
not applying at all, so some later inliner change must have fixed
something), so I had to change the threshold in the test.

Reviewed By: rampitec

Differential Revision: https://reviews.llvm.org/D94153
2021-01-21 20:29:17 -08:00
LLVM GN Syncbot 0cd1e47327 [gn build] Port d38be2ba0e 2021-01-21 23:19:45 +00:00
LLVM GN Syncbot 36b05d2e9f [gn build] Port 95ce32c787 2021-01-20 21:18:20 +00:00
Nico Weber 7f36df0fb1 [gn build] fix libcxx gn file with libcxx_abi_namespace set 2021-01-19 19:02:40 -05:00
Nico Weber be59bac184 [gn build] (manually) port 933518fff8 2021-01-19 18:51:39 -05:00
Nico Weber 0975604cc0 [gn build] (manually) port 387d3c2479 2021-01-14 16:19:25 -05:00
Valentin Clement ca98baa042 [openacc] Rename generated file from ACC.cpp.inc to ACC.inc to match D92955
This patch rename the tablegen generated file ACC.cpp.inc to ACC.inc in order
to match what was done in D92955. This file is included in header file as well as .cpp
file so it make more sense.

Reviewed By: sameeranjoshi

Differential Revision: https://reviews.llvm.org/D93485
2021-01-14 14:19:53 -05:00
LLVM GN Syncbot b4e083b0ef [gn build] Port 2f395b7092 2021-01-14 17:39:58 +00:00
LLVM GN Syncbot 14f322f074 [gn build] Port 60fda8ebb6 2021-01-13 17:33:32 +00:00
Nico Weber acea470c16 [gn build] Reorganize libcxx/include/BUILD.gn a bit
- Merge 6706342f48 -- no more libcxx_needs_site_config, we now
  always need it
- Since it was always off in practice, write_config bitrot. Unbitrot
  it so that it works
- Remove copy step and let concat step write to final location
  immediately -- and fix copy destination directory

As a side effect, libcxx/include/BUILD.gn now has only a single
sources list, which means the cmake sync script should be able to
automatically sync additions and removals of .h files. On the flipside,
this means this file now must be updated after most changes to
libcxx/include/__config_site.in, and looking through the last few months
of changes this looks like it's going to be a wash.
2021-01-12 21:30:06 -05:00
Nico Weber 25b3921f2f [gn build] (manually) port 79f99ba65d 2021-01-12 20:30:56 -05:00
Nico Weber 87d4ea2433 [gn build] Make an explicit `use_lld = true` on mac use lld.darwinnew
use_lld defaults to true on non-mac if clang_base_path is set (i.e.
the host compiler is a locally-built clang). On mac, the lld Mach-O
port used to be unusable, but ld64.lld.darwinnew is close to usable.
When explicitly setting `use_lld = true` in a GN build on a mac host,
check-lld passes, two check-clang tests fail, and a handful check-llvm
tests fail (the latter all due to -flat_namespace not yet being implemented).
2021-01-09 14:03:52 -05:00
LLVM GN Syncbot 657db0c6d4 [gn build] Port 9c4b2225b2 2021-01-08 13:30:54 +00:00
LLVM GN Syncbot 495b301de6 [gn build] Port 6b0ee02747 2021-01-08 04:23:02 +00:00
Nico Weber 2759041786 [gn build] (manually) merge a whole bunch of libc++ header files
I noticed __availability was missing, so I manually diffed the
file lists and put all recently(ish) added headers:
* __availability from 2eadbc8614
* concepts from 601f763182
* execution from 0a06eb911b
* numbers from 4f6c4b473c

Also remove libcxx_install_support_headers like the CMake build did in
6706342f48, and unconditionally copy
support/win32/{limits_msvc_win32.h,locale_win32.h} like the CMake
build always did as far as I can tell.
2021-01-07 22:09:35 -05:00
LLVM GN Syncbot ab814896dc [gn build] Port b12f26733a 2021-01-08 02:19:24 +00:00
LLVM GN Syncbot 5471b1fa40 [gn build] Port d2ddc694ff 2021-01-07 08:29:23 +00:00
LLVM GN Syncbot bf09e25e1e [gn build] Port fec1a442e3 2021-01-05 15:34:25 +00:00
LLVM GN Syncbot 835bdd1776 [gn build] Port 5799fc79c3 2021-01-02 22:46:43 +00:00
Nico Weber fc3f53fcda [gn build] (manually) port 5e31e226b5: Use Py3 for the build
Made necessary by 20670ba440, the first Py3-only change.
2021-01-01 22:14:03 -05:00
Nico Weber 51a292d994 [gn build] Switch copy_bundle_data from pax to cpio
This will hopefully fix the build not becoming clean when using Ninja
1.9+. Ninja 1.9 enabled high-resolution time stamps, but pax doesn't
correctly set high-resolution timestamps on its output.

See https://github.com/nico/hack/blob/master/notes/copydir.md for a
detailed writeup of problem and alternatives.
2020-12-30 13:59:03 -05:00
LLVM GN Syncbot 57b8afda10 [gn build] Port 480936e741 2020-12-30 00:40:53 +00:00
LLVM GN Syncbot a373eacb56 [gn build] Port 16c8f6e913 2020-12-30 00:29:58 +00:00
LLVM GN Syncbot 92207b2cce [gn build] Port 21314940c4 2020-12-29 23:18:48 +00:00