Commit Graph

11315 Commits

Author SHA1 Message Date
Fangrui Song
557efc9a8b [llvm] Remove unneeded cl::ZeroOrMore for cl::opt options. NFC
Some cl::ZeroOrMore were added to avoid the `may only occur zero or one times!`
error. More were added due to cargo cult. Since the error has been removed,
cl::ZeroOrMore is unneeded.

Also remove cl::init(false) while touching the lines.
2022-06-03 21:59:05 -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
Tobias Hieta
fde9ef5214 [NFC][workflow] Fix issue where the workflow would say all PR's already exists 2022-06-02 08:20:21 +02:00
LLVM GN Syncbot
11d8bc98d1 [gn build] Port a15ae4139c 2022-06-02 06:04:25 +00:00
Hendrik Greving
a92ed167f2 [ValueTypes] Define MVTs for v128i2/v64i4 as well as i2 and i4.
Adds MVT::v128i2, MVT::v64i4, and implied MVT::i2, MVT::i4.

Keeps MVT::i2, MVT::i4 lowering actions as expand, which should be
removed once targets set this explicitly.

Adjusts 11 lit tests to reflect slightly different behavior during
DAG combine.

Differential Revision: https://reviews.llvm.org/D125247
2022-06-02 00:49:11 +00:00
Nicolai Hähnle
d53de9b7ac update_mir_test_checks: Better handling of common prefixes
Support the pattern where a test file uses multiple prefixes per run line:
one prefix that is unique to the run line, and additional prefixes that are
common with other run lines.

Decide on a per-function basis which prefix(es) to emit, based on which run
lines have the same output.

Move the renaming of vregs earlier, so that we can compare the output as it
would actually be printed in check lines.

Differential Revision: https://reviews.llvm.org/D126411
2022-06-01 15:53:32 -05:00
LLVM GN Syncbot
4bc63858fc [gn build] Port 129c056d62 2022-06-01 20:34:21 +00:00
Hendrik Greving
e9d05cc7d8 Revert "[ValueTypes] Define MVTs for v128i2/v64i4 as well as i2 and i4."
This reverts commit 430ac5c302.

Due to failures in Clang tests.

Differential Revision: https://reviews.llvm.org/D125247
2022-06-01 13:27:49 -07:00
Hendrik Greving
430ac5c302 [ValueTypes] Define MVTs for v128i2/v64i4 as well as i2 and i4.
Adds MVT::v128i2, MVT::v64i4, and implied MVT::i2, MVT::i4.

Keeps MVT::i2, MVT::i4 lowering actions as `expand`, which should be
removed once targets set this explicitly.

Adjusts 11 lit tests to reflect slightly different behavior during
DAG combine.

Differential Revision: https://reviews.llvm.org/D125247
2022-06-01 12:48:01 -07: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
Hans Wennborg
b2719349d2 Change build_llvm_package.bat to build_llvm_release.bat
We don't build snapshot packages anymore, so repurpose this
for doing release builds instead.
2022-05-30 17:08:01 +02:00
Hans Wennborg
bac4934c84 Revert "build_llvm_package.bat: Produce zip files in addition to the installers"
The zip files were too large to be practical, so they were never
shipped. Reverting to reduce build time and complexity of the script.

This reverts commit 4486aa03c5.
2022-05-30 13:55:54 +02:00
Hans Wennborg
10d2195305 Update the Windows packaging script
Check in updates based on how the latest release was built [0] and add
the bug fix from [1] which allows LLDB to start.

Other changes which had accumulated in the local release script:
- Don't build the clang format plugin (VS has the functionality built
  in now)
- Disable tests that have been failing (I'll try to follow up and
  re-enable them)
- Switch to Python 3.10
- Jump through more hoops to make LLDB pick the right Python.

0. https://discourse.llvm.org/t/14-0-4-final-has-been-tagged/62750/3
1. https://github.com/llvm/llvm-project/issues/54589
2022-05-30 11:58:13 +02:00
LLVM GN Syncbot
b16460bb48 [gn build] Port 751c7be5b2 2022-05-30 06:27:55 +00:00
Sheng
751c7be5b2 [TableGen] Remove code beads
Code beads is useless since the only user, M68k, has moved on to
a new encoding/decoding infrastructure.

Reviewed By: myhsu

Differential Revision: https://reviews.llvm.org/D126349
2022-05-30 14:27:37 +08:00
LLVM GN Syncbot
936e9bf4bd [gn build] Port 30c37fb89c 2022-05-28 08:16:52 +00:00
Tobias Hieta
49ad577c07 [workflow] Don't fail workflow if we already have a PR for an issue
When running /cherry-pick several times you will get an
error when it tries to create a new PR since there already
is one.

This checks if we have PR first.

Fixes #54862

Reviewed By: tstellar

Differential Revision: https://reviews.llvm.org/D123657
2022-05-27 16:02:39 +02: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
Mircea Trofin
6ddc4cd1c2 Fix break introduced by D124306
argparse.BooleanOptionalAction is not supported until python 3.9.
2022-05-26 11:55:19 -07:00
Mircea Trofin
f15c60218d [UpdateTestChecks] Auto-generate stub bodies for unused prefixes
This is scoped to autogenerated tests.

The goal is to support having each RUN line specify a list of
check-prefixes where one can specify potentially redundant prefixes. For example,
for X86, if one specified prefixes for  both AVX1 and AVX2, and the codegen happened to
match today, one of the prefixes would be used and the onther one not.
If the unused prefix were dropped, and later, codegen differences were
introduced, one would have to go figure out where to add what prefix
(paraphrasing
https://lists.llvm.org/pipermail/llvm-dev/2021-February/148326.html)

To avoid getting errors due to unused prefixes, whole directories can be
opted out (as discussed on that thread), but that means that tests that
aren't autogenerated in such directories could have undetected unused
prefix bugs.

This patch proposes an alternative that both avoids the above, dir-level
optout, and supports the main autogen scenario discussed first. The autogen
tool appends at the end of the test file the list of unused prefixes,
together with a note explaining that is the case. Each prefix is set up
to always pass.

This way, unexpected unused prefixes are easily discoverable, and
expected cases "just work".

Differential Revision: https://reviews.llvm.org/D124306
2022-05-26 10:23:10 -07:00
LLVM GN Syncbot
ec0ef6809a [gn build] Port 0e3dc1a52f 2022-05-26 14:50:15 +00:00
Ivan Kosarev
8894c05b0d [FileCheck] GetCheckTypeAbbreviation() to handle the misspelled case.
Also fix directives not covered by D125604.
2022-05-26 12:20:15 +01: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