[llvm-exegesis] Fix non-existent lit substitution in setReg_init_check.s (#175547)
According to [1] there is no '%d' substitution. Not sure if it was
intended as a substitution but it's confusing, so I've updated the test
to dump the object file to '%t.o', i.e.:
<build_dir>/test/tools/llvm-exegesis/AArch64/Output/setReg_init_check.s.tmp.o
[1] https://llvm.org/docs/CommandGuide/lit.html#substitutions
AMDGPU/GlobalISel: Regbanklegalize rules for G_UNMERGE_VALUES
Move G_UNMERGE_VALUES handling to AMDGPURegBankLegalizeRules.cpp.
Fix sgpr S16 unmerge by lowering using shift and using S32.
Previously sgpr S16 unmerge was selected using _lo16 and _hi16 subreg
indexes which are exclusive to vgpr register classes.
For remaing cases we do trivial mapping, assigns same reg bank
to all operands, vgpr or sgpr.
[SeparateConstOffsetFromGEP] Perform offset calculations on APInt (#175732)
In general, GEP offset calculations are allowed to overflow (if no
poison flags are set). Using int64_t for this purpose can result in C
level signed integer overflow, which is UB. It also means that we
incorrectly model whether some offsets are zero, and thus generate
redundant zero-index GEPs.
Change the code to track offsets in APInts of the pointer index size,
like we do in other places (like accumulateConstantOffset etc).
[mlir] IntRangeNarrowing: Narrow loop induction variables. (#175455)
There are 2 parts:
* Update `LoopLikeOpInterface` to check the supported induction var type
and to update the loop bounds.
* Implement `NarrowLoopBounds` pattern which tries to narrow loop
induction var and bounds using this new interface.
[libc++] Replace uses of _LIBCPP_WEAK with [[gnu::weak]] (#171798)
Using `_LIBCPP_WEAK` doesn't give us anything that using `[[gnu::weak]]`
directly couldn't, so we can just expand the macro.
As a drive-by this also refactors `_LIBCPP_OVERRIDABLE_FUNCTION`.
[llvm][release] Reveal download links based on uploaded assets (#167688)
For the 21.x release, download links were supposed to be revealed once
all the release builds had completed successfully. In reality, MacOS
never had a successful build so I had to hand edit the release messages.
This PR fixes this by focusing instead on what is in the release assets
after the release build step has finished (in whatever state that might
be).
1. Links are now built from a format string, with the linked files being
format arguments for that string. This is a balance between ease of
editing the format, and having the file names for use later (I tried
regex-ing file names out of the final links, which can work but is error
prone and will be hard to debug in production).
Here's an example line:
```
<!-- LINUX_X86 * [Linux x86_64](https://github.com/llvm/llvm-project/releases/download/llvmorg-vX.Y.Z-1/LLVM-vX.Y.Z-1-Linux-X64.tar.xz) ([signature](https://github.com/llvm/llvm-project/releases/download/llvmorg-vX.Y.Z-1/LLVM-vX.Y.Z-1-Linux-X64.tar.xz.jsonl)) -->
```
[24 lines not shown]
[SEH] Ensure unreachable blocks are placed in EHScopeMembership (#175550)
The tests function has an unreachable block bb.2 leading to an
unreachable infinite loop bb.3. As BlockFolding removes the unreachable
bb.2, bb.3 is left only referencing itself. This block is then not
marked as unreachable and so left out of EHScopeMembership, leading to
an assert that FallThroughEHScope != EHScopeMembership.end(). This patch
makes sure that blocks not otherwise collected are added to
EHScopeMembership in the same way as unreachable blocks.
[lldb] Make sure that the "TypeSystemClang::GetBuiltinTypeByName" method returns the correct value also for "_BitInt(...)" types. (#165857)
When trying to get the `SBType` object corresponding to the
`_BitInt(...)` type name, we have noticed that the
`SBTarget::FindFirstType` metod returns `nil`. This branch proposes:
- some test that demonstrate that the problem exists
- a possible fix
---------
Co-authored-by: Matej Košík <matej.kosik at codasip.com>
Co-authored-by: Michael Buch <michaelbuch12 at gmail.com>
[LifetimeSafety] Merge lifetimebound attribute on implicit 'this' across method redeclarations (#172146)
Followup on https://github.com/llvm/llvm-project/pull/107627
Fixes https://github.com/llvm/llvm-project/issues/62072
Fixes https://github.com/llvm/llvm-project/issues/172013
Fixes https://github.com/llvm/llvm-project/issues/175391
This PR adds support for merging the `lifetimebound` attribute on the implicit `this` parameter when merging method declarations. Previously, if a method was declared with `lifetimebound` on its function type (which represents the implicit `this` parameter), this attribute would not be propagated to the method definition, causing lifetime safety warnings to be missed.
The implementation adds helper functions to extract the `lifetimebound` attribute from a function type and to merge this attribute from an old method declaration to a new one when appropriate.
[lldb][RISCV] Implement trap handler unwind plan (#166531)
This patch introduces special unwind plan for trap handling for RISC-V
and fixes `TestHandleAbort`
[clang][bytecode] Diagnose regular CK_LValueBitCast cast nodes (#175721)
We already do this similarly for CXXReinterpretCastExprs, except in that
case we try harder to make things work.
[TwoAddressInstruction] Track MadeChange when eliminating REG_SEQUENCE (#173535)
When `eliminateRegSequence()` is called, the pass modifies the
`MachineFunction` but `MadeChange` was not being set to true.
This causes the pass to incorrectly return `PreservedAnalyses::all()`
even though changes were made.
[LifetimeSafety] Add support for derived-to-base conversions (#175631)
Add support for derived-to-base conversions in lifetime analysis.
Added handling for `CK_UncheckedDerivedToBase` and `CK_DerivedToBase` cast kinds in the `FactsGenerator::VisitImplicitCastExpr` method. These cast kinds are now treated similarly to other conversions by flowing origins from source to destination.
Added a unit test `DerivedToBaseThisArg` that verifies lifetime information is correctly propagated through derived-to-base conversions when using member functions inherited from a base class.
[RISCV] Sync Inst{30-27} assignment into RVPWideningBase. NFC (#175705)
2 of the 3 subclases can pass 'f' straight through from their
instantiations. The third case just needs to concatenate 1b1 to widen f
to 4 bits.
[MLIR][SCFToOpenMP] Fix crash when lowering vector reductions (#173978)
This patch fixes a crash in the SCF to OpenMP conversion pass when
encountering scf.parallel with vector reductions.
- Extracts scalar element types for bitwidth calculations.
- Uses DenseElementsAttr for vector splat initializers.
- Bypasses llvm.atomicrmw for vector types (not supported in LLVM IR).
Fixes #173860
---------
Co-authored-by: Aniket Singh <amiket.singh.3200.00 at gmail.com>