13549 Commits

Author SHA1 Message Date
Aiden Grossman
66d8377dbd
[Github] Add ability to filter jobs in job counting script (#82136)
This patch adds a new flag pair, --filter-gha-runners, and
--no-filter-gha-runners, that filters out all non-Github hosted runners
so that we can actual counts of the Github runners, where we are
actually limited.
2024-02-19 16:28:47 -08:00
LLVM GN Syncbot
bb049094d5 [gn build] Port 2ea5d167ae43 2024-02-19 07:56:38 +00:00
Jason Eckhardt
2ed0aacf97
[TableGen] Fixes for per-HwMode decoding problem (#82201)
Today, if any instruction uses EncodingInfos/EncodingByHwMode to
override the default encoding, the opcode field of the decoder table is
generated incorrectly. This causes failed disassemblies and other
problems.

Specifically, the main correctness issue is that the EncodingID is
inadvertently stored in the table rather than the actual opcode. This is
caused by having set up the IndexOfInstruction map incorrectly during
the loop to populate NumberedEncodings-- which is then propagated around
when OpcMap is set up with a bad EncodingIDAndOpcode.

Instead, do away with IndexOfInstruction altogether and use opcode value
queried from CodeGenTarget::getInstrIntValue to set up OpcMap. This
itself exposed another problem where emitTable was using the decoded
opcode to index into NumberedEncodings. Instead pass in the
EncodingIDAndOpcode vector, and create the reverse mapping from Opcode
to EncodingID, which is then used to index NumberedEncodings.

This problem is not currently exposed upstream since no in-tree targets
yet use the per-HwMode feature. It does show up in at least two
downstream targets.
2024-02-19 13:14:22 +08:00
Sergei Barannikov
1e4c76cdc9
[MC][AsmParser] Make MatchRegisterName return MCRegister (NFC) (#81408)
`MCRegister` is preferred over `unsigned` nowadays.
2024-02-18 13:59:49 +03:00
Nico Weber
4206d06130 [gn] port d332d88b919f (tzdb.cpp) 2024-02-17 21:24:58 -05:00
LLVM GN Syncbot
9c4e2fe589 [gn build] Port 0e6a48c3e8cc 2024-02-17 00:01:26 +00:00
azhan92
3af5c98200
[Release] Install compiler-rt builtins during Phase 1 on AIX (#81485)
The current test-release.sh script does not install the necessary
compiler-rt builtin's during Phase 1 on AIX, resulting on a
non-functional Phase 1 clang. Futhermore, the installation is also
necessary for Phase 2 on AIX.

Co-authored-by: Alison Zhang <alisonzhang@ibm.com>
2024-02-15 22:27:45 -04:00
LLVM GN Syncbot
9150858b82 [gn build] Port e606dc1dafea 2024-02-16 01:23:52 +00:00
LLVM GN Syncbot
2f516d4b31 [gn build] Port 24144d726fef 2024-02-16 01:23:51 +00:00
Jay Foad
594d57e07a [TableGen] New RegUnitSet(Name) constructor. NFC. 2024-02-15 11:35:52 +00:00
Prabhuk
6c74a6f6f4
Revert "[lldb-dap] Add support for data breakpoint. (#81541)" (#81812)
This reverts commit 8c56e78ec531f0e2460213c20fff869b6b7add99.

Reverting to address the LLDB test failure in ARM64.
2024-02-14 22:07:26 -08:00
Jessica Clarke
de6fad5146
[TableGen][NFCI] Simplify TypeSetByHwMode::intersect and make extensible (#81688)
The current implementation considers both iPTR+iN and everything else
all in one go, which leads to more special casing when iPTR is present
in only one set than is described in the comment block. Moreover this
makes it very difficult to add any new iPTR-like wildcards due to the
exponential combinatorial explosion that occurs.

Logically, iPTR+iN handling is entirely independent from everything
else, so rewrite the code to do them separately. This removes special
cases, making the core of the implementation more succinct, whilst more
clearly implementing exactly what is described in the comment block, and
allows for any number of (non-overlapping) wildcards to be added to the
list, as needed by CHERI LLVM downstream (due to having a new capability
type which, much like a normal integer pointer in LLVM, varies in size
between targets and modes).

In testing, this change results in identical TableGen output for all
in-tree backends (including those in LLVM_ALL_EXPERIMENTAL_TARGETS), and
it is intended that this implementation is entirely equivalent to the
old one.
2024-02-15 04:02:30 +00:00
Nico Weber
2d7fdfa61f [gn] port 09e98950bfcf (InstallAPI) 2024-02-14 09:39:00 -05:00
Jay Foad
f723260a80
[TableGen] Stop using make_pair and make_tuple. NFC. (#81730)
These are unnecessary since C++17.
2024-02-14 13:16:20 +00:00
Nikita Popov
124cd11d7f Revert "[GitHub][workflows] Ask reviewers to merge PRs when author cannot (#81142)"
This reverts commit 38c706e30f5f339bfb0bfb26fd7b5c2d5086064a.

This workflow always fails in cases where it needs to create a
comment, due to a permissions issue, see the discussion at:
https://discourse.llvm.org/t/rfc-fyi-pull-request-greetings-for-new-contributors/75458/20
2024-02-14 11:33:36 +01:00
LLVM GN Syncbot
14b0d0de1f [gn build] Port edff3ff4d37a 2024-02-14 02:35:48 +00:00
LLVM GN Syncbot
9168a2119c [gn build] Port a6b846ae1e58 2024-02-13 23:42:41 +00:00
Nico Weber
4bc2a4f64f [gn] fix typo in 8c56e78ec531
The missing trailing comma confuses the sync script.
2024-02-13 18:21:29 -05:00
Zequan Wu
8c56e78ec5
[lldb-dap] Add support for data breakpoint. (#81541)
This implements functionality to handle `DataBreakpointInfo` request and
`SetDataBreakpoints` request.

If variablesReference is 0 or not provided, interpret name as ${number
of bytes}@${expression} to set data breakpoint at the given expression
because the spec
https://microsoft.github.io/debug-adapter-protocol/specification#Requests_DataBreakpointInfo
doesn't say how the client could specify the number of bytes to watch.

This is based on top of https://github.com/llvm/llvm-project/pull/80753.
2024-02-13 16:38:56 -05:00
Jay Foad
a7cebadc10 [TableGen] Trivial simplification in computeRegUnitSets. NFC. 2024-02-13 17:16:25 +00:00
Jay Foad
e847abc5b4 [TableGen] Remove trivial helper function hasRegUnit. NFC. 2024-02-13 16:59:17 +00:00
Zequan Wu
d58c128bc4
[lldb-dap][NFC] Add Breakpoint struct to share common logic. (#80753)
This adds a layer between `SounceBreakpoint`/`FunctionBreakpoint` and
`BreakpointBase` to have better separation and encapsulation so we are
not directly operating on `SBBreakpoint`.

I basically moved the `SBBreakpoint` and the methods that requires it
from `BreakpointBase` to `Breakpoint`. This allows adding support for
data watchpoint easier by sharing the logic inside `BreakpointBase`.
2024-02-13 11:38:02 -05:00
S. Bharadwaj Yadavalli
8ba4ff3925
[DirectX][NFC] Change specification of overload types and attribute in DXIL.td (#81184)
- Specify overload types of DXIL Operation as list of types instead of a
string.
- Add supported DXIL type record definitions to `DXIL.td` leveraging
`LLVMType` to avoid duplicate definitions.
 - Spell out DXIL Operation Attribute specification string.
 - Make corresponding changes to process the records in DXILEmitter.cpp
2024-02-13 08:12:03 -08:00
Jay Foad
1f90af183d [TableGen] Do not speculatively grow RegUnitSets. NFC.
This seems to be a trick to avoid copying a RegUnitSet, but it can be
done more simply using std::move.
2024-02-13 16:08:56 +00:00
Jay Foad
485ebbff55 [TableGen] Use emplace_back instead of resize to size() + 1. NFC. 2024-02-13 15:59:40 +00:00
David Spickett
38c706e30f
[GitHub][workflows] Ask reviewers to merge PRs when author cannot (#81142)
This uses
https://pygithub.readthedocs.io/en/stable/github_objects/Repository.html?highlight=get_collaborator_permission#github.Repository.Repository.get_collaborator_permission.

Which does
https://docs.github.com/en/rest/collaborators/collaborators?apiVersion=2022-11-28#get-repository-permissions-for-a-user
and returns the top level "permission" key.

This is less detailed than the user/permissions key but should be fine
for this
use case.

When a review is submitted we check:
* If it's an approval.
* Whether we have already left a merge on behalf comment (by looking for
a hidden HTML comment).
* Whether the author has permissions to merge their own PR. 
* Whether the reviewer has permissions to merge.

If needed we leave a comment tagging the reviewer. If the reviewer also
doesn't have merge permission, then it asks them to find someone else
who does.
2024-02-13 14:52:02 +00:00
Jay Foad
5e5e51e906 Make use of std::inserter. NFC. 2024-02-13 14:34:58 +00:00
Jay Foad
f7cddf8006
[TableGen] Use std::move instead of swap. NFC. (#81606)
Historically TableGen has used `A.swap(B)` to move containers without
the expense of copying them. Perhaps this predated rvalue references. In
any case `A = std::move(B)` seems like a more direct way to implement
this when only A is required after the operation.
2024-02-13 14:31:54 +00:00
LLVM GN Syncbot
af56beac45 [gn build] Port f65577830073 2024-02-13 14:03:07 +00:00
Jay Foad
880afa1c5d
[TableGen] Use vectors instead of sets for testing intersection. NFC. (#81602)
In a few places we test whether sets (i.e. sorted ranges) intersect by
computing the set_intersection and then testing whether it is empty. For
this purpose it should be more efficient to use a std:vector instead of
a std::set to hold the result of the set_intersection, since insertion
is simpler.
2024-02-13 13:44:31 +00:00
LLVM GN Syncbot
e678e6edec [gn build] Port fe3406e34988 2024-02-13 10:49:19 +00:00
Arthur Eubanks
93cdd1b5cf
[PGO] Add ability to mark cold functions as optsize/minsize/optnone (#69030)
The performance of cold functions shouldn't matter too much, so if we
care about binary sizes, add an option to mark cold functions as
optsize/minsize for binary size, or optnone for compile times [1]. Clang
patch will be in a future patch.

This is intended to replace `shouldOptimizeForSize(Function&, ...)`.
We've seen multiple cases where calls to this expensive function, if not
careful, can blow up compile times. I will clean up users of that
function in a followup patch.

Initial version: https://reviews.llvm.org/D149800

[1]
https://discourse.llvm.org/t/rfc-new-feature-proposal-de-optimizing-cold-functions-using-pgo-info/56388
2024-02-12 14:52:08 -08:00
Jay Foad
595d8d4e85 [TableGen] Make use of find_if. NFC. 2024-02-12 16:46:07 +00:00
LLVM GN Syncbot
1c48c9234b [gn build] Port f9d6d6fbcc23 2024-02-12 07:32:50 +00:00
LLVM GN Syncbot
2a51c56d8e [gn build] Port 5e9eaf87b374 2024-02-10 19:44:41 +00:00
LLVM GN Syncbot
fd140d4283 [gn build] Port d26b43ff4f73 2024-02-10 09:13:09 +00:00
Tom Stellard
bd65547805
[workflows] Create a more descriptive title and body when creating a PR for backports (#80396)
When a backport request is made, the resulting pull request will have a
title like this:

<release branch>: <First line of HEAD commit for the branch>

And a body that says:

Backport <commit0> <commit1> ..

Requested By: <user>
2024-02-09 13:04:49 -08:00
Tomas Matheson
a9e546cc71
[TableGen][NFC] convert TreePatternNode pointers to references (#81134)
Almost all uses of `*TreePatternNode` expect it to be non-null. There
was the occasional check that it wasn't, which I have removed. Making
them references makes it clear that they exist.

This was attempted in 2018 (1b465767d6ca69f4b7201503f5f21e6125fe049a)
for `TreePatternNode::getChild()` but that was reverted.
2024-02-09 13:35:42 +00:00
Nico Weber
1f780bfac9 [gn] port a8d4a024e6bea3a (BuiltinsRISCV.td) 2024-02-09 08:19:31 -05:00
LLVM GN Syncbot
75798f21ca [gn build] Port ac3bd2bd5301 2024-02-09 10:20:23 +00:00
Pierre van Houtryve
b9079baadd
[NFC] clang-format utils/TableGen (#80973)
```
find llvm/utils/TableGen -iname "*.h" -o -iname "*.cpp" | xargs clang-format-16 -i
```

Split from #80847
2024-02-09 09:27:04 +01:00
Arthur Eubanks
0572dabb71 [gn build] Add IntrinsicsSPIRV.h generator
This was missing in the gn build for some reason, causing build errors like http://45.33.8.238/linux/130337/step_4.txt after 3b57b647.
2024-02-08 21:57:30 +00:00
S. Bharadwaj Yadavalli
758fd59d01
[DirectX][NFC] Change usage pattern *Dxil* to *DXIL* for uniformity (#80778)
Match DXIL TableGen class names with structure names in DXIL Emitter. 
Delete unnecessary Name field.
2024-02-08 10:02:32 -08:00
Jason Eckhardt
d01864eb2f
[TableGen] Remove map CodeGenTarget::InstrToIntMap. (#81079)
This patch removes CodeGenTarget::InstrToIntMap, using instead a new
member CodeGenInstruction::EnumVal to store each enum value. This value
is computed and set by CodeGenTarget::computeInstrsByEnum and queried by
CodeGenTarget::getInstrIntValue.
2024-02-07 19:33:16 -08:00
Jason Eckhardt
567d304e53
[TableGen][NFC] Replace hardcoded opcode numbering. (#81065)
This patch uses the recently introduced CodeGenTarget::getInstrIntValue
to replace hardcoded opcode enum value numbering in a few places.
2024-02-07 19:04:14 -08:00
Yi Kong
d6c2cbbc65
Fix test failure if CLANG_VENDOR contains spaces (#81017) 2024-02-08 07:31:34 +09:00
Jason Eckhardt
8ae0485070
[TableGen] Extend direct lookup to instruction values in generic tables. (#80486)
Currently, for some tables involving a single primary key field which is
integral and densely numbered, a direct lookup is generated rather than
a binary search. This patch extends the direct lookup function
generation to instructions, where the integral value corresponds to the
instruction's enum value.

While this isn't as common as for other tables, it does occur in at
least one downstream backend and one in-tree backend.

Added a unit test and minimally updated the documentation.
2024-02-07 12:49:39 +08:00
LLVM GN Syncbot
bcd1490496 [gn build] Port 2217837c3377 2024-02-07 00:47:43 +00:00
LLVM GN Syncbot
e96ba2509d [gn build] Port c13e271a3836 2024-02-06 21:27:06 +00:00
Aiden Grossman
38476b063f
[Github] Add script to count running jobs (#80250)
This patch adds a script to automatically query the number of running
jobs and print them to the terminal as this functionality isn't
available through the Github UI (unless you are a Github administrator).
2024-02-05 23:49:34 -08:00