Commit Graph

11968 Commits

Author SHA1 Message Date
Nico Weber
e5371e80a1 [gn build] Reformat all build files
Ran:

    git ls-files '*.gn' '*.gni' | xargs llvm/utils/gn/gn.py format
2022-12-07 15:14:52 -05:00
James Y Knight
372240dfe3 [TableGen] More named sub-operands work.
Commit a538d1f13a first added support for named sub-operands in
CodeEmitterGen. We now add a few more features to that, enabling
further target cleanups.

1. Adds support for handling an EncoderMethod in a sub-operand in
CodeEmitterGen. Previously, the specified encoder of a sub-operand was
ignored, and only the default used.

2. Adds support for sub-operands in DecoderEmitter, along with support
for tied sub-operands.

The changes to the decoder required a few minor tweaks to a few
targets, where existing brokeness was exposed. In order to keep this
patch small, I left FIXMEs which will be addressed in upcoming
patches. (Except MIPS16, since its object file emission/decoding is
totally broken).

Differential Revision: https://reviews.llvm.org/D137653
2022-12-07 14:37:08 -05:00
LLVM GN Syncbot
e7569cb955 [gn build] Port d184958bad 2022-12-07 16:50:20 +00:00
serge-sans-paille
40ade845be Revert "Store OptTable::Info::Name as a StringRef"
Another revert, for another set of issues I don't reproduce locally...

see https://lab.llvm.org/buildbot/#/builders/139/builds/32327

This reverts commit bdfa3100dc.
2022-12-07 17:29:53 +01:00
serge-sans-paille
bdfa3100dc Store OptTable::Info::Name as a StringRef
This is a recommit of 8ae18303f9,
with a few cleanups.

This avoids implicit conversion to StringRef at several points, which in
turns avoid redundant calls to strlen.

As a side effect, this greatly simplifies the implementation of
StrCmpOptionNameIgnoreCase.

It also eventually gives a consistent, humble speedup in compilation
time (timing updated since original commit).

https://llvm-compile-time-tracker.com/compare.php?from=76fcfea283472a80356d87c89270b0e2d106b54c&to=b70eb1f347f22fe4d2977360c4ed701eabc43994&stat=instructions:u

Differential Revision: https://reviews.llvm.org/D139274
2022-12-07 16:32:37 +01:00
Nico Weber
73b1f27137 [gn build] Port c9b325088d 2022-12-07 08:27:50 -05:00
LLVM GN Syncbot
88594d1f85 [gn build] Port cb5b25c587 2022-12-07 12:44:01 +00:00
Nico Weber
08a9b22df1 [gn build] port d62480c199 (LoongArchTests) 2022-12-07 07:43:19 -05:00
Kazu Hirata
934942c033 [llvm] Don't include Optional.h (NFC)
These source files no longer use Optional<T>, so they do not need to
include Optional.h.

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
2022-12-06 22:34:50 -08:00
Douglas Yung
4857b6f8ff Revert "Store OptTable::Info::Name as a StringRef"
This reverts commit 5951b0bb23.

This is causing 24 test failures on the PS4 linux bot: https://lab.llvm.org/buildbot/#/builders/139/builds/32263
2022-12-06 19:37:05 -08:00
Gregory Alfonso
08ca2dc689 [count] Use correct integral type
Make the types consistent with each other, and return size_t instead of a long int.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D126121
2022-12-06 15:30:25 -08:00
serge-sans-paille
5951b0bb23 Store OptTable::Info::Name as a StringRef
This is a recommit of 8ae18303f9,
with a few cleanups.

This avoids implicit conversion to StringRef at several points, which in
turns avoid redundant calls to strlen.

As a side effect, this greatly simplifies the implementation of
StrCmpOptionNameIgnoreCase.

It also eventually gives a consistent, humble speedup in compilation
time (timing updated since original commit).

https://llvm-compile-time-tracker.com/compare.php?from=de4b6a1bc64db33643f001ad45fae7b92b4a4688&to=c23a93d1292052b4be2fbe8c586fa31143d0c7ed&stat=instructions:u

Differential Revision: https://reviews.llvm.org/D139274
2022-12-06 22:51:28 +01:00
Nico Weber
b58028831e [gn build] Add LoongArch target
Differential Revision: https://reviews.llvm.org/D139256
2022-12-06 16:11:52 -05:00
LLVM GN Syncbot
d216759f71 [gn build] Port d09d834bb9 2022-12-06 13:50:56 +00:00
LLVM GN Syncbot
cb74446acc [gn build] Port bc0617795f 2022-12-06 13:50:55 +00:00
Nico Weber
de4b6a1bc6 Revert "Store OptTable::Info::Name as a StringRef"
This reverts commit 8ae18303f9.
Breaks buildling lldb, see https://reviews.llvm.org/D139274#3974171
2022-12-06 08:43:48 -05:00
Nico Weber
13e061e73e Revert "Quick fix to unbreak tblgen past 8ae18303f97d"
This reverts commit e50a60d734.
Prerequisite for reverting 8ae18303f9.
2022-12-06 08:43:30 -05:00
Benjamin Kramer
e50a60d734 Quick fix to unbreak tblgen past 8ae18303f9
llvm/tools/llvm-objdump/llvm-objdump.cpp:128:38: error: constexpr variable 'ObjdumpInfoTable' must be initialized by a constant expression
static constexpr opt::OptTable::Info ObjdumpInfoTable[] = {
                                     ^                    ~
ObjdumpOpts.inc:30:45: note: non-constexpr function 'substr' cannot be used in a constant expression
OPTION(prefix_0, llvm::StringRef("<input>").substr(0), INPUT, Input, INVALID, INVALID, nullptr, 0, 0, nullptr, nullptr, nullptr)
                                            ^
2022-12-06 14:39:38 +01:00
serge-sans-paille
8ae18303f9 Store OptTable::Info::Name as a StringRef
This avoids implicit conversion to StringRef at several points, which in
turns avoid redundant calls to strlen.

As a side effect, this greatly simplifies the implementation of
StrCmpOptionNameIgnoreCase.

It also eventually gives a consistent, humble speedup in compilation
time.

https://llvm-compile-time-tracker.com/compare.php?from=5f5b942823474e98e43a27d515a87ce140396c53&to=60e13b778119fc32d50dc38ff1a564a87146e9c6&stat=instructions:u

Differential Revision: https://reviews.llvm.org/D139274
2022-12-06 14:10:07 +01:00
David Spickett
500587e23d [LLVM][Release] Prevent empty runtime name in release script
Unlike projects, runtimes doesn't have a default set of names.
This means you get a leading space at the start, which gets converted
to a ';' giving ";<runtime name>;<runtime name>".

CMake then errors because the "" before the first ';' is treated
as a runtime name and of course it's not a valid name.

Fix this by removing the leading spaces from runtimes before we
insert the ';'.

Reviewed By: ldionne

Differential Revision: https://reviews.llvm.org/D139306
2022-12-06 09:36:50 +00:00
dbakunevich
4c809de33b Added connection to the library with name "re".
Fixed a bug that the "re" library was used in
this python file, but there was no import of it.

Differential Revision: https://reviews.llvm.org/D137926
2022-12-06 14:24:57 +07:00
Fangrui Song
3cfe412e4c [TableGen] llvm::Optional => std::optional 2022-12-06 07:21:02 +00:00
LLVM GN Syncbot
f6f9caa580 [gn build] Port 200007ec85 2022-12-05 23:13:55 +00:00
Nico Weber
9ddbcb0182 [gn build] Fix build of merge-fdata in a clean build dir
merge-fdata doesn't depend on any libraries except Support,
but it includes headers that require Attributes.inc to exist.
Add a dep that ensures that it does exist.
Corresponds to the intrinsics_gen dep in CMake.
2022-12-05 15:44:30 -05:00
LLVM GN Syncbot
51e33ac9c7 [gn build] Port 5ecd363295 2022-12-05 18:56:16 +00:00
LLVM GN Syncbot
d8ab7cf2d3 [gn build] Port dbe8c2c316 2022-12-05 14:27:33 +00:00
Kazu Hirata
9f252e5567 [llvm] Use std::nullopt instead of None in comments (NFC)
This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
2022-12-04 17:31:17 -08:00
Kazu Hirata
3c09ed006a [llvm] Use std::nullopt instead of None in comments (NFC)
This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
2022-12-04 17:12:44 -08:00
LLVM GN Syncbot
5fa43db46e [gn build] Port 122efef8ee 2022-12-05 00:11:52 +00:00
Kazu Hirata
a38cfc50fc [llvm] Use std::nullopt instead of None (NFC)
I've verified that every change in this patch affects generated files
and would reduce the number of warnings if None were deprecated.

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
2022-12-04 13:52:42 -08:00
LLVM GN Syncbot
7724ac6163 [gn build] Port 17db0de330 2022-12-03 20:23:49 +00:00
Kazu Hirata
ed88e60b37 [utils] Use std::nullopt instead of None (NFC)
This patch mechanically replaces None with std::nullopt where the
compiler would warn if None were deprecated.  The intent is to reduce
the amount of manual work required in migrating from Optional to
std::optional.

This is part of an effort to migrate from
llvm::Optional to std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
2022-12-02 21:11:42 -08:00
Nicolai Hähnle
1743052a1d Add update_any_test_checks.py convenience utility
Given a list of test files, this utility will run (optionally in
parallel) the corresponding update_*_test_checks tool for all given
tests that have automatically generated assertions.

Differential Revision: https://reviews.llvm.org/D139100
2022-12-01 17:25:53 +01:00
LLVM GN Syncbot
e1da0e9ce0 [gn build] Port 89f36dd8f3 2022-12-01 11:19:48 +00:00
LLVM GN Syncbot
9b8eb0cf05 [gn build] Port 65d6d67fc9 2022-12-01 11:19:48 +00:00
LLVM GN Syncbot
0926035ed5 [gn build] Port b95646fe70 2022-11-30 22:46:01 +00:00
LLVM GN Syncbot
b802b537f8 [gn build] Port 77b2205245 2022-11-30 14:41:02 +00:00
LLVM GN Syncbot
9fa65ba155 [gn build] Port d3c851d3fc 2022-11-30 13:51:23 +00:00
Nicolai Hähnle
cba252de08 update_test_checks: fix typos
Found by our downstream CI.
2022-11-29 23:08:47 +01:00
LLVM GN Syncbot
1114d1a976 [gn build] Port 185d4964a1 2022-11-29 20:47:01 +00:00
Mateja Marjanovic
68057c2b8d Add new vector types for LLVM
Add v9i32, v9f32, v10i32, v10f32, v11i32, v11f32, v12i32 and v12f32.

Differential Revision: https://reviews.llvm.org/D138136
2022-11-29 17:02:04 +01:00
Mircea Trofin
255e7e1c21 [UpdateTestChecks] Fix update_*_test_checks.py to add "unused" prefixes
The support introduced in D124306 was only added to
update_llc_test_checks.py, but the motivating usecases (see
https://lists.llvm.org/pipermail/llvm-dev/2021-February/148326.html)
cover update_test_checks.py, update_cc_test_checks.py, and
update_analyze_test_checks.py, too.

Issue #59220.

Differential Revision: https://reviews.llvm.org/D138836
2022-11-28 13:24:32 -08:00
Arthur Eubanks
16312c5d7a [MCJIT][test] Use new pass manager API 2022-11-28 12:23:42 -08:00
Kazu Hirata
a677afd3c1 [TableGen] Use std::size (NFC)
std::size, introduced in C++17, allows us to directly obtain the
number of elements of an array.
2022-11-26 10:47:22 -08:00
LLVM GN Syncbot
eddcc01f35 [gn build] Port ed34590c1a 2022-11-25 13:20:54 +00:00
Ivan Kosarev
fce7a7aa9f [AMDGPU][AsmParser] Refine parsing instruction operands.
Eliminates the need for working around optional and token operands being
mistakenly parsed as expressions.

Reviewed By: dp

Differential Revision: https://reviews.llvm.org/D138492
2022-11-24 10:50:26 +00:00
Nico Weber
4ffc6f3b83 [bolt] Stop setting config.llvm_plugin_ext in lit.site.cfg.py.in
config.llvm_plugin_ext is used by lit to set the %pluginext
substitution. bolt's tests don't use %pluginext, so they don't
need to set config.llvm_plugin_ext.

Differential Revision: https://reviews.llvm.org/D138325
2022-11-22 20:29:14 -05:00
Sami Tolvanen
cacd3e73d7 Add generic KCFI operand bundle lowering
The KCFI sanitizer emits "kcfi" operand bundles to indirect
call instructions, which the LLVM back-end lowers into an
architecture-specific type check with a known machine instruction
sequence. Currently, KCFI operand bundle lowering is supported only
on 64-bit X86 and AArch64 architectures.

As a lightweight forward-edge CFI implementation that doesn't
require LTO is also useful for non-Linux low-level targets on
other machine architectures, add a generic KCFI operand bundle
lowering pass that's only used when back-end lowering support is not
available and allows -fsanitize=kcfi to be enabled in Clang on all
architectures.

This relands commit eb2a57ebc7 with
fixes.

Reviewed By: nickdesaulniers, MaskRay

Differential Revision: https://reviews.llvm.org/D135411
2022-11-22 23:01:18 +00:00
David Tenty
2edc54eded [lit][AIX] Add LIBPATH to pass through env vars
AIX uses LIBPATH to specify the library search path in addition to
LD_LIBRARY_PATH, and a lot of users / tooling will use it
preferentially. In lit we currently pass through LD_LIBRARY_PATH but not
LIBPATH in the env on AIX, this patch corrects this inconsistency.

Differential Revision: https://reviews.llvm.org/D138510
2022-11-22 17:22:52 -05:00
dbakunevich
073aebc431 [Utils] Improved chunk-print-before-all.py script
As part of this patch, the ability to work with dump files
containing ir after passes received using the -print-after-all
option was added to script chunk-print-before-all.py.
The names of the output files have also been changed.
	Before: chunk-NUM.ll
	Now: NUM-STAGE-PASS_NAME.ll
NUM - sequence number of the pass operation.
STAGE - stage of the pass operation (for example: before, after, dump).
PASS_NAME - the name of the pass.
2022-11-23 01:11:54 +07:00