[CIR] Fix the value of a compound assignment to a bit-field (#245035)
ClangIR gave `s->bf op= x` the untruncated result of the operation, not
the value that the bit-field holds after the assignment. For `unsigned b
: 1` holding 1, `(b |= 7)` evaluated to 7 instead of 1.
The code stored through the bit-field but dropped the truncated value
that `emitStoreThroughBitfieldLValue` returns. Plain assignment and
classic codegen use that value. Use it for compound assignment too.
This covers compound assignments computed in a scalar type. With a
complex operand, ClangIR still fails earlier, on another path; that is
an older, separate problem.
Found by the Plum Hall C validation suite, whose `|=` and `^=` tests
failed at run time with `-fclangir`.
Assisted-By: Claude Opus 5.5 + GPT-6.2 Sol as reviewer
[InstCombine] Refine demanded classes for exp (#244784)
Taught `SimplifyDemandedUseFPClass` that if `exp(x) != 0` then `x !=
-inf`, and if `exp(x) != qNaN` then `x != qNaN`. I also refactored the
code so that `SrcDemandedMask` removes classes from `fcAllFlags` instead
of adding classes to `fcNone`.
[DirectX] Set TiledResources for instruction LOD clamps (#241046)
Fixes https://github.com/llvm/llvm-project/issues/116131
Sample, SampleBias and SampleGrad with an instruction LOD clamp need
D3D12 tiled resources tier 2, and therefore the TiledResources shader
flag in DXIL. LLVM only set the flag for extracted buffer load status.
This PR sets the flag for the `dx.resource.sample.clamp`,
`samplebias.clamp` and
`samplegrad.clamp` intrinsics when the clamp operand is neither a
constant
zero nor undef.
As with DXC, the flag is set if and only if the validator version is 1.8
or later, since validator 1.7 and below do not expect it for LOD clamps.
Assisted by: Claude Opus 5.5
[2 lines not shown]
[InstCombine][KnownFPClass] Refine fptrunc_round infinity classes based on the rounding mode (#244500)
Refines `fptrunc_round` for directed rounding modes. `TowardZero` and
`TowardNegative` can't overflow to positive infinity, and `TowardZero`
and `TowardPositive` can't overflow to negative infinity.
I also added some tests to guard against bugs related to flushing
denormals before rounding (tiny before rounding).
AI Disclosure:
I used Claude Opus 5.5 to help write the tests.
[Clang] Use canonical decl for variable template specialization matching (#245195)
getPartialSpecializations returns the most recent declaration which
could be the declaration hidden inside modules that we don't want it to
participate in declaration comparison.
We always use the canonical decl for that purpose. This ensures that
they all point to the same template entity.
Fixes https://github.com/llvm/llvm-project/issues/244974
[flang][acc] Check that atomic variables are of intrinsic type (#230197)
The OpenACC specification requires the variables used in an atomic
construct to be scalar variables of intrinsic type (3.4, 2.12). This
patch:
1. Fixes the source locations of the "must be scalar" diagnostics: the
LHS one pointed at the RHS expression and vice versa.
2. Adds the missing type check: a derived type variable is now diagnosed
with `LHS/RHS of atomic <construct> statement must be of intrinsic
type`. Other intrinsic types, character included, stay accepted.
---------
Co-authored-by: Zachary.Fan <ES3Q at QQ.com>
[mlir][AMDGPU] Fix crash on invalid TDM element types (#245023)
Check isIntOrFloat() before getIntOrFloatBitWidth() in
TDMGatherBaseType::verify and verifyBase so a non int/float element type
gets a diagnostic instead of an assertion failure. Fixes #239941.
Revert "[Driver][Haiku] Add /boot/system/develop/headers/gcc/include header path (#140189)" (#245206)
This reverts commit a23d18726d32172f855d451375df2816b815c191.
/boot/system/develop/headers/gcc/include is GCC's internal header
directory. Clang has its own copies of these headers in its resource
directory and should not search GCC's. With this path, include_next in
Clang's stdatomic.h picks up GCC's stdatomic.h, which breaks C11
atomics.
https://github.com/haikuports/haikuports/issues/15124
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
Merge tag 'hid-for-linus-2026112301' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid
Pull HID fixes from Jiri Kosina:
"Mostly functional code fixes all over the place, plus a few new device
IDs support.
The amount of patches is slightly higher than I'd like to see for rc4,
and there are two reasons for it -- the amount of patches is much
higher overall, due to all the AI fixes coming to the driver land, and
both myself and Benjamin have been pretty much unable to process
incoming patches for a past couple weeks for various reasons; but
we're getting back on track"
* tag 'hid-for-linus-2026112301' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid: (42 commits)
HID: nintendo: release the player ID when LED setup fails
HID: quirks: add ALWAYS_POLL quirk for Keychron Link receiver
HID: wacom: Prevent NULL dereference in wireless work
HID: intel-thc-hid: intel-quickspi: validate GET REPORT response size
HID: apple: Add "F108Pro Dongle" to the list of non-apple keyboards
[16 lines not shown]
[OpenMP][OMPIRBuilder] Runtime warp size for SPIR-V reduction lane/warp ids
The inter-warp copy of a GPU reduction computes the lane and warp ids from
GV_Warp_Size, 64 for SPIR-V. The subgroup size of a SPIR-V kernel is
picked by the device compiler (16 or 32 on Intel GPUs), and the device
runtime uses the actual one (mapping::getWarpSize()):
runtime (Reduction.cpp) inter-warp copy, before
warp size __gpu_num_lanes() = 16 64
tid 16 warp 1, lane 0: copies warp 0, lane 16: no copy (1)
So only subgroups starting at a multiple of 64 threads copy their partial
value (1). On SPIR-V, use the runtime size:
; before ; after
%ws = call @__kmpc_get_warp_size()
%lane = and i32 %tid, 63 %lane = urem i32 %tid, %ws
%warp = ashr i32 %tid, 6 %warp = udiv i32 %tid, %ws
[4 lines not shown]
[OpenMP][OMPIRBuilder] Default address space in GPU reduction helpers
createReductionsGPU() fills the reduction list with pointers in
Config.getDefaultTargetAS(), but the helpers read the list, and the
pointers in it, as address space 0. On spirv64-intel and spirv64-amd-amdhsa
the default address space is generic (4), and 0 is private:
; caller
%red_list = alloca [1 x ptr addrspace(4)]
call @__kmpc_nvptx_parallel_reduce_nowait_v2(..., %red_list.ascast,..)
; before
define internal void @_omp_reduction_shuffle_and_reduce_func(ptr %0, (1)
%9 = load ptr, ptr %8 ; list[0] (2)
%12 = load i64, ptr %9 (3)
(2) reinterprets a generic pointer as a private one, and (3) reads through
it. Use Config.getDefaultTargetAS() for (1) and (2) in every helper:
shuffle-and-reduce (and shuffleAndStore()), inter-warp copy, the
[13 lines not shown]
[SystemZ] Add missing CC def to TRANSLATE EXTENDED (TRE)
TRE sets the condition code (0: operand processed, 1: test character
found, 3: CPU-determined amount processed), but its definition did not
list CC as an implicit def.
Adding the def raises TRE's write count from two to three, so update the
TRE scheduling entries for z196 through z17 to match (as for CU41/CU42).
Assisted by: IBM Bob
geography/geos: Update to 3.15.1
Tests pass on NetBSD 11 amd64, and qgis/postgis seem ok.
## Changes in 3.15.1
2026-11-23
- Fixes/Improvements:
- Arc noding: fix failure with endpoint intersections (GH-1513, Dan Baston)
- Arc noding: handle degenerate arcs with repeated points (GH-1584, Alejandro Pacheco and Dan Baston)
- GeometrySplitter: add ability to split MultiSurface inputs (GH-1518, Dan Baston)
- GeometrySplitter: fix result when splitting CurvePolygon inputs having only linear rings (GH-1609, Dan Baston)
- GeometrySplitter: allow splitting with CompoundCurve with Z/M coordinates (GH-1610, Dan Baston)
- GEOSGridIntersectionFractions: Set cells outside geometry bounding box to zero (GH-1532, Dan Baston)
- GEOSGridIntersectionFractions: Improve robustness (GH-1589, Dan Baston, Alejandro Pacheco)
- Skip testing FE_INVALID from unit-geom-Envelope for some Clang builds (GH-1555, Mike Taves)
- Polygonize / LineMerge: Copy Z/M values at shared endpoints of mixed-dimension inputs (GH-1545, Dan Baston)
- CircularArcIntersector: Use Orient2D to check for arc control points on line (GH-1546, Dan Baston)
- CircularArcIntersector: Avoid incorrectly classifying intersections as cocircular (GH-1549, Dan Baston)
[16 lines not shown]
[flang] Let FIR AA calls access the data of descriptor arguments (#244452)
getCallModRef finds whether a call may access a variable through its
arguments with alias(arg, var). When the argument is the address of a
descriptor, e.g. an allocatable passed to an allocatable dummy, alias()
answers NoAlias for the data that the descriptor describes, because the
address of a descriptor does not alias the address of data. So getModRef
answered NoModRef for the data of an allocatable across a call that may
modify it, and LICM could hoist a read of the data out of a loop that
passes the descriptor to such a call.
An argument that is the address of a descriptor now also passes the data
that the descriptor describes. getCallModRef builds the source of that
data as getSource() does for a fir.box_addr of a fir.load of the
argument, and compares it with the source of the variable using the part
of alias() that compares the sources, which moves into aliasSources().
The intent of the dummy applies to the data as well.
Assisted-by: AI
[flang] A call may access a saved local through another instance of its procedure (#244077)
`fir::AliasAnalysis::getModRef` assumed that a call to a Fortran
procedure cannot access a saved local variable other than through its
arguments, unless the variable is a TARGET or is used in an internal
procedure. That is wrong when the call may invoke the procedure that
owns the variable: all the instances of a procedure share its saved
local variables (F2023 8.5.16), so the other instance may read or write
the variable. For example, LICM hoisted the load of `x` out of the loop
below, and the program printed 0 instead of 6 at `-O1` and above:
```fortran
module m
contains
recursive subroutine work(nested, total)
logical, intent(in) :: nested
integer, intent(out) :: total
integer, save :: x
integer :: i
[62 lines not shown]
[GlobalISel] Use Info.size from getTgtMemIntrinsic for the memory type (#242433)
Handle every value of Info.size like SelectionDAGBuilder does, instead
of always using the size of memVT:
- An unknown size creates an unknown-size MachineMemOperand. Previously
llvm.aarch64.mops.memset.tag was described as a 1-byte store.
- A known size that differs from memVT uses a scalar of that size. This
changes PowerPC, which reports a 31-byte access for llvm.ppc.vsx.lxvd2x,
llvm.ppc.altivec.stvx and related intrinsics.
- A size that matches memVT keeps the type of memVT.
---------
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>