14816 Commits

Author SHA1 Message Date
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
Fangrui Song
1e53f9523d
[CMake] Remove some always-true HAVE_XXX_H
These are unneeded even on AIX, PURE_WINDOWS, and ZOS (per #104706)

* HAVE_ERRNO_H: introduced by 1a93330ffa2ae2aa0b49461f05e6f0d51e8443f8 (2009) but unneeded.
  The guarded ABI is unconditionally used by lldb.
* HAVE_FCNTL_H
* HAVE_FENV_H
* HAVE_SYS_STAT_H

Pull Request: https://github.com/llvm/llvm-project/pull/123087
2025-01-15 09:53:21 -08:00
abhishek-kaushik22
943b212d56
[TableGen] Use std::move to avoid copy (#123088) 2025-01-15 22:50:00 +05:30
LLVM GN Syncbot
d0a36423c1 [gn build] Port 3986cffe8112 2025-01-15 16:09:28 +00:00
Kazu Hirata
618ac908db
[TableGen] Avoid repeated hash lookups (NFC) (#123018) 2025-01-15 07:57:30 -08:00
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