[clang-format] Don't allow comma in front of structural enum (#91056)
Assume that a comma in front of `enum` means it is actually a part of an
elaborated type in a template parameter list.
Fixes https://github.com/llvm/llvm-project/issues/47782
[ADT] Reimplement operator==(StringRef, StringRef) (NFC) (#91139)
I'm planning to deprecate and eventually remove StringRef::equals in
favor of operator==. This patch reimplements operator== without using
StringRef::equals.
I'm not sure if there is a good way to make StringRef::compareMemory
available to operator==, which is not a member function. "friend"
works to some extent but breaks corner cases, which is why I've chosen
to "inline" compareMemory.
fix formatting issues with ODS docs around assembly format directives (#91149)
- Some sentences are incorrectly split across list items.
- Some pre-formatted syntax is left in plaintext
- Some lines end in spaces
Co-authored-by: Jeremy Kun <j2kun at users.noreply.github.com>
[clang backend] In AArch64's DataLayout, specify a minimum function alignment of 4. (#90702)
This addresses an issue where the explicit alignment of 2 (for C++ ABI
reasons) was being propagated to the back end and causing under-aligned
functions (in special sections).
This is an alternate approach suggested by @efriedma-quic in PR #90415.
Fixes #90358
[AArch64][SelectionDAG] Lower multiplication by a constant to shl+sub+shl+sub (#90199)
Change the costmodel to lower a = b * C where C = 1 - (1 - 2^m) * 2^n to
sub w8, w0, w0, lsl #m
sub w0, w0, w8, lsl #n
Fix https://github.com/llvm/llvm-project/issues/89430
[NFC] Remove BLOCKLIT workaround. (#91001)
Lit already has support for stopping LIT from parsing further test
directives. It is
// END.
After that directive, LIT will stop parsing.
This change removes the BLOCKLIT hack and replaces it with END.
[Target] Use StringRef::operator== instead of StringRef::equals (NFC) (#91072) (#91138)
I'm planning to remove StringRef::equals in favor of
StringRef::operator==.
- StringRef::operator==/!= outnumber StringRef::equals by a factor of
38 under llvm/ in terms of their usage.
- The elimination of StringRef::equals brings StringRef closer to
std::string_view, which has operator== but not equals.
- S == "foo" is more readable than S.equals("foo"), especially for
!Long.Expression.equals("str") vs Long.Expression != "str".
[LAA] Directly pass DepChecker to getSource/getDestination (NFC).
Instead of passing LoopAccessInfo only to fetch the MemoryDepChecker,
directly pass MemoryDepChecker. This simplifies the code and also allows
new uses in places where no LAI is available.
Upstream polynomial.ntt and polynomial.intt (#90992)
These two ops represent a number-theoretic transform of a polynomial to
a tensor of evaluations of the polynomial at a list of powers of
primitive roots of the polynomial.
To support this, a new optional attribute is added to the ring attribute
to specify the primitive root of unity used for the NTT. A verifier for
the op is added to ensure the chosen root is a primitive nth root of
unity.
---------
Co-authored-by: Jeremy Kun <j2kun at users.noreply.github.com>
Co-authored-by: Oleksandr "Alex" Zinenko <ftynse at gmail.com>
[clang-tidy][docs] Fix modernize-use-std-print docs (#91069)
The set of functions for the PrintfLikeFunctions and
FprintfLikeFunctions options replaces the default, so remove the word
"extra" from the description which implies that they are in addition to
the default.
[clang-tidy] fix false-positives for templates in `bugprone-return-const-ref-from-parameter` (#90273)
In the AST for function templates, the return will be a DeclRefExpr,
even if the return type differs from that of the returned variable.
Protect against false-positives by constraining the canonical return
type to be that of the parameter.
Also streams the source range of the returned expression into the
diagnostic.
[clang-tidy] Improve modernize-use-std-print diagnostic (#91071)
Include the source range of the printf function in the diagnostic so it
gets underlined in the output.
[X86] bypass-slow-division-64.ll - extend cpu test coverage
Ensure we test with/without the idivq-to-divl attribute, and test the x86-64-v* cpu levels and some common Intel/AMD cpus
[AArch64][SelectionDAG] Mask for SUBS with multiple users cannot be elided (#90911)
In DAGCombiner, the `performCONDCombine` function attempts to remove AND
instructions in front of SUBS (cmp) instructions for which the AND is
transparent. The rules for that are correct, but it fails to take into
account the case where the SUBS instruction has multiple users with
different condition codes for comparison and simply removes the AND for
all of them. This causes a miscompilation in the attached test case.
[X86][EVEX512] Add `HasEVEX512` when `NoVLX` used for 512-bit patterns (#91106)
With KNL/KNC being deprecated, we don't need to care about such no VLX
cases anymore. We may remove such patterns in the future.
Fixes #90844
[VectorCombine] shuffleToIdentity - guard against call instructions.
The shuffleToIdentity fold needs to be a bit more careful about the difference
between call instructions and intrinsics. The second can be handled, but the
first should result in bailing out. This patch also adds some extra intrinsic
tests from #91000.
Fixes #91078