[clang-tidy][NFC] Replace `llvm::StringLiteral` with `StringRef` (#172765)
`llvm::StringLiteral` isn't necessary now that `StringRef` is
constexpr-constructible, so keeping it around just creates confusion.
Implement reserveAllocationSpace for SectionMemoryManager (#71968)
Implements `reserveAllocationSpace` and provides an option to enable
`needsToReserveAllocationSpace` for large-memory environments with
AArch64.
The [AArch64
ABI](https://github.com/ARM-software/abi-aa/blob/main/sysvabi64/sysvabi64.rst#7code-models)
has restrictions on the distance between TEXT and GOT sections as the
instructions to reference them are limited to 2 or 4GB. Allocating
sections in multiple blocks can result in distances greater than that on
systems with lots of memory. In those environments several projects
using SectionMemoryManager with MCJIT have run across assertion failures
for the R_AARCH64_ADR_PREL_PG_HI21 instruction as it attempts to address
across distances greater than 2GB (an int32).
Fixes #71963 by allocating all sections in a single contiguous memory
allocation, limiting the distance required for instruction offsets
similar to how pre-compiled binaries would be loaded into memory.
Co-authored-by: Lang Hames <lhames at gmail.com>
[RISCV] Prevent unnecessary calls to hasAllBUsers/AllHUsers. NFC (#172768)
Make sure the constant isn't already sign extended before calling these
functions.
Also add some elses to prevent checks where we already know the value
has been optimized.
[IR] Update `PHINode::removeIncomingValueIf()` to use the swap strategy like `PHINode::removeIncomingValue()` (#172639)
As suggested in https://github.com/llvm/llvm-project/pull/171963, update
`PHINode::removeIncomingValueIf()` to use the swap strategy too.
[clang][deps] Extract `CompilerInvocation` creation (#172744)
This PR extracts the modifications we make to the scanner's
`CompilerInvocation` from multiple spots into a single function.
[BOLT][AArch64] Use minimal code alignment for cold functions (#172598)
On AArch64, a larger cold code size can result in more veneers,
increasing potential overhead for hot code. This change minimizes cold
code size when the `--use-compact-aligner` option (default) is enabled.
[lldb/test] Fix libcxx configuration handling for remote platforms (#172761)
When using --platform remote-* options, explicitly clear the libcxx
configuration variables instead of just warning and continuing with
potentially set values. This prevents the test suite from attempting to
use custom libcxx paths on remote platforms where they're not
applicable.
Also initialize libcxx variables to None when not specified, ensuring a
clean state regardless of how the arguments are parsed.
Signed-off-by: Med Ismail Bennani <ismail at bennani.ma>
[MLIR] Fix AsmPrinter alias uniqueness check (#172734)
A sneaky operator precedence bug caused this resize operation to always
truncate to size 0 or 1:
```
probeAlias.resize(alias.size() + isdigit(alias.back()) ? 1 : 0);
```
Because `+` is associated more strongly than the ternary operator. This
eventually led to the asm printer repeating an alias name, generating
illegal IR.
It wasn't a problem in most cases because it required two things to
trigger:
- Two naturally generated aliases, one "xxx" the other "xxx1" (note the
trailing "1").
- A unique processing order such that we process "xxx", then "xxx1",
then "xxx" again. This can only happen if they happen to be at different
"alias depths", since otherwise the pre-sorting will make sure this
ordering never happens. See the added test case for how this works in
[3 lines not shown]
[MLIR][Transform] Fix transform.smt.constrain_params's verifier (#172753)
Verifier was insisting on `!transform.param<...>` too early and hence
crashed on `!transform.any_param`.