[HLSL] Add sema for use of samplers and gathers on textures of doubles and ints (#212613)
Fixes https://github.com/llvm/llvm-project/issues/198882 and
https://github.com/llvm/llvm-project/issues/198883
This PR:
- Implements sema checks to reject the use of samplers and gathers on
textures of doubles.
- Implements sema checks to reject use of samplers on textures of
integers before shader model 6.7
Assisted by: Claude Opus 5
[flang][cuda] Unify registration under -gpu=mem:unified (#212871)
Always use the cuf operation under -gpu=unified as registration might be
differed to the backend. Add a UnitAttr to distinguish device resident
variable that will not use cudaRegisterHostVar but cudaRegisterVar.
[flang][cuda] Keep data transfers for allocatable assignments with device data (#212855)
An assignment to a whole allocatable was lowered as a host assignment to
keep reallocation semantics, without checking the memory kind, so a
device allocatable assigned from a managed array wrote device memory
from the host and segfaulted.
Keep the transfer when either side is device or constant data. CUDA
Fortran Programming Guide 3.4.1 makes an assignment between managed and
device data a copy in both directions, with no exception for an
allocatable left-hand side.
[CIR] Allow boolean operands in cir.cmp (#206846)
GROMACS uses scoped enums with a boolean underlying type as type-safe
flags (`enum class EmulateGpuNonbonded : bool`), and compares them with
`==` / `!=` / `<`. A scoped enum is not integer-promoted before the
comparison, so the operand reaches `cir.cmp` as a `!cir.bool` (CIR
already
represents a boolean-underlying enum with `!cir.bool`). The `cir.cmp`
operand constraint `CIR_ComparableType` does not list bool, so module
verification fails before the CIR-to-CIR passes with:
```
'cir.cmp' op operand #0 must be comparable type, but got '!cir.bool'
```
Add bool to `CIR_ComparableType` and let the comparison lowering compare
`!cir.bool` the same way it already compares pointers, as an unsigned
`icmp` (`ult` for `<`), which is what classic CodeGen does with these as
`i1`. Plain `bool` comparisons are unchanged, since they still carry the
[13 lines not shown]
[NFC][analyzer] Remove BlockEdge parameter of processCFGBlockEntrance (#212804)
As a side effect of my previous refactoring efforts, the method
`ExprEngine::processCFGBlockEntrance` had two very similar parameters: a
`BlockEdge` and a `BlockEntrance` instance.
These are both subclasses of `ProgramPoint`, stored the same data (the
`BlockEntrance` was initialized with data taken from the `BlockEdge`
just before the call) and the `BlockEdge` was almost completely unused
within `processCFGBlockEntrance`.
The only reason for having the `BlockEdge` was that it was stored in the
debug statistic table `blocksExhausted`; so this commit transitions that
simple debug code to use `BlockEntrance` instances instead (which is
also perfectly sufficient for its goals). This allows the removal of the
redundant argument of `processCFGBlockEntrance`.
This prepares the ground for further cleanup in this method.
[CIR] Add fenv attribute to more builtins (#212880)
This adds the #cir.fenv attribute to the CIR_UnaryFPToIntBuiltinOp and
CIR_TernaryFPToFPBuiltinOp base classes, and through them to the
cir.lround, cir.llround, cir.lrint, cir.llrint, and cir.fma operations.
This attribute is still missing from various cast and compare
operations. Those will be added in a follow-up change.
Assisted-by: Cursor / various models
[DWARFLinker] Keep DW_TAG_enumerator children of a live enumeration_type (#212849)
Swift allows functions inside enums:
enum Foo: Int {
case bar = 0
func baz() { ... }
}
DW_TAG_enumeration_type "Foo"
DW_TAG_enumerator "bar"
DW_TAG_subprogram "baz" DW_AT_declaration
...
DW_TAG_subprogram DW_AT_low_pc(...) DW_AT_specification -> "baz"
dieNeedsChildrenToBeMeaningful() did not list DW_TAG_enumeration_type,
so the parent walk skipped the enum's children.
[2 lines not shown]
[HLSL] Move cross implementation to header files (#211446)
This patch removes the previous implementation of cross; instead, it
adds a new one inside the header files.
Fix: https://github.com/llvm/llvm-project/issues/135425
Assisted by: Claude Opus 4.8
---------
Co-authored-by: Joao Saffran <jderezende at microsoft.com>
[flang][OpenMP] Fix metadirective DSA corner cases
Selected loop variants reconstruct data-sharing attributes during lowering.
Flattening nested parallel and task environments can silently privatize shared
variables, while clauses naming a COMMON block lose firstprivate or lastprivate
copy semantics when the block is expanded into members.
Reject replacement queues with multiple DSA-generating environments until
lowering can represent distinct bindings at every region boundary, and
propagate explicit DSA flags to every COMMON-block member. Add focused
coverage for the diagnostic and member copy-in/copy-out.
RuntimeLibcalls: Emit all available impls for a libcall, not just one (#210915)
The intent is RuntimeLibcalls should represent all functions that are
callable from the module, which may have contextually selectable
alternatives. Previously we had this warning since there was no mechanism
to select which one you want, and as a workaround the library call sets avoided
adding the variants which should nto be selected.
Now targets can use initLibcallLoweringInfo, so remove the warning to
unblock more libcall cleanups. Eventually initLibcallLoweringInfo should also
be tablegen driven.
Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
[clang][DependencyScanning] Adding a Multiarch clang-scan-deps Test (#211404)
This test adds coverage of multiarch scanning command macro
canonicalization.
---
<sub>Stack created with <a
href="https://github.com/github/gh-stack">GitHub Stacks CLI</a> • <a
href="https://gh.io/stacks-feedback">Give Feedback 💬</a></sub>
[clang][DependencyScanning] Adding a test that exercies the async-scanning code path (#211402)
This PR adds a test that exercises the async-scanning code path to
sanity check that async-scanning generates identical results as TU
scanning.
---
<sub>Stack created with <a
href="https://github.com/github/gh-stack">GitHub Stacks CLI</a> • <a
href="https://gh.io/stacks-feedback">Give Feedback 💬</a></sub>