[X86] Fold OR of constant splats into GF2P8AFFINEQB (#194330)
Fold OR of a constant byte splat into X86ISD::GF2P8AFFINEQB when the
affine matrix is known at compile time.
For bits forced to 1 by the OR mask, zero the corresponding matrix rows
(in reverse row order within each 64-bit lane) and set the same bits in
the immediate. This turns:
gf2p8affineqb(x, M, imm) | C
into:
gf2p8affineqb(x, M & KeepMask, imm | C)
where KeepMask clears the rows for output bits selected by C.
This removes a separate OR after GF2P8AFFINEQB for constant-matrix cases
and extends the existing GFNI combine coverage beyond XOR folds.
Fixes: https://github.com/llvm/llvm-project/issues/191173
[LLVM][IR] Make sure that DILabel's line is always printed (#200846)
This commit ensures that the textual IR of the DILabel always contains
the `line` information. This is required as the absence of a line causes
a parsing failure, i.e., this change fixes the print + parse roundtrip.
[scudo] Return nullptr if a remap fails on linux. (#200537)
Add a check if a fixed address mmap doesn't return the expected address.
Allow a remap call to fail if the mmap fails and returns a nullptr to
the caller.
Fix a place where if remap fails in the secondary, it didn't do
anything. Now it will unmap the original entry on failure.
[SelectionDAG] Don't over-claim alignment on vector splice/compress stack MMOs (#200622)
expandVectorSplice and expandVECTOR_COMPRESS allocate their scratch slot
on the stack with getReducedAlign, but the memory accesses they generate
touching this slot use the type's natural alignment, which may be
larger!
[llvm-debuginfo-analyzer] Add support for LLVM IR format. (#200603)
llvm-debuginfo-analyzer is a command line tool that processes debug
info contained in a binary file and produces a debug information
format agnostic “Logical View”, which is a high-level semantic
representation of the debug info, independent of the low-level format.
Add support for the LLVM IR format and be able to generate logical
views. Both textual representation (.ll) and bitcode (.bc) formats
are supported.
This relands https://github.com/llvm/llvm-project/pull/135440, which was
reverted in https://github.com/llvm/llvm-project/pull/199890.
It includes the fixes for the buildbots problems.
[CIR][AMDGPU] Implement lowering for __builtin_amdgcn_dispatch_ptr (#199880)
Port `emitAMDGPUDispatchPtr` from OGCG. Emits the `amdgcn.dispatch.ptr`
intrinsic and inserts an address-space cast when the builtin's expected
return type differs.
[CIR] Fix cir.call_llvm_intrinsic lowering for 0-result ops (#199516)
`cir.call_llvm_intrinsic` declares `Optional<CIR_AnyType>:$result`, but
the lowering indexed `op->getResultTypes()[0]` unconditionally and OOBed
on void calls.
Guard with `getNumResults()` and pick the void overload of
`LLVM::CallIntrinsicOp::create` in `createCallLLVMIntrinsicOp`.
[clang][bytecode] Improve `getType()` (#200342)
We previously often fell back to the type of the declaration, which is
wrong if we're pointing e.g. to a nested array.
Add a new unit test to vaildate this.
Add todo guard for declarative construct
Metadirective variants are lowered through genOMPDispatch, which
only handles executable constructs. If the generated construct
queue contains a declarative directive, route it to the existing
TODO path instead of dispatching it.
[ORC] Simplify DylibManager::lookupSymbols, remove LookupRequest. (#195954)
DylibManager::lookupSymbols used to take an array of LookupRequests,
where each request specified a handle and list of symbols to lookup
within that handle.
This commit replaces the array of lookup requests with a single handle
and list of symbols passed directly to lookupSymbols.
In practice all clients were passing a singlton array anyway, and
simplifying this signature significantly simplifies implementations.
[SandboxVec][LoadStoreVec][AMDGPU] Remove early reject of mixed types (#200523)
Up until now mixing floats and non-floats was disabled in the legality
checks. This patch changes this. We are now eagerly vectorizing mixed
types, but we are also checking the cost model to make sure we don't
regress on targets where this is expensive.
[clang] implement CWG2064: ignore value dependence for decltype
The 'decltype' for a value-dependent (but non-type-dependent) should be known,
so this patch makes them non-opaque instead.
This patch also implements what's neceessary to allow overloading
on pure differences in instantiation dependence, making `std::void_t`
usable for SFINAE purposes.
This also readds a few test cases from da98651, which was a previous attempt
at resolving CWG2064.
Fixes #8740
Fixes #61818
Fixes #190388
[clang-tidy] Add `bugprone-missing-end-comparison` check (#182543)
This PR introduces a new check `bugprone-missing-end-comparison`.
It detects instances where the result of a standard algorithm is used
directly in a boolean context without being compared against the
corresponding end iterator.
Currently the check can't handle algorithms returning `std::pair` and
`std::ranges::mismatch_result`, but it should be a good enough starting
point for future improvements.
As of AI-Usage: Assisted by Gemini CLI (for pre-commit reviewing,
documentation and some code refactor/cleanup)
Closes https://github.com/llvm/llvm-project/issues/178731
---------
Co-authored-by: EugeneZelenko <eugene.zelenko at gmail.com>
[RISCV] Disable Zilsd CSR-pair generation when push/pop or save-restore is enabled (#200623)
We were generating duplicate/worse code due to the generation of the
`Zilsd` load/store doubles for handling `CSR's` when `Zcmp/Xqccmp` or
`Save/Restore Libcalls` were enabled.
[clang] implement CWG2064: ignore value dependence for decltype
The 'decltype' for a value-dependent (but non-type-dependent) should be known,
so this patch makes them non-opaque instead.
This patch also implements what's neceessary to allow overloading
on pure differences in instantiation dependence, making `std::void_t`
usable for SFINAE purposes.
This also readds a few test cases from da98651, which was a previous attempt
at resolving CWG2064.
Fixes #8740
Fixes #61818
Fixes #190388
[clang-tidy] Fix false positive in bugprone-use-after-move for std::tie (#192895)
std::tie(a, b) = expr reinitializes all variables passed to std::tie
because the tuple assignment operator writes back through the stored
references. The check was not recognizing this pattern, causing a false
positive on the second std::tie assignment in loops like:
std::tie(a, b) = foo(std::move(a), std::move(b));
std::tie(a, b) = foo(std::move(a), std::move(b)); // false positive
Add std::tie assignment as a reinitialization case in
makeReinitMatcher().
Fixes #136105.
---
**AI Disclosure:** Claude (Anthropic) was used to assist in diagnosing
the CI test failure and identifying the off-by-one line number in the
[5 lines not shown]
[clang][clang-tools-extra] Remove unused DenseMapInfo::getTombstoneKey (#200634)
#200595 changed DenseMap to no longer create tombstone buckets, so
DenseMapInfo<T>::getTombstoneKey() is never called. Remove dead
definitions and dead tombstone branches.
[clang] fix getTemplateInstantiationArgs (#199528)
This implements a new strategy for collecting the template arguments, by
relying on the qualifiers and template parameter lists to navigate the
template context of out-of-line definitions.
This greatly simplifies the signature of that function, by removing a
bunch of workarounds, and simpliffying a couple that weren't removed
yet.
Since this now relies on qualifiers and template parameter lists, this
patch expends most of its effort making sure these are placed,
transformed and propagated to template instantiations.
Also makes the explicit specialization AST nodes stop abusing the
template parameter lists by storing it's own template parameter list,
creating a dedicated field for them, similar to partial specializations.
Fixes #101330