[DWARFLinker] Treat NULL DIE references as resolution failures in parallel (#195363)
CompileUnit::resolveDIEReference returned whatever getDIEIndexForOffset
pointed at, even when the entry was a NULL tombstone. The classic linker
checks DWARFDie::isNULL(). Mirror that here so callers get std::nullopt
and warn.
Also fix the "cann't" typo at the two warning sites to match classic,
and enable `--linker parallel` in null-die.test.
[test] Cover R_RISCV_ADD/SUB and R_RISCV_RVC_{BRANCH,JUMP} (#195555)
These were uncovered according to an LLVM_BUILD_INSTRUMENTED_COVERAGE
build.
llvm-mc resolves `.L1 - .L0` differences at assembly time, so
riscv-reloc-add.s doesn't emit the R_RISCV_ADD*/R_RISCV_SUB* pairs it
was meant to test.
Add riscv-reloc-rvc.s, modeled on riscv-branch.s/riscv-jal.s, to
exercise R_RISCV_RVC_BRANCH and R_RISCV_RVC_JUMP. Drive offsets via
-Ttext + --defsym to land precise values that isolate complementary
extractBits groups.
[clang][NFC] Mark CWG2629 as implemented and add a test (#195490)
This is ill-formed:
```cpp
switch (0.0) {}
```
Before [CWG2629](https://wg21.link/cwg2629) though, this was allowed:
```cpp
switch (double d = 0.0) {} // Value of 'd' is implicitly converted to an integer
```
Clang however has always rejected both: https://godbolt.org/z/GYc4hhrnz
[clang-tidy] Preserve typedef comments in `modernize-use-using` (#180372)
Keep comment blocks between the typedef type and name by capturing the
raw lexer range and avoid injecting unrelated tokens into the
replacement.
Fixes https://github.com/llvm/llvm-project/issues/159518.
[ELF] maybeWarnUnorderableSymbol: drop redundant `d &&`, assert isShared. NFC (#195543)
Test Defined first via dyn_cast. Lazy/Common/Placeholder cannot reach
here: readCallGraph runs after replaceCommonSymbols, buildSectionOrder
runs after demoteSymbolsAndComputeIsPreemptible, and redirectSymbols
detaches Placeholder foo at v1 stubs from objectFiles.
In symbol-ordering-file-warnings.s, add a common-symbol case and use
`count 0` for empty-output checks.
[ELF] Simplify checkDuplicate; cover SharedSymbol/CommonSymbol resolve. NFC (#195541)
Drop the redundant isDefined() check.
Extend common-shared.s to also exercise the case where the
SharedSymbol's
st_size is not larger than the incoming CommonSymbol's.
[compiler-rt][UBSan] Add __ubsan_default_suppressions() hook (#194862)
In line with commit 5c62af5 and 83566da.
Assisted-by: Gemini
---------
Co-authored-by: Vitaly Buka <vitalybuka at google.com>
[MLIR][Presburger] Conversion between Int- and FracMatrix (#192822)
A straightforward conversion between `IntMatrix` and `FracMatrix`. This
is one further preparation PR.
The next step for upstreaming is to find a particular solution `x` to
the system `Ax = Bp + C`, which might contain fractions while `A`, `B`
and `C` are IntMatrices. That's the reason we need these conversion
helpers.
---------
Co-authored-by: Arjun Pitchanathan <arjunpitchanathan at gmail.com>
[SelectionDAG][NFC] Add function for `peekThroughFreeze` (#195324)
There are a few callsites in SelectionDAG and DAGCombiner where it is
necessary to look through an `ISD::FREEZE` to unblock some optimization
and folds. This patch introduces `peekThroughFreeze` and
`peekThroughOneUseFreeze` utility functions to cleanup the repeated sites.
[Clang][ItaniumMangle] Preserve field-name closure-prefix for instantiated lambdas (#195340)
Previously, instantiation did not pass `LambdaContextDecl`, so the NSDMI
lambda in the class template used the wrong `ContextDecl`.
Fixes: #190555
[SLP][NFC] Pre-commit tests for build-vector stores in store chains (#195531)
These tests exercise SLP store-chain handling when an explicit
build-vector store (a chain of insertelements stored to memory) is
interleaved with scalar stores at adjacent addresses. The CHECK lines
reflect current behavior:
- buildvector_store_middle: vector store sits in the middle of the
chain.
SLP currently leaves it intact and packs the surrounding scalars into
a narrower <2 x float> + scalar tail mix.
- buildvector_store_start / buildvector_store_end: vector store sits at
the start/end of the chain. SLP already combines the adjacent scalar
stores into a clean <4 x float> store, so these are regression cases
that should remain unchanged.
- buildvector_store_duplicate_offset: scalar stores at the same address
bracket the vector store; SLP keeps the chain split.
A follow-up patch updates the CHECK lines for the cases that change.
[SLP][REVEC] Replace all uses of direct gather scalar operands
When ReVec gather inserts a tree-vector scalar V directly as a
shufflevector operand (poison-vector path of createInsertVector), the
existing per-User external use only rewrites V's use inside that one
shufflevector. Other in-IR uses of V are left untouched and trigger
the "Deleting out-of-tree value" assertion in vectorizeTree when V's
tree entry is erased.
Register an additional nullptr-User external use so V's remaining
uses are rewritten via replaceAllUsesWith.
Fixes #195425
Reviewers:
Pull Request: https://github.com/llvm/llvm-project/pull/195536
[clang-format] Honor later negated .clang-format-ignore patterns (#195432)
This addresses (#178344).
In this issue the negation (`!`) for paths inside .clang-format-ignore
doesn't behave as intended, as clang-format stops processing patterns on
the first match, rather than processing further rules/patterns.
Rather than
```
foo/*
!foo/*.h
```
un-ignoring `.h`-files in `foo/` - the header-files remain ignored,
since the ignore-condition exits early and considers the files ignored
when checking `foo/*`.
I've tried to make negation work with the old behaviour (like mentioned
in #178344), but could find no sensible way to use it.
From the draft/proposal of .clang-format-ignore (#52975) it looks like
the intent of the negation pattern was to behave similar to .gitignore -
[8 lines not shown]