532342 Commits

Author SHA1 Message Date
Sam Elliott
75ca080dab
[RISCV][Xqccmp] Correctly Parse/Disassemble pushfp (#133188)
In the `qc.cm.pushfp` instruction, it is like `cm.pushfp` except in one
important way - `qc.cm.pushfp {ra}, -N*16` is not a valid encoding,
because this would update `s0`/`fp`/`x8` without saving it.

This change now correctly rejects this variant of the instruction, both
during parsing and during disassembly. I also implemented validation for
immediates that represent register lists (both kinds), which may help to
catch bugs in the future.
2025-03-27 17:43:26 -07:00
Krzysztof Drewniak
d7c53a91c2
[mlir] Decouple enum generation from attributes, adding EnumInfo and EnumCase (#132148)
This commit pulls apart the inherent attribute dependence of classes
like EnumAttrInfo and EnumAttrCase, factoring them out into simpler
EnumCase and EnumInfo variants. This allows specifying the cases of an
enum without needing to make the cases, or the EnumInfo itself, a
subclass of SignlessIntegerAttrBase.

The existing classes are retained as subclasses of the new ones, both
for backwards compatibility and to allow attribute-specific information.

In addition, the new BitEnum class changes its default printer/parser
behavior: cases when multiple keywords appear, like having both nuw and
nsw in overflow flags, will no longer be quoted by the operator<<, and
the FieldParser instance will now expect multiple keywords. All
instances of BitEnumAttr retain the old behavior.
2025-03-27 19:40:06 -05:00
Craig Topper
f4e14e7cf3 [RISCV] Const correct reference argument to isElementRotate. NFC 2025-03-27 17:23:00 -07:00
Florian Mayer
aa3149d204
[sanitizer] intercept getservent_r, getservbyname_r, getservbyport_r (#133339) 2025-03-27 17:05:37 -07:00
AdityaK
d18faf6460
[MLIR] NFC: Remove unused includes (#133327) 2025-03-27 16:50:47 -07:00
Craig Topper
9cd88847b5 [RISCV] Remove unused MCOperandPredicate from simm12_lsb00000. NFC
I don't think the use of isBareSymbolRef() was correct since we
don't have any relocations associated with this instruction type.
2025-03-27 16:45:58 -07:00
Ryosuke Niwa
2e3c317790
Fix the assertion failure in Analysis/Checkers/WebKit/forward-decl-checker.mm after https://github.com/llvm/llvm-project/pull/132784. (#133341) 2025-03-27 16:45:47 -07:00
Michael Buch
fc33aa9684
[llvm][cmake] Quote CMAKE_CXX_COMPILER_ID in string comparison (#133332)
We're seeing following configuration error when building the `runtimes`
target on our buildbots:
```
CMake Error at /Users/ec2-user/jenkins/workspace/llvm.org/lldb-cmake-sanitized/llvm-project/llvm/cmake/modules/CheckProblematicConfigurations.cmake:14 (if):
  if given arguments:

    "STREQUAL" "MSVC"

  Unknown arguments specified
Call Stack (most recent call first):
  /Users/ec2-user/jenkins/workspace/llvm.org/lldb-cmake-sanitized/llvm-project/llvm/cmake/modules/HandleLLVMOptions.cmake:10 (include)
  CMakeLists.txt:175 (include)
```

If I understand correctly this happens because ${CMAKE_CXX_COMPILER_ID}
is empty. Quoting it should make the comparison work for those cases.
2025-03-27 16:44:51 -07:00
Walter Lee
5e1fba4243
Revert "[X86] combineINSERT_SUBVECTOR - fold insert_subvector(base,extract_subvector(broadcast)) -> blend shuffle(base,broadcast)" (#133340)
Reverts llvm/llvm-project#133083

This causes BuildBot failures, and causes time outs in some of our internal tests (3 min => over 5 min).
2025-03-27 19:17:02 -04:00
Walter Lee
e9dc0518c9
Revert "Fix gcc signed/unsigned comparison warning. NFC." (#133334)
This reverts commit 6c2171672f03356835c534a0ec18250233ea66db. It touches
a common file as #133083, which is causing failures
2025-03-27 19:12:52 -04:00
Stanislav Mekhanoshin
864d4f940b
[AMDGPU] Trim traling blank in VOP3Instructions.td. NFC. (#133330) 2025-03-27 16:08:14 -07:00
Tom Stellard
a10a913402
workflows: Add missing apt-get update to abi tests (#133264) 2025-03-27 16:01:35 -07:00
LLVM GN Syncbot
a42342265f [gn build] Port d8e44a9ab290 2025-03-27 22:51:31 +00:00
Ryosuke Niwa
a285be320a
[WebKit Checkers] Recognize Objective-C and CF pointer conversion functions. (#132784)
Recognize dynamic_objc_cast, checked_objc_cast, dynamic_cf_cast, and
checked_cf_cast.
2025-03-27 15:47:38 -07:00
Alex Bradbury
c676eb770a [PreISelIntrinsicLowering][test] Add coverage for @llvm.experimental.memset.pattern with ptr pattern argument
These tests all show the desired output because after #132026, the
intrinsic can take any sized type as an argument. The tests were adapted
from those I proposed adding in #129220.
2025-03-27 22:39:11 +00:00
Jonas Devlieghere
c10e26ba2e
[lldb] Improve default statusline colors to work with more color schemes (#133315)
Use the reverse video [1] font effect (`${ansi.negative}`) as the
default for the statusline. Inverting the foreground and background
color has a better change as looking reasonably good, compared to
picking an arbitrary color.

[1] https://en.wikipedia.org/wiki/Reverse_video
2025-03-27 15:38:32 -07:00
Walter Lee
5b7fd708fe
Revert "[DAG] visitEXTRACT_SUBVECTOR - accumulate SimplifyDemandedVectorElts demanded elts across all EXTRACT_SUBVECTOR uses" (#133331)
Reverts llvm/llvm-project#133130

This touches a common file as #133083, which is causing failures
2025-03-27 18:36:38 -04:00
Alan Zhao
50ea777e40
[opt][timers] Fix time-passes.ll test failing on reversed iterators (#131941)
After https://github.com/llvm/llvm-project/pull/131217 was submitted,
time-passes.ll fails because `opt` prints `-time-report` when
`ManagedTimerGlobals` is destroyed. `ManagedTimerGlobals` stores
`TimerGroup`s in an unordered map, so the ordering of the output
`TimerGroup`s depends on the underlying iterator.

To fix this, we do what Clang does and use
`llvm::TimerGroup::printAll(...)`, which *is* deterministic. This is
also what Clang does. This does put move analysis section before the
pass section for `-time-report`, but again, this is also what Clang
currently does.
2025-03-27 15:31:53 -07:00
Mikhail R. Gadelha
d8e44a9ab2
[RISCV] Add late optimization pass for riscv (#133256)
This patch is an alternative to PRs #117060, #131684, #131728.

The patch adds a late optimization pass that replaces conditional
branches that can be statically evaluated with an unconditinal branch.

Adding Michael as a co-author as most of the code that evaluates the
condition comes from #131684.

Co-authored-by: Michael Maitland michaeltmaitland@gmail.com
2025-03-27 19:31:38 -03:00
Congcong Cai
01e505b992
[clang-tidy][misc-const-correctness] fix fp when using const array type. (#133018)
Fixed: #132931
const array is immutable in C/C++ language design, we don't need to
check constness for it.
2025-03-28 06:21:15 +08:00
Michael Liao
52975d5c9f [mlir][scf] Allow different forwarding ordering in uplift
- Allow 'before' arguments are forwarded in different order to 'after'
  body when uplifting `scf.while` to `scf.for`.
2025-03-27 18:09:07 -04:00
Craig Topper
10f983aebb [RISCV] Remove ParserMatchClass and DecoderMethod from an operand only used by pseudos. NFC 2025-03-27 15:07:29 -07:00
AdityaK
f2849fe05f
Fix RemoveDeadValues: Bail out early when there are no terminators (#133316)
Fixes: #131765
2025-03-27 15:04:31 -07:00
Alexander Weinrauch
1d9d4651df
[MLIR][ROCDL] Enable AliasAnalysis for GlobalLoadLds and LDS_Read_Tr (#133255)
Enables AliasAnalysis for `GlobalLoadLds` and `LDS_Read_Tr`. All other
memory related ROCDL Ops have this already enabled.
2025-03-27 15:02:40 -07:00
Jacob Lalonde
2a96beca9b
[SBProgress][CLI] Configure sbprogress events to be emitted for the CLI (#133309)
In the original SBProgress patch, #123837, I didn't ensure the debugger
was broadcasting these events to the CLI as SBProgress has far been
focused on DAP. We had an internal ask to have SBProgress events
broadcasted to the CLI so this patch addresses that.

<img width="387" alt="image"
src="https://github.com/user-attachments/assets/5eb93a46-1db6-4d46-a6b7-2b2f9bbe71db"
/>
2025-03-27 14:20:43 -07:00
Florian Hahn
5c26e80e57
[LV] Make cost model tests independent of VPValue numbers.
Update tests to not rely on hard-coded VPValue numbers.
2025-03-27 21:15:32 +00:00
alx32
57e5b82e8c
[lld-macho] Fix STABS entries for --icf=safe_thunks and --keep-icf-stabs (#133179)
When using the linker flags `--icf=safe_thunks` and `--keep-icf-stabs`
together, an issue arises with the STABS debugging entries in the linked
output. The problem affects STABS entries for functions that are folded
via ICF using thunks.
For instance, if `func1` is merged into `func2` through a thunk, the
STABS entry for `func1` incorrectly points to the object file of
`func2`. This is incorrect behavior—each function’s STABS entry should
consistently point to its own original object file (e.g., the STABS
entry for `func1` should reference `func1`’s object file). This issue
causes `dsymutil` to not be able to retrieve the debug information for
the problematic function.
This patch corrects this behavior - making it so that STABS entries
always point to the correct object file.
2025-03-27 14:11:19 -07:00
Bruno Cardoso Lopes
7c3ecffe9b
[MLIR][LLVMIR] Add support for the full form of global_{ctor,dtor} (#133176)
Currently only ctor/dtor list and their priorities are supported. This
PR adds support for the missing data field.

Few implementation notes:
- The assembly printer has a fixed form because previous `attr_dict`
will sort the dict by key name, making global_dtor and global_ctor
differ in the order of printed arguments.
- LLVM's `ptr null` is being converted to `#llvm.zero` otherwise we'd
have to create a region to use the default operation conversion from
`ptr null`, which is silly given that the field only support null or a
symbol.
2025-03-27 14:11:05 -07:00
Matthew Bastien
0d4f12ee00
[lldb-dap] Allow providing debug adapter arguments in the extension (#129262)
Added a new setting called `lldb-dap.arguments` and a debug
configuration attribute called `debugAdapterArgs` that can be used to
set the arguments used to launch the debug adapter. Right now this is
mostly useful for debugging purposes to add the `--wait-for-debugger`
option to lldb-dap.

Additionally, the extension will now check for a changed lldb-dap
executable or arguments when launching a debug session in server mode. I
had to add a new `DebugConfigurationProvider` to do this because VSCode
will show an unhelpful error modal when the
`DebugAdapterDescriptorFactory` returns `undefined`.

In order to facilitate this, I had to add two new properties to the
launch configuration that are used by the
`DebugAdapterDescriptorFactory` to tell VS Code how to launch the debug
adapter:

- `debugAdapterHostname` - the hostname for an existing lldb-dap server
- `debugAdapterPort` - the port for an existing lldb-dap server

I've also removed the check for the `executable` argument in
`LLDBDapDescriptorFactory.createDebugAdapterDescriptor()`. This argument
is only set by VS Code when the debug adapter executable properties are
set in the `package.json`. The LLDB DAP extension does not currently do
this (and I don't think it ever will). So, this makes the debug adapter
descriptor factory a little easier to read.

The check for whether or not `lldb-dap` exists has been moved into the
new `DebugConfigurationProvider` as well. This way the extension won't
get in the user's way unless they actually try to start a debugging
session. The error will show up as a modal which will also make it more
obvious when something goes wrong, rather than popping up as a warning
at the bottom right of the screen.
2025-03-27 14:09:09 -07:00
Jonas Devlieghere
8244f8210f
[lldb] Emit progress events in SymbolFileDWARFDebugMap (#133211)
Emit progress events from SymbolFileDWARFDebugMap. Because we know the
number of OSOs, we can show determinate progress. This is based on a
patch from Adrian, and part of what prompted me to look into improving
how LLDB shows progress events. Before the statusline, all these
progress events would get shadowed and never displayed on the command
line.
2025-03-27 13:09:38 -07:00
Hubert Tong
7712de3062
[compiler-rt][tests][AIX] Use /opt/freeware/bin/env (#133160)
`env -u` is not supported by the system `env` utility on AIX.

`/opt/freeware/bin/env` is the standard path for the GNU coreutils `env`
utility as distributed by the AIX Toolbox for Open Source Software.

Adding `/opt/freeware/bin` to `PATH` causes issues by picking up other
utilities that are less capable, in an AIX context, than the system
ones.

This patch modifies the relevant usage of `env` to use (on AIX) the full
path to `/opt/freeware/bin/env`.
2025-03-27 16:02:40 -04:00
egebeysel
a1a5594ad2
[mlir][arith] add wide integer emulation support for subi (#133248)
Adds wide integer emulation support for the `arith.subi` op. `(i2N, i2N)
-> (i2N)` ops are emulated as `(vector<2xiN>, vector<2xiN>) ->
(vector<2xiN>)`, just as the other emulation patterns.

The emulation uses the following scheme:

```
resLow = lhsLow - rhsLow;      // carry = 1 if rhsLow > lhsLow
resHigh = lhsLow - carry - rhsLow;
```

Signed-off-by: Ege Beysel <beysel@roofline.ai>
2025-03-27 15:01:04 -05:00
Aiden Grossman
2fb53f59c1
[CI] Refactor generate_test_report script
This patch refactors the generate_test_report script, namely turning it
into a proper library, and pulling the script/unittests out into
separate files, as is standard with most python scripts. The main
purpose of this is to enable reusing the library for the new Github
premerge.

Reviewers: tstellar, DavidSpickett, Keenuts, lnihlen

Reviewed By: DavidSpickett

Pull Request: https://github.com/llvm/llvm-project/pull/133196
2025-03-27 12:59:43 -07:00
Mikhail R. Gadelha
ee0009c4e6 [RISCV] Sort list of files. NFC. 2025-03-27 16:45:30 -03:00
Shilei Tian
02b45f4b81
[AMDGPU] Add a new function getIntegerPairAttribute (#133271)
The new function will return `std::nullopt` when any error occurs.
2025-03-27 15:38:54 -04:00
Joseph Huber
e9d517d183
[Clang] Handle -flto-partitions generically and forward it properly (#133283)
Summary:
The https://github.com/llvm/llvm-project/pull/128509 patch introduced
`--flto-partitions`. This was marked as a HIP only argument, and was
also spelled and handled incorrectly for an `-f` option. This patch
makes the handling generic for `ld.lld` consumers.

This also fixes some issues with emitting the flags being put after the
default arguments, preventing users from overriding them. Also, forwards
things properly for the new driver so we can test this.
2025-03-27 14:31:35 -05:00
Florian Hahn
5eccd71ce4
[VPlan] Add assertion ensuring Plan's UF matches BestUF (NFC). 2025-03-27 19:29:55 +00:00
Jordan Rupprecht
48864a52ef
Revert "[lldb] Remove UnwindPlan::Row shared_ptrs (#132370)" (#133299)
This reverts commit d7cea2b18717f0cc31b7da4a03f772d89ee201db. It causes
crashes in API tests.
2025-03-27 14:20:07 -05:00
Aiden Grossman
18172e461c
[Github] Bump CI container to ubuntu 24.04
This helps keep things up to date, and should not cause any issues given we do
not need to care about binary compatibility for things built in the CI
container. This patch also changes the name of the container which allows
incrementally moving jobs over after this lands.

Reviewers: tstellar

Reviewed By: tstellar

Pull Request: https://github.com/llvm/llvm-project/pull/132568
2025-03-27 12:16:45 -07:00
Aiden Grossman
5cb3052ccc
[Github] Bump CI container to LLVM 20.1.1
This patch bumps the CI container to the latest LLVM Release and gets rid of
the patch that we were carrying that is in 20.1.1.

Reviewers: tstellar

Reviewed By: tstellar

Pull Request: https://github.com/llvm/llvm-project/pull/132567
2025-03-27 12:15:23 -07:00
Florian Hahn
8bdcd0a96e
[LAA] Add missing test coverage for retrying with runtime checks.
Adds extra test coverage showing change by
https://github.com/llvm/llvm-project/pull/128045.
2025-03-27 19:09:10 +00:00
Joseph Huber
a2432793ea
[Clang] Add 'Joseph Huber' as offloading driver maintainer (#133296)
Summary:
I am probably the person most familiar with the offloading pipeline in
clang at this point.
2025-03-27 14:02:47 -05:00
Philip Reames
c90a536bcf [CodeGen] Simplify code using TypeSize overloads of getMachineMemOperand [nfc]
These were added in d584cea.  This change runs through existing uses and
simplifies where obvious.
2025-03-27 11:47:51 -07:00
Fabian Mora
1a7af2a90f
[mlir][DataLayout] Add IsolatedFromAbove to DataLayoutOpInterface (#132742)
This patch adds the `IsolatedFromAbove` trait as a dependent trait to
the `DataLayoutOpInterface` op interface.

The motivation behind this change comes from the implementation of the
`ptr` dialect, specifically the `ptr.type_offset` op. This op produces
an int-like value that equates to the size of a memory element. This is
useful for ptr arithmetic and indexing arrays. For example:

```mlir
%f32_off = ptr.type_offset f32 : index
%addr = ptr.ptradd %ptr, %f32_off : !ptr, index
%x = ptr.load %addr : !ptr -> f32 // Read ptr[1]
```

Without the `IsolatedFromAvobe` trait in the DL interface, the
`ptr.type_offset` cannot be `ConstantLike`. Why?
Take the example:
```mlir
op {DL1} {
  %f32_off0 = ptr.type_offset f32 : index
  op {DL2} {
    %f32_off1 = ptr.type_offset f32 : index
  }
}
```
If `ptr.type_offset` were to be `ConstantLike` then `canonicalize` would
hoist and unique the value. However, that could be wrong as DL2 could
have an entry to specify the size that's different from the size in DL1.

The best solution to the above problem is to make
`DataLayoutOpInterface` require the `IsolatedFromAbove` trait, as it
preserves the constness of values in the DL with respect to the
canonicalizer.
2025-03-27 14:37:37 -04:00
Florian Hahn
8ddbc01295
[VPlan] Manage FindLastIV start value in ComputeFindLastIVResult (NFC) (#132690)
Keep the start value as operand of ComputeFindLastIVResult. A follow-up
patch will use this to make sure the start value is frozen if needed.

Depends on https://github.com/llvm/llvm-project/pull/132689

PR: https://github.com/llvm/llvm-project/pull/132690
2025-03-27 18:34:13 +00:00
Ariel-Burton
fb993cd229
Add guard to for loop test clang/test/Sema/for.c (#133169)
Commit 20b7f5982622f includes a case that checks diagnostics for for
loops using thread locals.
This fails on platforms which do not support TLS.
This change adds guards to run this part of the test iff the feature is
supported.
2025-03-27 14:26:06 -04:00
Aaron Ballman
4480f26e93 Fix failing test case for _Countof
Test just needs an explicit triple that was missed.
2025-03-27 14:07:57 -04:00
Philip Reames
d584cea064
[RISCV] Use TypeSize instead of uint64_t in getMachineMemOperand interface (#133274)
The primary reason is that if you pass a TypeSize without explicitly
converting to LocationSize, you otherwise implicit convert to uint64_t
to call the respective LocationSize constructor. This means that any
scalable value becomes a runtime assertion failure.

By replacing uint64_t with TypeSize in this API, we avoid the implicit
conversion for TypeSize. uint64_t callers implicit convert to
LocationSize (via the raw constructor) which should have unchanged
behavior.
2025-03-27 11:04:00 -07:00
Min-Yih Hsu
aa207c3f05
[RISCV] Update the latency of floating point load in SiFive P500 scheduling model (#133165)
P500-series cores should have a floating point load latency closer to 5
cycles, just like P400- and P600-series cores.
2025-03-27 11:00:07 -07:00
Bruno Cardoso Lopes
08aedf7201
[MLIR][LLVM] Lift alignstack attribute ptr type restriction (#133195)
Current usage of alignstack is restricted to LLVM pointer types, whereas
when it's used in parameters it's possible to use it for other types,
see examples like `{i8, i8}, [2 x float], etc` in `llvm/test/CodeGen`.
This PR lifts the restriction and add testcases.
2025-03-27 10:28:37 -07:00