[RISCV] Improve shrinkDemandedConstant. (#196585)
Teach shrinkDemandedConstant to restore a constant that can be
materialized as:
lui a0, hi20
addi(w) a0, a0, lo12
slli a1, a0, 32
add a0, a0, a1
or:
lui a0, hi20
addi(w) a0, a0, lo12
pack a0, a0, a0
This fixes a regression between clang 18 and 19 on this test case
https://godbolt.org/z/Ma746a8xP
[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")
{ ... }
Kernel names need to be unique or they are diagnosed at compile or link
time as errors.
Co-Authored-By: Claude (claude-sonnet-4.5) <noreply at anthropic.com>
[NVPTX][clang] Remove nvvm scoped atomic intrinsics; use atomicrmw/cmpxchg (#200735)
The
`llvm.nvvm.atomic.{add,exch,max,min,inc,dec,and,or,xor,cas}.gen.{i,f}.{cta,sys}`
intrinsics are redundant; we can use atomicrmw / cmpxchg with a syncscope.
Moreover, the nvvm atomics are problematic because they don't have
unsigned min/max opcodes. Clang uses these intrinsics and currently emits
signed min/max for what should be unsigned operations!
Fix by doing the following.
- Remove the nvvm intrinsics.
- Auto-upgrade the removed intrinsics to atomicrmw/cmpxchg.
- Make clang Clang emits atomicrmw/cmpxchg directly.
[libc] Renaming Float128 (DyadicFloat<128>) to DFloat128 (#200907)
This is to be able to use the `Float128` for emulated float128 type.
[#200565 ](https://github.com/llvm/llvm-project/pull/200565)
[libc] Add FENV_ACCESS pragma with CMake compiler feature detection (#200268)
Related to https://github.com/llvm/llvm-project/pull/199009
Added compiler feature detection for _STDC FENV_ACCESS_ pragma. It is
used to conditionally add function-scoped `#pragma STDC FENV_ACCESS ON`
to `libc/src/__support/FPUtil/FEnvAccess.h`, whenever functions from the
`<fenv.h>` header are called and the target supports the pragma.
[X86] Remove extra MOV after widening atomic store (#197619)
This change adds patterns to optimize out an extra MOV present after
widening the atomic store. Covers `<2 x i8>` (SSE4.1+), `<2 x i16>`,
`<4 x i8>`, `<2 x i32>`, `<2 x float>`, `<4 x i16>`,
`<2 x ptr addrspace(270)>`.
Store-side counterpart to #148898. Stacked on top of #197618; and below
of #197860.
[mlir] Remove unused DenseMapInfo::getTombstoneKey (#200633)
#200595 changed DenseMap to no longer create tombstone buckets, so
DenseMapInfo<T>::getTombstoneKey() is never called. Remove dead
definitions and dead tombstone branches.
[flang] Remove unused DenseMapInfo::getTombstoneKey (#200632)
#200595 changed DenseMap to no longer create tombstone buckets, so
DenseMapInfo<T>::getTombstoneKey() is never called. Remove dead
definitions and dead tombstone branches.
[BOLT] Remove unused DenseMapInfo::getTombstoneKey (#200637)
#200595 changed DenseMap to no longer create tombstone buckets, so
DenseMapInfo<T>::getTombstoneKey() is never called. Remove dead
definitions and dead tombstone branches.
[lldb] Remove unused DenseMapInfo::getTombstoneKey (#200635)
#200595 changed DenseMap to no longer create tombstone buckets, so
DenseMapInfo<T>::getTombstoneKey() is never called. Remove dead
definitions and dead tombstone branches.
[lld] Remove unused DenseMapInfo::getTombstoneKey (#200636)
#200595 changed DenseMap to no longer create tombstone buckets, so
DenseMapInfo<T>::getTombstoneKey() is never called. Remove dead
definitions and dead tombstone branches.
Preserve dynamic user condition scores for variant ranking
Dynamic user conditions are bypassed during static applicability
filtering, but their scores must still influence variant ordering.
Previously, the filtering VMI removed `user_condition_unknown`,
inadvertently dropping the score attached to
`user={condition(score(...): expr)}`.
We now preserves that score in the ranking VMI by transferring
any non-zero dynamic condition score onto `user_condition_true`. The
runtime condition remains separate and correctly lowers as a `fir.if`
guard for the selected variant.
Variant ordering now correctly prioritizes scored conditions over
lexically earlier unscored conditions or static fallbacks:
```
if (high) barrier
else if (low) taskyield
[4 lines not shown]
[X86] Remove extra MOV after widening atomic store
This change adds patterns to optimize out an extra MOV present after
widening the atomic store. Covers <2 x i8> (SSE4.1+), <2 x i16>,
<4 x i8>, <2 x i32>, <2 x float>, <4 x i16>, <2 x ptr addrspace(270)>.
[SelectOpt] Preserve Profile Information (#200680)
If at least one of the SelectLike instructions in the group has profile
metadata, we can propagate it given they all share the same condition.
[SelectionDAG] Widen <2 x T> vector types for atomic store (#197618)
Vector types of 2 elements must be widened. This change does this
for vector types of atomic store in SelectionDAG so that it can
translate aligned vectors of >1 size.
Store-side counterpart to #148897. Stacked on top of #197166; and below
of #197619.
[clang] fix transformation of SubstNonTypeTemplateParmExpr nodes from typealiases and concepts
This makes sure SubstNonTypeTemplateParmExpr produced from non-specialization
decls (Type alias templates and concepts) are correctly transformed.
This makes the SubstNonTypeTemplateParmExpr store the parameter type directly,
and uses that instead of relying on the AssociatedDecl.
Fixes #191738
Fixes #196375
[lldb] Strip objc superclass pointer in trampoline handler (#200490)
The pointer needs to be stripped before being handed off to any objc
runtime functions. Otherwise the utility expression will hit a PAC
exception and the thread plan will fail to execute correctly.
This fixes TestObjCStepping.py on arm64e.
[Docs] Update coding standard for TD files (#200848)
This PR proposes an update to the coding standards document to make
explicit that we do not want unnecessary formatting changes to TD files.
This is in response to this merged PR (#199346), which lead to this RFC
(https://discourse.llvm.org/t/80-column-limit-for-td-files/90950/).
---------
Co-authored-by: Vlad Serebrennikov <serebrennikov.vladislav at gmail.com>