[LLVM][Intrinsics] Adds an API to automatically resolve overload types (#169007)
Currently, the getOrInsertDeclaration API requires callers to explicitly
provide overload types for overloaded intrinsics, placing a significant
burden on callers who must determine whether overload types are needed.
This typically results in conditional logic at each call site to check
if the intrinsic is overloaded and manually match the intrinsic
signature.
This patch introduces a new getOrInsertDeclaration overload that
automatically deduces overload types from the provided return type and
argument types, then uses this API to simplify
IRBuilder::CreateIntrinsic. The new API uses
Intrinsic::matchIntrinsicSignature internally to resolve overloaded
types, eliminating the need for callers to do manual overload detection.
[lldb][DWARFASTParserClang] Treat DW_TAG_template_alias like we do DW_TAG_typedef (#170135)
Depends on:
* https://github.com/llvm/llvm-project/pull/170132
Clang gained the `-gtemplate-alias` not too long ago, which emits C++
alias templates as `DW_TAG_template_alias` (instead of
`DW_TAG_typedef`). The main difference is that `DW_TAG_template_alias`
has `DW_TAG_template_XXX` children. The flag was not enabled by default
because consumers (mainly LLDB) didn't know how to handle it. This patch
adds rudimentary support for debugging with `DW_TAG_template_alias`.
This patch simply creates the same kind of `TypedefDecl` as we do for
`DW_TAG_typedef`. The more complete solution would be to create a
`TypeAliasTemplateDecl` and associated `TypeAliasDecl`. But that would
require DWARF to carry generic template information, but currently each
`DW_TAG_template_alias` represents a concrete instantiation. We could
probably hack up some working AST representation that includes the
template parameters, but I currently don't see a compelling reason to.
[3 lines not shown]
[TTI] Use MemIntrinsicCostAttributes for getGatherScatterOpCost (#168650)
- Following #168029. This is a step toward a unified interface for
masked/gather-scatter/strided/expand-compress cost modeling.
- Replace the ad-hoc parameter list with a single attributes object.
API change:
```
- InstructionCost getGatherScatterOpCost(Opcode, DataTy, Ptr, VariableMask,
- Alignment, CostKind, Inst);
+ InstructionCost getGatherScatterOpCost(MemIntrinsicCostAttributes,
+ CostKind);
```
Notes:
- NFCI intended: callers populate MemIntrinsicCostAttributes with same
information as before.
[Delinearization] Add validation for large size arrays (#169902)
This patch adds a check in validation for delinearization to ensure that
the offset calculation does not overflow. If it overflows, different
array accesses (e.g., `A[0][0]` and `A[1][0]`) could map to the same
linear index, leading to incorrect behavior.
For fixed-size arrays, the check is relatively straightforward. However,
for dynamic-size arrays (i.e., arrays where the size is not known at
compile time), it's difficult to prove this statically, and it going to
fail for almost all cases. Maybe we need to add some runtime checks or
reasoning based on `inbounds` like LAA does.
Fixes the test cases added in #169048.
[RISCV] Sources of vmerge shouldn't overlap V0 (#170070)
According to the spec:
> A vector register cannot be used to provide source operands with more
> than one EEW for a single instruction. A mask register source is
> considered to have EEW=1 for this constraint.
There must be a mask `V0` in `vmerge` variants so the sources should
use register classes without `V0`.
This fixes #169905.
Co-authored-by: Luke Lau <luke at igalia.com>
[clang][NFC] Promote CWG3005 test to "ready"
Not updating cxx_dr_status.html yet, because CWG2917 test might need major adjustments before make_cxx_dr_status can be ran.
[lldb/test] Skip ScriptedFrameProviders tests on arm32 (NFC)
It looks like the providers don't get loaded on arm32 bots:
https://github.com/llvm/llvm-project/issues/170412
Skipping for now since I don't have access to a machine to investigate
it.
Signed-off-by: Med Ismail Bennani <ismail at bennani.ma>