10476 Commits

Author SHA1 Message Date
LLVM GN Syncbot
ae4c0c7cfc [gn build] Port ccfb0555f76b 2021-10-06 22:24:38 +00:00
LLVM GN Syncbot
9f5c70c7ad [gn build] Port 67231650e6ef 2021-10-06 20:22:05 +00:00
Nico Weber
07e5394c63 [gn build] (manually) port 77d5ccdc6f460
(similar to 64f623d4c37c6)
2021-10-06 15:41:38 -04:00
LLVM GN Syncbot
665662a71e [gn build] Port 10f16bc7b2bf 2021-10-06 17:59:12 +00:00
LLVM GN Syncbot
1e013f112e [gn build] Port a30a36f66aea 2021-10-06 11:59:40 +00:00
LLVM GN Syncbot
a67b1220f5 [gn build] Port fc36fb4d23a5 2021-10-06 08:40:14 +00:00
Markus Lavin
91d15aa0b8 [NPM] Automatic 'opt' pipeline reducer script.
Script for automatic 'opt' pipeline reduction for when using the new
pass-manager (NPM). Based around the '-print-pipeline-passes' option.

The reduction algorithm consists of several phases (steps).

Step #0: Verify that input fails with the given pipeline and make note of the
error code.

Step #1: Split pipeline in two starting from front and move forward as long as
first pipeline exits normally and the second pipeline fails with the expected
error code. Move on to step #2 with the IR from the split point and the
pipeline from the second invocation.

Step #2: Remove passes from end of the pipeline as long as the pipeline fails
with the expected error code.

Step #3: Make several sweeps over the remaining pipeline trying to remove one
pass at a time. Repeat sweeps until unable to remove any more passes.

Usage example:
./utils/reduce_pipeline.py --opt-binary=./build-all-Debug/bin/opt --input=input.ll --output=output.ll --passes=PIPELINE [EXTRA-OPT-ARGS ...]

Differential Revision: https://reviews.llvm.org/D110908
2021-10-06 09:09:33 +02:00
Simon Pilgrim
3ca232feb3 [TableGen] CodeEmitterGen - emit report_fatal_error(const char*) instead of report_fatal_error(std::string&)
As described on D111049, we're trying to remove the <string> dependency from error handling. In most cases the plan is to use the Twine() variant directly but to reduce introducing additional headers for the generated files, I'm using the const char* variant here instead.
2021-10-05 17:03:18 +01:00
LLVM GN Syncbot
8b2d6fd6cb [gn build] Port 214054f78a4e 2021-10-05 10:41:33 +00:00
LLVM GN Syncbot
e66121b68e [gn build] Port cfef1803dd83 2021-10-05 04:34:07 +00:00
LLVM GN Syncbot
72abda418e [gn build] Port 811b1736d91b 2021-10-04 15:13:27 +00:00
Jay Foad
a9bceb2b05 [APInt] Stop using soft-deprecated constructors and methods in llvm. NFC.
Stop using APInt constructors and methods that were soft-deprecated in
D109483. This fixes all the uses I found in llvm, except for the APInt
unit tests which should still test the deprecated methods.

Differential Revision: https://reviews.llvm.org/D110807
2021-10-04 08:57:44 +01:00
Dávid Bolvanský
b1fcca3884 Fixed warnings in LLVM produced by -Wbitwise-instead-of-logical 2021-10-03 13:04:18 +02:00
LLVM GN Syncbot
e420164f40 [gn build] Port 657f02d45804 2021-10-02 00:21:42 +00:00
LLVM GN Syncbot
4cdee8de6b [gn build] Port c8c2b4629f75 2021-10-01 20:14:30 +00:00
LLVM GN Syncbot
06cea95a5a [gn build] Port 33dd98e9e499 2021-10-01 18:18:21 +00:00
LLVM GN Syncbot
9c49587cc1 [gn build] Port 47d6274d4c31 2021-10-01 14:57:31 +00:00
LLVM GN Syncbot
4f0a39b9b4 [gn build] Port fb99424a6f65 2021-10-01 14:29:37 +00:00
LLVM GN Syncbot
fcdefc8575 [gn build] Port 3077bc90de8d 2021-10-01 00:43:50 +00:00
LLVM GN Syncbot
0337e228c1 [gn build] Port 050edef8538e 2021-09-30 19:35:12 +00:00
Nico Weber
e31899c708 Reland "[clang-cl] Accept #pragma warning(disable : N) for some N"
This reverts commit 0cd9d8a48bdddb17de2c6388f9d775353f9acab9 and
adds the changes described in https://reviews.llvm.org/D110668#3034461.
2021-09-30 15:03:23 -04:00
LLVM GN Syncbot
4db00342e5 [gn build] Port 13f3c39f3658 2021-09-30 08:28:24 +00:00
Amy Huang
0cd9d8a48b Revert "[clang-cl] Accept #pragma warning(disable : N) for some N"
because it causes `error: error reading '/wd4091'` errors in
compiler-rt builds.
2021-09-29 18:46:55 -07:00
LLVM GN Syncbot
9ad17fe0de [gn build] Port 969359e3b86b 2021-09-29 20:09:08 +00:00
Nico Weber
b2de52bec1 [clang-cl] Accept #pragma warning(disable : N) for some N
clang-cl maps /wdNNNN to -Wno-flags for a few warnings that map
cleanly from cl.exe concepts to clang concepts.

This patch adds support for the same numbers to
`#pragma warning(disable : NNNN)`. It also lets
`#pragma warning(push)` and `#pragma warning(pop)` have an effect,
since these are used together with `warning(disable)`.

The optional numeric argument to `warning(push)` is ignored,
as are the other non-`disable` `pragma warning()` arguments.
(Supporting `error` would be easy, but we also don't support
`/we`, and those should probably be added together.)

The motivating example is that a bunch of code (including in LLVM)
uses this idiom to locally disable warnings about calls to deprecated
functions in Windows-only code, and 4996 maps nicely to
-Wno-deprecated-declarations:

    #pragma warning(push)
    #pragma warning(disable: 4996)
      f();
    #pragma warning(pop)

Implementation-wise:
- Move `/wd` flag handling from Options.td to actual Driver-level code
- Extract the function mapping cl.exe IDs to warning groups to the
  new file clang/lib/Basic/CLWarnings.cpp
- Create a diag::Group enum so that CLWarnings.cpp can refer to
  existing groups by ID (and give DllexportExplicitInstantiationDecl
  a named group), and add a function to map a diag::Group to the
  spelling of it's associated commandline flag
- Call that new function from PragmaWarningHandler

Differential Revision: https://reviews.llvm.org/D110668
2021-09-29 13:14:23 -04:00
LLVM GN Syncbot
fd9a5b911d [gn build] Port c07f7099690e 2021-09-29 01:03:11 +00:00
Arthur Eubanks
aa53785f23 Reland [clang] Rework dontcall attributes
To avoid using the AST when emitting diagnostics, split the "dontcall"
attribute into "dontcall-warn" and "dontcall-error", and also add the
frontend attribute value as the LLVM attribute value. This gives us all
the information to report diagnostics we need from within the IR (aside
from access to the original source).

One downside is we directly use LLVM's demangler rather than using the
existing Clang diagnostic pretty printing of symbols.

Previous revisions didn't properly declare the new dependencies.

Reviewed By: nickdesaulniers

Differential Revision: https://reviews.llvm.org/D110364
2021-09-28 15:31:30 -07:00
Alex Richardson
a28177035b [UpdateTestChecks][NFC] Drop a python2 workaround 2021-09-28 17:57:36 +01:00
Alex Richardson
547e5e4ae6 [update_llc_test_checks.py] Fix MIPS ASM regex for functions with EH
On MIPS, functions with exception handling code emits an additional
temporary label at the start of the function (due to UseAssignmentForEHBegin):

    _Z8do_catchv:                           # @_Z8do_catchv
    .Ltmp3:
    .set .Lfunc_begin0, .Ltmp3
    .cfi_startproc
    .cfi_personality 128, DW.ref.__gxx_personality_v0
    .cfi_lsda 0, .Lexception0
    .frame	$c11,48,$c17
    .mask 	0x00000000,0
    .fmask	0x00000000,0
    .set	noreorder
    .set	nomacro
    .set	noat
    # %bb.0:                                # %entry

The `[^:]*` regex was terminating the search after .Ltmp<N>: and therefore
not detecting functions with exception handling.

Reviewed By: atanasyan, MaskRay

Differential Revision: https://reviews.llvm.org/D100027
2021-09-28 17:57:36 +01:00
LLVM GN Syncbot
5aa4c74c9a [gn build] Port 864b206796ae 2021-09-28 10:58:48 +00:00
LLVM GN Syncbot
57cd7b018c [gn build] Port 6cfb4d46bae1 2021-09-27 21:56:39 +00:00
LLVM GN Syncbot
e2eb651cfc [gn build] Port 9da2fa277e81 2021-09-27 12:33:13 +00:00
LLVM GN Syncbot
a44b122ade [gn build] Port 6498b0e991ba 2021-09-26 17:25:08 +00:00
Konrad Kleine
6deaebe5fe [llvm] Improve export.sh with help and snapshot
This change adds the ability to create source tarballs for unreleased or untagged code by providing the `--git-ref <GIT_REF>` flag to the `llvm/utils/release/export.sh` script. This is useful for creating daily snapshot tarballs that can easily be consumed by packagers who want to build a daily snapshot.

The default behavior of `export.sh` hasn't changed.

You may also provide a `--template` argument to say how the artifacts
are supposed to be named (as suggested by @hans).

The `-help` output of `export.sh` was changed quite significantly to look like this:

```
Export the Git sources and build tarballs from them.

Usage: export.sh [-release|--release <major>.<minor>.<patch>]
                      [-rc|--rc <num>]
                      [-final|--final]
                      [-git-ref|--git-ref <git-ref>]
                      [-template|--template <template>]

Flags:

  -release  | --release <major>.<minor>.<patch>    The version number of the release
  -rc       | --rc <num>                           The release candidate number
  -final    | --final                              When provided, this option will disable the rc flag
  -git-ref  | --git-ref <git-ref>                  (optional) Use <git-ref> to determine the release and don't export the test-suite files
  -template | --template <template>                (optional) Possible placeholders: $PROJECT $YYYYMMDD $GIT_REF $RELEASE $RC.
                                                   Defaults to '${PROJECT}-${RELEASE}${RC}.src.tar.xz'.

The following list shows the filenames (with <placeholders>) for the artifacts
that are being generated (given that you don't touch --template).

  * llvm-<RELEASE><RC>.src.tar.xz
  * clang-<RELEASE><RC>.src.tar.xz
  * compiler-rt-<RELEASE><RC>.src.tar.xz
  * libcxx-<RELEASE><RC>.src.tar.xz
  * libcxxabi-<RELEASE><RC>.src.tar.xz
  * libclc-<RELEASE><RC>.src.tar.xz
  * clang-tools-extra-<RELEASE><RC>.src.tar.xz
  * polly-<RELEASE><RC>.src.tar.xz
  * lldb-<RELEASE><RC>.src.tar.xz
  * lld-<RELEASE><RC>.src.tar.xz
  * openmp-<RELEASE><RC>.src.tar.xz
  * libunwind-<RELEASE><RC>.src.tar.xz
  * flang-<RELEASE><RC>.src.tar.xz

Additional files being generated:

  * llvm-project-<RELEASE><RC>.src.tar.xz    (the complete LLVM source project)
  * test-suite-<RELEASE><RC>.src.tar.xz      (only when not using --git-ref)

To ease the creation of snapshot builds, we also provide these files

  * llvm-release-<YYYYMMDD>.txt        (contains the <RELEASE> as a text)
  * llvm-rc-<YYYYMMDD>.txt             (contains the rc version passed to the invocation of export.sh)
  * llvm-git-revision-<YYYYMMDD>.txt   (contains the current git revision sha1)

Example values for the placeholders:

  * <RELEASE>  -> 13.0.0
  * <YYYYMMDD> -> 20210414
  * <RC>       -> rc4        (will be empty when using --git-ref)

In order to generate snapshots of the upstream main branch you could do this for example:

  export.sh --git-ref upstream/main --template '${PROJECT}-${YYYYMMDD}.src.tar.xz'

```

Reviewed By: tstellar

Differential Revision: https://reviews.llvm.org/D101446
2021-09-25 00:38:19 +02:00
LLVM GN Syncbot
70a48697d5 [gn build] Port c0d889995e70 2021-09-24 20:30:26 +00:00
LLVM GN Syncbot
5f98024011 [gn build] Port a9ae2436fc0d 2021-09-24 20:30:25 +00:00
Christudasan Devadasan
40ddde5d1f [TableGen] Allow targets to entirely ignore Psets for registers
Tablegen currently expects targets to have at least one
pressure set for every broader register category. AMDGPU's
VGPR or AGPR, for instance, seemed to work correctly without
any pset, though we have forced one for each type to avoid
the assertion in computeRegUnitSets. However, psets can not
be entirely empty. At least one set is mandatory for every
target. This patch bypasses the assertion for the classes
when GeneratePressureSet is zero while ensuring the
RegUnitSets are not empty.

Reviewed By: arsenm, rampitec

Differential Revision: https://reviews.llvm.org/D110305
2021-09-23 23:07:35 -04:00
LLVM GN Syncbot
58d9ed2c93 [gn build] Port a2c1cf09dfaa 2021-09-24 03:01:20 +00:00
LLVM GN Syncbot
1aed7fcf09 [gn build] Port a44ab1702539 2021-09-23 19:01:30 +00:00
LLVM GN Syncbot
ac889a5262 [gn build] Port f4abdb0c074b 2021-09-23 13:34:40 +00:00
Nico Weber
64f623d4c3 [gn build] (manually) port ac191bcc99e2f 2021-09-23 09:34:24 -04:00
Nico Weber
cef0280a95 [gn build] (semi-manually) port 702cb7afe9de 2021-09-23 09:26:27 -04:00
LLVM GN Syncbot
f099ac838e [gn build] Port 7a320b279d07 2021-09-22 12:20:22 +00:00
Nico Weber
c828b93fb3 [gn build] (manually) port f8b1cc365786 2021-09-22 08:20:12 -04:00
Sebastian Neubauer
ecd5145c27 [Utils] Replace llc with cat for tests
Make the update_llc_test_checks script test independant of llc behavior
by using cat with static files to simulate llc output.

This allows changing llc without breaking the script test case.

The update script is executed in a temporary directory, so the
llc-generated assembly files are copied there. %T is deprecated, but it
allows copying a file with a predictable filename.

Differential Revision: https://reviews.llvm.org/D110143
2021-09-22 10:10:35 +02:00
LLVM GN Syncbot
a3bb4f1455 [gn build] Port a04a6ce7726b 2021-09-21 16:34:07 +00:00
Amara Emerson
4ceea77409 [X86] Rename the X86WinAllocaExpander pass and related symbols to "DynAlloca". NFC.
For x86 Darwin, we have a stack checking feature which re-uses some of this
machinery around stack probing on Windows. Renaming this to be more appropriate
for a generic feature.

Differential Revision: https://reviews.llvm.org/D109993
2021-09-20 16:19:28 -07:00
Arthur Eubanks
b64fdaa86b [gn build] Don't pass -Wl,-z,defs for sanitizer builds
-Wl,-z,defs doesn't work with sanitizers.
See https://clang.llvm.org/docs/AddressSanitizer.html

Reviewed By: thakis

Differential Revision: https://reviews.llvm.org/D110086
2021-09-20 11:39:39 -07:00
LLVM GN Syncbot
93604c9711 [gn build] Port d85e347a28dc 2021-09-20 16:39:59 +00:00
Alex Richardson
817e23d481 [update_mir_test_checks.py] Use -NEXT FileCheck directories
Previously the script emitted output using plain CHECK directives. This
can result in a test passing even if there are some instructions between
CHECK directives that should have been removed. It also makes debugging
tests that have the output in a different order more difficult since
FileCheck can match with a later line and then complain about the "wrong"
directive not being found.

This will cause quite large diffs when updating existing tests, but I'm not sure we need an opt-in flag here.

Depends on D109765 (pre-commit tests)

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D109767
2021-09-20 12:55:56 +01:00