[ExpandIRInsts] Drop ProfcheckDisableMetadataFixes in some cases (#200627)
This is unnecessary inside of applyProfMetadataIfEnabled because it is
already handled before the callback lambda gets called within the
function. There was also a redundant case to remove.
[IR] Fix !invariant.group in combineMetadataForCSE when K moves (#200551)
SimplifyCFG mergeConditionalStoreToAddress currently transforms
if (cond)
store ptr, x !invariant.group;
else
store ptr, y;
into
store ptr, select(cond, x, y) !invariant.group; // BUG
It's clearly not valid to preserve !invariant.group here.
Fix this inside combineMetadataForCSE. It can only preserve
!invariant.group if
1. !DoesKMove, meaning that original instruction ("K") is replaced by
[5 lines not shown]
[asan] NFC: clang-format allocator-related files (#200478)
Depends on #200615
Groundwork for #196413.
Mechanical cleanup of allocator related files in preparation of
functional changes. clang-format (v21.1.2) applied whole-file to:
compiler-rt/lib/asan/asan_allocator.cpp
compiler-rt/lib/asan/asan_allocator.h
compiler-rt/lib/asan/asan_malloc_linux.cpp
compiler-rt/lib/asan/asan_malloc_mac.cpp
compiler-rt/lib/asan/asan_new_delete.cpp
compiler-rt/lib/asan/tests/asan_noinst_test.cpp
Both compiler-rt/lib/asan/.clang-format and
compiler-rt/lib/sanitizer_common/.clang-format use
"BasedOnStyle: Google", so pointer alignment becomes "Type* name"
throughout.
[3 lines not shown]
[asan] NFC: tag ambiguous literal args at Allocate call sites (#200615)
Groundwork for #200478
Add /*name=*/ comments to ambiguous literal call-site arguments in
compiler-rt/lib/asan/asan_allocator.cpp so the parameter name is visible
at the call site for the Allocate / instance.Allocate uses. Covers the
can_fill flag and the bare alignment literals (8, 16, 0) used by:
asan_malloc / asan_vec_malloc / asan_realloc / asan_valloc /
asan_pvalloc / asan_memalign / asan_aligned_alloc /
asan_posix_memalign / asan_new / asan_new_aligned
and the internal Reallocate / Calloc paths.
NFC.
Assisted by: Claude Opus 4.7
[libc++][ranges] P2542R8: Implement `views::concat` (#120920)
Closes #105419
Closes #105348
Closes #105349
Closes #171314
Assisted-by: Chatgpt.
I use AI to help me write some tests, however. I have reviewed the code
I submit in the tests.
---------
Co-authored-by: A. Jiang <de34 at live.cn>
Co-authored-by: Hristo Hristov <hghristov.rmm at gmail.com>
Co-authored-by: Hristo Hristov <zingam at outlook.com>
[IRBuilder] ConstFold unary intrinsics (#200496)
Extend TargetFolder and InstSimplifyFolder to fold unary intrinsics.
CreateUnaryIntrinsic now returns a Value, similar to
CreateBinaryIntrinsic, and this has necessitated more changes.
[VPlan] Factor vputils::getIntrinsicID (NFC) (#200174)
In preparation to get getOpcodeOrIntrinsicID used by CSE to handle calls
and to constant-fold intrinsic calls, factor out vputils::getIntrinsicID
from VPlanPatternMatch to re-use.
[clang-tidy] `use-ranges`: preserve used unique results
Preserve iterator uses when replacing std::unique with std::ranges::unique by appending .begin() in used-result contexts.
Fix #127658
Assisted by Codex.
[clang-tidy] `use-ranges`: avoid unsafe result fix-its
Preserve callable results with .fun, allow structured-binding-safe rewrites, and keep diagnostics while suppressing unsafe fix-its when ranges result objects do not match the original result shape.
Assisted by Codex.
[clang-tidy] `use-ranges`: preserve remove iterator results
Preserve used iterator results for remove, partition, stable_partition, and rotate-style replacements by appending .begin() where the ranges algorithm returns a subrange.
Fix #124794
Assisted by Codex.
[clang-tidy] `use-ranges`: preserve output results
Preserve used output iterator results for output algorithm replacements by appending .out where the ranges algorithm returns an algorithm result object.
Fix #110223
Assisted by Codex.
[X86] matchBinaryPermuteShuffle - match to X86ISD::SHLD funnel shift patterns (REAPPLIED) (#200604)
Add matchShuffleAsVSHLD helper to recognise shuffle masks that can fold
to funnel shifts
Reapplied with fix for shift amount not being appropriately scaled -
test case added at #200569
Fixes #145276
[DenseMap] Replace tombstone deletion with TAOCP 6.4 Algorithm R (#200595)
DenseMap uses quadratic probing with lazy deletion: an erased entry
becomes a tombstone, a third bucket state alongside empty and live that
every find/insert must inspect.
Switch to linear probing with backward-shift deletion (Knuth TAOCP 6.4
Algorithm R), similar to the SmallPtrSet change #197637. This removes
the tombstone state entirely.
In exchange, erase now relocates the following live entries to close the
hole, so it invalidates iterators and references other than the erased
one. For callers that cache pointers into the bucket array,
erase(Key, OnMoved) and erase(iterator, OnMoved) fire a callback once
per
shifted bucket, so fix-ups cost O(cluster) rather than O(NumEntries).
ValueHandleBase::RemoveFromUseList uses this to refresh each moved
handle's PrevPtr.
[17 lines not shown]