[clangd] fix compilation errors with newer versions of gRPC (#67258)
in recent versions of gRPC, header files with prefix `grpc++` are
deprecated.
gRPC headers in include/grpc++ are deprecated since gRPC 1.10.0
https://github.com/grpc/grpc/releases/tag/v1.10.0 , this PR should close
https://github.com/clangd/clangd/issues/1603
Co-authored-by: Thibault Monnier <97551402+Thibault-Monnier at users.noreply.github.com>
[NFC] To fix comment in the code as getIntN no longer does truncation. (#178834)
The comment of `getIntN` says it may truncate the result. However, PR
#171456 changed the default of truncation of `ConstantInt::get` to
false, so it no longer truncates. Fix the comments to reflect the
change.
Thread Safety Analysis: Add test for alias reassignment through pointer-to-pointer (#179028)
Alias reassignment through pointer-to-pointer (nor ptr-to-ptr-to-ptr...)
does not invalidate an alias for now. While this may result in either
false positives or negatives, there's rarely a good reason not to just
do direct assignment within the same scope.
For the time being, we retain this as a deliberate "escape hatch":
specifically, this may be used to help the alias analysis to "see
through" complex helper macros that e.g. read a value (such as a
pointer) via inline assembly or other opaque helpers [1].
Add a test to document the current behaviour.
NFC.
[1] https://lore.kernel.org/all/20260130132951.2714396-1-elver@google.com/
[mlir][PDL] PDLToPDLInterp: Use the pdl pattern name in the generated rewriter. (#149481)
Before, the rewriters generated by `convert-pdl-to-pdl-interp` had a
generic `"pdl_generated_rewriter"` name. With this change, the name from
the original pdl pattern is kept for the rewriter. This makes it easier
to relate the two.
---------
Co-authored-by: Mehdi Amini <joker-eph at gmail.com>
AMDGPU: Implement computeKnownFPClass for llvm.amdgcn.trig.preop
Surprisingly this doesn't consider the special cases, and literally
just extracts the exponent and proceeds as normal.
AMDGPU: Fix incorrect fold of undef for llvm.amdgcn.trig.preop
We were folding undef inputs to qnan which is incorrect. The instruction
never returns nan. Out of bounds segment select will return 0, so fold
undef segment to 0.
[OpenMP][MLIR] Modify lowering OpenMP Dialect lowering to support attach mapping
This PR adjusts the LLVM-IR lowering to support the new attach map type that the runtime
uses to link data and pointer together, this swaps the mapping from the older
OMP_MAP_PTR_AND_OBJ map type in most cases and allows slightly more complicated ref_ptr/ptee
and attach semantics.
[Flang] Fix type error when calling EXIT intrinsic (#178688)
`EXIT` expects a `KIND=8` integer. If such an integer was passed when
`-fdefault-integer-8` was present, the `assert` removed in this PR would
trigger. Since Flang was already silently downcasting `KIND=8` to
`KIND=4`, this PR removes the `assert` and adds a new test to validate
the correct behavior when large integers are the default
[Flang][OpenMP][Offload] Modify MapInfoFinalization to handle attach mapping and 6.1's ref_* and attach map keywords
This PR is one of four required to implement the attach mapping semantics in Flang, alongside the
ref_ptr/ref_ptee/ref_ptr_ptee map modifiers and the attach(always/never/auto) modifiers.
This PR is the MapInfoFinalization changes required to support these features, it mainly deals with
applying the correct attach map type and manipulating the descriptor types maps for base address
and descriptor so that when we specify ref_ptr/ref_ptee we emit one of the two maps and when we
emit ref_ptr_ptee we emit our usual default maps. In all cases we add the "glue" of an new
attach map except in cases where a user has provided attach never. In cases where we are
provided an always, we apply the always map type to our attach maps.
It's important to note the runtime has a toggle for the auto map behaviour, which will flip the
attach behaviour to the newer semantics or the older semantics for backwards compatability (outside
the purview of this PR but good to mention).
[Flang][MLIR][OpenMP] Add distinct var_ptr_ptr_type to omp.map.info operations
This is a precursor patch to attach and ref_ptr/ptee mapping that I intend to upstream
over the next few weeks. The attach maps require both the type of the descriptor and
the pointed to data to calculate the appropriate offload/base pointers and size. In
the base case of ref_ptr_ptee all of this information can be gathered from the pointer
and pointee maps, but in cases where we have only one (i.e. ref_ptr/ref_ptee) we will
be missing one of the key elements required to create an corresponding attach map.
So, this PR basically adds the ability to ferry around the type of both var_ptr and
var_ptr_ptr as opposed to just var_ptr, then we can emit attach maps as seperate
map.info's that carry all the pre-requisite informaion for lowering to LLVM-IR. But,
otherwise it seems reasonable to have var_ptr_ptr mirror var_ptr in all aspects for
consistency.
[MLIR][Python] Support dialect conversion in python bindings (#177782)
This PR adds dialect conversion support to the MLIR Python bindings.
Because it introduces a number of new APIs, it’s a fairly large PR. It
mainly includes the following parts:
* Add a set of types and APIs to the C API, including
`MlirConversionTarget`, `MlirConversionPattern`, `MlirTypeConverter`,
`MlirConversionPatternRewriter`, and others.
* Add the corresponding types and APIs to the Python bindings.
* Extend `mlir-tblgen` with codegen for Python adaptor classes, which
generates an adaptor class for each op.
Note that this PR only adds support for 1-to-1 conversions, 1-to-N
type/value conversions are not supported yet.
---------
Co-authored-by: Maksim Levental <maksim.levental at gmail.com>
[MC/DC] Enable nested expressions (#125413)
A warning "contains an operation with a nested boolean expression." is
no longer emitted. At the moment, split expressions are treated as
individual Decisions.
[alpha.webkit.NoDeleteChecker] Don't emit a warning for a function without annotation. (#178824)
This PR fixes the bug in alpha.webkit.NoDeleteChecker that it emits a
warning for any function without
[[clang::annotate_type("webkit.nodelete")]] annotation if it contains
non-trivial code. It also fixes a bug hat we weren't checking the
presence of the annotation on superclass' corresponding member
functions.
[MC/DC] Make covmap tolerant of nested Decisions (#125407)
CoverageMappingWriter reorders `Region`s by `endLoc DESC` to prioritize
wider `Decision` with the same `startLoc`.
In `llvm-cov`, tweak seeking Decisions by reversal order to find smaller
Decision first.
[HLSL] Implement Texture2D type and Sample method in Clang (#177240)
This patch implements the `Texture2D` resource type and its `Sample`
member
function in Clang. It includes the necessary AST and Sema changes to
support
the new type and its built-in methods, as well as CodeGen support for
both
DirectX and SPIR-V targets.
Key changes:
- Added `ResourceDimension` to `HLSLAttributedResourceType` and
`HLSLResourceDimension` attribute.
- Implemented `Texture2D` and `SamplerState` in
`HLSLExternalSemaSource`.
- Added `__builtin_hlsl_resource_sample` and associated Sema checking.
- Updated `DirectXTargetCodeGenInfo` and `CommonSPIRTargetCodeGenInfo`
to handle texture types.
- Added AST, Sema, and CodeGen tests for `Texture2D`.
Part 2 of https://github.com/llvm/llvm-project/issues/175630
[VectorCombine] Fix the PtrAdd offset in shrinkLoadForShuffles to account for element type size (#179001)
This PR fixes an [issue I pointed out in regards to incorrect GEP
indices](https://github.com/llvm/llvm-project/pull/149093#discussion_r2748266079)
introduced by PR #149093.
Changes:
- Updated the pointer offset calculation in
`VectorCombine::shrinkLoadForShuffles` so that the offset is now
multiplied by the element size (`ElemSize`) when computing the new
pointer for loads
- Updated the GEP indices in
`llvm/test/Transforms/VectorCombine/load-shufflevector.ll` for the
correct byte offsets
[HLSL] Make Matrix types in `buildInitializerListImpl` index in row major order for initializer lists. (#178931)
fixes #178930
- changes the loop indexing order
- updates the associated tests
[msan] Support Arm NEON usdot (#178982)
Handle tariff-free dot-product using the existing
handleVectorDotProductIntrinsic() instead of with the default handler.