Commit Graph

543579 Commits

Author SHA1 Message Date
Aiden Grossman
6b7e1b97f4 [CI] Use Github Native Groups in monolithic-* scripts
This patch updates monolithic-linux.sh and monolithic-windows.sh to emit
expandable groups in the Github logs. The syntax this replaces
originally worked to produce the same functionality on Buildkite, but
Github uses a different syntax.

https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/workflow-commands-for-github-actions#grouping-log-lines

Reviewers: cmtice, DavidSpickett, tstellar, lnihlen, Endilll

Reviewed By: Endilll, DavidSpickett

Pull Request: https://github.com/llvm/llvm-project/pull/143481
2025-07-01 16:15:27 -07:00
Jonas Devlieghere
e89458d398 [lldb] Fix PipeTest name collision in unit tests
We had two classes named `PipeTest`: one in `PipeTestUtilities.h` and
one in `PipeTest.cpp`. The latter was unintentionally using the wrong
class (from the header) which didn't initialize the HostInfo subsystem.

This resulted in a crash due to a nullptr dereference (`g_fields`) when
`PipePosix::CreateWithUniqueName` called `HostInfoBase::GetProcessTempDir`.
2025-07-01 16:01:38 -07:00
jjasmine
e9c9f8f374 [WebAssembly] Fold any/alltrue (setcc x, 0, eq/ne) to [not] any/alltrue x (#144741)
Fixes https://github.com/llvm/llvm-project/issues/50142, a miss of
further vectorization, where we can only achieve zext (xor (any_true),
-1).

Now in test case simd-setcc-reductions, it's converted to all_true.

Also fixes https://github.com/llvm/llvm-project/issues/145177, which is

all_true (setcc x, 0, eq) -> not any_true
any_true (setcc x, 0, ne) -> any_true
all_true (setcc x, 0, ne) -> all_true

---------

Co-authored-by: badumbatish <--show-origin>
2025-07-01 15:27:37 -07:00
jjasmine
4a8c1f7d12 [WebAssembly] [Backend] Wasm optimize illegal bitmask (#145627)
[WebAssembly] [Backend] Wasm optimize illegal bitmask for #131980.

Currently, the case for illegal bitmask (v32i8 or v64i8) is that at the
SelectionDag level, two (four) vectors of v128 will be concatenated
together, then they'll all be SETCC by the same pseudo illegal
instruction, which requires expansion later on.

I opt for SETCC-ing them seperately, bitcast and zext them and then add
them up together in the end.

---------

Co-authored-by: badumbatish <--show-origin>
2025-07-01 15:13:08 -07:00
James Y Knight
ae2104897c [SelectionDAG] Fix NaN regression in fma dag-combine. (#146592)
After 901e1390c9 (#127770), the DAG
combine would transform `fma(x, 0.0, 1.0)` into `1.0` if
`-fp-contract=fast` was enabled, in addition to when 'x' is marked
nnan/ninf.

It's only valid in the latter case, not the former, so delete the extra
condition.
2025-07-01 18:10:30 -04:00
Alex MacLean
475cd8dfaf [NVPTX] Further cleanup call isel (#146411)
This change continues rewriting and cleanup around DAG ISel for
formal-arguments, return values, and function calls. This causes some
incidental changes, mostly to instruction ordering and register naming
but also a couple improvements caused by using scalar types earlier in
the lowering.
2025-07-01 14:55:04 -07:00
Skrai Pardus
5ed852f7f7 [mlir][arith] Add arith::ConstantIntOp constructor (#144638)
This PR adds a `build()` constructor for `ConstantIntOp` that takes in
an `APInt`.


Creating an `arith` constant value with an `APInt` currently requires a
structure like the following:
```c
b.create<arith::ConstantOp>(IntegerAttr::get(apintValue, 5));
```
In comparison, the`ConstantFloatOp` already has an `APFloat` constructor
which allows for the following:
```c
b.create<arith::ConstantFloatOp>(floatType, apfloatValue);
```
Thus, intuitively, it makes sense that a similar `ConstantIntOp`
constructor is made for `APInts` like so:
```c
b.create<arith::ConstantIntOp>(intType, apintValue);
```

Depends on https://github.com/llvm/llvm-project/pull/144636
2025-07-01 23:50:39 +02:00
Florian Hahn
863e17a5be [VPlan] Make Phi operand for VPReductionPHIRecipe optional (NFC).
VPReductionPHIRecipe doesn't rely on the underlying phi any longer,
allow empty underlying values when cloning. NFC at the moment but will
enable follow-up patches.
2025-07-01 22:49:27 +01:00
zGoldthorpe
f393211454 [Reland][IPO] Added attributor for identifying invariant loads (#146584)
Patched and tested the `AAInvariantLoadPointer` attributor from #141800,
which identifies pointers whose loads are eligible to be marked as
`!invariant.load`.

The bug in the attributor was due to `AAMemoryBehavior` always
identifying pointers obtained from `alloca`s as having no writes. I'm
not entirely sure why `AAMemoryBehavior` behaves this way, but it seems
to be beceause it identifies the scope of an `alloca` to be limited to
only that instruction (and, certainly, no memory writes occur within the
`alloca` instructin). This patch just adds a check to disallow all loads
from `alloca` pointers from being marked `!invariant.load` (since any
well-defined program will have to write to stack pointers at some
point).
2025-07-01 17:46:19 -04:00
Changpeng Fang
d99b14623f AMDGPU: Implement tensor_save and tensor_stop for gfx1250 (#146590)
MC layer only.
2025-07-01 14:28:38 -07:00
Florian Hahn
bcbc440712 [VPlan] Add missing VPWidenSelectto VPRecipeWithIRFlags::classof (NFC).
Add missing entry to VPRecipeWithIRFlags. NFC currently as it is never
called on VPWidenSelectRecipes currently.
2025-07-01 22:26:57 +01:00
Han-Chung Wang
42578e8586 [mlir][linalg] Use hasPureTensorSemantics in TransposeMatmul methods. (#146438)
The issue is triggered by
ee070d0816
that checks `TensorLikeType` when downstream projects use the pattern
without registering bufferization::BufferizationDialect. The
registration is needed because the interface implementation for builtin
types locate at `BufferizationDialect::initialize()`. However, we do not
need to fix it by the registration. The proper fix is using the linalg
method, i.e., hasPureTensorSemantics.

No additional tests are added because the functionality is well tested
in
[transpose-matmul.mlir](https://github.com/llvm/llvm-project/blob/main/mlir/test/Dialect/Linalg/transpose-matmul.mlir).
To reproduce the issue, it requires a different setup, e.g., writing a
new C++ pass, which seems not worth it.

Signed-off-by: hanhanW <hanhan0912@gmail.com>
2025-07-01 14:15:27 -07:00
Chao Chen
5d849d3a90 [mlir][xegpu] Fix seg-fault caused by setting a null attribute (#146002) 2025-07-01 15:42:52 -05:00
Florian Hahn
829f2f2448 [VectorCombine] Mark function as changed if shuffle is created.
777d6b5de9 exposed a code path where a function is modified but not
marked accordingly. Make sure we return true from foldShuffleFromReductions
if only a shuffle has been inserted/replaced.

Should fix    https://lab.llvm.org/buildbot/#/builders/187/builds/7578.
2025-07-01 21:38:29 +01:00
Haojian Wu
ac76e4d8a9 [Serialization] Use SourceLocation::UIntTy for the offset type, NFC 2025-07-01 22:33:23 +02:00
Richard Smith
c56c349d39 [clang-tidy] Switch misc-confusable-identifiers check to a faster algorithm. (#130369)
Optimizations:

- Only build the skeleton for each identifier once, rather than once for
each declaration of that identifier.
- Only compute the contexts in which identifiers are declared for
identifiers that have the same skeleton as another identifier in the
translation unit.
- Only compare pairs of declarations that are declared in related
contexts, rather than comparing all pairs of declarations with the same
skeleton.

Also simplify by removing the caching of enclosing `DeclContext` sets,
because with the above changes we don't even compute the enclosing
`DeclContext` sets in common cases. Instead, we terminate the traversal
to enclosing `DeclContext`s immediately if we've already found another
declaration in that context with the same identifier. (This optimization
is not currently applied to the `forallBases` traversal, but could be
applied there too if needed.)

This also fixes two bugs that together caused the check to fail to find
some of the issues it was looking for:

- The old check skipped comparisons of declarations from different
contexts unless both declarations were type template parameters. This
caused the checker to not warn on some instances of the CVE it is
intended to detect.
- The old check skipped comparisons of declarations in all base classes
other than the first one found by the traversal. This appears to be an
oversight, incorrectly returning `false` rather than `true` from the
`forallBases` callback, which terminates traversal.

This also fixes an issue where the check would have false positives for
template parameters and function parameters in some cases, because those
parameters sometimes have a parent `DeclContext` that is the parent of
the parameterized entity, or sometimes is the translation unit. In
either case, this would cause warnings about declarations that are never
visible together in any scope.

This decreases the runtime of this check, especially in the common case
where there are few or no skeletons with two or more different
identifiers. Running this check over LLVM, clang, and clang-tidy, the
wall time for the check as reported by clang-tidy's internal profiler is
reduced from 5202.86s to 3900.90s.
2025-07-01 13:31:46 -07:00
Kazu Hirata
a061171426 [AsmParser] Remove unnecessary casts (NFC) (#146549)
Linkage is already of GlobalValue::LinkageTypes.
2025-07-01 13:11:02 -07:00
Haojian Wu
650d0151c6 [clang] Improve getFileIDLocal binary search. (#146510)
Avoid reading the `LocalSLocEntryTable` twice per loop iteration. NFC.

https://llvm-compile-time-tracker.com/compare.php?from=0b6ddb02efdcbdac9426e8d857499ea0580303cd&to=1aa335ccfb07ba96177b89b1933aa6b980fa14f6&stat=instructions:u
2025-07-01 21:59:09 +02:00
Florian Hahn
777d6b5de9 [VectorCombine] Use InstSimplifyFolder to simplify instrs on creation. (#146350)
Update VectorCombine to use InstSimplifyFolder to simplify redundant
instructions on creation.

PR: https://github.com/llvm/llvm-project/pull/146350
2025-07-01 20:55:51 +01:00
Florian Hahn
6b3d2b629c [VPlan] Add VPExpressionRecipe, replacing extended reduction recipes. (#144281)
This patch adds a new recipe to combine multiple recipes into an
'expression' recipe, which should be considered as single entity for
cost-modeling and transforms. The recipe needs to be 'decomposed', i.e.
replaced by its individual recipes before execute.

This subsumes VPExtendedReductionRecipe and
VPMulAccumulateReductionRecipe and should make it easier to extend to
include more types of bundled patterns, like e.g. extends folded into
loads or various arithmetic instructions, if supported by the target.

It allows avoiding re-creating the original recipes when converting to
concrete recipes, together with removing the need to record various
information. The current version of the patch still retains the original
printing matching VPExtendedReductionRecipe and
VPMulAccumulateReductionRecipe, but this specialized print could be
replaced with printing the bundled recipes directly.

PR: https://github.com/llvm/llvm-project/pull/144281
2025-07-01 20:44:50 +01:00
Meredith Julian
7da8ed8d33 Fix missing/outdated pass options in PassRegistry.def (#146160)
There are a handful of passes in PassRegistry.def with outdated or
missing pass options. These strings describing pass options are used for
the printPassNames() function only, which is likely why they have gotten
out-of-date without being caught. This MR simply changes the few passes
where the option string is out-of-date, fixing the output of
-print-passes. This does not affect functionality of the pipeline
parser, and is hard to verify in a unit test, so no tests were added.
2025-07-01 12:41:26 -07:00
Matthias Springer
d480359420 [mlir][sparse] Do not access operation after it was replaced (#146546)
Accessing an erased operation will no longer work during a One-Shot
Dialect Conversion.
2025-07-01 21:39:54 +02:00
S. VenkataKeerthy
119292c40b [IR2Vec] Add out-of-place arithmetic operators to Embedding class (#145118)
This PR adds out-of-place arithmetic operators (`+`, `-`, `*`) to the `Embedding` class in IR2Vec, complementing the existing in-place operators (`+=`, `-=`, `*=`). 

Tests have been added to verify the functionality of these new operators.

(Tracking issue - #141817)
2025-07-01 12:09:54 -07:00
S. VenkataKeerthy
efe0deae3f [NFC][IR2Vec] Increasing tolerance in approximatelyEquals() of Embedding (#145117)
Increase the default tolerance for `approximatelyEquals` in IR2Vec's Embedding class from 1e-6 to 1e-4.

(Tracking issue - #141817)
2025-07-01 12:03:37 -07:00
Amr Hesham
6fafa46f8c [CIR] Upstream PackIndexingExpr for ScalarExpr (#146239)
Upstream PackIndexingExpr for ScalarExpr
2025-07-01 20:59:53 +02:00
Amr Hesham
e11d354d64 [CIR] Upstream GenericSelectionExpr (#146211)
Upstream GenericSelectionExpr for ScalarExpr
2025-07-01 20:56:39 +02:00
Amr Hesham
67f1eb5c17 [CIR] Comma Operator for ComplexType (#146204)
This change adds support for the comma operator for ComplexType

https://github.com/llvm/llvm-project/issues/141365
2025-07-01 20:55:58 +02:00
Timm Baeder
b54e02a40b [clang][bytecode] Check pointer data type for bitcast eligibility (#146552)
So we get the proper type for a heap-allocated value.
2025-07-01 20:37:09 +02:00
Amr Hesham
8dbfe83681 [CIR] Fix mlir::ValueRange init from ArrayRef warning (#146577)
Fix initalizing ValueRange with ArrayRef
`ValueRange(ArrayRef<Value>(std::forward<Arg>(arg))) {}` warning
2025-07-01 20:32:04 +02:00
Amr Hesham
491c79f763 [CIR] Implement ArraySubscript for ComplexType (#146283)
Implement ArraySubscript for ComplexType

https://github.com/llvm/llvm-project/issues/141365
2025-07-01 20:27:29 +02:00
Changpeng Fang
5035d20dcb AMDGPU: Implement ds_atomic_async_barrier_arrive_b64/ds_atomic_barrier_arrive_rtn_b64 (#146409)
These two instructions are supported by gfx1250. We define the
instructions and implement the corresponding intrinsic and builtin.

Co-authored-by: Stanislav Mekhanoshin <Stanislav.Mekhanoshin@amd.com>
2025-07-01 11:08:49 -07:00
Jonas Devlieghere
3edae0d5e5 [lldb] Use EL_REFRESH to refresh Editline
Letting Editline refresh itself is more robust and ensures that the
current text is redraw if it was accidentally cleared. In that scenario
MoveCursor would only fix up the cursor position.
2025-07-01 11:08:11 -07:00
S. VenkataKeerthy
35b80031f4 [NFC] Formatting PassRegistry.def (#144139) 2025-07-01 11:03:43 -07:00
Kazu Hirata
c17e88f07e [Analysis] Remove a workaround for ancient GCC (NFC) (#146550)
The version of GCC mentioned is older than currently required GCC 7.4.
The comment about the crash dates back to 2014.
2025-07-01 10:42:29 -07:00
Kazu Hirata
e79e22c9af [AMDGPU] Remove an unnecessary cast (NFC) (#146548)
Val is already of uint64_t.
2025-07-01 10:42:22 -07:00
Kazu Hirata
72a9c3cced [Analysis] Remove an unnecessary cast (NFC) (#146547)
ME is already of ObjCMessageExpr *.
2025-07-01 10:42:14 -07:00
Kazu Hirata
98e6d5cd47 [lldb] Fix warnings
This patch fixes:

  lldb/source/Host/posix/ConnectionFileDescriptorPosix.cpp:279:15:
  error: format specifies type 'unsigned long' but the argument has
  type 'file_t' (aka 'int') [-Werror,-Wformat]

  lldb/source/Host/posix/ConnectionFileDescriptorPosix.cpp:383:15:
  error: format specifies type 'unsigned long' but the argument has
  type 'file_t' (aka 'int') [-Werror,-Wformat]
2025-07-01 10:41:07 -07:00
Kazu Hirata
d79c284a2f [flang] Fix a warning
This patch fixes:

  flang/lib/Semantics/check-omp-structure.cpp:1747:41: error: lambda
  capture 'this' is not used [-Werror,-Wunused-lambda-capture]
2025-07-01 10:34:41 -07:00
John Harrison
a79404e50c [lldb] Correct an assertion name. 2025-07-01 10:26:32 -07:00
Changpeng Fang
c8450ea226 AMDGPU: Remove the unnecessary needAlias argument in DS_Real_gfx12 (#146439) 2025-07-01 10:20:25 -07:00
Joe Nash
21d5017a05 [AMDGPU] Refactor FLAT_Load_Pseudo class (#146539)
NFC. Refactor it to make it easier to inherit from.
2025-07-01 12:51:15 -04:00
Simon Pilgrim
b697b801b1 [X86] freeze-vector.ll - fix cut+pasta typo in frozen build vector tests
Ensure we load BOTH scalars, inserted into different positions into separate vectors with the freeze(poison) base

Noticed while triaging regressions in #145939
2025-07-01 17:36:43 +01:00
Sameer Sahasrabuddhe
a34a024812 [AMDGPU][SIInsertWaitCnts] skip meta instructions early (#145720)
When iterating over a block, meta instructions have no effect on wait counts,
but their presence drops the reference to earlier waitcnt instructions before
they are processed. This results in spurious wait counts, which do not affect
correctness, but are also not required in the resulting program. Skipping meta
instructions as soon as they are seen cleans this up.
2025-07-01 22:02:48 +05:30
Benjamin Kramer
13e6ea7b4c [bazel] Add missing dependency for 08cf6ae537 2025-07-01 18:21:45 +02:00
Guy David
01a6c08533 [PHIElimination] Verify reappropriated COPY is of similar register class, update livevars. (#146337)
Follow up to the second bug that
https://github.com/llvm/llvm-project/pull/131837 introduced, described
in
https://github.com/llvm/llvm-project/pull/131837#issuecomment-3018777795.
2025-07-01 19:18:31 +03:00
Krzysztof Parzyszek
ba116a8bed [flang][OpenMP] Split check-omp-structure.cpp into smaller files, NFC (#146359)
Create these new files in flang/lib/Semantics:
  openmp-utils.cpp/.h         - Common utilities
  check-omp-atomic.cpp        - Atomic-related checks
  check-omp-loop.cpp          - Loop constructs/clauses
  check-omp-metadirective.cpp - Metadirective-related checks

Update lists of included headers, std in particular.

---------

Co-authored-by: Jack Styles <jack.styles@arm.com>
2025-07-01 11:12:00 -05:00
John Harrison
1a7b7e24bc [lldb] Adding pipe support to lldb_private::MainLoopWindows. (#145621)
This updates MainLoopWindows to support events for reading from a pipe
(both anonymous and named pipes) as well as sockets.

This unifies both handle types using `WSAWaitForMultipleEvents` which
can listen to both sockets and handles for change events.

This should allow us to unify how we handle watching pipes/sockets on
Windows and Posix systems.

We can extend this in the future if we want to support watching other
types, like files or even other events like a process life time.

---------

Co-authored-by: Pavel Labath <pavel@labath.sk>
2025-07-01 08:59:27 -07:00
sribee8
47e28d9cd1 [libc] wcscspn implementation (#146158)
Implemented wcscspn and tests.

---------

Co-authored-by: Sriya Pratipati <sriyap@google.com>
2025-07-01 15:56:09 +00:00
Luke Lau
04c614327c [InstCombine] Pull vector reverse through intrinsics (#146384)
This is the intrinsic version of #146349, and handles fabs as well as
other intrinsics.

It's largely a copy of InstCombinerImpl::foldShuffledIntrinsicOperands
but a bit simpler since we don't need to find a common mask.

Creating a separate function seems to be cleaner than trying to shoehorn
it into the existing one.
2025-07-01 16:49:10 +01:00
Shilei Tian
4dab0b2300 [AMDGPU] Fix wrong reverse operations for v_cmpx_le_u32 (#146398)
Fixes: SWDEV-538616
2025-07-01 11:48:08 -04:00