[libc][math] Fix -Wshadow warnings in cos.h (#196342)
cos() does `using namespace range_reduction_double_internal;` and
range_reduction_double_internal after 51e9430a0c767 contains
using LIBC_NAMESPACE::fputil::DoubleDouble;
using Float128 = LIBC_NAMESPACE::fputil::DyadicFloat<128>;
So the local using statements for DoubleDouble and Float128 shadowed
these. Just remove the local using statements.
No behavior change.
[clang-tidy][NFC] Move `ClassifiedToken` to cpp file (#196820)
`ClassifiedToken` is used in only the implementation of
`UseTrailingReturnTypeCheck`. Move it into the unnamed namespace of the
cpp file instead of it being in the header.
[clang-tidy] Move `ClassifiedToken` to cpp file
`ClassifiedToken` is used in only the implementation of `UseTrailingReturnTypeCheck`. Move it into the unnamed namespace of the cpp file instead of it being in the header.
Move KCFI type ID hash helpers out of LLVMSupport (#196784)
PR #167254 inappropriately introduced llvm/Support/Hash.{h,cpp} for the
KCFI helpers. The name is misleading — it has nothing to do with the
generic hashing facility in llvm/ADT/Hashing.h — and KCFI is a
CodeGen/IR feature that does not belong in the foundational Support
layer.
Move the files to llvm/lib/Transforms/Utils/KCFIHash.cpp, alongside
setKCFIType, which is the only existing KCFI helper in TransformUtils.
Also relocate the deprecated pre-xxh3 xxHash64 implementation into
KCFIHash.cpp, the sole user. clang/test/CodeGen/kcfi-generalize.c and
kcfi-normalize.c are end-to-end regression tests for the xxHash64 output
[InstCombine] Fold constant byte stores to integer stores (#196740)
Byte constants are equivalent to integer constants when stored to
memory. Replacing them in store instructions reduces IR differences and
enables existing optimizations over integer constants.
[flang][OpenMP] Optionally get final symbol in Get(Argument|Object)Symbol
Originally these functions returned the ultimate symbol for the one
obtained from the argument or object. However, this may be somewhat
unintuitive/unexpected, so instead return the original symbol, and
add a flag to optionally return the ultimate one.
[llvm][RISCV] Optimize fcopysign for fixed vectors (#193802)
vfsgnj is not available on zvfhmin or zvfbfmin, it's expected to expand
to integer operations instead of unrolling to scalar operations.
General expandFCOPYSIGN already handles that in most of cases except for
fixed vector types that are not promotable, we need to find a better
heuristic to gate this.
[llvm][RISCV] Optimize fabs for fixed vectors (#194554)
vfabs is not available on zvfhmin or zvfbfmin, it's expected to expand
to integer operations instead of unrolling to scalar operations.
General expandFABS already handles that in most of cases except for
fixed vector types that are not promotable, we need to find a better
heuristic to gate this.
[llvm][RISCV] Optimize fneg for fixed vectors (#194555)
vfneg is not available on zvfhmin or zvfbfmin, it's expected to expand
to integer operations instead of unrolling to scalar operations.
General expandFNEG already handles that in most of cases except for
fixed vector types that are not promotable, we need to find a better
heuristic to gate this.
[CIR][AArch64] Lower NEON vuzp intrinsics (#195591)
### Summary
part of : https://github.com/llvm/llvm-project/issues/185382
lower `vuzp` intrinsics in:
https://arm-software.github.io/acle/neon_intrinsics/advsimd.html#unzip-elements
this is a follow up : https://github.com/llvm/llvm-project/pull/195527
Lower `NEON::BI__builtin_neon_vuzp_v` and
`NEON::BI__builtin_neon_vuzpq_v`in CIRGenBuiltinAArch64.cpp by porting
by porting the existing incubator
logic(clangir/clang/lib/CIR/CodeGen/CIRGenBuiltinAArch64.cpp) : two
bitcasts on the input vectors,two rounds of cir.vec.shuffle generating
the deinterleave (even/odd) shuffle patterns with indices 2*i+vi, each
stored via ptr_stride on the sret base pointer.
[IRBuilder] Split CreateAssumption to one with bundle and one with condition [NFC] (#196795)
as it is not possible to combine bundles and conditions from
https://github.com/llvm/llvm-project/pull/160460 reflect that in
CreateAssumption
[clang-tidy] Rename hicpp-multiway-paths-covered to bugprone-unhandled-code-paths (#191625)
Part of the work in https://github.com/llvm/llvm-project/issues/183462.
Closes https://github.com/llvm/llvm-project/issues/183464.
Splitting the check into two more focused checks was considered during
discussion, but since clang-tidy does not support one-to-many aliases, a
single name covering both behaviors was chosen instead that is more
clear than `multiway-paths-covered`.
---------
Co-authored-by: Zeyi Xu <mitchell.xu2 at gmail.com>
[AArch64] Improve post-inc stores of SIMD/FP values (#151372)
Add patterns to match post-increment truncating stores from lane 0 of
wide integer vectors (v4i32/v2i64) to narrower types (i8/i16/i32). This
avoids transferring the value through a GPR when storing.
Also remove the pre-legaliztion early-exit in `combineStoreValueFPToInt`
as it prevented the optimization from applying in some cases.
[X86] Cast atomic vectors in IR to support floats
This commit casts floats to ints in an atomic load during AtomicExpand to support
floating point types. It also is required to support 128 bit vectors in SSE/AVX.
[LifetimeSafety] Warn on incorrectly placed `[[clang::lifetimebound]]` attributes (#196144)
Adds new warning that is emitted when parameter is marked as
`[[clang::lifetimebound]]` but is not returned in one way or another
(tracked via `OriginEscapeFact`).
Closes #182935
Revert "[VectorCombine] foldShuffleChainsToReduce - add support for partial vector reductions" (#196796)
Reverts llvm/llvm-project#195119 while reported assertions are investigated.