forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 75
merge main into amd-staging #392
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
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
…lvm#163893) Cache extracted elements in lowerShuffleVector(). For example, when lowering ``` %0:_(<2 x s32>) = G_BUILD_VECTOR %0, %1 %2:_(<N x s32>) = G_SHUFFLE_VECTOR %1, shufflemask(0, 0, 0, 0 ... x N ) ``` Currently, we generate `N` `G_EXTRACT_VECTOR_ELT` for each element in shufflemask. This is undesirable and bloats the code, especially for larger vectors. With this change, we only generate one `G_EXTRACT_VECTOR_ELT` from `%0` and reuse it for all four result elements.
…vm#164543) This commit enhances the `SpecialCaseList::GlobMatcher` to filter globs more efficiently by considering both prefixes and suffixes. Previously, the `GlobMatcher` used a `RadixTree` to store globs based on their prefixes. This allowed for quick lookup of potential matches by matching the query string's prefix against the stored prefixes. However, for globs with common prefixes but different suffixes, unnecessary glob matching attempts could still occur. This change introduces a nested `RadixTree` structure: `PrefixSuffixToGlob: RadixTree<Prefix, RadixTree<Suffix, Globs>>`. Now, when a query string is matched, it first finds matching prefixes, and then within those prefix matches, it further filters by matching the reversed suffix of the query string against the reversed suffixes of the globs. This significantly reduces the number of `Glob::match` calls, especially for large special case lists with many globs sharing common prefixes but differing in their suffixes. According to SpecialCaseListBM: Lookup benchmarks (significant improvements): ``` OVERALL_GEOMEAN -0.5815 ``` Lookup `*suffix` and `prefix*suffix` like benchmarks (huge improvements): ``` OVERALL_GEOMEAN -0.9316 ``` https://gist.github.com/vitalybuka/e586751902760ced6beefcdf0d7b26fd
This patch tightens the static_assert. FirstBit and LastBit are 0-based bit indices of a bitfield, so they must be strictly less than StorageBits.
This patch uses std::scoped_lock to ensure the mutex is released via RAII, improving robustness.
DenseMap.h has: - DenseMapBase::copyFrom - DenseMap::copyFrom - SmallDenseMap::copyFrom The latter two clear and set up the storage again before delegating DenseMapBase::copyFrom to do the actual work of copying buckets. This patch consolidates all these into DenseMapBase::copyFrom while eliminating name shadowing concerns. Note that DenseMap::copyFrom and SmallDenseMap::copyFrom are nearly identical, and they can be made identical with small adjustments: - Set NumEntries and NumTombstones to 0 unconditionally. - Teach SmallDenseMap::allocateBuckets to always return true. This patch essentially applies these adjustments and then "inlines" the identical function body to the beginning of DenseMapBase::copyFrom. This patch de-templatizes DenseMapBase::copyFrom because nobody calls it with any type other than DerivedT.
This patch removes getEmptyKey, getTombstoneKey, and getHashValue from DenseMapBase. These forwarder methods do not really encapsulate KeyInfoT. Many of their callers already mention KeyInfoT::isEqual for example. An existing static_assert is moved to another method. Note that it must live in a method for type completeness reasons.
Without this patch, DenseMap and SmallDenseMap have distinct implementations of shrink_and_clear. These implementations mix a common high-level algorithm with class-specific logic. This patch moves the common algorithm into DenseMapBase::shrink_and_clear. A new private helper, planShrinkAndClear, now handles the class-specific logic for deciding whether to shrink the buffer. The base class method now serves as the single public entry point.
…lvm#165067) Based on some recent discussion in llvm#162007. Documenting this in the best practices page so we have something easy to point to in code review/reference for ourselves now that the repository has been cleaned up.
…ates (llvm#164848) Source: Hacker's delight.
ronlieb
approved these changes
Oct 25, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.