[NFCI][sanitizer_common] Realign #ifdefs in sanitizer_internal_defs.h (#186861)
Currently it is very hard to tell these nested ifdefs apart. This patch
fixes that, while trying to be as light-touch as possible.
[ASan][test-only] Remove superfluous guards in stack_container_dynamic_lib.c (#188469)
As noted in https://github.com/llvm/llvm-project/pull/188406 comments,
the documentation recommends guarding only with
__has_feature(address_sanitizer). This patch updates the test to follow
the same pattern by removing the
__SANITIZER_DISABLE_CONTAINER_OVERFLOW__ checks. Having this macro
defined results in the common_interface_defs.h header defining the
contiguous container functions as no-ops anyway.
This is a followup to https://github.com/llvm/llvm-project/pull/188406.
[SPIR-V] Emit OpSpecConstantComposite for composites with spec constant operands (#188557)
- The SPIR-V spec requires that OpConstantComposite must not reference
spec constant operands. When a composite contains non-constant
constitued, OpSpecConstantComposite should be emitted instead of
OpConstantComposite
- Avoid creating function pointer types when the
SPV_INTEL_function_pointers extension is unavailable, falling back to i8
as the pointee type
- Re-enable spirv-val validation in tests that previously failed due to
this issue, and un-XFAIL the block_w_struct_return and global_block
transcoding tests
related to #60133
fixes #186756
[OpenMP][test] Remove %flags-use-compiler-omp-h (#188789)
With the standalone and project builds removed,
`OPENMP_TEST_COMPILER_HAS_OMP_H`/`config.test_compiler_has_omp_h` is set
to constant 1, which causes the `config.omp_header_directory` search
path NOT to be added to `%flags-use-compiler-omp-h`, causing the system
`omp.h` used, or the only test actually using it
(`omp50_taskdep_depobj.c`) failing if that one is not available.
The intention of `OPENMP_TEST_COMPILER_HAS_OMP_H` was to use gcc's
`omp.h` which declares `omp_depend_t` differently than our `omp.h`
(https://reviews.llvm.org/D108790). Using `OPENMP_TEST_C_COMPILER=gcc`
was used to test libomp's GOMP compatibility layer, but testing it is
currently unmaintained and has no buildbot (60 failing tests out of 389
with gcc-13, not including OMPD and OMPT). If updating testing for GOMP,
then gcc's own `omp.h` must be used for all tests: using the GOMP ABI
requires using GOMP's `omp.h`.
Closes: #187879
[SPIRV] Add bitreverse expansion for kernel (#186412)
The OpBitReverse is available when Shader or SPV_KHR_bit_instructions
extension is enabled. For targets without these capabilities, introduce
software emulation of G_BITREVERSE based on the parallel bit reversal
algorithm:
https://graphics.stanford.edu/~seander/bithacks.html#ReverseParallel
The emulation supports 8/16/32/64-bit scalars and vectors using bitwise
operations (shifts, AND, OR). A helper lambda avoids undefined behavior
when computing masks for 64-bit types.
Tests added for both emulation and native paths across all supported
types.
Assisted-by: Claude Code
libclc: Partially implement nonuniform subgroup reduce functions (#188929)
For AMDGPU these are identical to the uniform case. Stub out the missing
cases with traps to avoid test failures from undefined symbols while
keeping the structure consistent.
[mlir][spirv][gpu] Add lowering for gpu.subgroup_broadcast (#187947)
Add lowering for `gpu.subgroup_broadcast` and
`gpu.subgroup_broadcast_first` to `spirv.GroupNonUniformBroadcast` and
`spirv.GroupNonUniformBroadcastFirst`.
Fixes #157940
PatternMatch: Add matchers for positive or negative infinity
The existing m_Inf deceptively matches both positive and negative
infinities. Add variants that match the specific sign.
[clang-tidy] Add missing #include insertion in macros for modernize-use-std-print (#188394)
Follow-up of: #188247
---------
Co-authored-by: Victor Chernyakin <chernyakin.victor.j at outlook.com>
libclc: Partially implement nonuniform subgroup reduce functions
For AMDGPU these are identical to the uniform case. Stub out the missing
cases with traps to avoid test failures from undefined symbols while keeping
the structure consistent.
Support Serializing/Deserializing Extended Generic Selection Expressions
Clang supports using a type as the predicate for generic selection
expressions but lacked support for serializing/deserializing these
extended generic selection expressions.
Signed-off-by: Will Hawkins <hawkinsw at obs.cr>
[lldb] use the Py_REFCNT() macro instead of directly accessing member (#188161)
[PyObject members are not to be accessed
directly](https://docs.python.org/3/c-api/structures.html#c.PyObject),
but rather through macros, in this case `Py_REFCNT()`.
In most, ie Global Interpreter Lock-enabled, CPython cases,
`Py_REFCNT()` expands to accessing `ob_refcnt` anyway. However, in a
free-threaded CPython, combined with disabling the limited API (since it
requires the GIL for now), the direct member does not exist, causing the
build to fail. The macro expands to the correct access method in the
free-threaded configuration.
(cherry picked from commit 2a7b0f06d2060dbab8fa38fae7689f2d9048fa9d)