[Flang][OpenMP] Reject array sections and subobjects in LINEAR clause (#197430)
Array sections like a(:,1,1) and array elements like a(1) in a LINEAR
clause cause a crash during MLIR-to-LLVM IR translation because the
semantic checker doesn't catch them.
This adds a call to CheckVarIsNotPartOfAnotherVar for the LINEAR clause,
which is the same check used by PRIVATE and FIRSTPRIVATE to reject
subobject designators.
Fixes :
[https://github.com/llvm/llvm-project/issues/196068](https://github.com/llvm/llvm-project/issues/196068)
Co-authored-by: Chandra Ghale <ghale at pe34genoa.hpc.amslabs.hpecorp.net>
[Flang][Parser] Handle compiler directives inside INTERFACE blocks (#198516)
Unrecognized !DIR$ directives between interface specifications currently
cause cascading parse errors because the grammar for
InterfaceSpecification has no path to consume them. This patch adds
CompilerDirective as a valid alternative — matching how
InternalSubprogram and ModuleSubprogram already handle this — so that
unrecognized directives produce the expected warning instead of a fatal
parse failure.
Fixes :
[https://github.com/llvm/llvm-project/issues/198289](https://github.com/llvm/llvm-project/issues/198289)
---------
Co-authored-by: Chandra Ghale <ghale at pe34genoa.hpc.amslabs.hpecorp.net>
[SelectionDAG] Remove redundant asserts in WidenVecRes_ATOMIC_LOAD (#200159)
These asserts duplicate guarantees already provided elsewhere:
- `isVector()` checks are redundant because `findMemType()` calls
`WidenVT.getVectorElementType()` and `WidenVT.isScalableVector()`
internally, and `WidenVecRes_ATOMIC_LOAD` is only reached from the
`ATOMIC_LOAD` case in `WidenVectorResult`, which is the vector path.
- The element-type and scalability consistency between `LdVT` and
`WidenVT` is a property of `GetWidenedVector` / `getTypeToTransformTo`.
Follow-up to feedback on #197618.
[CIR][CodeGen] Replace errorNYI with assert for address space in emitAutoVarAlloca (#197506)
Auto variables can only be in the default address space, or
opencl_private when compiling OpenCL. Replace the errorNYI with an
assert matching OG codegen (CGDecl.cpp).
Fixes part of #160386
Co-authored-by: Andy Kaylor <akaylor at nvidia.com>
[lldb][Windows] Cache thread context in NativeRegisterContextWindows_arm64 (#197385)
Cache thread context in _NativeRegisterContextWindows_arm64_ to improve
read performance. Previously, the thread context was retrieved for every
read or write operation.
This change intends to lay the groundwork for provisioning debug support
for SVE on WoA.
Assisted-by: Claude Sonnet 4.6
[Bazel] Add inl files to nanobind textual headers (#200516)
When using this overlay to build some bindings I noticed that
counter.inl was not available in the sandbox and the build failed. This
line adds it to the sandbox.
[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>