14847 Commits

Author SHA1 Message Date
LLVM GN Syncbot
d578d0bb13 [gn build] Port def50f701f6a 2025-01-25 18:30:36 +00:00
Stephen Long
ab976a1712
PreISelIntrinsicLowering: Lower llvm.exp/llvm.exp2 to a loop if scalable vec arg (#117568) 2025-01-24 14:02:06 -05:00
LLVM GN Syncbot
3861b9db88 [gn build] Port 0cd794d4860e 2025-01-24 18:27:23 +00:00
Rahul Joshi
7842374103
[NFC][TableGen] Emit nested namespaces in InstrInfoEmitter (#124210)
- Emit C++17 nested namespaces in InstrInfoEmitter.
2025-01-24 08:20:35 -08:00
LLVM GN Syncbot
a5cc897cde [gn build] Port 0ee037b861f9 2025-01-24 13:13:18 +00:00
Nico Weber
b4e81fd1eb [gn] port 4018317407006b2c63 2025-01-24 07:52:21 -05:00
Craig Topper
e19261faf5
[TableGen] Add a SmallPtrSet to track WriteRes that are referenced by some ReadAdvance. NFC (#124160)
Use this to remove a linear scan from CodeGenProcModel::hasReadOfWrite.

This reduces build time of RISCVGenSubtargetInfo.inc on by machine from
~6 seconds to ~3 seconds.
2025-01-23 12:48:59 -08:00
Oleksandr T.
4018317407
[Clang] restrict use of attribute names reserved by the C++ standard (#106036)
Fixes #92196

https://eel.is/c++draft/macro.names#2
> A translation unit shall not #define or #undef names lexically
identical to keywords, to the identifiers listed in Table
[4](https://eel.is/c++draft/lex.name#tab:lex.name.special), or to the
[attribute-token](https://eel.is/c++draft/dcl.attr.grammar#nt:attribute-token)s
described in [[dcl.attr]](https://eel.is/c++draft/dcl.attr), except that
the names likely and unlikely may be defined as function-like macros
([[cpp.replace]](https://eel.is/c++draft/cpp.replace))[.](https://eel.is/c++draft/macro.names#2.sentence-1)
2025-01-23 21:16:59 +02:00
LLVM GN Syncbot
a6211a64dc [gn build] Port ff17a4136ded 2025-01-23 18:28:02 +00:00
Craig Topper
082b148041 [TableGen] Pass CodeGenProcModel reference instead of index to addWriteRes/addReadAdvance. NFC
2 of the 3 callers of each of these already had a reference they
converted to index. Use that reference and make the one caller
that only has an index responsible for looking up the reference from it.
2025-01-23 09:11:29 -08:00
Nico Weber
92b839e9c8 [gn] fix mistake in ee99c4d4845db 2025-01-23 08:54:37 -05:00
SivanShani-Arm
ee99c4d484
[LLVM][Clang][AArch64] Implement AArch64 build attributes (#123990)
- Added support for AArch64-specific build attributes.
- Print AArch64 build attributes to assembly.
- Emit AArch64 build attributes to ELF.

Specification: https://github.com/ARM-software/abi-aa/pull/230
2025-01-23 09:46:59 +00:00
Chandler Carruth
cd5694ecea
[StrTable] Switch the option parser to llvm::StringTable (#123308)
Now that we have a dedicated abstraction for string tables, switch the
option parser library's string table over to it rather than using a raw
`const char*`. Also try to use the `StringTable::Offset` type rather
than a raw `unsigned` where we can to avoid accidental increments or
other issues.

This is based on review feedback for the initial switch of options to a
string table. Happy to tweak or adjust if desired here.
2025-01-22 23:19:47 -08:00
LLVM GN Syncbot
646f034e4e [gn build] Port de209fa11b54 2025-01-23 05:16:48 +00:00
Nico Weber
1042ddc31b [gn] port ec15b242505 2025-01-22 20:52:12 -05:00
Craig Topper
517334bdb8
[TableGen] Add maps from Write/ReadType to the parent WriteRes/ReadAdvance. NFC (#123876)
Use this to improve performance of SubtargetEmitter::findWriteResources
and SubtargetEmitter::findReadAdvance. Now we can do a map lookup
instead of a linear search through all WriteRes/ReadAdvance records.
    
This reduces the build time of RISCVGenSubtargetInfo.inc on my
machine from 43 seconds to 10 seconds.
2025-01-22 13:41:42 -08:00
Kazu Hirata
b40739a6e9 Revert "[LLVM][Clang][AArch64] Implement AArch64 build attributes (#118771)"
This reverts commit d7fb4a275c98f4035d1083b5eb3edd2ffb2da00e.

Buildbots failing:
https://lab.llvm.org/buildbot/#/builders/169/builds/7671
https://lab.llvm.org/buildbot/#/builders/65/builds/11046
2025-01-22 10:12:27 -08:00
Fangrui Song
58c6d440f8
[CMake] Remove HAVE_DLFCN_H and HAVE_DLADDR (#123879)
It is sufficient to just use `HAVE_DLOPEN`.
2025-01-22 08:15:10 -08:00
Nico Weber
d0a89e7179 [gn] fix mistake in d7fb4a275c98f 2025-01-22 10:19:30 -05:00
Nico Weber
4170d6123c [gn] port 6aeffcdb9130 2025-01-22 10:16:53 -05:00
SivanShani-Arm
d7fb4a275c
[LLVM][Clang][AArch64] Implement AArch64 build attributes (#118771)
- Added support for AArch64-specific build attributes.
- Print AArch64 build attributes to assembly.
- Parse AArch64 build attributes from assembly.
- Emit AArch64 build attributes to ELF.

Specification:
 https://github.com/ARM-software/abi-aa/pull/230
2025-01-22 14:23:46 +00:00
Marc Auberer
5136c6d9d2
[Tools][Docker] Update Dockerfiles and Docker guide (#123841)
Fixes #123669

- Update Dockerfiles to work with the LLVM trunk
- Adapt Documentation accordingly
- Fix duplicate `-c` flag
2025-01-22 13:53:23 +01:00
Sergei Barannikov
6aeffcdb91
[TableGen] Add a backend generating SDNode descriptions (#123002)
This patch adds a simplistic backend that gathers all target-specific
SelectionDAG nodes and emits descriptions for most of them.

This includes generating node enumeration, node names, and information
about node "prototype" that can be used to verify that a node is valid.

The patch also extends SDNode by adding target-specific flags, which are
also included in the generated tables.

Part of #119709,
[RFC](https://discourse.llvm.org/t/rfc-tablegen-erating-sdnode-descriptions/83627).

Pull Request: https://github.com/llvm/llvm-project/pull/123002
2025-01-22 09:01:08 +03:00
Finn Plummer
011b618644
[DXIL] Define and generate DXILAttribute and DXILProperty (#117072)
- Redefines `DXILAttribute` to denote a function attribute, compatible
to how it was define in DXC/LLVM 3.7
- Fix how `DXILAttribute` is emitted to be a struct of set attributes
instead of an "or" of the enums
- Implement the lowering of `DXILAttribute` to LLVM function attributes
in `DXILOpBuilder.cpp`. A custom mapping is defined.
- Audit all current ops to specify the correct attributes consistent
with DXC. This is done here to allow for testing.
- Update testcases in `llvm/test/CodeGen/DirectX` of all ops with
attributes to match that attributes are set
- Update testcases of ops that had previously incorrectly set attributes
to check there is no attributes set
- Defines `DXILProperty` to denote the other type of attributes from DXC
used to query properties.
- Emit `DXILProperty` as a struct of set attributes.
- Updates `DXIL.td` to specify applicable `DXILProperty`s on ops

Note: `DXILProperty` was referred to as 'queryable attributes' in design
discussion. Changed to property to allow for better expression in
`DXIL.td`

Resolves #114461
Resolves #115912
2025-01-21 17:33:45 -08:00
Kazu Hirata
1714facf4f
[TableGen] Avoid repeated map lookups (NFC) (#123699) 2025-01-21 16:23:23 +08:00
Jason Eckhardt
271b3383d7
[TableGen][NFC] Factor early-out range check. (#123645)
Combine the EarlyOut and IsContiguous range check.
Also avoid "comparison is always false" warnings in emitted code when
the lower-bound check is against 0.
2025-01-20 19:13:31 -06:00
Kazu Hirata
818d6e5665
[TableGen] Avoid repeated hash lookups (NFC) (#123562) 2025-01-20 10:16:20 -08:00
LLVM GN Syncbot
a034555097 [gn build] Port 6d12b954a7df 2025-01-20 03:16:21 +00:00
Craig Topper
0e4a10dff8 [MC] Add MCRegister::isPhysical. NFC 2025-01-18 22:28:37 -08:00
Craig Topper
bc386a8268
[TableGen] Replace some uses of make_range with methods that already return a range. NFC (#123453) 2025-01-18 08:37:25 -08:00
Craig Topper
2a4c4b554b
[TableGen] Use const getter to implement non-const getter instead of the other way around. NFC (#123452)
It's better to cast away constness on the reference being returned than
to cast away constness on the this pointer.
2025-01-18 08:35:59 -08:00
Craig Topper
c3aa86c9de [TableGen] const-correct a couple CodeGenSchedule methods. NFC 2025-01-17 22:55:20 -08:00
Jie Fu
d79e3af8ad [TableGen] Fix unused-variable warnings in CodeGenSchedule.cpp (NFC)
/llvm-project/llvm/utils/TableGen/Common/CodeGenSchedule.cpp:1704:32:
 error: unused variable 'Seq' [-Werror,-Wunused-variable]
    SmallVectorImpl<unsigned> &Seq =
                               ^
/llvm-project/llvm/utils/TableGen/Common/CodeGenSchedule.cpp:1713:32:
 error: unused variable 'Seq' [-Werror,-Wunused-variable]
    SmallVectorImpl<unsigned> &Seq =
                               ^
2 errors generated.
2025-01-18 14:48:55 +08:00
Craig Topper
6628b5934d
[TableGen] Use a range-based for loop. NFC (#123443) 2025-01-17 21:41:52 -08:00
Craig Topper
23746c2f6d
[TableGen] Use vector constructor instead of calling append or emplace_back on an empty vector. NFC (#123442) 2025-01-17 21:41:34 -08:00
Craig Topper
9cd12b5652
[TableGen] Inline a helper function that didn't seem necessary. NFC (#123440)
The function called find_if and converted the iterator to an index.
The caller then had to check the index being non-zero to know if the
find succeeded.

Seems better to just do the find and distance in the caller.
2025-01-17 21:41:04 -08:00
LLVM GN Syncbot
18eec97f09 [gn build] Port ae932becb2c9 2025-01-17 22:08:15 +00:00
LLVM GN Syncbot
580ba2eed2 [gn build] Port 6b048aeaf837 2025-01-17 20:01:12 +00:00
LLVM GN Syncbot
a807b2feb8 [gn build] Port 128e2e446e90 2025-01-17 20:01:11 +00:00
Fangrui Song
414980d061
[CMake] Remove HAVE_SYS_RESOURCE_H/HAVE_SETRLIMIT/HAVE_GETRLIMIT
Only used by Unix/Program.inc and seem always available.

Pull Request: https://github.com/llvm/llvm-project/pull/123288
2025-01-16 22:44:54 -08:00
Fangrui Song
219beb7aca [CMake] Remove HAVE_SYS_IOCTL_H 2025-01-16 21:52:01 -08:00
Fangrui Song
86a81d424c [CMake] Remove HAVE_TERMIOS_H
The code path has been dead since 2019.
See a3eb3d3d92d037fe3c9deaad87f6fc42fe9ea766
2025-01-16 21:48:27 -08:00
Fangrui Song
f999b11e68
[CMake] Remove some unneeded HAVE_*_H
Pull Request: https://github.com/llvm/llvm-project/pull/123282
2025-01-16 21:37:24 -08:00
LLVM GN Syncbot
8942d5ee6f [gn build] Port e902c6960cff 2025-01-16 23:27:05 +00:00
Evgenii Kudriashov
a242880371
[TableGen][GlobalISel] Reorder atomic predicate to preserve the order (#121806)
Since there are no opcodes for atomic loads and stores comparing to
SelectionDAG, we add `CheckMMOIsNonAtomic` predicate immediately after
the opcode predicate to make a logical combination of them. Otherwise
when `IPM_AtomicOrderingMMO` is inserted after `IPM_GenericPredicate`,
the patterns without predicates get a higher priority as
`IPM_AtomicOrderingMMO` has higher priority than `IPM_GenericPredicate`.

This is important to preserve an order of aligned/unaligned patterns on
X86 because aligned memory operations have an additional alignment
predicate and should be checked first according to their placement in td
file.

Closes #121446
2025-01-16 17:06:21 +01:00
LLVM GN Syncbot
da5ec78f2a [gn build] Port 8fb29ba287d7 2025-01-16 15:05:44 +00:00
LLVM GN Syncbot
25e5eb17b1 [gn build] Port 2c75bda42605 2025-01-16 15:05:43 +00:00
Nico Weber
b1cef93917 [gn] port bf17016a92bc (-gen-clang-diags-enums) 2025-01-16 09:31:35 -05:00
Jay Foad
4e8c9d2813
[TableGen] Use std::pair instead of std::make_pair. NFC. (#123174)
Also use brace initialization and emplace to avoid explicitly 
constructing std::pair, and the same for std::tuple.
2025-01-16 13:20:41 +00:00
Kazu Hirata
f30ff0b1a9
[TableGen] Avoid repeated hash lookups (NFC) (#123161) 2025-01-15 23:07:12 -08:00