14816 Commits

Author SHA1 Message Date
Simon Pilgrim
3a5cf6d99b
[X86] Rename AVX512 VEXTRACT/INSERT??x? to VEXTRACT/INSERT??X? (#116826)
Use uppercase in the subvector description ("32x2" -> "32X4" etc.) - matches what we already do in VBROADCAST??X?, and we try to use uppercase for all x86 instruction mnemonics anyway (and lowercase just for the arg description suffix).
2024-11-20 08:25:01 +00:00
LLVM GN Syncbot
581f755a2a [gn build] Port 3a6340768631 2024-11-19 23:41:42 +00:00
Yingwei Zheng
c727b48287
[SDAG][ISel][TableGen][LoongArch] Report error for trivial bitcasts when there are predicate calls (#116075)
On loongarch64 with lsx extension, we select `VBITREV_W` for `v4i32 (xor
X, (shl splat(1), Y))`:

8e66303916/llvm/lib/Target/LoongArch/LoongArchLSXInstrInfo.td (L1583-L1584)

And `vsplat_imm_eq_1` is defined as:

8e66303916/llvm/lib/Target/LoongArch/LoongArchLSXInstrInfo.td (L77-L87)

For the `(bitconvert (v4i32 (build_vector)))` case, the pattern is
expected to be:
```
PATTERN: (xor:{ *:[v4i32] } v4i32:{ *:[v4i32] }:$vj, (shl:{ *:[v4i32] } (bitconvert:{ *:[v4i32] } (build_vector:{ *:[v4i32] }))<<P:Predicate_vsplat_imm_eq_1>>, v4i32:{ *:[v4i32] }:$vk))
RESULT:  (VBITREV_W:{ *:[v4i32] } v4i32:{ *:[v4i32] }:$vj, v4i32:{ *:[v4i32] }:$vk)
```

However, `simplifyTree` drops the `bitconvert` node and its predicates:

8e66303916/llvm/utils/TableGen/Common/CodeGenDAGPatterns.cpp (L3036-L3062)

Then llvm will match `vsplat_imm_eq_1` for any v4i32 splats and cause a
miscompilation:
```
PATTERN: (xor:{ *:[v4i32] } v4i32:{ *:[v4i32] }:$vj, (shl:{ *:[v4i32] } (build_vector:{ *:[v4i32] }), v4i32:{ *:[v4i32] }:$vk))
RESULT:  (VBITREV_W:{ *:[v4i32] } v4i32:{ *:[v4i32] }:$vj, v4i32:{ *:[v4i32] }:$vk)
```

This patch adds additional checks for predicates associated with the
trivial bitconvert node. Unused patterns in the LoongArch target are
also removed.

Fixes https://github.com/llvm/llvm-project/issues/116008.
2024-11-19 21:24:40 +08:00
LLVM GN Syncbot
85a2d2df57 [gn build] Port 4e7682b1c47d 2024-11-18 09:32:50 +00:00
Craig Topper
92ffefe351
[Tablegen] Add more comments for result numbers to DAGISelEmitter.cpp (#116533)
Print what result number the Emit* nodes are storing their results in.
This makes it easy to track the inputs of later opcodes that consume
these results.
2024-11-17 19:11:28 -08:00
LLVM GN Syncbot
723dec66f0 [gn build] Port 224290d44899 2024-11-18 00:17:55 +00:00
LLVM GN Syncbot
3f67544b4d [gn build] Port dedc5159997e 2024-11-16 18:30:12 +00:00
Tobias Hieta
e2b4a700fd
[Utils] Fixed rebase in merge-release-pr script (#116340)
Recently GitHub changed something on their side so we no longer can
rebase release PR's with the API. This means that we now have to
manually rebase the PR locally and then push the results. This fixes
the script that I use to merge PRs to the release branch by changing
the rebase part to do the local rebase and also adds a new option
--rebase-only so that you can rebase the PRs easier.

Minor change is that the script now can take a URL to the pull request
as well as just the PR ID.
2024-11-16 19:14:56 +01:00
LLVM GN Syncbot
15ca79998a [gn build] Port 764834d63d5b 2024-11-16 17:25:47 +00:00
LLVM GN Syncbot
4b928608f8 [gn build] Port 62c3c1cad78b 2024-11-15 13:32:40 +00:00
LLVM GN Syncbot
3d474738df [gn build] Port 0b0d61101fa0 2024-11-15 12:14:59 +00:00
Matin Raayai
bb3f5e1fed
Overhaul the TargetMachine and LLVMTargetMachine Classes (#111234)
Following discussions in #110443, and the following earlier discussions
in https://lists.llvm.org/pipermail/llvm-dev/2017-October/117907.html,
https://reviews.llvm.org/D38482, https://reviews.llvm.org/D38489, this
PR attempts to overhaul the `TargetMachine` and `LLVMTargetMachine`
interface classes. More specifically:
1. Makes `TargetMachine` the only class implemented under
`TargetMachine.h` in the `Target` library.
2. `TargetMachine` contains target-specific interface functions that
relate to IR/CodeGen/MC constructs, whereas before (at least on paper)
it was supposed to have only IR/MC constructs. Any Target that doesn't
want to use the independent code generator simply does not implement
them, and returns either `false` or `nullptr`.
3. Renames `LLVMTargetMachine` to `CodeGenCommonTMImpl`. This renaming
aims to make the purpose of `LLVMTargetMachine` clearer. Its interface
was moved under the CodeGen library, to further emphasis its usage in
Targets that use CodeGen directly.
4. Makes `TargetMachine` the only interface used across LLVM and its
projects. With these changes, `CodeGenCommonTMImpl` is simply a set of
shared function implementations of `TargetMachine`, and CodeGen users
don't need to static cast to `LLVMTargetMachine` every time they need a
CodeGen-specific feature of the `TargetMachine`.
5. More importantly, does not change any requirements regarding library
linking.

cc @arsenm @aeubanks
2024-11-14 13:30:05 -08:00
LLVM GN Syncbot
5300ba7f4f [gn build] Port 2e9f8696e953 2024-11-14 18:02:40 +00:00
LLVM GN Syncbot
0192ae5ce0 [gn build] Port 9f06129e55a0 2024-11-14 14:13:22 +00:00
LLVM GN Syncbot
b18bb240a8 [gn build] Port c1c68baf7e0f 2024-11-14 09:19:23 +00:00
Sander de Smalen
c1c68baf7e
[AArch64] Define high bits of FPR and GPR registers (take 2) (#114827)
This is a step towards enabling subreg liveness tracking for AArch64,
which requires that registers are fully covered by their subregisters,
as covered here #109797.

There are several changes in this patch:

* AArch64RegisterInfo.td and tests: Define the high bits like B0_HI,
H0_HI, S0_HI, D0_HI, Q0_HI. Because the bits must be defined by some
register class, this added a register class which meant that we had to
update 'magic numbers' in several tests.

The use of ComposedSubRegIndex helped 'compress' the number of bits
required for the lanemask. The correctness of the masks is tested by an
explicit unit tests.

* LoadStoreOptimizer: previously 'HasDisjunctSubRegs' was only true for
register tuples, but with this change to describe the high bits, a
register like 'D0' will also have 'HasDisjunctSubRegs' set to true
(because it's fullly covered by S0 and S0_HI). The fix here is to
explicitly test if the register class is one of the known D/Q/Z tuples.
2024-11-14 09:09:13 +00:00
LLVM GN Syncbot
e5ca3ede06 [gn build] Port 813f7c3820d0 2024-11-14 05:51:37 +00:00
LLVM GN Syncbot
474ed453f7 [gn build] Port d23c5c2d6566 2024-11-14 01:34:37 +00:00
Rahul Joshi
39a8046b73
[NFC][TableGen] Use formatv automatic index in AsmWriterEmitter (#115966)
Use formatv automatic index assignment in AsmWriterEmitter.
2024-11-13 09:37:11 -08:00
LLVM GN Syncbot
51e9609706 [gn build] Port 21f7c626270d 2024-11-13 17:27:43 +00:00
LLVM GN Syncbot
e5d5ee4ea7 [gn build] Port 67b81e212069 2024-11-13 11:20:37 +00:00
Rakshit Patel
c63e83f495
[lit] Add --report-failures-only option for lit test reports (#115439)
- Add option (--report-failures-only) to generate a reduced report for
lit tests that only includes failing tests
- This is a continuation of proposed patches by @gregbedwell here:
    - https://reviews.llvm.org/D143516
    - https://reviews.llvm.org/D143519

---------

Co-authored-by: Greg Bedwell <greg.bedwell@sony.com>
Co-authored-by: James Henderson <James.Henderson@sony.com>
2024-11-13 08:30:33 +00:00
LLVM GN Syncbot
5a5122cac6 [gn build] Port 0e97b4d05a0b 2024-11-12 22:23:40 +00:00
Zaara Syeda
aaa37d6755
[PPC] Replace PPCMergeStringPool with GlobalMerge for Linux (#114850)
Enable merging all constants without looking at use in GlobalMerge by
default to replace PPCMergeStringPool pass on Linux.
2024-11-12 14:02:01 -05:00
Kazu Hirata
4048c64306
[llvm] Remove redundant control flow statements (NFC) (#115831)
Identified with readability-redundant-control-flow.
2024-11-12 10:09:42 -08:00
Alexandros Lamprineas
3cc852ece4
[FMV][AArch64] Expand feature dependencies using AArch64::ExtensionSet. (#113281)
Currently we maintain a hand written list of subtarget features which we
are implied for a given FMV feature. It is more robust to expand such
dependencies using ExtensionDependency from TargetParser, since that is
generated by tablegen. For this to work each FMV feature must have a
corresponding SubtargetFeature in place. FMV features which didn't
satisfy this criteria have been removed from the ACLE specification
(https://github.com/ARM-software/acle/pull/315). However, I deliberately
marked the ArchExtKind in FMVInfo structure as std::optional in case we
decide to break this rule in the future.

I have also added the missing dependencies:
 * FEAT_DPB2 -> FEAT_DPB
 * FEAT_FlagM2 -> FEAT_FlagM
2024-11-12 16:01:35 +00:00
Nico Weber
3793decaaa [gn] port 28e4aad45a64 2024-11-12 09:55:38 -05:00
David Spickett
5dd9867e2d
[llvm][llvm-lit] Hide --use-unique-output-file-name from --help (#114812)
I was too hasty landing an option whose only known use at this time is
LLVM's own CI.

We may be able to remove it before the next branch that would be the
next llvm-lit release outside of llvm, but the timing may not work out.

So I am hiding the option in case that were to happen.
2024-11-12 11:40:27 +00:00
LLVM GN Syncbot
0c5bf565ba [gn build] Port f77101ea7913 2024-11-12 07:19:04 +00:00
LLVM GN Syncbot
ad35450d85 [gn build] Port 5098b56d22b5 2024-11-11 23:00:47 +00:00
LLVM GN Syncbot
e8fe895df1 [gn build] Port 9c3a7ad7faab 2024-11-11 18:28:38 +00:00
LLVM GN Syncbot
7c6d809dfc [gn build] Port 11cc826c0a58 2024-11-11 18:28:37 +00:00
Nico Weber
87605b1fba [gn] Port e19d74016971f 2024-11-11 13:18:47 -05:00
Kazu Hirata
b9fb6b6cb5
[llvm] Migrate away from PointerUnion::{is,get,dyn_cast} (NFC) (#115681)
Note that PointerUnion::{is,get,dyn_cast} have been soft deprecated in
PointerUnion.h:

  // FIXME: Replace the uses of is(), get() and dyn_cast() with
  //        isa<T>, cast<T> and the llvm::dyn_cast<T>
2024-11-11 00:00:07 -08:00
LLVM GN Syncbot
40f52e849b [gn build] Port eddb79d56dd5 2024-11-11 07:45:12 +00:00
LLVM GN Syncbot
0e936e375e [gn build] Port dc11c0601577 2024-11-11 00:40:10 +00:00
LLVM GN Syncbot
ad2d313f74 [gn build] Port 2c10664afafc 2024-11-10 12:22:25 +00:00
Craig Topper
09b372aa60
[GISel][AArch64][RISCV] Allow G_SEXT_INREG patterns to be imported. (#115576)
SelectionDAG uses VTSDNode to store the extension type. GlobalISel uses
a literal constant operand.

For vectors, SelectionDAG uses a type with the same number of elements
as other operand of the sext_inreg. I assume for GISel we would just use
the scalar size.
2024-11-08 22:26:56 -08:00
LLVM GN Syncbot
cdc1c1ac84 [gn build] Port 8f4401374ca1 2024-11-09 05:26:20 +00:00
Sergei Barannikov
501a583441
[TableGen][SelectionDAG] Remove the implicit DAG node (#115295)
The node was introduced in 59c39dc1 and was intended to allow writing
patterns like this:
`[(set AL, (mul AL, GR8:$src1)), (implicit EFLAGS)]`

However, it does not introduce new functionality because the same
pattern can be equivalently expressed as:
`[(set AL, EFLAGS, (mul AL, GR8:$src1))]`

The latter form is also more flexible as it allows reordering output
operands.

In most places uses of `implicit` were redundant -- removing them didn't
change anything in the generated DAG tables. The only three cases where
it did have effect are in X86InstrArithmetic.td and X86InstrSystem.td --
those were rewritten to use `set` node.

Removing `implicit` from some patterns made them importable by GISel,
hence the change in a test.
2024-11-09 07:25:40 +03:00
LLVM GN Syncbot
f791cfc822 [gn build] Port ff2251543069 2024-11-09 00:19:23 +00:00
LLVM GN Syncbot
4f3bf1c62c [gn build] Port 58a17e1bbc54 2024-11-08 08:27:24 +00:00
LLVM GN Syncbot
1cb119b168 [gn build] Port e189d61924ba 2024-11-07 23:10:25 +00:00
Arthur Eubanks
09fb01a5e5
[gn build] Enable hwasan for aarch64 Android (#115219) 2024-11-07 12:32:42 -08:00
LLVM GN Syncbot
64c921875a [gn build] Port d2aff182d379 2024-11-07 19:25:20 +00:00
LLVM GN Syncbot
e9cb9285ce [gn build] Port cacbe71af7b1 2024-11-07 19:25:19 +00:00
LLVM GN Syncbot
3f4df52315 [gn build] Port 427a5cf105c4 2024-11-07 19:25:18 +00:00
Ryosuke Niwa
ef353b02b0
Introduce a new WebKit checker for a unchecked call arguments (#113708) (#114522)
This PR introduces alpha.webkit.UncheckedCallArgsChecker which detects a
function argument which is a raw reference or a raw pointer to a
CheckedPtr capable object.
2024-11-07 08:34:37 -08:00
Nico Weber
7aa02f9e3f [gn] port c6f3b7bcd0596d3 (libc++ __config_site HAS_NO -> HAS) 2024-11-07 10:25:18 -05:00
Nico Weber
c3e9f48454 [gn] port 4d4024e1edf3 2024-11-07 10:16:13 -05:00