Commit Graph

540368 Commits

Author SHA1 Message Date
Kazu Hirata
90428419a5 [llvm] Use std::none_of (NFC) (#143320) 2025-06-08 16:18:38 -07:00
Kazu Hirata
a14de0f810 [lldb] Use std::none_of (NFC) (#143319) 2025-06-08 16:18:30 -07:00
Kazu Hirata
9ce8dde54c [lld] Use std::none_of (NFC) (#143318) 2025-06-08 16:18:23 -07:00
Kazu Hirata
240ff854ad [clangd] Use llvm::find (NFC) (#143317) 2025-06-08 16:18:16 -07:00
Aiden Grossman
b93e4215ec [CI] Use LLVM_ENABLE_RUNTIMES for runtimes builds on Linux
This patch switches us to using LLVM_ENABLE_RUNTIMES rather than using
separate runtimes builds for some reductions in CMake configuration time
and some simplification of the monolithic-linux.sh script.

Reviewers: DavidSpickett, cmtice, lnihlen, Endilll, tstellar

Reviewed By: Endilll, DavidSpickett

Pull Request: https://github.com/llvm/llvm-project/pull/142694
2025-06-08 22:06:53 +00:00
Aiden Grossman
20a6b63f1b [libcxx] Include __fwd/span.h in <mdspan>
This patch includes __fwd/span.h in <mdspan> so that we get the
declaration of dynamic_extent inside <mdspan>. We also clean up quite a
few tests that were manually included <span> for dynamic_extent.

This is based on feedback from #142693.

Reviewers: philnik777, ldionne

Reviewed By: philnik777

Pull Request: https://github.com/llvm/llvm-project/pull/142925
2025-06-08 21:58:36 +00:00
Florian Hahn
9ee4b356fd [LV] Reorganize index select tests (NFC).
This reorganizes the test coverage for selecting the min/max index. It
adds coverage for umin,umax,smin,smax variants, including test-coverage
for interleave codegen and cost-model driven tests.
2025-06-08 22:34:07 +01:00
Florian Hahn
414590bae8 [VPlan] Infer result type for ComptueReductionResult in ::execute (NFC).
Remove explicit use of underlying instruction to get type.
2025-06-08 21:44:28 +01:00
David Green
0583297f37 [AArch64][GlobalISel] Add patterns for FPR i8 G_DUP
This adds missing patterns for i8 G_DUP from FPR registers, not present from
the other fp patterns like f16/f32 etc.
2025-06-08 21:38:09 +01:00
David Green
55b6c3ed17 [AArch64][GlobalISel] Add dup tests where load is not combined into dup. NFC 2025-06-08 21:34:26 +01:00
Baranov Victor
68070f908b [clang-tidy][NFC] run clang-format over 'cert', 'cppcore', 'fuchsia',… (#143316)
… 'google' checks
2025-06-08 23:22:55 +03:00
Baranov Victor
ce46adb8b7 [clang-tidy][NFC] run clang-format over 'android', 'boost' and 'bugprone' checks (#143315) 2025-06-08 23:22:05 +03:00
Baranov Victor
65d66625b3 [clang-tidy][NFC] run clang-format over abseil and altera checks. (#143314) 2025-06-08 23:21:35 +03:00
Matheus Izvekov
366f48890d [clang] AST: fix dependency calculation for TypedefTypes (#143291)
The dependency from the type sugar of the underlying type of a Typedef
were not being considered for the dependency of the TypedefType itself.

A TypedefType should be instantiation dependent if it involves
non-instantiated template parameters, even if they don't contribute to
the canonical type.

Besides, a TypedefType should be instantiation dependent if it is
declared in a dependent context, but fixing that would have performance
consequences, as otherwise non-dependent typedef declarations would need
to be transformed during instantiation as well.

This removes the workaround added in
https://github.com/llvm/llvm-project/pull/90032

Fixes https://github.com/llvm/llvm-project/issues/89774
2025-06-08 17:07:36 -03:00
Jeremy Kun
b1b84a629d Pretty print on -dump-pass-pipeline (#143223)
This PR makes `dump-pass-pipeline` pretty-print the dumped pipeline. For
large pipelines the current behavior produces a wall of text that is
hard to visually navigate.

For the command

```bash
mlir-opt --pass-pipeline="builtin.module(flatten-memref, expand-strided-metadata,func.func(arith-expand,func.func(affine-scalrep)))" --dump-pass-pipeline
```

Before:

```bash
Pass Manager with 3 passes:
builtin.module(flatten-memref,expand-strided-metadata,func.func(arith-expand{include-bf16=false include-f8e8m0=false},func.func(affine-scalrep)))
```

After:

```bash
Pass Manager with 3 passes:
builtin.module(
  flatten-memref,
  expand-strided-metadata,
  func.func(
    arith-expand{include-bf16=false include-f8e8m0=false},
    func.func(
      affine-scalrep
    )
  )
)
```

Another nice feature of this is that the pretty-printed string can still
be copy/pasted into `-pass-pipeline` using a quote:

```bash
$ bin/mlir-opt --dump-pass-pipeline test.mlir --pass-pipeline='
builtin.module(
  flatten-memref,
  expand-strided-metadata,
  func.func(
    arith-expand{include-bf16=false include-f8e8m0=false},
    func.func(
      affine-scalrep
    )
  )
)'
```

---------

Co-authored-by: Jeremy Kun <j2kun@users.noreply.github.com>
2025-06-08 12:23:38 -07:00
jeremyd2019
d34b392dad [LLVM][Tests] remove %exeext from lli-child-target parameter. (#143077)
Its presence seems to actively hinder the ToolSubst mechanism that was
supposed to fill in the path to the tool, which prevented these tests
from working on Cygwin.
2025-06-08 20:52:05 +03:00
David Green
6baaa0afc3 [ARM] Handle roundeven for MVE. (#142557)
Now that #141786 handles scalar and neon types, this adds MVE
definitions and legalization for llvm.roundeven intrinsics. The existing
llvm.arm.mve.vrintn are auto-upgraded to llvm.roundeven like other vrint
instructions, so should continue to work.
2025-06-08 18:23:50 +01:00
Fangrui Song
718fd90b8a ELF,test: Make tests not rely on PPC64 .TOC.
`.quad .TOC.@tocbase` leads to a R_PPC64_TOC relocation referencing 0.
GNU Assembler does not define .TOC. . Fix reliance on the .TOC. symbol.
2025-06-08 10:14:21 -07:00
Tomohiro Kashiwada
89aef7e060 [LLD][Cygwin] Add libcygwin and libmsys-2.0 to exclude-from-auto-export library list (#143118)
Linking for Cygwin target always needs -lcygwin (and, -lmsys-2.0
instead for MSYS2 target) but should not auto-export from
them, same as -lmingw32 for MinGW target.
2025-06-08 20:06:03 +03:00
Yash Solanki
73a351e7d4 [llvm][GVN] Propagate trunc nuw to i1 equalities (#143273)
This patch adds to GVN's `propagateEquality()` to reason about equality
constraints through `trunc nuw iN to i1`.

Given:
  %tr = trunc nuw iN %v to i1

We can deduce that if `%tr == true`, then `%v == 1`, and if `%tr ==
false`, then `%v == 0`. This is valid because `nuw` guarantees that
truncation didn't lose unsigned bits, so `%v` must have been either 0 or
1.

The patch adds logic to propagate this information via the GVN worklist.
This enables further simplification opportunities downstream, such as
folding redundant stores or conditionals that depend on `%v`.

Includes a test case in `GVN/trunc-nuw-equality.ll`.

Resolves #142744
2025-06-08 18:58:16 +02:00
Rahul Joshi
8a5c8eb0be [NFC][Clang] Adopt simplified getTrailingObjects in AST/Type (#143258) 2025-06-08 07:42:00 -07:00
Rahul Joshi
b0ff07e0cc [NFC][Clang] Adopt simplified getTrailingObjects in TemplateBase (#143257) 2025-06-08 07:41:26 -07:00
Matt Arsenault
07a86a525e CodeGen: Look up frame-pointer attribute once (#142902)
Instead of pre-checking if the frame-pointer attribute is present,
just query the attribute and see if it's valid.
2025-06-08 23:03:52 +09:00
Simon Pilgrim
3fc216bc3b [X86] Add test coverage for #143238 2025-06-08 13:35:52 +01:00
Simon Pilgrim
e0b33c9500 Revert "[X86] Fold (add X, (srl Y, 7)) -> (sub X, (ashr Y, 7)) on vXi8 vectors" (#143303)
Reverts llvm/llvm-project#143106 as this is causing infinite loops in
#143238
2025-06-08 13:15:22 +01:00
Baranov Victor
55c86c5f77 [clang-tidy][NFC] fix formatting of namespace-comment-check (#143305)
Fixed formatting and codestyle issues in `namespace-comment-check`

Follow up to https://github.com/llvm/llvm-project/pull/124265.
2025-06-08 13:51:17 +02:00
Harrison Hao
102dfa8a48 [DAGCombiner] Allow freeze to sink through fmul by adding it to AllowMultipleMaybePoisonOperands (#142250)
Allow freeze to sink through fmul by treating it as a
non-poison-generating op
when operands are not poison.

Adding `ISD::FMUL` to `AllowMultipleMaybePoisonOperands` lets DAG
combine
push freeze through fmul. This helps expose patterns like `fmul+fadd`
for `FMA` fusion.

When rebuilding the node, we drop flags like nnan/ninf/nsz that imply
poison,
but keep contract, reassoc, afn, and arcp.


Closes: https://github.com/llvm/llvm-project/issues/141622
2025-06-08 19:38:57 +08:00
Andrzej Warzyński
5dfb7bbaa4 [mlir][linalg] Simplify createWriteOrMaskedWrite (NFC) (#141567)
This patch removes `inputVecSizesForLeadingDims` from the parameter list
of `createWriteOrMaskedWrite`. That argument is unnecessary - vector
sizes can be obtained from the `vecToStore` parameter. Since this doesn't
change behavior or test results, it's marked as NFC.

Additional cleanups:
  * Renamed `vectorToStore` to `vecToStore` for consistency and brevity.
  * Rewrote a conditional at the end of the function to use early exit,
    improving readability:

```cpp
  // BEFORE:
  if (maskingRequried) {
    Value maskForWrite = ...;
    write = maskOperation(write, maskForWrite);
  }
  return write;

  // AFTER
  if (!maskingRequried)
    return write;

  Value maskFroWrite = ...;
  return vector::maskOperation(builder, write, maskForWrite);
```
2025-06-08 12:36:51 +01:00
AZero13
7119a0f39b [AtomicExpandPass] Match isIdempotentRMW with InstcombineRMW (#142277)
Add umin, smin, umax, smax to isIdempotentRMW
2025-06-08 11:32:20 +01:00
Thorsten Klein
00eb22fff9 added option google-readability-namespace-comments.AllowNoNamespaceComments (#124265)
New option AllowNoNamespaceComments for
`google-readability-namespace-comments.AllowNoNamespaceComments` is
added.

When true, the check will allow that no namespace comment is present. If
a namespace comment is added but it is not matching, the check will
fail. Default is `false`

Fixes #124264
2025-06-08 13:19:40 +03:00
Kazu Hirata
3e1931d7fe [Scalar] Use std::none_of (NFC) (#143282)
While I am at it, this patch replaces It with std::next(It) for clarity.

Note that It is not used after this point.
2025-06-08 01:34:32 -07:00
Kazu Hirata
6edfc6ce6c [clang-tools-extra] Use llvm::any_of (NFC) (#143281) 2025-06-08 01:34:24 -07:00
Kazu Hirata
1cf1c21b84 [mlir] Strip away lambdas (NFC) (#143280)
We don't need lambdas here.
2025-06-08 01:34:17 -07:00
Kazu Hirata
9ea3972cd1 [Vectorize] Strip away lambdas (NFC) (#143279)
We don't need lambdas here.
2025-06-08 01:34:09 -07:00
Kazu Hirata
0613f8b9e4 [clang-move] Teach getDeclarationList to return ArrayRef (NFC) (#143278)
getDeclarationList is used only for read-only access to the array.  I
don't think it's actually meant to return by value.
2025-06-08 01:34:02 -07:00
Fangrui Song
38658b54b2 LanaiMCExpr: Migrate to MCSpecifierExpr 2025-06-08 00:26:26 -07:00
Fangrui Song
ef328e97db MipsMCExpr: Migrate to MCSpecifierExpr 2025-06-08 00:20:49 -07:00
Corentin Jabot
5c76ae2894 [Clang] Support constexpr asm at global scope. (#143268)
I previously failed to realize this feature existed...

Fixes #137459
Fixes #143242
2025-06-08 09:16:57 +02:00
Fangrui Song
39064519cb AVRMCExpr: Migrate to MCSpecifierExpr 2025-06-08 00:15:32 -07:00
Fangrui Song
2f1c08215f SystemZMCExpr: Migrate to MCSpecifierExpr 2025-06-08 00:10:15 -07:00
Fangrui Song
ce270b495d MCExpr: Move isSymbolUsedInExpression workaround to AMDGPU
This function was a workaround used to detect cyclic dependency
(properly resolved by 343428c666).
We do not want backends to use it. However, #112251 exposed it to MCExpr
to be reused by AMDGPU. Keep the workaround within AMDGPU to prevent
other backends from accidentally relying on it.
2025-06-08 00:02:27 -07:00
flovent
239c8ac268 [clang-tidy] Fix false positives with deducing this in readability-convert-member-functions-to-static check (#141391)
Add check for `DeclRefExpr` which points to an explicit object
parameter.

Fixes #141381.

---------

Co-authored-by: fubowen <fubowen@protomail.com>
Co-authored-by: flovent <flbven@protomail.com>
2025-06-08 09:58:24 +03:00
Fangrui Song
532facc78e ARMMCExpr: Migrate to MCSpecifierExpr 2025-06-07 23:32:18 -07:00
Fangrui Song
49a706d8ef MCSpecifierExpr: Make dtor defaulted 2025-06-07 23:25:29 -07:00
Fangrui Song
8eac7f5a81 PPCMCExpr: Migrate to MCSpecifierExpr 2025-06-07 23:01:29 -07:00
Fangrui Song
cdd0a6c781 BOLT: Replace MCTargetExpr with MCSpecifierExpr to fix bolt-icf.test on aarch64 host 2025-06-07 22:35:20 -07:00
Fangrui Song
4a6b4d3894 RISCVMCExpr: Migrate to MCSpecifierExpr 2025-06-07 22:14:28 -07:00
Fangrui Song
beaa98bf80 AArch64MCExpr: Migrate to MCSpecifierExpr 2025-06-07 21:53:55 -07:00
Owen Pan
897ccddcc3 [clang-format][NFC] Clean up fillRanges() in ClangFormat.cpp (#143236) 2025-06-07 20:59:53 -07:00
AZero13
7730853fa1 [SelectionDAG] Use DAG.getSelect (NFC) (#143276) 2025-06-08 10:27:10 +09:00