1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 20:23:11 +01:00
Commit Graph

2039 Commits

Author SHA1 Message Date
Nico Weber
cde6b35842 [gn build] (semi-manually) port 966386514bec 2021-07-07 19:27:19 -04:00
Fangrui Song
3586ecfc1a [llvm-nm] Switch command line parsing from llvm::cl to OptTable
Part of https://lists.llvm.org/pipermail/llvm-dev/2021-July/151622.html
"Binary utilities: switch command line parsing from llvm::cl to OptTable"

Users should generally observe no difference as long as they only use intended
option forms. Behavior changes:

* `-t=d` is removed. Use `-t d` instead.
* `--demangle=0` cannot be used. Omit the option or use `--no-demangle` instead.
* `--help-list` is removed. This is a `cl::` specific option.

Note:

* `-t` diagnostic gets improved.
* This patch avoids cl::opt collision if we decide to support multiplexing for binary utilities
* One-dash long options are still supported.
* The `-s` collision (`-s segment section` for Mach-O) is unfortunate. `-s` means `--print-armap` in GNU nm.
* This patch removes the last `cl::multi_val` use case from the `llvm/lib/Support/CommandLine.cpp` library

`-M` (`--print-armap`), `-U` (`--defined-only`), and `-W` (`--no-weak`)
are now deprecated. They could conflict with future GNU nm options.
(--print-armap has an existing alias -s, so GNU will unlikely add a new one.
--no-weak (not in GNU nm) is rarely used anyway.)

`--just-symbol-name` is now deprecated in favor of
`--format=just-symbols` and `-j`.

Reviewed By: jhenderson

Differential Revision: https://reviews.llvm.org/D105330
2021-07-07 13:34:33 -07:00
LLVM GN Syncbot
a67e94b8ca [gn build] Port 6829db727e9e 2021-07-07 10:14:59 +00:00
LLVM GN Syncbot
7ae669846a [gn build] Port 8517a26d442f 2021-07-06 18:17:43 +00:00
Nico Weber
27befb62e0 [gn build] (manually) port 98f078324fc5 (llvm-strings Opts.td) 2021-07-05 14:43:05 -04:00
LLVM GN Syncbot
15c9cd07da [gn build] Port 99f00635d7ac 2021-07-02 17:03:49 +00:00
LLVM GN Syncbot
18f6051a4c [gn build] Port bf64210fd88f 2021-07-02 16:12:54 +00:00
Sam McCall
f01feb00be Revert "[clangd] Unbreak mac build differently 0c96a92d8666b8"
This reverts commit 2f79acb7b701c41494abff588b5f03a74ea2e11d.

Should no longer be needed after 26e1553a107f52667be879e99739a4153f8799d8
2021-07-02 16:29:48 +02:00
LLVM GN Syncbot
62f1d32559 [gn build] Port a92964779cb5 2021-07-02 13:05:44 +00:00
LLVM GN Syncbot
a3a9d61236 [gn build] Port 33a7b4d9d8e6 2021-07-01 22:26:09 +00:00
Nico Weber
856c1b08d5 [gn build] Port 050b064f15ee 2021-07-01 14:52:21 -04:00
Nico Weber
394ac62585 [clangd] Unbreak mac build differently 0c96a92d8666b8
This reverts b56e5f8a10c1 (and follow-up f6db88535cb) and instead
restores the state we had before 0c96a92d8666b8: ClangdMain.cpp
includes Features.inc before including Transport.h.

This is a bit ugly, but it matches the former state and making Transport.h
include Features.h means that xpc/ needs to be able to find the generated
Features.inc, wich is also a bit ugly.
2021-07-01 10:51:27 -04:00
LLVM GN Syncbot
81673f2df8 [gn build] Port 39f64c4c8375 2021-07-01 08:31:00 +00:00
LLVM GN Syncbot
4a2c6265d9 [gn build] Port 28b01c59c93d 2021-07-01 04:00:13 +00:00
LLVM GN Syncbot
d69d14b00d [gn build] Port 662c55442f17 2021-07-01 03:45:41 +00:00
LLVM GN Syncbot
a277ada21c [gn build] Port 381ded345bdd 2021-06-30 18:49:16 +00:00
Nico Weber
c59b205c9c [gn build] (manually) port f617ab104451 (DoublerPlugin) 2021-06-30 14:49:06 -04:00
Nico Weber
f604789ef5 [gn build] add dep needed after b56e5f8a10c1e 2021-06-30 12:58:59 -04:00
LLVM GN Syncbot
4addd52a45 [gn build] Port 0c96a92d8666 2021-06-30 15:57:43 +00:00
LLVM GN Syncbot
93f53bac4a [gn build] Port d03aa7d6b66f 2021-06-29 15:41:00 +00:00
LLVM GN Syncbot
9bb30676fd [gn build] Port 9b02a9b40150 2021-06-29 09:44:27 +00:00
LLVM GN Syncbot
c68d0345e7 [gn build] Port 159024ce2315 2021-06-29 09:44:26 +00:00
LLVM GN Syncbot
8356e90c32 [gn build] Port f32f3db9fcbf 2021-06-28 16:30:29 +00:00
LLVM GN Syncbot
39ed7fe00e [gn build] Port 499e39c5983d 2021-06-28 08:50:56 +00:00
LLVM GN Syncbot
4d0d5cf124 [gn build] Port 8b7881a084d0 2021-06-26 14:20:52 +00:00
LLVM GN Syncbot
769467b21f [gn build] Port aff57ff24aca 2021-06-26 11:38:00 +00:00
LLVM GN Syncbot
8f1d8367e8 [gn build] Port 69d5a6662115 2021-06-25 00:29:34 +00:00
LLVM GN Syncbot
0394084380 [gn build] Port 6adbc83ee9e4 2021-06-24 18:02:44 +00:00
Nico Weber
15adc02ee3 [gn build] Fix a comment typo and a comment copy-pasto 2021-06-24 11:06:48 -04:00
Nico Weber
64fb2ced44 [gn build] Remove an unneeded -I flag
Everything includes clang/Config/config.h by qualified "clang/Config/config.h"
path, so there's no need for `-Igen/clang/include/clang/Config/clang/include`.

No behavior change.
2021-06-24 10:18:49 -04:00
Peter Collingbourne
1f2c61f362 gn build: Build ubsan_minimal on Android. 2021-06-23 19:25:21 -07:00
Andrew Litteken
6cfd76633f [IRSim] Adding basic implementation of llvm-sim.
This is a similarity visualization tool that accepts a Module and
passes it to the IRSimilarityIdentifier.  The resulting SimilarityGroups
are output in a JSON file.

Tests are found in test/tools/llvm-sim and check for the file not found,
a bad module, and that the JSON is created correctly.

Reviewers: paquette, jroelofs, MaskRay

Recommit of: 15645d044bcfe2a0f63156048b302f997a717688 to fix linking
errors and GN build system.

Differential Revision: https://reviews.llvm.org/D86974
2021-06-23 14:38:58 -05:00
LLVM GN Syncbot
5b75cf9bf8 [gn build] Port 560170fa2de5 2021-06-23 17:11:10 +00:00
Nico Weber
d6577233fa [gn build] don't build ubsan_minimal on mac
It doesn't build there, see http://45.33.8.238/macm1/12180/step_4.txt
2021-06-22 22:21:20 -04:00
Peter Collingbourne
48ca0247f9 gn build: Only build the TSan runtime on 64-bit platforms.
TSan only supports 64-bit platforms.

Differential Revision: https://reviews.llvm.org/D104755
2021-06-22 17:51:00 -07:00
Peter Collingbourne
5b5b35d51b gn build: Add support for building ubsan_minimal.
Differential Revision: https://reviews.llvm.org/D104754
2021-06-22 17:51:00 -07:00
Peter Collingbourne
458d10ff3a gn build: Rebase clang-tblgen include path against root_build_dir instead of root_out_dir.
Fixes clang cross-compilation.

Also remove some redundant include path arguments.
2021-06-22 14:32:24 -07:00
Nico Weber
fe6edd20fe [gn build] manually port c747b7d1d9a2 more (config.osx_sysroot) 2021-06-22 15:33:52 -04:00
LLVM GN Syncbot
1bf34b2165 [gn build] Port 40d6d2c49dd1 2021-06-22 17:03:46 +00:00
Nico Weber
afac7e2fd3 [gn build] manually port c747b7d1d9a2 (config.osx_sysroot) 2021-06-22 12:50:58 -04:00
LLVM GN Syncbot
150a090f84 [gn build] Port 208332de8abf 2021-06-21 07:27:34 +00:00
LLVM GN Syncbot
75f1abb9b8 [gn build] Port 80fd5fa5269c 2021-06-21 06:23:08 +00:00
Nico Weber
a20aff32da [gn build] (manually) port b9c05aff205b (MIRTests) 2021-06-19 13:04:09 -04:00
LLVM GN Syncbot
db683fa2a1 [gn build] Port 134723edd5bf 2021-06-19 11:49:56 +00:00
LLVM GN Syncbot
55cf55cf08 [gn build] Port f27e4548fc42 2021-06-17 17:09:43 +00:00
Nico Weber
9be684f5d3 [gn build] (manually) port f9aba9a5afe 2021-06-16 18:04:46 -04:00
LLVM GN Syncbot
a4f344271c [gn build] Port ef16c8eaa5cd 2021-06-16 15:57:43 +00:00
LLVM GN Syncbot
a020da51e1 [gn build] Port 6478ef61b1a4 2021-06-15 20:04:02 +00:00
Vitaly Buka
e7f5783c60 [asan] Remove Asan, Ubsan support of RTEMS and Myriad
Differential Revision: https://reviews.llvm.org/D104279
2021-06-15 12:59:05 -07:00
Roman Lebedev
10ca53ce65 [NewPM] Remove SpeculateAroundPHIs pass
Addition of this pass has been botched.
There is no particular reason why it had to be sold as an inseparable part
of new-pm transition. It was added when old-pm was still the default,
and very *very* few users were actually tracking new-pm,
so it's effects weren't measured.

Which means, some of the turnoil of the new-pm transition
are actually likely regressions due to this pass.

Likewise, there has been a number of post-commit feedback
(post new-pm switch), namely
* https://reviews.llvm.org/D37467#2787157 (regresses HW-loops)
* https://reviews.llvm.org/D37467#2787259 (should not be in middle-end, should run after LSR, not before)
* https://reviews.llvm.org/D95789 (an attempt to fix bad loop backedge metadata)
and in the half year past, the pass authors (google) still haven't found time to respond to any of that.

Hereby it is proposed to backout the pass from the pipeline,
until someone who cares about it can address the issues reported,
and properly start the process of adding a new pass into the pipeline,
with proper performance evaluation.

Furthermore, neither google nor facebook reports any perf changes
from this change, so i'm dropping the pass completely.
It can always be re-reverted should/if anyone want to pick it up again.

Reviewed By: aeubanks

Differential Revision: https://reviews.llvm.org/D104099
2021-06-15 20:35:55 +03:00
LLVM GN Syncbot
5b8f203a86 [gn build] Port 4eb9fe2e1a07 2021-06-15 12:01:01 +00:00
LLVM GN Syncbot
d90014c622 [gn build] Port d0a5d8611935 2021-06-15 05:56:32 +00:00
LLVM GN Syncbot
4f6c145c6a [gn build] Port c820b494d6e1 2021-06-14 14:41:33 +00:00
LLVM GN Syncbot
174f747fbd [gn build] Port 7eba4856c702 2021-06-11 18:04:01 +00:00
LLVM GN Syncbot
c85b97b264 [gn build] Port c54d3050f7b9 2021-06-11 16:57:34 +00:00
LLVM GN Syncbot
0f438067de [gn build] Port 9106047ee3dd 2021-06-11 16:34:49 +00:00
LLVM GN Syncbot
621e1fc902 [gn build] Port 9907746f5db7 2021-06-11 14:01:11 +00:00
LLVM GN Syncbot
a7bd77dff1 [gn build] Port c4a0969b9c14 2021-06-11 08:23:07 +00:00
LLVM GN Syncbot
c9694dc562 [gn build] Port bbb3d03f93b8 2021-06-10 19:39:58 +00:00
Nico Weber
f63c735892 [gn build] minor TODO.txt update 2021-06-10 12:50:23 -04:00
Nico Weber
b706e7826c Reland "[gn build] port d1d36f7ad (llvm-tapi-diff)"
This reverts commit d84ed15c649616a50abdd7fbd9b28ddebb9f432c
The original change relanded in 5b5ab80e3195.
2021-06-10 06:22:03 -04:00
Nico Weber
1f78d78c62 [gn build] (semi-manually) port 944b3c53aec5 2021-06-08 15:21:03 -04:00
LLVM GN Syncbot
8ad1e65afe [gn build] Port 692d7166f771 2021-06-08 00:16:13 +00:00
Nico Weber
52fe7939d4 [gn build] fix syntax error from 50bb1b930dbc 2021-06-07 07:27:58 -04:00
Jingu Kang
7721ad79a0 [SimpleLoopBoundSplit] Split Bound of Loop which has conditional branch with IV
This pass transforms loops that contain a conditional branch with induction
variable. For example, it transforms left code to right code:

                             newbound = min(n, c)
 while (iv < n) {            while(iv < newbound) {
   A                           A
   if (iv < c)                 B
     B                         C
   C                         }
 }                           if (iv != n) {
                               while (iv < n) {
                                 A
                                 C
                               }
                             }

Differential Revision: https://reviews.llvm.org/D102234
2021-06-07 10:55:25 +01:00
Esme-Yi
4a3c52750c [yaml2obj] Initial the support of yaml2obj for 32-bit XCOFF.
Summary: The patch implements the mapping of the Yaml
information to XCOFF object file to enable the yaml2obj
tool for XCOFF. Currently only 32-bit is supported.

Reviewed By: jhenderson, shchenz

Differential Revision: https://reviews.llvm.org/D95505
2021-06-07 04:14:44 +00:00
Vitaly Buka
6f08ed2393 Revert "Update and improve compiler-rt tests for -mllvm -asan_use_after_return=(never|[runtime]|always)."
Windows is still broken.

This reverts commit 927688a4cd9dcde92e8bf430e6ceefac6ab8c8a0.
2021-06-05 00:39:50 -07:00
Kevin Athey
6bd5841410 Update and improve compiler-rt tests for -mllvm -asan_use_after_return=(never|[runtime]|always).
In addition:
  - optionally add global flag to capture compile intent for UAR:
    __asan_detect_use_after_return_always.
    The global is a SANITIZER_WEAK_ATTRIBUTE.

for issue: https://github.com/google/sanitizers/issues/1394

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D103304
2021-06-05 00:26:10 -07:00
Vitaly Buka
4962534c4a Revert "[gn build] manually port 60e5243e593e (weak asan symbol)"
Not needed after d8a4a2cb93212c493b7b47663c1cda1103de0bfc.

This reverts commit 00542932fe13ea3b989f40b434399c72f5eca4ec.
2021-06-05 00:02:50 -07:00
Nico Weber
66eb7fdc4f [gn build] manually port 60e5243e593e (weak asan symbol) 2021-06-04 19:49:41 -04:00
Nico Weber
8a6b99494c [gn build] (semi-manually) port 07c92b2e9581 2021-06-04 16:41:42 -04:00
LLVM GN Syncbot
601a8b2bc9 [gn build] Port d31a2e7554ea 2021-06-04 16:41:04 +00:00
LLVM GN Syncbot
3a3c157dfb [gn build] Port 7ed7d4ccb899 2021-06-04 16:41:03 +00:00
Nico Weber
a9f5bf83d0 [gn build] (manually) port de07b1e84d8de9 2021-06-04 10:37:53 -04:00
Nico Weber
5442d5f5fd Revert "[gn build] port d1d36f7ad (llvm-tapi-diff)"
This reverts commit 13155138c1ce1e91032d467e20e557f9cdbf08f5.
d1d36f7ad was reverted in 5337c7550d.
2021-06-04 06:46:19 -04:00
Nico Weber
218519bf96 [gn build] port d1d36f7ad (llvm-tapi-diff) 2021-06-03 19:22:39 -04:00
LLVM GN Syncbot
bb16d7139c [gn build] Port 05d164b25c40 2021-06-02 19:59:40 +00:00
Nico Weber
511556e3ea [lld/mac] Implement -dead_strip
Also adds support for live_support sections, no_dead_strip sections,
.no_dead_strip symbols.

Chromium Framework 345MB unstripped -> 250MB stripped
(vs 290MB unstripped -> 236M stripped with ld64).

Doing dead stripping is a bit faster than not, because so much less
data needs to be processed:

    % ministat lld_*
    x lld_nostrip.txt
    + lld_strip.txt
        N           Min           Max        Median           Avg        Stddev
    x  10      3.929414       4.07692     4.0269079     4.0089678   0.044214794
    +  10     3.8129408     3.9025559     3.8670411     3.8642573   0.024779651
    Difference at 95.0% confidence
            -0.144711 +/- 0.0336749
            -3.60967% +/- 0.839989%
            (Student's t, pooled s = 0.0358398)

This interacts with many parts of the linker. I tried to add test coverage
for all added `isLive()` checks, so that some test will fail if any of them
is removed. I checked that the test expectations for the most part match
ld64's behavior (except for live-support-iterations.s, see the comment
in the test). Interacts with:
- debug info
- export tries
- import opcodes
- flags like -exported_symbol(s_list)
- -U / dynamic_lookup
- mod_init_funcs, mod_term_funcs
- weak symbol handling
- unwind info
- stubs
- map files
- -sectcreate
- undefined, dylib, common, defined (both absolute and normal) symbols

It's possible it interacts with more features I didn't think of,
of course.

I also did some manual testing:
- check-llvm check-clang check-lld work with lld with this patch
  as host linker and -dead_strip enabled
- Chromium still starts
- Chromium's base_unittests still pass, including unwind tests

Implemenation-wise, this is InputSection-based, so it'll work for
object files with .subsections_via_symbols (which includes all
object files generated by clang). I first based this on the COFF
implementation, but later realized that things are more similar to ELF.
I think it'd be good to refactor MarkLive.cpp to look more like the ELF
part at some point, but I'd like to get a working state checked in first.

Mechanical parts:
- Rename canOmitFromOutput to wasCoalesced (no behavior change)
  since it really is for weak coalesced symbols
- Add noDeadStrip to Defined, corresponding to N_NO_DEAD_STRIP
  (`.no_dead_strip` in asm)

Fixes PR49276.

Differential Revision: https://reviews.llvm.org/D103324
2021-06-02 11:09:26 -04:00
LLVM GN Syncbot
5680b05e63 [gn build] Port 924ea3bb53ca 2021-06-02 01:47:33 +00:00
LLVM GN Syncbot
f55aa7710b [gn build] Port 065cf3f9d703 2021-06-01 21:08:31 +00:00
LLVM GN Syncbot
ae74a4e8b3 [gn build] Port aaac268285ff 2021-06-01 20:28:25 +00:00
LLVM GN Syncbot
92d9ca26bc [gn build] Port 5671ff20d92b 2021-06-01 19:37:29 +00:00
Nico Weber
13cf3435ae [gn build] make libunwind build on macOS 2021-05-31 13:17:16 -04:00
Arthur Eubanks
7178161bf7 Remove "Rewrite Symbols" from codegen pipeline
It breaks up the function pass manager in the codegen pipeline.

With empty parameters, it looks at the -mllvm flag -rewrite-map-file.
This is likely not in use.

Add a check that we only have one function pass manager in the codegen
pipeline.

Some tests relied on the fact that we had a module pass somewhere in the
codegen pipeline.

addr-label.ll crashes on ARM due to this change. This is because a
ARMConstantPoolConstant containing a BasicBlock to represent a
blockaddress may hold an invalid pointer to a BasicBlock if the
blockaddress is invalidated by its BasicBlock getting removed. In that
case all referencing blockaddresses are RAUW a constant int. Making
ARMConstantPoolConstant::CVal a WeakVH fixes the crash, but I'm not sure
that's the right fix. As a workaround, create a barrier right before
ISel so that IR optimizations can't happen while a
ARMConstantPoolConstant has been created.

Reviewed By: rnk, MaskRay, compnerd

Differential Revision: https://reviews.llvm.org/D99707
2021-05-31 08:32:36 -07:00
LLVM GN Syncbot
3dc711e872 [gn build] Port b13edf6e907b 2021-05-29 07:51:43 +00:00
Nico Weber
311aa386aa [gn build] manually port 982e3c05108b6 (check-lld needs dsymutil) 2021-05-28 15:39:12 -04:00
LLVM GN Syncbot
995b39f2fa [gn build] Port 9968896cd62a 2021-05-28 18:57:30 +00:00
Reid Kleckner
c5daefddfe [gn] Make ubsan errors fatal, as in cmake
Apparently ubsan errors are non-fatal by default. If you introduce UB
into LLVM and run the tests, if errors are not fatal, the test will
still produce the expected output and the tests will pass. In order to
make ubsan errors show up as test failures, they have to be made fatal.
Pass the -fno-sanitize-recover=all flag to make it so.

Differential Revision: https://reviews.llvm.org/D103298
2021-05-28 08:05:37 -07:00
LLVM GN Syncbot
a4add6ae20 [gn build] Port 58b29a4efc22 2021-05-28 14:09:31 +00:00
Nico Weber
597dcf2f46 [gn build] (semi-manually) port bd04d78d649b 2021-05-28 08:04:52 -04:00
LLVM GN Syncbot
75be5c89d2 [gn build] Port 857fa7b7b187 2021-05-27 04:42:56 +00:00
LLVM GN Syncbot
878593c3e2 [gn build] Port 0dc7fd1bc167 2021-05-27 04:42:55 +00:00
LLVM GN Syncbot
6a5774190b [gn build] Port de9df3f5b952 2021-05-26 15:57:01 +00:00
LLVM GN Syncbot
5a48acaef9 [gn build] Port 16342e39947b 2021-05-26 15:45:57 +00:00
LLVM GN Syncbot
4876ff1ec7 [gn build] Port 36d0fdf9ac3b 2021-05-26 04:31:12 +00:00
LLVM GN Syncbot
51ec30d56f [gn build] Port 33706191d88d 2021-05-25 18:58:50 +00:00
LLVM GN Syncbot
604164d943 [gn build] Port b510e4cf1b96 2021-05-24 18:48:17 +00:00
LLVM GN Syncbot
90d57fab4e [gn build] Port a64ebb863727 2021-05-24 18:36:50 +00:00
LLVM GN Syncbot
1a857f7158 [gn build] Port 095e91c9737b 2021-05-24 17:18:43 +00:00
Nico Weber
9cfe1a59a7 [gn build] (semi-manually) port 0bccdf82f705 2021-05-23 10:01:06 -04:00