13352 Commits

Author SHA1 Message Date
David Spickett
b81bfea99b
[llvm][TableGen] Add a README to the main TableGen folder (#69943)
Though I doubt that many people will land here directly, I thought it
odd that we didn't have one we can at least reference in response to questions.

The intro I've copied from the programmer's reference and added a simple
example. Then some links to resources and tools, which is the main
reason to have this page.
2023-10-25 09:45:31 +01:00
LLVM GN Syncbot
4343c4e25b [gn build] Port 5d7f346bd398 2023-10-24 12:16:30 +00:00
David Spickett
600e38b11a
[llvm][Release] Add note about binaries to Github release description (#69698)
This appears on the announcements e.g.
https://discourse.llvm.org/t/llvm-17-0-3-released/74172 and it is
important context.

However a lot of folks see release pages e.g.
https://github.com/llvm/llvm-project/releases/tag/llvmorg-17.0.3 first
so it's good to include it there too.
2023-10-23 15:50:04 +01:00
LLVM GN Syncbot
4aeb7a0f5e [gn build] Port d2a46e6480f3 2023-10-22 08:26:17 +00:00
Madhur Amilkanthwar
0b7ae41b23
[LIT] Print discovered tests and percentages (#66057) (#69831)
This patch adds "nice-to-have" feature in lit.
it prints the total number of discovered tests at the beginning. It is
covenient to see the total number of tests and avoid scrolling up to the
beginning of log.

Further, this patch also prints %ge of tests.

This patch fixes tests pointed by previous attempt of landing this
patch.

Reviewed By: RoboTux, jdenny-ornl

Co-authored-by: Madhur A <madhura@nvidia.com>
2023-10-22 09:22:25 +05:30
Ryan Prichard
af25304319
[Workflow] make code-format-helper.py mypy-safe (NFC) (#69691)
Fix type errors that mypy reports with code-format-helper.py.

Add a few return type annotations and change `param: [str]` to
`param: list[str]`.

Leave a few required FormatHelper members missing instead of defining a
placeholder:
 - FormatHelper.name
 - FormatHelper.friendly_name
 - FormatHelper.format_run: NotImplementedError() instead of `pass`
2023-10-20 15:07:59 -07:00
LLVM GN Syncbot
c5dacb6d7a [gn build] Port 538b7ba2aacd 2023-10-20 20:34:41 +00:00
Joel E. Denny
080fb3e5b7
[lit] Clean up internal shell parse errors with ScriptFatal (#68496)
Without this patch, the functions `executeScriptInternal` and thus
`runOnce` in `llvm/utils/lit/lit/TestRunner.py` return either a tuple like
`(out, err, exitCode, timeoutInfo)` or a `lit.Test.Result` object. They
return the latter only when there's a lit internal shell parse error in
a RUN line. In my opinion, a more straight-forward way to handle
exceptional cases like that is to use python exceptions.

For that purpose, this patch introduces `ScriptFatal`. Thus, this patch
changes `executeScriptInternal` to always either return the tuple or
raise the `ScriptFatal` exception. It updates `runOnce` and
`libcxx/utils/libcxx/test/format.py` to catch the exception rather than
check for the special return type.

This patch also changes `runOnce` to convert the exception to a
`Test.UNRESOLVED` result instead of `TEST.FAIL`. The former is the
proper result for such a malformed test, for which a rerun (given an
`ALLOW_RETRIES:`) serves no purpose. There are at least two benefits
from this change. First, `_runShTest` no longer has to specially and
cryptically handle this case to avoid unnecessary reruns. Second, an
`XFAIL:` directive no longer hides such a failure [as we saw
previously](https://reviews.llvm.org/D154987#4501125).

To facilitate the `_runShTest` change, this patch inserts the internal
shell parse error diagnostic into the format of the test's normal debug
output rather than suppressing the latter entirely. That change is also
important for [D154987](https://reviews.llvm.org/D154987), which
proposes to reuse `ScriptFatal` for python compile errors in PYTHON
lines or in `config.prologue`. In that case, the diagnostic might follow
debugging output from the test's previous RUN or PYTHON lines, so
suppressing the normal debug output would lose information.
2023-10-20 11:53:18 -04:00
LLVM GN Syncbot
ab76a7c568 [gn build] Port 9a5c6f1760a3 2023-10-20 14:29:40 +00:00
LLVM GN Syncbot
759cc2588e [gn build] Port 639a0986f3a3 2023-10-20 14:14:31 +00:00
Madhur Amilkanthwar
11a7195b2f
Revert "[LIT] Print discovered tests and percentages (#66057)" (#69715)
This reverts commit ba8565fbcb975e2d067ce3ae5a7dbaae4953edd3.

Co-authored-by: Madhur A <madhura@nvidia.com>
2023-10-20 18:16:45 +05:30
Madhur Amilkanthwar
ba8565fbcb
[LIT] Print discovered tests and percentages (#66057)
This patch adds "nice-to-have" feature in lit.
it prints the total number of discovered tests at the beginning. It is
covenient to see the total number of tests and avoid scrolling up to the
beginning of log.

Further, this patch also prints %ge of tests.

Reviewed By: RoboTux, jdenny-ornl

Co-authored-by: Madhur A <madhura@nvidia.com>
2023-10-20 17:23:34 +05:30
yubingex007-a11y
f2517cbcee
[X86][AMX] remove related code of X86PreAMXConfigPass (#69569)
In https://reviews.llvm.org/D125075, we switched to use
FastPreTileConfig in O0 and abandoned X86PreAMXConfigPass.
we can remove related code of X86PreAMXConfigPass safely.
2023-10-20 13:43:34 +08:00
Erik Jonsson
f8325f1260
[Tablegen] Bugfix and refactor VarLenCodeEmitter HwModes. (#68795)
VarLenCodeEmitterGen produced code that did not compile if using
alternative encoding in different HwModes. It's not possbile to assign

    unsigned **Index = Index_<mode>[][2] = { ... };

As a fix, Index and InstBits where removed in favor of mode specific
getInstBits_<mode> functions since this is the only place the arrays are
accessed.

Handling of HwModes is now concentrated to the VarLenCodeEmitterGen::run
method reducing the overall amount of code and enabling other types of
alternative encodings not related to HwModes.

Added a test for VarLenCodeEmitterGen HwModes.

Make sure that HwModes are supported in the same way they are supported
for the standard CodeEmitter. It should be possible to define
instructions with universal encoding across modes, distinct encodings
for each mode or only define encodings for some modes.

Fixed indentation in generated code.
2023-10-20 07:21:24 +02:00
Nico Weber
dda3ed9091 [gn] port ab17ecd10767 2023-10-19 19:04:48 -04:00
Ryan Prichard
d173ce4a67
[libc++][Android] Support libc++ testing on Android (#69274)
I could probably break this commit into more pieces.

---

This patch adds libc++ support for Android L (Android 5.0+) and up,
tested using the Android team's current compiler, a recent version of
the AOSP sysroot, and the x86[-64] Android Emulator.

CMake and Lit Configuration:

Add runtimes/cmake/android/Arch-${ARCH}.cmake files that configure CMake
to cross-compile to Android without using CMake's built-in NDK support
(which only works with an actual packaged NDK).

Add libcxx/cmake/caches/AndroidNDK.cmake that builds and tests libc++
(and libc++abi) for Android. This file configures libc++ to match what
the NDK distributes, e.g.:
- libc++_shared.so (includes libc++abi objects, there is no
libc++abi.so). libunwind is linked statically but not exported.
 - libc++_static.a (does not include libc++abi) and libc++abi.a
 - `std::__ndk1` namespace
- All the libraries are built with `__ANDROID_API__=21`, even when they
are linked to something targeting a higher API level.

(However, when the Android LLVM team builds these components, they do
not use these CMake cache files. Instead they use Python scripts to
configure the builds. See
https://android.googlesource.com/toolchain/llvm_android/.)

Add llvm-libc++[abi].android-ndk.cfg.in files that test the Android
NDK's libc++_shared.so. These files can target old or new Android
devices. The Android LLVM team uses these test files to test libc++ for
both arm/arm64 and x86/x86_64 architectures.

The Android testing mode works by setting %{executor} to adb_run.py,
which uses `adb push` and `adb shell` to run tests remotely. adb_run.py
always runs tests as the "shell" user even on an old emulator where "adb
unroot" doesn't work. The script has workarounds for old Android
devices. The script uses a Unix domain socket on the host
(--job-limit-socket) to restrict concurrent adb invocations. Compiling
the tests is a major part of libc++ testing run-time, so it's desirable
to exploit all the host cores without overburdening the test devices,
which can have far fewer cores.

BuildKite CI:

Add a builder to run-buildbot, `android-ndk-*`, that uses Android Clang
and an Android sysroot to build libc++, then starts an Android emulator
container to run tests.

Run the emulator and an adb server in a separate Docker container
(libcxx-ci-android-emulator), and create a separate Docker image for
each emulator OS system image. Set ADB_SERVER_SOCKET to connect to the
container's adb server. Running the only adb server inside the container
makes cleanup more reliable between test runs, e.g. the adb client
doesn't create a `~/.android` directory and the adb server can be
restarted along with the emulator using docker stop/run. (N.B. The
emulator insists on connecting to an adb server and will start one
itself if it can't connect to one.)

The suffix to the android-ndk-* job is a label that concisely specifies
an Android SDK emulator image. e.g.:
 - "system-images;android-21;default;x86" ==> 21-def-x86
 - "system-images;android-33;google_apis;x86_64" ==> 33-goog-x86_64

Fixes: https://github.com/llvm/llvm-project/issues/69270
Differential Revision: https://reviews.llvm.org/D139147
2023-10-19 16:58:30 -04:00
Nico Weber
a91a664839 [gn] port 01263c6c6fb495 (lldb-vscode -> lldb-dap) 2023-10-19 14:51:28 -04:00
LLVM GN Syncbot
94123d164b [gn build] Port 460e84398a19 2023-10-19 18:16:07 +00:00
Haowei
44d4b30ca3
[unittest] Refactoring the gtest sharding option. (#69537)
This patch addresses the missed review comment from PR #67063. It
renames LIT flag "--disable-gtest-sharding" to "--no-gtest-sharding"
and corrects the code style issue.
2023-10-19 10:34:19 -07:00
LLVM GN Syncbot
30520cdff6 [gn build] Port 01263c6c6fb4 2023-10-19 17:14:27 +00:00
LLVM GN Syncbot
60622511bb [gn build] Port 2023-10-19 17:14:26 +00:00
Francesco Petrogalli
416884544e
[TableGen] Update editor modes for new keywords and bang operators. (#68897)
* `dump`, added in https://github.com/llvm/llvm-project/pull/68793
* `!repr`, added in https://github.com/llvm/llvm-project/pull/68716

The keyword `assert` was missing, so I have added that too.
2023-10-19 09:31:59 +02:00
Kai Nacke
a587f42953
[TableGen] SubtargetEmitter must use std::nullopt (#69475)
Use of llvm::Optional was migrated to std::optional. This included a
change in the constructor of ArrayRef.
However, there are still 2 places in the SubtargetEmitter which uses
llvm::None, causing a compile error when emitted.
2023-10-18 13:11:23 -04:00
Stephen Tozer
df3478e480
[LLVM] Add new attribute optdebug to optimize for debugging (#66632)
This patch adds a new fn attribute, `optdebug`, that specifies that
optimizations should make decisions that prioritize debug info quality,
potentially at the cost of runtime performance.

This patch does not add any functional changes triggered by this
attribute, only the attribute itself. A subsequent patch will use this
flag to disable the post-RA scheduler.
2023-10-18 16:32:06 +01:00
LLVM GN Syncbot
ae89497110 [gn build] Port 1072b94ed8e5 2023-10-18 12:47:18 +00:00
LLVM GN Syncbot
d7246c1ab5 [gn build] Port b4b35a5d2b4e 2023-10-18 09:36:46 +00:00
Haowei
6eee238975
[unittest] Add option to allow disabling sharding in unittest (#67063)
[unittest] Add lit option to allow disabling sharding in unittest

By default, googletest based unit tests uses sharding to speed up the
testing. However, when these unit tests are run through wrapper program
on a remote platform with large round trip time, the sharding will increase
the time cost dramatically. This patch adds a LLVM LIT option
"--disable-gtest-sharding" to allow sharding on gtest based unittest to
be disabled.
2023-10-17 16:52:58 -07:00
Valentin Clement (バレンタイン クレメン)
cf670d5e56
[flang][openacc] Accept scalar integer expression in the if clause (#69381)
Relax the parser to accept scalar integer expression in addition to
scalar logical expression. The parser now accepts scalar expression and
the semantic checks its type.
2023-10-17 14:41:03 -07:00
LLVM GN Syncbot
c0f3478934 [gn build] Port 31512811b8c0 2023-10-17 19:22:25 +00:00
Nico Weber
f781508d31 [gn] port dd64c82cbc9c6 2023-10-17 15:21:21 -04:00
LLVM GN Syncbot
4df46c39d6 [gn build] Port 088d272e8325 2023-10-17 14:49:49 +00:00
Nico Weber
8b5625cb42 [gn] port 3694697003bb 2023-10-17 07:52:53 -04:00
Nico Weber
e730f4a27f [gn] port 3694697003bb 2023-10-17 07:52:08 -04:00
Pierre van Houtryve
d2b74d7e42
[TableGen] Handle duplicate rules in combiners (#69296)
We would crash when a rule was accidentally added twice to a combiner.
This patch adds a warning instead to skip the already-processed rules.
2023-10-17 10:59:32 +02:00
Pierre van Houtryve
0841955bf3
[TableGen] Use buildConstant to emit apply pattern immediates (#66077)
Use `MachineIRBuilder::buildConstant` to emit typed immediates in
'apply' MIR patterns.
This adds flexibility, e.g. it allows us to seamlessly handle vector
cases, where a `G_BUILD_VECTOR` is needed to create a splat.
2023-10-17 10:39:59 +02:00
Arthur Eubanks
528b5e6743 Revert "[gn build] Add rules for crtbegin/end (#66012)"
This reverts commit e2e32f091a903a57c9fd8778c88488d32330ca6e.

Breaks bots, e.g. http://45.33.8.238/linux/120748/step_4.txt
2023-10-16 13:04:18 -07:00
Arthur Eubanks
e2e32f091a
[gn build] Add rules for crtbegin/end (#66012) 2023-10-16 12:50:24 -07:00
Pierre van Houtryve
96e473a6be
[RFC][GlobalISel] Use Builders in MatchTable (#65955)
The MatchTableExecutor did not use the MachineIRBuilder but instead
created instructions ad-hoc.
Making it use a Builder has the benefit that any observer added by a
combine is now notified when instructions are created by MIR patterns.

Another benefit is that it allows me to improve how constants are
created in apply MIR patterns.
`MachineIRBuilder::buildConstant` automatically handles splats for us,
this means that we may change `addCImm` to use that and handle vector
cases automatically.
2023-10-16 07:41:18 +02:00
LLVM GN Syncbot
6121b9088e [gn build] Port 819ac45d1c1b 2023-10-16 02:16:00 +00:00
Freddy Ye
819ac45d1c
[X86] Add USER_MSR instructions. (#68944)
For more details about this instruction, please refer to the latest ISE
document:
https://www.intel.com/content/www/us/en/develop/download/intel-architecture-instruction-set-extensions-programming-reference.html
2023-10-16 10:12:53 +08:00
LLVM GN Syncbot
c442d20e23 [gn build] Port f445be9790f9 2023-10-14 15:35:14 +00:00
LLVM GN Syncbot
f4a0cb5c95 [gn build] Port 311bc6683dee 2023-10-14 15:35:13 +00:00
Nico Weber
eb4a061568 [gn] port 99d92d18e334 2023-10-13 16:04:13 -04:00
David Spickett
05bde3cc23 [llvm][TableGen][Jupyter] Link to tutorial notebook from README 2023-10-13 16:58:24 +01:00
LLVM GN Syncbot
d2aa523f2a [gn build] Port 2cea1babefbb 2023-10-13 13:30:38 +00:00
Nico Weber
3f4bf998e8 [gn] port 46cb8d9a3252 2023-10-13 09:11:34 -04:00
LLVM GN Syncbot
220244b71b [gn build] Port 1c9035d1b5a9 2023-10-12 19:43:07 +00:00
LLVM GN Syncbot
9b89b80dba [gn build] Port 31c2cf113617 2023-10-12 17:29:02 +00:00
Nico Weber
7dcb260bef [gn] port 0ce6255a5058 (HipStdPar) 2023-10-12 13:28:46 -04:00
Nico Weber
cff50072a0 [gn] port f445be9790f9 2023-10-12 12:36:19 -04:00