[pull] main from llvm:main#1030
Merged
pull[bot] merged 54 commits intoMPACT-ORG:mainfrom Feb 20, 2026
Merged
Conversation
This diagnostic is no longer documented on MSDN, but the diagnostic text was: > ''var': symbol will be dynamically initialized (implementation limitation) This was disabled in 5cbf37f to work around false positives with MSVC 2015 Update 1. I believe those false positives have been fixed and this diagnostic no longer needs to be disabled. Local testing shows it is not emitted.
…ype (#181722) These are the required uses of the alloca type, but have trivial access to the expected result of that API call. The remaining uses in unittests are for testing the LLVM API itself. Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
…redicate to check shift amount range. NFC. (#182548)
…h `sparse-tensor-codegen` (#181145) This PR handles the case where users call the `--sparse-tensor-codegen` pass without sufficiently lowering dense tensors to sparse ones (with passes like `--lower-sparse-ops-to-foreach` and `--lower-sparse-foreach-to-scf` among others). This results in dense tensors having a null `SparseTensorEncodingAttr`, which was originally assumed to be true in the SparseTensor's `ConvertOp` lowering, but is now checked against. This PR closes #177779.
After merging #181760 this loop no longer erases instructions while iterating. So this patch moves the iteration increment inside the for statement. Note: Replacing the loop with a range loop like `for (MachineInstr &Instr : Block)` is not an NFC.
`Tags` can be nested under other `Tags`, which represents nested C++ classes. `Methods` can be nested under `Tags`, which represents C++ methods. rdar://151033780
Upstreaming clangIR PR: llvm/clangir#2098 This PR enables AppendingLinkage in CIR_GlobalLinkageKind.
This PR added IR examples for rocdl as suggested in #157945. Examples are extracted from: - https://github.com/llvm/llvm-project/blob/main/mlir/test/Dialect/LLVMIR/rocdl.mlir - https://github.com/llvm/llvm-project/blob/main/mlir/test/Target/LLVMIR/rocdl.mlir
The prefalign attribute determines the function's preferred alignment. By default, the function's preferred alignment is set in a target-specific way, but it may be overridden with this attribute. The backend logic will be added in followup patches. Part of this RFC: https://discourse.llvm.org/t/rfc-enhancing-function-alignment-attributes/88019 Reviewers: efriedma-quic, nikic, arsenm Pull Request: #155527
As suggested in [this comment](#173340 (comment))!
…HS (#180446) Add missing `UseFact` for binary operators and function call arguments to track object usage. These changes allow the analyzer to properly detect cases where an object is used after being invalidated, particularly in container operations like map access. **Pointer vs Iterator Invalidation:** Different containers provide different stability guarantees: - **Pointer/Reference Stability**: Containers like `std::unordered_map` guarantee that pointers and references to elements remain valid even after insertions. This makes operations like `mp[2] = mp[1]` safe in practice. - **No Pointer Stability**: Containers like `std::flat_hash_map` (C++23) do not provide pointer stability on insertion, making such operations unsafe. - **Iterator Stability**: Most containers (including `std::unordered_map`) do not provide iterator stability. Operations that invalidate iterators (like `erase`) make subsequent use of those iterators unsafe. The current implementation conservatively warns on all such cases.
An UnsafeBufferUsage summary is the ssaf representation of the set of unsafe buffer pointers found by `-Wunsafe-buffer-usage` in a translation unit. rdar://170176278 --------- Co-authored-by: Balázs Benics <benicsbalazs@gmail.com>
…anges (#182003) The motivator here is that Python allows class methods to be redefined. But in the vast majority of cases this is a bug. E.g., in our API test-suite two methods with the same name cause the latest definition to shadow the earlier, in which case only one test-case runs. This happens silently. Every couple of months i've been running the script from #97043 manually on the code-base and it catches a handful of these every time. This patch sets up a github action that runs on pull requests that change any files under `lldb/test/API`. The action runs `pylint` on the changed Python files. The caveat here is that `pylint` isn't set up to run cleanly on our test-suite. So I just use the [specific redefinition error code](https://pylint.readthedocs.io/en/stable/user_guide/messages/error/function-redefined.html). Any other errors won't cause `pylint` to fail for now (hence the `--error-under=0`). Here's an example: <img width="1412" height="367" alt="Screenshot From 2026-02-20 10-29-28" src="https://github.com/user-attachments/assets/20093be8-a122-4e17-944a-4472eb12ab25" />
According to RISC-V ELF psABI, Section 4.3 (C/C++ Type Representations) "char is unsigned". This patch makes plain `char` unsigned by default on RISC-V. Also this fixes TestConstStaticIntegralMember.py on RISC-V
MachineFunction can now be queried for the preferred alignment which comes from the function attributes (optsize, minsize, prefalign) and TargetLowering. Part of this RFC: https://discourse.llvm.org/t/rfc-enhancing-function-alignment-attributes/88019 Reviewers: vitalybuka, nikic, efriedma-quic, MaskRay Reviewed By: vitalybuka Pull Request: #158368
The result of the MachineFunction preferred alignment query is emitted as a .prefalign directive if supported, otherwise it gets combined into the minimum alignment. Part of this RFC: https://discourse.llvm.org/t/rfc-enhancing-function-alignment-attributes/88019 Reviewers: nikic, vitalybuka Reviewed By: vitalybuka Pull Request: #155529
For assembler functions, doing them as best as possible is paramount. Save sp in ARM, restore sp in ARM.
From MSDN: https://learn.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-4-c4706?view=msvc-170 > assignment used as a condition This diagnostic was disabled as part of enabling /W4 use in 5c73e1f where there were hundreds of instances of the diagnostic being triggered. However, local testing suggests we now are adding the parentheses required to silence the diagnostic, and so I believe this can be enabled again.
…name only. (#182426) Loading a module input file triggers its validation. Avoid this process when we need only a file name. rdar://167647519
…2/2) (NFC) (#181974) Refactor `EmitAArch64BuiltinExpr` so that all AArch64/NEON builtins handled by this hook _and marked as overloaded_ share a common path for generating LLVM IR arguments (collected into the `Ops` `SmallVector<Value*>`) (*). This is a follow-up for #181794 - please refer to that PR for more context. As in the previous PR, the key change is implemented in `HasExtraNeonArgument` , i.e. in the hook that identifies Builtins with the extra argument. In this PR, I am replacing the ad-hoc switch statement with a more principled approach borrowed from SemaARM.cpp, namely: ```cpp static bool HasExtraNeonArgument(unsigned BuiltinID) { // (...) uint64_t mask = 0; switch (BuiltinID) { #define GET_NEON_OVERLOAD_CHECK #include "clang/Basic/arm_fp16.inc" #include "clang/Basic/arm_neon.inc" #undef GET_NEON_OVERLOAD_CHECK // Non-neon builtins for controling VFP that take extra argument for // discriminating the type. case ARM::BI__builtin_arm_vcvtr_f: case ARM::BI__builtin_arm_vcvtr_d: mask = 1; } switch (BuiltinID) { default: break; } if (mask) return true; return false; ``` This is preferred because the extra argument is defined for Sema verification. CodeGen should reuse the same source of truth rather than duplicating or partially reimplementing the logic. No functional change intended. (*) `EmitAArch64BuiltinExpr` contains two large switch statements intended to separate handling of non-overloaded and overloaded builtins. In practice, the split is not consistently enforced. Patch 1/2 refactored the first switch (non-overloaded path). This patch applies the same cleanup to the overloaded path and completes the refactoring.
…d fixture header (#182523) This change converts `Serialization/JSONFormatTest.cpp` into a directory to support reuse of the `JSONFormatTest` fixture by upcoming test files for additional data structures with JSON serialization support. New test files for other serializable data structures can now include `JSONFormatTest.h`, inherit from `JSONFormatTest`, and add their own fixture and tests without duplicating the filesystem scaffolding.
…Passes (#180058) This Commit refactors the conversion of Math / Arith operations to NVVM into a separate Pass called MathToNVVM. This was done to allow to support the lowering of Math / Arith operations in flang. This mirrors what was done in MathToROCDL. This is PR (1/2) to address #147023 and #179347. PR(2/2) that adds this pass to flang is here: #180060
Extra test coverage for #172569
size.getDefiningOp() returns nullptr for block arguments when a OPTIONAL character length generated the conditional "fir.if". Check for a nullptr before calling mlir::isa<> to avoid the crash. Addresses: #182436 Passes check-flang, check-flang-rt, and llvm-test-suite (x86_64) --------- Co-authored-by: Valentin Clement (バレンタイン クレメン) <clementval@gmail.com>
Besides the Attribute description. It is worth noting that this attribute will later be consumed when handling runtime registration on loweringPrepare.
The order of visiting loops in collectFusionCandidates() guarantees that a new member can only possibly be added to the end of a set. Also currently `NumFusionCandidates` counts any loop that is added to a candidate set. Usually large majority of candidate sets have a single members so they are not really candidates for fusion. Only the second member of a candidate set and the ones that come after that could be counted as fusion candidates.
Summary: Expands on the previous support to enable formatted output, characters, and checking basic iostat. We intentionally do not handle cases where the descriptor is non-null as this is a non-trivial class that cannot easily be shepherded across the wire.
Summary: We autuomatically dereference pointers, we should check if these are null. Minimal change made by just keeping it zero and handling zero.
No functional change. Cleaning up to get number of VGPRs for different AMDGPU target based on features.
- Fold DivOp with LHS that has NaN as real or imag to Complex of NaNs - Fold `div(a, Complex<1, 0>) -> a` if fast math flag with nnan is set
…n Utils.cpp (NFC)
Add DW_AT_elemental, DW_AT_pure, and DW_AT_recursive attributes to subprograms and functions when they are specified in the source.
…182575) (#182590) GetCountedByFieldExprGEP() used getOuterLexicalRecordContext() to find the RecordDecl containing the counted_by count field. This walks up through all lexically enclosing records to find the outermost one, which is wrong when a struct with a counted_by FAM is defined nested inside another named struct. For example, when struct inner (containing the FAM) is defined inside struct outer, getOuterLexicalRecordContext() resolves to struct outer instead of struct inner. The StructAccessBase visitor then fails to match the base expression type (struct inner *) against the expected record (struct outer), returning nullptr. This nullptr propagates back as the GEP result, and the subsequent dereference in *__builtin_counted_by_ref() triggers an assertion failure in Address::getBasePointer(). Replace getOuterLexicalRecordContext() with a walk that only traverses anonymous structs and unions, which are transparent in C and must be walked past. Named nested structs are independently-addressable types, so the walk stops at them. Add a regression test for a FAM struct defined nested inside another struct. This also fixes __builtin_dynamic_object_size() for FAMs in nested structs, which was silently returning -1 (unknown) instead of computing the correct size. Update the attr-counted-by-pr88931.c test to reflect the now-correct dynamic object size calculation. Fixes #182575 Signed-off-by: Kees Cook <kees@kernel.org>
For FindLast reduction selecting an IV, we can avoid the horizontal AnyOf in the vector loop, by introducing an independent boolean reduction to track if the condition was ever true in the loop. If it was never true in the loop, we select the start value, otherwise the select the min/max of the FindIV reduction, as required by the predicate. The main advantage of this approach is that we have 2 independent reductions, that do not require a horizontal AnyOf reduction in the loop. Currently this requires a non-wrapping IV, but this can be relaxed in the future by selecting a canonical IV, which is then transformed to the specific derived IV for the reduction after the loop. Depends on #177870. PR: #172569
This makes the searchable table emitter use uint8_t instead of bool in the KeyType struct. This is needed to allow us to use a bitfield in the PseudoInfo struct and avoid a compare between a bool and uint16_t. We already use this same bits<1> trick in other searchable tables. Fixes #182485
These are copied from libcxx with some details and implementation removed. Reviewers: rohanjr Pull Request: #182602
This is to test coroutines Reviewers: rohanjr Reviewed By: rohanjr Pull Request: #182603
…COpsTest.cpp (NFC)
I don't know why this was trying to do placement do. I guess this was overriding the unique_ptr, bypassing its destructor.
…ons (#175655) When the machine outliner duplicates instructions, it clears their debug locations to avoid having the outlined function reference DISubprograms from the original functions. However, this only cleared the debug location on the bundle header, not on the individual instructions inside the bundle. This caused assertion failures in `LexicalScopes::getOrCreateRegularScope`, because the bundled instructions still had debug locations pointing to the original function's. Fix this by iterating through all instructions in a bundle and clearing their debug locations as well.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )