[libc++] Switch the enable_warnings Lit parameter to enable_werror (#214113)
Our enable_warnings=False parameter in the test suite was basically not
working as intended. Instead of disabling warnings, it would disable all
warning-related flags, including flags that are required for the test
suite to pass (e.g. -Wno-user-defined-literals). As a result, it
couldn't be turned off.
Remove enable_warnings and introduce enable_werror instead. That way, we
can disable -Werror in the test suite but the warnings (and -Wno-foo)
are always used, which is necessary for the test suite to function.
Note that the ability to run the test suite without -Werror is necessary
in order to test against other implementations, including older versions
of libc++ itself.
[SSAF] Close unsafe-buffer reachability over override families
An unsafe pointer reaching one override's parameter is equally unsafe in every
sibling and base override of that method, because the call site picks the
target dynamically. Without closing over the families, reachability depended
on which override the extractor happened to see the flow through, so a fix
suggested for the base could be contradicted by a derived override.
Mirroring is level-preserving: families relate slot entities, so a reachable
EPL propagates only to the same pointer level on its family members.
The closure runs after the pointer-flow DFS has converged and does not feed
its own output back in, so a flow edge out of a newly discovered EPL is still
missed. FamilyClosureDoesNotRerunDFS pins that gap.
§4 of rdar://179151603
[SSAF] Serialize virtual method summaries and families
Per-TU summaries and whole-program results cross process boundaries, and the
JSON layer refuses to write a summary kind it has no format for. Register both
sides so --ssaf-extract-summaries=VirtualMethod becomes usable and the family
result survives a round trip.
Deserialization tolerates a missing override list, since a root virtual method
legitimately has none.
§3 of rdar://179151603
[SSAF] Group virtual method slots into override families
A virtual call site can dispatch to any override, so the parameter and return
slots that occupy the same vtable slot across an override chain are
indistinguishable to a caller. Whole-program consumers therefore have to treat
them as one unit or they will reason about a slot that a call never actually
reaches.
Compute those units up front, keyed per slot, so consumers only need a map
lookup rather than their own traversal of the override relation. Overloads
occupy distinct vtable slots and stay in distinct families.
The family representative is the smallest EntityId in the class, which keeps
the result stable across runs.
§2 of rdar://179151603
[SSAF] Extract the virtual method override relation per TU
A virtual call may dispatch to any override of its callee, so a whole-program
analysis cannot reason about a method's parameters and return value in
isolation. It needs to know which method overrides which, and which slots
that relates. Collect this per TU, so a later pass can join the related
slots into families.
JSON serialization lands separately, so the summary is not writable via
--ssaf-extract-summaries yet.
§1 of rdar://179151603
tmp - Test that three-level chain records only direct override edges
`overridden_methods()` is not transitive. This means that it describes
the directly overridden methods - which is usually a single method
(unless it overrides the same function from multiple parents).
This test case demonstrates that A::f overrides B::f which overrides C::f.
And that it's not that A::f overrides C::f without overriding B::f first.
Assisted-By: claude
[lldb][Windows] Fix value API tests (#214237)
This removes the XFAILs for the value API tests.
- For `lldb/test/API/python_api/value/TestValueAPI.py`, we need to pass
`/debug:symtab` to the linker to get a symbol table. Symbols are
"hidden" by default. PDB works around this in the publics stream. For
DWARF, we need `/debug:symtab`. An alternative is to use `/debug:dwarf`
which also enables this.
- For
`lldb/test/API/python_api/value/change_values/TestChangeValueAPI.py`
there were two issues. First, the stdout wasn't available when we
stopped at a breakpoint. Adding a `fflush(stdout)` fixes this.
Secondly, the breakpoint was created where the inputs to `printf` were
already evaluated. I added another assignment where we set the
breakpoint.
The added `fflush` might also help with this being flakey on Linux
(#26026).
Closes #25146
[LLVM][CodeGen][AArch64] Increase opportunities to fold shift-of-extend into sshll/ushll. (#213989)
Add PreprocessISelDAG logic to undo mul-of-shl to shl-of-mul
canonicalisation when either operand is sign/zero extended because the
extension can be folded into the shift.
[SelectionDAG] Fold constant PARTIAL_REDUCE_SMLA/UMLA/SUMLA nodes (#210351)
This PR implements constant folding for `ISD::PARTIAL_REDUCE_SMLA`,
`ISD::PARTIAL_REDUCE_UMLA`, and `ISD::PARTIAL_REDUCE_SUMLA` when their
operands are constant `BUILD_VECTOR`s. The fold computes the partial
reduction using `APInt` arithmetic and returns a folded `BUILD_VECTOR`.
Input constants are truncated to their logical element width before
being sign- or zero-extended as required by each opcode. Input lane `I`
is accumulated into result lane `I % NumAccElts`, matching
`TargetLowering::expandPartialReduceMLA`. The reduction order is
deliberately unspecified, so this mapping is a valid refinement.
Poison is propagated only to the affected result lanes. Folding is
skipped for undef and opaque constants. Unsupported operand forms return
early because partial-reduce nodes have no scalar form and must not fall
through to generic per-element folding. After type legalization, when
the accumulator element type is not a legal scalar type, the folded
constants are created in the promoted legal type (matching the generic
[13 lines not shown]
[clang-tidy][docs] Normalize fuchsia check documentation links (#214697)
Use stable fuchsia.dev URLs without `?hl=en` and add the missing
reference on `fuchsia-temporary-objects`.
Fixes #62334
[LV][REVEC][AArch64] Proof of concept for re-vectorisation
This shows the changes required to enable basic re-vectorisation support in LoopVectorizer. Most of the diff comes from the added tests, the changes to LoopVectorizer files are rather minimal. This proof-of-concept has obvious limitations and only represents the first building block.
My hope is that this helps discussions and complements the RFC at https://discourse.llvm.org/t/rfc-re-vectorisation-to-wider-vectors-in-loopvectorizer/91071.
Support for re-vectorisation is hidden behind a -vectorize-vector-loops flag and LV will bail out if it encounters constructs that are not yet supported. For example:
- shufflevectors
- gather/scatter and interleaved accesses
- target intrinsics
- reductions
- if-conversion or tail folding
[IR] Define llvm.vector.broadcast intrinsic
This is used broadcast a smaller vector into a wider one. The patch adds
basic legalisation support and ISel for AArch64.