ValueTracking: Use computeKnownBits for ldexp integer handling (#179234)
Switch to using computeKnownBits instead of computeConstantRange
in computeKnownFPClass's ldexp handling. This is preparation to
move the handling into KnownFPClass. Since KnownFPClass is in Support,
it can make use of KnownBits as the input argument. ConstantRange is in
IR, so it cannot be used from Support.
[NFC][GlobalISel] Expose `CallLowering::buildCopyFromRegs` and `CallLowering::buildCopyToRegs` (#179185)
Makes `CallLowering::buildCopyFromRegs` and
`CallLowering::buildCopyToRegs` public so targets not making use of
`ValueHandler` don't have to duplicate this functionality.
For future use in the WASM GlobalISel backend.
InstCombine: Add baseline tests for broken snan handling (#179243)
SimplifyDemandedFPClass doesn't correctly account for possible
quieting in all cases.
[CIR] Upstream support for array new with empty initializer list (#178806)
This adds CIR support for array new with an empty initializer list for
zero-initializable types.
This is part of https://github.com/llvm/llvm-project/issues/160383
[SelectionDAG][NFC] Rename isConstantSequence to isArithmeticSequence (#179108)
The previous name was misleading: the method checks for an arithmetic
progression `(start, start+stride, start+2*stride, ...)`, not just any
constant sequence. The new name uses precise mathematical terminology.
https://github.com/llvm/llvm-project/pull/176671#discussion_r2735571479
Update ObjC and Itanium maintainership (#177950)
John is stepping down from both of these roles as well. We do not have a
replacement for Itanium ABI at this time, but this PR leaves the section
in the maintainers file so it's clear we need to fill it.
Akira Hatanaka has graciously agreed to step up for Objective-C, thank
you!
[mlir][ROCDL] do not hardcode partial lld path in utilities (#179201)
`ROCDL::linkObjectCode` was unconditionally appending llvm/bin/ld.lld to
the path it is been passed to to look for lld, which isn't desirable for
a utility function and makes it unusable with, e.g., system lld or one
from the LLVM's own build directory. Move this logic to the caller and
let the utility take a full path.
[mlir][PDL] Support running `pdl_interp.foreach` on ranges of values and types (#173161)
The foreach execution only works for operation ranges, typically
stemming from pdl_interp.get_users.
Custom rewrites/constraints can return ranges of types and values as
well, however.
This pr adds support for executing `pdl_interp.foreach` in those cases.
AMDGPU/GlobalISel: Regbanklegalize rules for G_UNMERGE_VALUES (#171653)
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.
[LLVM][Intrinsics] Allow IIT fixed encoding table to be 32-bit (#178531)
Change Intrinsics.cpp to rely on the type `FixedEncodingTy` emitted by
the intrinsic emitter in `getIntrinsicInfoTableEntries` to process the
intrinsic type table. This enables downstream targets that need a 32-bit
fixed encoding table to just change the value of `Use16BitFixedEncoding`
in the intrinsic emitter to enable 32-bit fixed encoding table.
[CIR] Create cir.cleanup.scope operation (#178085)
This adds the CIR dialect definitions for the cir.cleanup.scope
operation. Nothing is being added yet to generate this operation. That
will be done in a later change.
[libc++] Short-cut constraints of single-argument `any` constructor (#177082)
When a default template argument of a function template uses
`std::is_copy_constructible<T>::value` and `T` is convertible from and
to `any`, the changes in 21dc73f6a46cd786394f10f5aef46ec4a2d26175 would
introduce constraint meta-recursion when compiling with Clang.
This patch short-cuts constraints of the related constructor to avoid
computing `is_copy_constructible<T>` when `decay_t<T>` is `any`, which
gets rid of constraint meta-recursion in the overload resolution of copy
construction of `T`.
Fixes #176877.
[Clang] Fix coro_await_elidable breaking with parenthesized expressions (#178495)
The `applySafeElideContext` function used `IgnoreImplicit()` to find the
underlying CallExpr, but this didn't strip `ParenExpr` nodes. When code
like `co_await (fn(leaf()))` was parsed, the operand was wrapped in a
`ParenExpr`, causing safe elide attribution to fail in Clang stage.
This fix chains `IgnoreImplicit()->IgnoreParens()->IgnoreImplicit()` to
handle both orderings of implicit nodes and parentheses in the AST.
Fixes https://github.com/llvm/llvm-project/issues/178256. Except that
`IgnoreParen()` should be a better suggestion than
`IgnoreParenImpCast()`.
Revert "[SPIRV] Emit intrinsics for globals only in function that references them (#178143 (#179268)
This reverts commit 1daef5927ff0e43b92d615380a8d60f213cc5e52.
From the ASAN buildbot:
```bash
FAIL: LLVM :: CodeGen/SPIRV/extensions/SPV_INTEL_function_pointers/fun-ptr-addrcast.ll (46596 of 94488)
******************** TEST 'LLVM :: CodeGen/SPIRV/extensions/SPV_INTEL_function_pointers/fun-ptr-addrcast.ll' FAILED ********************
Exit Code: 2
Command Output (stdout):
--
# RUN: at line 5
/home/b/sanitizer-aarch64-linux-bootstrap-asan/build/llvm_build_asan/bin/llc -verify-machineinstrs -O0 -mtriple=spirv32-unknown-unknown /home/b/sanitizer-aarch64-linux-bootstrap-asan/build/llvm-project/llvm/test/CodeGen/SPIRV/extensions/SPV_INTEL_function_pointers/fun-ptr-addrcast.ll -o - --spirv-ext=+SPV_INTEL_function_pointers | /home/b/sanitizer-aarch64-linux-bootstrap-asan/build/llvm_build_asan/bin/FileCheck /home/b/sanitizer-aarch64-linux-bootstrap-asan/build/llvm-project/llvm/test/CodeGen/SPIRV/extensions/SPV_INTEL_function_pointers/fun-ptr-addrcast.ll
# executed command: /home/b/sanitizer-aarch64-linux-bootstrap-asan/build/llvm_build_asan/bin/llc -verify-machineinstrs -O0 -mtriple=spirv32-unknown-unknown /home/b/sanitizer-aarch64-linux-bootstrap-asan/build/llvm-project/llvm/test/CodeGen/SPIRV/extensions/SPV_INTEL_function_pointers/fun-ptr-addrcast.ll -o - --spirv-ext=+SPV_INTEL_function_pointers
# note: command had no output on stdout or stderr
# error: command failed with exit status: 1
# executed command: /home/b/sanitizer-aarch64-linux-bootstrap-asan/build/llvm_build_asan/bin/FileCheck /home/b/sanitizer-aarch64-linux-bootstrap-asan/build/llvm-project/llvm/test/CodeGen/SPIRV/extensions/SPV_INTEL_function_pointers/fun-ptr-addrcast.ll
[9 lines not shown]
[Compiler-rt] Implement AEABI Unaligned Read/Write Helpers in compiler-rt (#167913)
This patch adds implementations for the __aeabi_uread and __aeabi_uwrite
helper functions to compiler-rt.
Without these helpers, LLVM would need to inline byte wise sequences ,
which can increases code size, especially at -Os/-Oz. Using the helper
functions allows to retain correctness while avoiding the code-size
growth.
GCC-based toolchains already provide these AEABI helpers, so supporting
them in compiler-rt ensures parity and avoids accidental dependencies on
libgcc when LLVM begins emitting these calls.
[ARM] Lower unaligned loads/stores to aeabi functions. (#172672)
When targeting architectures that do not support unaligned memory
accesses or when explictly pass -mno-unaligned-access, it requires the
compiler to expand each unaligned load/store into an inline sequences.
For 32-bit operations this typically involves:
1. 4× LDRB (or 2× LDRH),
2. multiple shift/or instructions
These sequences are emitted at every unaligned access site, and
therefore contribute significant code size in workloads that touch
packed or misaligned structures.
When compiling with -Oz and in combination with -mno-unaligned-access,
this patch lowers unaligned 32 bit and 64 bit loads and stores to below
AEABI heper calls:
```
__aeabi_uread4
[21 lines not shown]
Move John Ericson to the inactive maintainers list (#179264)
While reaching out to folks for a maintainers list refresh, John asked
to step down due to other commitments. Thank you for all your help!
[clang][bytecode] Fix crash on __builtin_infer_alloc_token with struct argument (#178936)
## Summary
- Fix crash when passing non primitive types (structs) to
`__builtin_infer_alloc_token`
- The bytecode interpreter's discard loop dereferenced an empty
`OptPrimType` for non primitive arguments
## Test plan
- Added regression test in `clang/test/SemaCXX/alloc-token.cpp`
- Existing tests continue to pass
Fixes #178892
[NFC][LoopUnroll] Add `-unroll-runtime-other-exit-predictable=false` to `unroll-multi-exit-loop-heuristics.ll` (#179198)
Adds `-unroll-runtime-other-exit-predictable=false` option to
`unroll-multi-exit-loop-heuristics.ll` test for stability reasons.
This is a followup to a discussion in #164799 and a similar patch
https://reviews.llvm.org/D98098. Since this option is false by default,
this is an NFC.
[DAG] Change default expansion of strictfp vector operations
The previous default implementation unrolled strictfp vector operation,
producing its scalar version. This behavior can result in low
performance in some cases. A better behavior is to convert strictfp
nodes into default-mode operations. This method has already been used to
support strictfp nodes on targets with limited support of strictfp
operations.
Many targets already implement lowering of strictfp and default-mode
nodes identically. Small number of deviations from this rule is fixed in
this change. Identical treatment of strictfp and default mode nodes is
natural because both represent the same operation in the resulting code,
the only difference is additional restrictions that compiler should
apply when it handles strictfp nodes.
Unrolling vector operations can also violate user expectations. In
strictfp mode, vector operations cannot be created by auto-vectorization
because of the side effect of constrained functions, so the vector
[3 lines not shown]
[AArch64][llvm] Remove `+xs` gating for `tlbip *nxs` instructions
A recent spec update has removed FEAT_XS gating for `tlbip *nxs`
instructions. It remains gated on FEAT_XS for `tlbi *nxs` instructions.