13737 Commits

Author SHA1 Message Date
Argyrios Kyrtzidis
d2353ae00c
[utils/TableGen/X86CompressEVEXTablesEmitter.cpp] Make sure the tablegen output for the checkPredicate function is deterministic (#84533)
The output for the `checkPredicate` function was depending on a
`std::map` iteration that was non-deterministic from run to run, because
the keys were pointer values.
    
Make a change so that the keys are `StringRef`s so the ordering is
stable.
2024-03-09 22:34:18 -08:00
Andreas Jonson
40282674e9
Reapply [IR] Add new Range attribute using new ConstantRange Attribute type (#84617)
The only change from https://github.com/llvm/llvm-project/pull/83171 is the
change of the allocator so the destructor is called for
ConstantRangeAttributeImpl.

reverts https://github.com/llvm/llvm-project/pull/84549
2024-03-09 19:47:43 +08:00
Tom Stellard
0b9ce71a25
github-upload-release.py: Fix bug preventing release creation (#84571)
After aa02002491333c42060373bc84f1ff5d2c76b4ce we started passing the
user name to the create_release function and this was being interpreted
as the git tag.
2024-03-08 21:17:27 -08:00
Florian Mayer
0861755e59
Revert "[IR] Add new Range attribute using new ConstantRange Attribute type" (#84549)
Reverts llvm/llvm-project#83171

broke sanitizer buildbot
https://lab.llvm.org/buildbot/#/builders/168/builds/19110/steps/10/logs/stdio
2024-03-08 12:12:35 -08:00
LLVM GN Syncbot
0d7dba6300 [gn build] Port 087666811452 2024-03-08 20:02:42 +00:00
Andreas Jonson
e0d49066c1
[IR] Add new Range attribute using new ConstantRange Attribute type (#83171)
implementation as discussed in
https://discourse.llvm.org/t/rfc-metadata-attachments-for-function-arguments/76420
2024-03-08 23:20:04 +08:00
Shengchen Kan
1ca8092e87
[X86][MC] Support encoding/decoding for APX CCMP/CTEST (#83863)
APX assembly syntax recommendations:
  https://cdrdv2.intel.com/v1/dl/getContent/817241

NOTE:
The change in llvm/tools/llvm-exegesis/lib/X86/Target.cpp is for test
LLVM ::
tools/llvm-exegesis/X86/latency/latency-SETCCr-cond-codes-sweep.s

For `SETcc`, llvm-exegesis would randomly choose 1 other instruction to
test with `SETcc`, after selecting the instruction, llvm-exegesis would
check if the operand is initialized and valid, if not
`randomizeTargetMCOperand` would choose a value for invalid operand, it
misses support for condition code operand, which cause the flaky failure
after `CCMP` supported.

llvm-exegesis can choose `CCMP` without specifying ccmp feature b/c it
use `MCSubtarget` and only16/32/64 bit is considered.
llvm-exegesis doesn't choose other instructions b/c requirement in
`hasAliasingRegistersThrough`: the instruction should use GPR (defined
by `SETcc`) and define `EFLAGS` (used by `SETcc`).
2024-03-08 20:54:33 +08:00
Pierre van Houtryve
4b1910b11d
[GlobalISel][AMDGPU] Import patterns with multiple defs (#84171)
Fixes #63216
2024-03-08 09:39:10 +01:00
Nicolai Hähnle
3846019d8f update_test_checks: keep meta variables stable by default
Resubmitting this after previous revert with the following changes:

- Split table into table_rhs_idx and table_candidate_idx so that
  bisect.bisect_left can be used without the `key` argument, which
  was introduced in Python 3.10
- Remove a re.Pattern type annotation

Original commit message:

Prior to this change, running UTC on larger tests, especially tests
with unnamed IR values, often resulted in a spuriously large diff
because e.g. TMPnn variables in the CHECK lines were renumbered. This
change attempts to reduce the diff by keeping those variable names the
same.

There are cases in which this "drift" of variable names can end up being
more confusing. The old behavior can be re-enabled with the
--reset-variable-names command line argument.

The improvement may not be immediately apparent in the diff of this change.
The point is that the diff of stable_ir_values.ll against
stable_ir_values.ll.expected after this change is smaller.

Ideally, we'd also keep meta variables for "global" objects stable, e.g.
for attributes (#nn) and metadata (!nn). However, that would require a
much more substantial refactoring of how we generate check lines, so I
left it for future work.
2024-03-08 04:33:38 +01:00
Nicolai Hähnle
b565126b4d Revert "update_test_checks: keep meta variables stable by default"
This reverts commit fb02f9ac84a6151e41aba8f7391edd132a9aaf14.

Looks like some Python version incompatibility, will investigate.
2024-03-08 04:25:07 +01:00
Nicolai Hähnle
fb02f9ac84 update_test_checks: keep meta variables stable by default
Prior to this change, running UTC on larger tests, especially tests
with unnamed IR values, often resulted in a spuriously large diff
because e.g. TMPnn variables in the CHECK lines were renumbered. This
change attempts to reduce the diff by keeping those variable names the
same.

There are cases in which this "drift" of variable names can end up being
more confusing. The old behavior can be re-enabled with the
--reset-variable-names command line argument.

The improvement may not be immediately apparent in the diff of this change.
The point is that the diff of stable_ir_values.ll against
stable_ir_values.ll.expected after this change is smaller.

Ideally, we'd also keep meta variables for "global" objects stable, e.g.
for attributes (#nn) and metadata (!nn). However, that would require a
much more substantial refactoring of how we generate check lines, so I
left it for future work.
2024-03-08 03:58:12 +01:00
Nicolai Hähnle
5747f9d3e9 update_test_checks: simplify get_ir_regex
The match argument isn't used.
2024-03-08 03:58:11 +01:00
Nicolai Hähnle
fc1e5f9785 update_test_checks: simplify is_local_def_ir_value
The match argument is unused.
2024-03-08 03:58:11 +01:00
LLVM GN Syncbot
23d2c38830 [gn build] Port 2a4a852a67ea 2024-03-07 22:18:39 +00:00
LLVM GN Syncbot
d64632becd [gn build] Port 00f412168cf6 2024-03-07 19:18:25 +00:00
LLVM GN Syncbot
fc837f7a2d [gn build] Port a6a6fca7911f 2024-03-07 19:05:50 +00:00
LLVM GN Syncbot
38a73fb157 [gn build] Port 0083c3eb83bb 2024-03-07 03:38:16 +00:00
LLVM GN Syncbot
b84f3ea996 [gn build] Port 6a39a714423b 2024-03-07 00:03:07 +00:00
LLVM GN Syncbot
351a82b836 [gn build] Port bec2d105c7b8 2024-03-06 21:19:52 +00:00
LLVM GN Syncbot
f95a76391c [gn build] Port 6494f9bb8ac1 2024-03-06 19:29:40 +00:00
Krzysztof Parzyszek
5dc5bfbb70 [Frontend] Fix build break after 67c82d6ffb4b
Remove the `default` label from a switch that covers all cases.
2024-03-06 11:39:04 -06:00
Krzysztof Parzyszek
ecea949f0a Revert "[Frontend] Fix build break after 67c82d6ffb4b"
This reverts commit deff460b46dfcc8d6d5917a2b78c0d52edbe4afb.

Committed this from a different computer with my old (invalid) email
address.
2024-03-06 11:38:08 -06:00
Krzysztof Parzyszek
deff460b46 [Frontend] Fix build break after 67c82d6ffb4b
Remove the `default` label from a switch that covers all cases.
2024-03-06 11:33:57 -06:00
Krzysztof Parzyszek
67c82d6ffb
[Frontend] Add leaf constructs and association to OpenMP/ACC directives (#83625)
Add members "leafConstructs" and "association" to .td describing
OpenMP/ACC directives. The naming follows the terminology used in the
OpenMP standard: a "leaf" construct is a construct that is itself not a
composition or a combination of other constructs, and "association" is
the source language construct to which the directive applies (e.g. loop,
block, etc.)

The tblgen-generated output then contains two additional functions
- getLeafConstructs(D), and
- getDirectiveAssociation(D)
plus "enum class Association", all in namespaces "llvm::omp" and
"llvm::acc".

Note: getLeafConstructs returns an empty sequence for a construct that
is itself a leaf construct.

Use the new functions to simplify a few OpenMP-related functions in
clang.
2024-03-06 10:46:26 -06:00
Krzysztof Drewniak
6540f1635a
[AMDGPU] Add IR-level pass to rewrite away address space 7 (#77952)
This commit adds the -lower-buffer-fat-pointers pass, which is
applicable to all AMDGCN compilations.

The purpose of this pass is to remove the type `ptr addrspace(7)` from
incoming IR. This must be done at the LLVM IR level because `ptr
addrspace(7)`, as a 160-bit primitive type, cannot be correctly handled
by SelectionDAG.

The detailed operation of the pass is described in comments, but, in
summary, the removal proceeds by:
1. Rewriting loads and stores of ptr addrspace(7) to loads and stores of
i160 (including vectors and aggregates). This is needed because the
in-register representation of these pointers will stop matching their
in-memory representation in step 2, and so ptrtoint/inttoptr operations
are used to preserve the expected memory layout

2. Mutating the IR to replace all occurrences of `ptr addrspace(7)` with
the type `{ptr addrspace(8), ptr addrspace(6) }`, which makes the two
parts of a buffer fat pointer (the 128-bit address space 8 resource and
the 32-bit address space 6 offset) visible in the IR. This also impacts
the argument and return types of functions.

3. *Splitting* the resource and offset parts. All instructions that
produce or consume buffer fat pointers (like GEP or load) are rewritten
to produce or consume the resource and offset parts separately. For
example, GEP updates the offset part of the result and a load uses the
resource and offset parts to populate the relevant
llvm.amdgcn.raw.ptr.buffer.load intrinsic call.

At the end of this process, the original mutated instructions are
replaced by their new split counterparts, ensuring no invalidly-typed IR
escapes this pass. (For operations like call, where the struct form is
needed, insertelement operations are inserted).

Compared to LGC's PatchBufferOp (

32cda89776/lgc/patch/PatchBufferOp.cpp
): this pass
- Also handles vectors of ptr addrspace(7)s
- Also handles function boundaries
- Includes the same uniform buffer optimization for loops and
conditionals
- Does *not* handle memcpy() and friends (this is future work)
- Does *not* break up large loads and stores into smaller parts. This
should be handled by extending the legalization
of *.buffer.{load,store} to handle larger types by producing multiple
instructions (the same way ordinary LOAD and STORE are legalized). That
work is planned for a followup commit.
- Does *not* have special logic for handling divergent buffer
descriptors. The logic in LGC is, as far as I can tell, incorrect in
general, and, per discussions with @nhaehnle, isn't widely used.
Therefore, divergent descriptors are handled with waterfall loops later
in legalization.

As a final matter, this commit updates atomic expansion to treat buffer
operations analogously to global ones.

(One question for reviewers: is the new pass is the right place? Should
it be later in the pipeline?)

Differential Revision: https://reviews.llvm.org/D158463
2024-03-06 09:49:58 -06:00
LLVM GN Syncbot
6bf61283ed [gn build] Port 60822637bf00 2024-03-06 06:59:20 +00:00
LLVM GN Syncbot
929ceec705 [gn build] Port 85388a06b602 2024-03-06 03:03:27 +00:00
LLVM GN Syncbot
caad3794f0 [gn build] Port a8cb9db5f59d 2024-03-05 17:55:56 +00:00
LLVM GN Syncbot
97e9780e4c [gn build] Port 8e56fb824a43 2024-03-05 17:55:55 +00:00
LLVM GN Syncbot
aa4e3d594a [gn build] Port 1a67dee08913 2024-03-05 17:55:54 +00:00
Nico Weber
9f67f19614 [gn] Remove ScudoBenchmarks
It's the only thing depending on third-party/benchmark.
The recent third-party/benchmark uprev made it not build in the
GN build, so remove ScudoBenchmarks until someone feels motivated
to update the third-party/benchmark BUILD.gn file.
2024-03-05 12:46:07 -05:00
Nico Weber
f836048a2b [gn] port 6fd27d5b0321f (no more module.modulemap.in) 2024-03-05 12:03:53 -05:00
Wang Pengcheng
de1f33873b
[TableGen] Fix wrong codegen of BothFusionPredicateWithMCInstPredicate (#83990)
We should generate the `MCInstPredicate` twice, one with `FirstMI`
and another with `SecondMI`.
2024-03-05 19:54:02 +08:00
Shourya Goel
9a894e7d84
[Github Automation] Allow colon after cherry-pick command (#81002)
Fixes: https://github.com/llvm/llvm-project/issues/64803

Removed unsupported branch command and changed Regex to
accept /cherry-pick: command.
2024-03-05 09:28:44 +01:00
Shengchen Kan
7cd3268804 [X86][TableGen] Fix the mnemonic table for CMPCCXADD
The mnemonic of CMPCCXADD is `cmp${cond}xadd` and the condition code
is in the middle of mnemonic. When generating the function name for
CMPCCXADD, the substring `xadd` should be kept.

Before this patch, the name is `isCMPCC`. After this patch, the name
is `isCMPCCXADD`.
2024-03-05 12:30:55 +08:00
Mircea Trofin
a81a7b9962
[Py Reformat] Exclude third-party in code-format-helper.py (#83872)
Follow-up from PR #83491. `Darker`'s configuration is ignored because of the way we invoke it - with an explicit list of files. We need to filter it in `code-format-helper.py`.
2024-03-04 11:22:35 -08:00
Alexander Richardson
53a656d9a4
[utils/not] Disable coredumps when --crash is passed
We are expecting a crash, so it is unlikely that a coredump is going to
be particularly useful. For debugging the program can always be run without
the `not --crash` wrapper.

Reviewed By: jh7370

Pull Request: https://github.com/llvm/llvm-project/pull/83704
2024-03-04 10:45:22 -08:00
LLVM GN Syncbot
e6dff54f36 [gn build] Port bc9c6c0c65e2 2024-03-04 16:57:43 +00:00
LLVM GN Syncbot
af9c5ca820 [gn build] Port 17efdad2296a 2024-03-04 16:57:42 +00:00
Nico Weber
2a65941a79 [gn] port 8300f30a9234 2024-03-04 11:25:47 -05:00
LLVM GN Syncbot
5105f1551b [gn build] Port 33de5a316caa 2024-03-03 19:51:44 +00:00
Bjorn Pettersson
da591d390e [GlobalISel][TableGen] Take first result for multi-output instructions (#81130)
Previously, tblgen would reject patterns where one of its nested
instructions produced more than one result. These arise when the
instruction definition contains 'outs' as well as 'Defs'. This patch
fixes that by always taking the first result, which is how these
situations are handled in SelectionIDAG.

Original patch: https://reviews.llvm.org/D86617
Continued as: https://github.com/llvm/llvm-project/pull/81130
2024-03-02 20:10:02 +01:00
Sergei Barannikov
199bbe2b38
[MC] Teach checkAsmTiedOperandConstraints about optional operands (#81381)
At some point in the past, optional operands have become allowed in the
middle of an instruction. However, `checkAsmTiedOperandConstrains`
hasn't been modified to support this. This patch adds the support by
pulling operand offsets counting out of `convertToMCInst` and reusing it
in `checkAsmTiedOperandConstrains`.
2024-03-01 13:00:39 +03:00
LLVM GN Syncbot
6137f482fc [gn build] Port ca9d2e923b28 2024-02-29 22:58:02 +00:00
LLVM GN Syncbot
920094ea3b [gn build] Port 525fe4492bbe 2024-02-29 19:49:37 +00:00
Jason Eckhardt
be8f987d8c
[TableGen] Use consistent field kind checking in getNumericKey. (#83284)
Fields GenericField::IsInstruction and GenericField::Enum can be
simultaneously active for a given field. Methods compareBy and
primaryRepresentation both order the checking of IsInstruction before
GenericField::Enum. Do the same in getNumericKey for consistency.
2024-03-01 01:57:06 +08:00
Francesco Petrogalli
9491aecd23
[TableGen][CodeGenTarget] Add support for v3i8 and v3i1 MVTs. [NFCI] (#83140) 2024-02-29 17:35:34 +01:00
S. Bharadwaj Yadavalli
b1c8b9f89c
[DirectX][NFC] Leverage LLVM and DirectX intrinsic description in DXIL Op records (#83193)
* Leverage TableGen record descriptions of LLVM or DirectX intrinsics
that can be directly mapped in DXIL Ops TableGen description. As a
result, such DXIL Ops can be succinctly described without duplication.
DXILEmitter backend can derive the properties of DXIL Ops accordingly.
* Ensured that corresponding lit tests pass.
2024-02-29 06:21:44 -08:00
XinWang10
ffa48f0c94
[X86][MC] Teach disassembler to recognize apx instructions which ignores W bit (#82747)
Extended VMX instructions and 8 bit apx extended instructions don't need
W bit, they are marked as W ignored in spec.
RFC:
https://discourse.llvm.org/t/rfc-design-for-apx-feature-egpr-and-ndd-support/73031/4
2024-02-29 11:44:41 +08:00
Henrik G. Olsson
6a65b44322
[UTC] Don't leave dangling CHECK-SAME when removing CHECK lines (#82569)
When removing only lines that are global value CHECK lines, a related
CHECK-SAME line could be left dangling without a previous line to belong
to.

Resolves #78517
2024-02-28 17:08:36 -08:00