14793 Commits

Author SHA1 Message Date
LLVM GN Syncbot
ea4a87957f [gn build] Port 42595bdaefb6 2025-01-14 09:26:18 +00:00
Craig Topper
726cfc67b6
[RISCV] Don't convert virtual register Register to MCRegister in isCompressibleInst. (#122843)
Calling MCRegisterClass::contains with a Register does an implicit
conversion from Register to MCRegister. I think MCRegister is only
intended to be used for physical registers. We should protect this
implicit conversion by checking for physical registers first.

While I was here I removed some unnecessary parentheses from the output.
2025-01-13 23:36:09 -08:00
Craig Topper
9844badfca
[X86] Use loaded/stored element size when parsing/printing gather/scatter pointer size in Intel syntax. (#122530)
This matches binutils.
2025-01-13 10:36:40 -08:00
LLVM GN Syncbot
7059178bd3 [gn build] Port cedb44af53f1 2025-01-13 15:56:33 +00:00
LLVM GN Syncbot
051cd36f82 [gn build] Port b5ba4f06db2e 2025-01-13 15:56:32 +00:00
Momchil Velikov
5315f3f8cb
Handle leading underscores in update_cc_test_checks.py (#121800)
For some ABIs `update_cc_test_checks.py` is unable to generate tests
because of the mismatch between the mangled function names reported by
clang's `-asd-dump` and the function names in LLVM IR.

This patch fixes it by striping the leading underscore from the mangled
name for global functions if the data layout string says they have one.
2025-01-13 11:24:05 +00:00
Kazu Hirata
76af93fbea Partially revert "[TableGen] Avoid repeated hash lookups (NFC) (#122586)"
This partially reverts commit 07ff786e39e2190449998d3af1000454dee501be.

The hunk being reverted in this patch seems to break:

  tools/llvm-gsymutil/ARM_AArch64/macho-merged-funcs-dwarf.yaml

under LLVM_ENABLE_EXPENSIVE_CHECKS.
2025-01-12 23:50:58 -08:00
LLVM GN Syncbot
7532958355 [gn build] Port 8ebc35f8d041 2025-01-12 10:05:24 +00:00
Kazu Hirata
07ff786e39
[TableGen] Avoid repeated hash lookups (NFC) (#122586) 2025-01-11 13:15:30 -08:00
LLVM GN Syncbot
0f242897ce [gn build] Port 2e5c29828196 2025-01-10 19:52:53 +00:00
LLVM GN Syncbot
513fa28901 [gn build] Port c664a7f97503 2025-01-10 16:05:01 +00:00
LLVM GN Syncbot
0e1c5bfac8 [gn build] Port 69b54c1a05c0 2025-01-09 18:02:43 +00:00
Justin Bogner
cba9bd5cb0
[DirectX] Implement the resource.load.rawbuffer intrinsic (#121012)
This introduces `@llvm.dx.resource.load.rawbuffer` and generalizes the
buffer load docs under DirectX/DXILResources.

This resolves the "load" parts of #106188
2025-01-08 16:56:05 -08:00
Alexandros Lamprineas
8e65940161
[FMV][AArch64] Simplify version selection according to ACLE. (#121921)
Currently, the more features a version has, the higher its priority is.
We are changing ACLE https://github.com/ARM-software/acle/pull/370 as
follows:

"Among any two versions, the higher priority version is determined by
 identifying the highest priority feature that is specified in exactly
 one of the versions, and selecting that version."
2025-01-08 18:59:07 +00:00
LLVM GN Syncbot
0b722de4a5 [gn build] Port 30ba8be22eb0 2025-01-08 18:41:23 +00:00
Nico Weber
d6ae3d3070 [gn] port afa8aeeeec (RISCVGenExegesis.inc) 2025-01-08 13:16:11 -05:00
Nico Weber
911880e8a7 [gn] port 71ddde8ba52a (LLVMExegesisRISCVTests) 2025-01-08 13:16:11 -05:00
Jessica Del
d07762e474
[UpdateTestChecks][NFC] - Fix typos (#121964)
substition -> substitution
in-betweem -> in-between
2025-01-08 14:24:39 +01:00
LLVM GN Syncbot
c3fc41c60b [gn build] Port bc51a2e3940a 2025-01-07 14:50:31 +00:00
LLVM GN Syncbot
f06d4d9ae5 [gn build] Port d00f65c6acd9 2025-01-06 21:32:10 +00:00
Nico Weber
40a00af3ea [gn] port 21edac25f09f (BuiltinsSPIRV) 2025-01-06 15:25:13 -05:00
Farzon Lotfi
21edac25f0
[SPIRV] Add Target Builtins using Distance ext as an example (#121598)
- Update pr labeler so new SPIRV files get properly labeled.
- Add distance target builtin to BuiltinsSPIRV.td.
- Update TargetBuiltins.h to account for spirv builtins.
- Update clang basic CMakeLists.txt to build spirv builtin tablegen.
- Hook up sema for SPIRV in Sema.h|cpp, SemaSPIRV.h|cpp, and
SemaChecking.cpp.
- Hookup sprv target builtins to SPIR.h|SPIR.cpp target.
- Update GBuiltin.cpp to emit spirv intrinsics when we get the expected
spirv target builtin.

Consensus was reach in this RFC to add both target builtins and pattern
matching:
https://discourse.llvm.org/t/rfc-add-targetbuiltins-for-spirv-to-support-hlsl/83329.

pattern matching will come in a separate pr this one just sets up the
groundwork to do target builtins for spirv.

partially resolves
[#99107](https://github.com/llvm/llvm-project/issues/99107)
2025-01-06 11:37:20 -05:00
LLVM GN Syncbot
d3b77a960d [gn build] Port 3a7a9c928671 2025-01-06 10:29:47 +00:00
LLVM GN Syncbot
f99b190757 [gn build] Port b51a082e1afd 2025-01-06 08:32:04 +00:00
LLVM GN Syncbot
483832b37a [gn build] Port 34e8aff480dd 2025-01-06 06:24:25 +00:00
Nico Weber
510263a969 [gn] port a774adb01725 (BuiltinsX86_64.td) 2025-01-05 21:09:55 -05:00
Evgenii Kudriashov
2bbdce9a42
[GlobalISel] Support physical register inputs in nested patterns (#121239)
When importing nested patterns, we create InsnMatcher for each pattern
and miss them if consider only the top level InsnMatcher. Iterate
PhysRegOperands instead.

Change the type of PhysRegOperands from DenseMap to SmallMapVector to
have stable generation. Also drop PhysRegInputs member from InsnMatcher
as there are no users of it.
2025-01-05 01:10:25 +01:00
Sergei Barannikov
c56b74315f
[TableGen][GISel] Reuse importNodeRenderer for OperandWithDefaultOps (#121285)
This avoids some code duplication (handling `Register`, `zero_reg` and
immediate operands).
2025-01-05 00:11:24 +03:00
Nico Weber
d598829375 [gn] make LLVMTableGenCommon a static_library again
Else TableGenTests doesn't link.
2025-01-03 08:05:15 -05:00
Nico Weber
b1c195cbd1 [gn] port 27f30029741e (yet another tblgen reorg) 2025-01-03 08:00:08 -05:00
Michael Kruse
27f3002974 [llvm-(min-)tblgen] Avoid redundant source compilation (#114494)
All the sources of `llvm-min-tblgen` are also used for `llvm-tblgen`,
with identical compilation flags. Reuse the object files of
`llvm-min-tblgen` for `llvm-tblgen` by applying the usual source
structure of an executable: One file per executable which named after
the executable name containing the (in this case trivial) main function,
which just calls the tblgen_main in TableGen.cpp. This should also clear
up any confusion (including mine) of where each executable's main
function is.

While this slightly reduces build time, the main motivation is ccache.
Using the hard_link
option, building the object files for `llvm-tblgen` will result in a
hard link to the same object file already used for `llvm-min-tblgen`. To
signal the build system that the file is new, ccache will update the
file's time stamp. Unfortunately, time stamps are shared between all
hard-linked files s.t. this will indirectly also update the time stamps
for the object files used for `llvm-tblgen`. At the next run, Ninja will
recognize this time stamp discrepancy to the expected stamp recorded in
`.ninja_log` and rebuild those object files for `llvm-min-tblgen`, which
again will also update the stamp for the `llvm-tblgen`... . This is
especially annoying for tablegen because it means Ninja will re-run all
tablegenning in every build.

I am using the hard_link option because it reduces the cost of having
multiple build-trees of the LLVM sources and reduces the wear to the SSD
they are stored on.
2025-01-03 09:41:57 +01:00
Michael Kruse
06b6161d3f Revert "[llvm-(min-)tblgen] Avoid redundant source compilation (#114494)"
This reverts commit f6cb56902c6dcafede21eb6662910b6ff661fc0f.

Buildbot failures such as https://lab.llvm.org/buildbot/#/builders/89/builds/13541:
```
/usr/bin/ld: utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o: undefined reference to symbol '_ZN4llvm23EnableABIBreakingChecksE'
/usr/bin/ld: /home/tcwg-buildbot/worker/flang-aarch64-libcxx/build/./lib/libLLVMSupport.so.20.0git: error adding symbols: DSO missing from command line
```

Going to investigate.
2025-01-02 23:28:17 +01:00
Michael Kruse
f6cb56902c
[llvm-(min-)tblgen] Avoid redundant source compilation (#114494)
All the sources of `llvm-min-tblgen` are also used for `llvm-tblgen`,
with identical compilation flags. Reuse the object files of
`llvm-min-tblgen` for `llvm-tblgen` by applying the usual source
structure of an executable: One file per executable which named after
the executable name containing the (in this case trivial) main function,
which just calls the tblgen_main in TableGen.cpp. This should also clear
up any confusion (including mine) of where each executable's main
function is.

While this slightly reduces build time, the main motivation is ccache.
Using the hard_link
option, building the object files for `llvm-tblgen` will result in a
hard link to the same object file already used for `llvm-min-tblgen`. To
signal the build system that the file is new, ccache will update the
file's time stamp. Unfortunately, time stamps are shared between all
hard-linked files s.t. this will indirectly also update the time stamps
for the object files used for `llvm-tblgen`. At the next run, Ninja will
recognize this time stamp discrepancy to the expected stamp recorded in
`.ninja_log` and rebuild those object files for `llvm-min-tblgen`, which
again will also update the stamp for the `llvm-tblgen`... . This is
especially annoying for tablegen because it means Ninja will re-run all
tablegenning in every build.

I am using the hard_link option because it reduces the cost of having
multiple build-trees of the LLVM sources and reduces the wear to the SSD
they are stored on.
2025-01-02 23:22:20 +01:00
LLVM GN Syncbot
4922350407 [gn build] Port cd19f3f787b0 2025-01-02 20:18:56 +00:00
Jonas Paulsson
8ab88f11a1
[emacs] Add noext as an attribute in llvm-mode.el (#121444)
The NoExt attribute was introduced with #100757, to exist alongside with
signext and zeroext.

This patch adds "noext" as an attribute to llvm-mode.el to get the proper
highlighting of the keyword.
2025-01-02 17:03:33 +01:00
LLVM GN Syncbot
6d604ba363 [gn build] Port e45e091b9089 2025-01-02 14:14:43 +00:00
Nico Weber
0cbe28df71 [gn] port 28ae2ff2a44c 2025-01-01 14:24:25 -05:00
Mark Danial
1135d36f86
[AIX] [lit] Fix shtest-format.py to account for behaviour on AIX (#121426)
The changes from https://github.com/llvm/llvm-project/pull/121376 has
broken the ppc64 aix bot:
https://lab.llvm.org/buildbot/#/builders/64/builds/1835. Adjusted the
testcase to account for `cat` behaviour on AIX prior to the changes
2025-01-01 13:34:28 -05:00
Angus Lees
ebdb6cf2ac
[lit] Cope with more cat variants (#121376)
BusyBox `cat` has yet another slight variation of error formatting:

```console
$ cat --help 2>&1 | head -1
BusyBox v1.37.0 (2024-09-30 10:39:57 UTC) multi-call binary.

$ cat does-not-exist
cat: can't open 'does-not-exist': No such file or directory
```

Rather than extend the test result regex with a third case,
recognise that we only really care about the filename and errno string.
Weaken the regex to ignore all "noise" around the filename.

Note this also corrects what looks like a bug with the previous regex.
Previously, the `cannot open does-not-exist` alternate did not assert
the following errno message.  This was introduced in
https://reviews.llvm.org/D60553 (apparently) due to differences in the
`cat` command on AIX.  That bug doesn't include the specific
AIX output, so it's unclear if this omission was intended.
2024-12-31 16:52:35 +00:00
Jonas Hahnfeld
998bdae7f5
[MLGO] Only configure tests with LLVM_INCLUDE_TESTS (#121293)
This allows downstream customers to remove all test directories and save
quite some space when only building with LLVM_INCLUDE_TESTS=OFF.
2024-12-30 10:32:54 +01:00
Sergei Barannikov
6cbc64ed92
[TableGen][GISel] Fix IMPLICIT_DEF operand being added as a use (#121283)
`IMPLICIT_DEF` has one operand that is a def, not a use.
2024-12-29 16:29:55 +03:00
Sergei Barannikov
4a92c27f9d
[TableGen][GISel] Remove check for LLT when emitting renderers (#121144)
Types used in the destination DAG of a pattern should not matter for
GlobalISel. All necessary checks are emitted in the form of matchers
when traversing the source DAG.

In particular, the check prevented importing patterns containing iPTR in
the middle of the destination DAG.

This reduces the number of skipped patterns on Mips and RISCV:
```
Mips   1270  -> 1212  (-58)
RISCV 42165 -> 42088  (-77)
```

Most of these patterns are for atomic operations.
2024-12-26 17:45:29 +03:00
Sergei Barannikov
a0e1fcc093
[TableGen][GISel] Refactor node renderers emission (#121071)
Split importExplicitUseRenderer into several smaller functions and
add a bunch of TODOs and FIXMEs.

This is an NFCI change to simplify review of future functional changes.

Pull Request: https://github.com/llvm/llvm-project/pull/121071
2024-12-26 08:40:47 +03:00
Sergei Barannikov
6f72d28dd9
[TableGen][GISel] Don't copy dead def from a sub-instruction to the root (#121094)
Sub-instruction can have a def with the same name as a def in a
top-level instruction.
Previously this could result in both defs copied to the instruction
being built.
2024-12-26 08:36:35 +03:00
Sergei Barannikov
4884b1b08a
[TableGen][GISel] Simplify checks for BasicBlockSDNode (NFC) (#121098) 2024-12-25 13:32:02 +03:00
LLVM GN Syncbot
ae435adabb [gn build] Port 2d6e7c2b359d 2024-12-25 08:56:33 +00:00
Vitaly Buka
1de228fa9b
[ubsan] Remove UBSAN_CAN_USE_CXXABI (#121082)
It's should be enough to provide weak implementation.

Fixes solaris and android linking after #121006.
2024-12-24 20:21:40 -08:00
Nico Weber
10c18ab7e6 [gn] port dbae7176a6ec (LLVMTelemetry) 2024-12-24 08:18:09 -05:00
Aiden Grossman
c84f5a9e00
[Github] Skip MIR files for undef check (#120919)
This patch skips checking files with a .mir extension for the presence
of undef. This was creating false positives that got reported on
discourse.
2024-12-24 01:09:34 -08:00
Nico Weber
24eb1566e0 [gn] port 24fc8f01a403 (and aec87a2143c01) 2024-12-23 08:40:29 -05:00