Fix type mismatch in ARM calling convention ternary (#180872)
GCC's -Wextra flags the ternary in the ARM half-precision calling
convention setup because the branches have different types. Use
static_cast to make both sides consistent.
Built with ToT clang and GCC 13.3.0 on Linux x86_64. All existing tests
pass.
[lldb/docs] Update Scripted Symbol Locator tutorial title (NFC) (#181717)
This patch addresses some post-merge comments from llvm-project#181594,
where the tutorial name for Scripted Symbol Locator was missing a word
and wasn't capitalized properly.
Signed-off-by: Med Ismail Bennani <ismail at bennani.ma>
[libc++] Fix FreeBSD atomic timed wait system call (#180400)
This PR fixes atomic timed wait on FreeBSD platforms.
When we added timed wait support, on FreeBSD platform, we were looking
only the `UMTX_OP_WAIT` section of the FreeBSD doc
https://man.freebsd.org/cgi/man.cgi?query=_umtx_op&apropos=0&sektion=2&manpath=FreeBSD+16.0-CURRENT&format=html
. Somehow we missed the generic section that describes the timeout
parameter that applies to all operations. As a consequence, we missed
the part that the FreeBSD is expecting the `size` to be casted to
`uintptr_t`, then passed in to the `void*` parameter.
This PR fixes the issue by casting the type to what the system requires.
As drive by, this PR also
- uses simple `timespec` instead of the extended one
- as documentation suggests, "Interval counting is always performed by
the monotonic wall clock", and "If the flag is absent, the timeout value
is relative", which means that using the simple version is enough and
[6 lines not shown]
[ELF,test] eh-frame-hdr-sdata8.s: use AT() to avoid huge PT_LOAD segments
Use AT() to ensure output sections with huge addresses are placed in separate
PT_LOAD segments. Without this, 2.lds and 3.lds created a huge PT_LOAD
segment, making the sparse file size larger than 4GiB, unsupported by
some 32-bit systems.
https://github.com/llvm/llvm-project/pull/179089#issuecomment-3908549089
Add DW_LNAME_HIP (#180999)
In PR #89980, DW_LNAME_HIP was not added because of a value conflict
with DW_LNAME_Assembly. The value of DW_LNAME_HIP has been updated (see
https://dwarfstd.org/languages-v6.html). This commit adds DW_LNAME_HIP.
Tests added by that PR accommodates the new SourceLanguageName.
[analyzer][Z3][NFCI] Simplify getExpr* functions by taking a RetTy reference (#180801)
Let me start by: This is some ancient code and was never really uphold
to the greatest quality standards.
It turns out the `RetTy` was almost always provided, and in the cases
when it wasn't, we could just pass a dummy and discard the result.
Probably the APIs could be refactored, but I decided not to. The code
mostly works, let's not stir up the mud.
Addresses
https://github.com/llvm/llvm-project/pull/168034#discussion_r2785236941
[NFC][ELF] Remove unused Config::hasTlsIe (#181680)
This was obsoleted by Ctx::hasTlsIe when the latter was introduced, but
the old Config::hasTlsIe was not removed at the same time.
Fixes: 2b153088be4a ("[ELF] Set DF_STATIC_TLS for AArch64/PPC32/PPC64")
[MLIR] Convert DialectReductionPatternInterface using ODS (#180640)
This PR converts `DialectReductionPatternInterface` using ODS.
It also introduces a new Interface Method class:
`PureVirtualInterfaceMethod` which creates the method as pure virtual.
[NFC][AMDGPU] Use `zeroinitializer` instead of `null` for `ptr addrspace(2/3/5)` in AMDGPU tests
A future change will update `ConstantPointerNull` semantics so that `null`
represents the actual null pointer for a given address space, which may be
non-zero. For AMDGPU, address spaces 2, 3, and 5 will have non-zero null
pointers. These tests use `null` to mean "address zero", not "semantic null", so
replace them with `zeroinitializer` which unambiguously represents the start of
the corresponding address space. This is NFC because `null` and
`zeroinitializer` are currently equivalent for all address spaces today.
Unify expandPow2Division/expandPow2Remainder into expandPow2DivRem.
Merge the two functions into one to share the common signed-path logic (freeze, bias, ashr) and reduce code duplication, as suggested.
[OpenMP] Make isPrivatizingClause version-sensitive (#181691)
Some pre-existing clauses (e.g. use_device_ptr) are privatizing in
OpenMP 6.0, but not in 5.2. Make the check more accurate by considering
the effective spec version.
[clang-tidy] Refactor `modernize-redundant-void-arg` (#173340)
Essentially, instead of having individual matchers for functions, and
for pointers to functions, and for casts to functions, and for typedefs
of functions, and (you get the point), this PR unifies them into one
`FunctionTypeLoc`-based matcher.
This refactor is not entirely NFC:
- First, it changes the diagnostic message. What used to be `redundant
void argument list in {function definition, lambda expression, etc.}` is
now just `redundant void argument list`. I don't think we're losing any
important information though.
- Second, it causes the check to fire in more places than it did before.
Specifically, it now removes the 2 `void`s in this test case:
https://github.com/llvm/llvm-project/blob/01effcd82dfbd3ce880a20c335334045191f217b/clang-tools-extra/test/clang-tidy/checkers/modernize/redundant-void-arg.cpp#L434-L442
Seeing as this check does want to remove `void` in macros, I believe
this is fixing an FN. And I don't believe I'm violating the intent of
the test case, because [the intent was just to ensure the check doesn't
crash when encountering it](https://reviews.llvm.org/D14204).
[lldb] Add tree-sitter based syntax highlighting (#181279)
This adds the necessary infrastructure to use tree-sitter for syntax
highlighting in LLDB. It provides the base class for a tree-sitter
highlighter plugin. Its primary function is interfacing with the
tree-sitter library, and converting captures to highlighting styles.
Adding a new tree-sitter highlighter consists of creating an LLDB plugin
that inherits from this class. The plugin has two core responsibilities:
1. Loading the tree-sitter grammar.
2. Specifying the tree-sitter syntax highlighting query.
Everything else is handled by the base class, making it extremely easy
to add a new language.
For more context and the motivation behind using tree-sitter for syntax
highlighting, see #170250.
Tweak cost of sub-reductions
This patch tweaks the cost of sub-reductions such that add-with-sub
reductions are not always discarded by the cost-model, because at the
moment we rely on the LV to generate partial reductions for reduction
chains that have both adds and subs for generating complex dot-product
instructions.
We should really be modeling this in the LV directly though,
but at least this mitigates the regressions caused when using the
cost-model to determine whether partial reductions are profitable
before transforming the VPlan to use them.
Tweak cost of FP reductions
The costs of FP reductions are prohibitively expensive,
which means that we prefer regular reductions even though
the expanded codegen would not be much different, while the
type of the PHI node requires less registers.
Reflect MLALB/T for partial reductions cost-model.
This patch implements the fact that 16-bit -> 32-bit partial
reductions can make use of the MLALB/T instructions.
[DA] Remove `DependenceInfo::removeMatchingExtensions` (#171809)
If two subscripts has same cast operation (`sext` or `zext`),
`removeMatchingExtensions` strips off them. Due to the following
reasons, remaining this function is not useful and risky:
- If the operand of the cast operation has proper nowrap properties,
SCEV usually strips off the cast operation automatically. It's not very
meaningful to do it on DA side.
- If the operand doesn't have nowrap properties, stripping off the cast
operation may lead to incorrect result. Especially, if it can be
negative, removing `zext` would change the interpretation of the value
in a signed sense.
- This function is part of the root cause of #148435.
Although I've not found any cases where incorrect results are produced
by this function, but I think it doesn't make sense to keep it. As far
as I have checked, there are no regressions after removing this
function.
Resolve #169809
[LV] Only create partial reductions when profitable.
We want the LV cost-model to make the best possible decision of
VF and whether or not to use partial reductions. At the moment,
when the LV can use partial reductions for a given VF range, it
assumes those are always preferred. After transforming the plan to
use partial reductions, it then chooses the most profitable VF. It
is possible for a different VF to have been more profitable, if it
wouldn't have chosen to use partial reductions.
This PR changes that, to first decide whether partial reductions
are more profitable for a given chain. If not, then it won't do
the transform.
[AArch64][llvm] Remove +cmh gating
Remove gating of `shuh` and `stcph` since these are instructions from
the HINT space, and therefore is a NOP on cores that don't implement it,
so gating is superfluous. gcc doesn't gate these, so remove for better
compatibility.
[AArch64][llvm] Remove +pcdphint gating (#181633)
Remove gating of `stshh` since this is an instruction from the
HINT space, and therefore is a NOP on cores that don't implement
it, so gating is superfluous. gcc doesn't gate this, so remove
for better compatibility.