[clang] Add CLANG_USE_EXPERIMENTAL_CONST_INTERP cmake option (#199396)
To enable the new constant interpreter by default at configure time.
I don't expect any distributions to set this for now but it's useful for
testing and I think we need it eventually.
[lldb/test] Trim @expectedFailureAll(remote=True) decorators (#200529)
These three tests pass when run against a remote-darwin platform backed
by lldb-platform on device. Update each decorator to reflect where it's
still expected to fail rather than blanket-XFAILing every remote run.
- `TestAssertMessages.test_createTestTarget`: was XFAIL on
oslist=no_match(["linux"]) + remote=True. Add darwin_all to the no_match
list so the XFAIL stays only on remote-windows / remote-freebsd /
remote-netbsd / remote-android.
- `TestDebuggerAPI.test_CreateTarget_platform`: scope to non-Darwin
remotes (bug llvm/llvm-project#92419 still tracks the underlying issue
on those platforms).
- `TestObjcOptimized`: drop @expectedFailureAll(remote=True) from the
test method and put @skipUnlessDarwin on the class. The Makefile depends
on `-framework Foundation` and `-lobjc`, so the test cannot build on
non-Darwin platforms — skip it there outright instead of pretending it
could XFAIL.
Signed-off-by: Med Ismail Bennani <ismail at bennani.ma>
[AMDGPU] Introduce ABI occupancy for object linking
This PR introduces ABI occupancy as the contract used to compile functions under
object linking. The default is derived from the occupancy needed for a 1024
workitem workgroup, can be overridden with `-amdgpu-abi-waves-per-eu`, and can
be overridden per function by `amdgpu-flat-work-group-size` or tightened by an
accepted `amdgpu-waves-per-eu` hint.
The backend emits the selected occupancy in `.amdgpu.info` and uses it to
enforce the object linking register budget.
[dsymutil] Bump .dSYM bundle directory mtime after a rewrite (#199257)
When dsymutil rewrites an existing .dSYM bundle, only the inner DWARF
file is replaced and the bundle directory's mtime stays frozen at the
time of the original build.
macOS Spotlight's bundle re-import path keys off the bundle directory's
mtime to decide whether the importer should re-run. With the mtime
frozen, Spotlight keeps the previous build's UUID indexed forever,
DebugSymbols.framework's Spotlight lookup misses on the new UUID.
Bump the bundle directory's mtime explicitly at the end of a successful
run, reusing the .dSYM extraction already used by the codesign path.
rdar://177725866
[OpenMP] Introduce the ompx_name clause for kernel naming
This adds support for the ompx_name clause that allows users to specify
custom kernel names for OpenMP target offloading regions. The clause
accepts a string literal and overrides the default compiler-generated
kernel names.
Example usage:
#pragma omp target ompx_name("my_kernel")
{ ... }
In the process, the linkage of the offload entries was changed from weak
to external (for kernels), or whatever the global variable linkage is.
This makes sure we can link weak globals together but clash on kernels
with the same name.
Co-Authored-By: Claude (claude-sonnet-4.5) <noreply at anthropic.com>
[OpenMP] Introduce the ompx_name clause for kernel naming
This adds support for the ompx_name clause that allows users to specify
custom kernel names for OpenMP target offloading regions. The clause
accepts a string literal and overrides the default compiler-generated
kernel names.
Example usage:
#pragma omp target ompx_name("my_kernel")
{ ... }
In the process, the linkage of the offload entries was changed from weak
to external (for kernels), or whatever the global variable linkage is.
This makes sure we can link weak globals together but clash on kernels
with the same name.
Co-Authored-By: Claude (claude-sonnet-4.5) <noreply at anthropic.com>
[RISCV] Do not append duplicate Zilsd GPRPair CSR (#200463)
`determineCalleeSaves` can run more than once and as a result we were
appending duplicate `Zilsd GPRPair CSR's`. Skip a pair if it is already
present in the CSR set.
[LLDB] Simplify the hint when po-ing an object with no object descrip… (#200499)
…tion
The current wording of the hint is so long that the output obscures the
output of the command, which can be confusing. By shortening the message
the command output hopefully comes back into the center of attention.
[os_log] Fix a CodeGen crash for non-trivial C++ arguments (#200320)
The earlier fix in commit 8a0d145d90df (#158744) only emitted a hard
error for os_log arguments of record or complex type that took the
VarArgKind::Valid / ValidInCXX11 path in checkFormatExpr. Arguments of
non-trivial C++ class type (non-trivial copy/move ctor or dtor) instead
take the VarArgKind::Undefined path, which only emitted the
-Wnon-pod-varargs warning and let compilation proceed into CodeGen.
There, emitBuiltinOSLogFormat passes the argument expression to
EmitScalarExpr, which requires a scalar type. A non-trivial class
argument is not a scalar, so CodeGen crashes (asserting in
hasScalarEvaluationKind in assertions builds).
Emit the hard error err_format_conversion_argument_type_mismatch on the
Undefined path too, so compilation stops before CodeGen.
rdar://174747930
[X86] Use kmovw, not kmovq, for VK16 copies without BWI (#200337)
`copyPhysReg` selected `KMOVQkk_EVEX` for a `$k -> $k` VK16 copy on a
`+egpr` (APX) subtarget even without BWI, but `KMOVQ` requires BWI. Use
`KMOVW` instead.
This bug was found by a large run of Opus 4.7 looking for bugs in LLVM.
[Support] Add path-based setLastAccessAndModificationTime overload (#199256)
The existing setLastAccessAndModificationTime takes a file descriptor.
Add a const Twine & overload that opens the path internally so callers
no longer need to manage the fd themselves. The new overload accepts
both files and directories: on POSIX, O_RDONLY opens directories and the
existing fd-based implementation accepts a directory fd. On Windows,
FILE_FLAG_BACKUP_SEMANTICS is required to obtain a handle for a
directory.
The path overload pair mirrors the existing (Twine &) / (int FD) shape
used by setPermissions and resize_file.
[ExpandIRInsts] Fix sitofp/uitofp to float producing garbage instead of inf (#200291)
[ExpandIRInsts] Fix sitofp/uitofp producing garbage instead of inf
s/uitofp of an integer larger than the max finite floating-point value
should produce inf. This can't happen with e.g. an int32 -> float32
conversion, but can happen for e.g. int256 -> float32.
Before this change we'd produce garbage.
Fixes #189054.
Co-Authored-By: Claude Opus 4.8 <noreply at anthropic.com>
[lldb][Darwin] Correct jGetLoadedDynamicLibrariesInfos typeo & fallback (#200515)
Jonas caught that I had a typeo in checking for the
`sizeof_mh_and_loadcmds` key in the `jGetLoadedDynamicLibrariesInfos`
response from debugserver in DyanmicLoaderDarwin. Fix that.
Also I originally picked a fallback value for the mach header + load
commands as a guess. I've sinced looked at a large UI app's binaries and
based on the size of their actual mh+load commands, picked a default
that will read all the data needed in the majority of cases.
rdar://178283767
workflows/issue-write: Do not read pr number from file for pull_request events (#200474)
For pull_request events, the author of the pull request has full control
over the workflow job and can potentially write any pull request number
to the file. This would allow them to modify comments on any pull
request not just their own.
The reading of the pull request number from the file was added in
53ff447b64186ff51181cd6050a9613983ff80be to support issue_comment events
so we don't need it for pull_request events anyway.
[lldb-server] Add accelerator plugin infrastructure for debugging hardware accelerators like gpus (#198907)
This is the first patch of many related to
https://discourse.llvm.org/t/upstreaming-basic-support-for-accelerators/89827/6
### What this patch adds
- **`LLDBServerAcceleratorPlugin`** base class in
`source/Plugins/Process/gdb-remote/` so accelerator can implement the
own plugin
- **`accelerator-plugins+`** feature in `qSupported` response, only
advertised when at least one plugin is installed
- **`jAcceleratorPluginInitialize`** GDB remote packet and its
implementation in handlers, request and response.
- **`AcceleratorActions`** struct so every plugin can return the actions
that needs to be on the initilaize. in the future we will extend this
install breakpoints etc.
- **Mock accelerator plugin** for testing, gated by CMake option
`LLDB_ENABLE_MOCK_ACCELERATOR_PLUGIN` (default OFF)
[6 lines not shown]
[lldb] Halve the size of indexes in DemangledNameInfo (NFC) (#200506)
Mangled should not be more than 4GB. This will halve the size of
`DemangledNameInfo` from 128 to 64 bytes.
[mlir][vector] Fix incorrect byte-alignment assumption in ConvertVectorStore (#189235)
When `ConvertVectorStore` emits the narrow-type emulation for a
`vector.store` into a 2-D memref, it previously assumed that if the
trailing dimension of the memref exactly matches the vector size
(`trailingDimsMatch`), then the last-dimension index must be zero and no
sub-byte alignment adjustment is needed. This assumption is wrong: a
valid store such as
vector.store %v, %src[%c0, %c1] : memref<3x4xi2>, vector<4xi2>
has a non-zero column index (%c1 == 1) even though trailingDim (4)
equals the vector size (4). The incorrect shortcut caused the pattern to
fall into the "aligned" path and emit a plain bitcast + store at byte
offset 0, silently dropping elements [1], [2], [3] of the first byte and
overwriting the wrong memory.
Fix: use `linearizedInfo.intraDataOffset` when it can be folded, so
constant non-zero offsets emit the required partial RMW stores. If the
[11 lines not shown]