[clang-tidy] `use-ranges`: preserve iterator results with `.begin()` (#196036)
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.
[lit] Add --check to run only selected RUN lines from a test
`llvm-lit --check=LIST <test>` keeps only the listed RUN directives in
the test and discards the rest. LIST is a comma-separated mix
of 0-indexed integers and ranges (e.g. `--check=0,2,4-6`). The
selection is applied to the parseIntegratedTestScript output.
Run tests via
`llvm-lit --check=0 llvm/utils/lit/tests/Inputs/check-filter/sample.ll`,
`llvm-lit --check=1 llvm/utils/lit/tests/Inputs/check-filter/sample.ll`,
`llvm/utils/lit/lit.py llvm/utils/lit/tests/check-filter.py`.
[clang-tidy] Avoid unsafe `use-default-member-init` fixes (#191607)
Suppress `modernize-use-default-member-init` diagnostics when moving a
constructor initializer into a default member initializer would
reference a declaration not visible from the field declaration.
Add `IgnoreNonVisibleReferences` to allow preserving the warning without
emitting unsafe fix-its, and document the new behavior.
Fixes #156412
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 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.
[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 used `unique` results (#196035)
Preserve iterator uses when replacing `std::unique` with
`std::ranges::unique` by appending `.begin()` in used-result contexts.
Fix #127658
Assisted by Codex.
[AArch64] Use ADDP tree for v16i8 to i16 bitmask extraction (#199812)
Re-land of #192974, reverted in 868aefd.
The original PR was reverted because the new lowering produced an
EXTRACT_VECTOR_ELT with an illegal i16 result type, which tripped the
operation legalizer when called from combineBoolVectorAndTruncateStore
on a `<32 x i1>` store split into two `<16 x i1>` halves. Returning i32
(handled by the caller's existing getZExtOrTrunc) avoids this.
Regression test added: bitmask_v32i8_split in
vec-combine-compare-to-bitmask.ll.
Note: in alias_mask.ll's whilewr_8_split2, the four halfword bitmask
results are now stored as separate `str h` × 4 rather than packed into
a d-register via ZIP1+EXT before a single store. Functionally
equivalent, slightly fewer NEON arithmetic ops. Side effect of the i32
return type; the store-merging combine doesn't match the same shape.
[VPlan] Recognize shl by constant in getSCEVExprForVPValue. (#199359)
Treat `shl x, c` (with c < bitwidth) as `x * (1 << c)` so callers that
analyze GEP indices via SCEV can see through stride shifts written as
logical shifts.
PR: https://github.com/llvm/llvm-project/pull/199359
[IR][NFC] Fast path for Constant::isNullValue (#200434)
Constant::isNullValue is the, by far, most frequently called out-of-line
function of Constant. It also has non-trivial logic and needs to switch
on the class type.
Therefore, compute the "is null" property once on construction and store
it in an unused bit in SubclassOptionalData.
This improves performance of stage2-O3 by 0.15%.
[Object] Remove unused argument of DataExtractor constructor (NFC) (#197124)
`AddressSize` parameter is not used by `DataExtractor` and will be
removed in the future. See #190519 for more context.
[Profile] Remove unused argument of DataExtractor constructor (NFC) (#197119)
`AddressSize` parameter is not used by `DataExtractor` and will be
removed in the future. See #190519 for more context.
[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]