[Clang] Warn when `std::atomic_thread_fence` is used with `fsanitize=thread` (#166542)
- ThreadSanitizer currently does not support `std::atomic_thread_fence`,
leading to false positives:
https://github.com/llvm/llvm-project/issues/52942.
- GCC produces a warning when `std::atomic_thread_fence` is used with
`-fsanitize=thread` while Clang doesn't.
- This PR introduces a matching warning in Clang to avoid confusion as
in the linked issue.
---------
Co-authored-by: Aaron Ballman <aaron at aaronballman.com>
[DAG]Add ISD::SPLAT_VECTOR to TargetLowering::getNegatedExpression (#173967)
Fold splat_vector(fneg(X)) -> splat_vector(-X)
Call the getCheaperNegatedExpression function, and ISD::SPLAT_VECTOR
return NegatibleCost::Cheaper.
This optimization is applied only to the fneg instruction.
[mlir][tosa] Add mod_shape op (#170343)
Adds support for the mod_shape operation after spec change:
https://github.com/arm/tosa-specification/commit/efc88a100e2db06c2d6bc479fa63b26daab899ce.
This includes the operator definition, same rank checks and level checks
during validation. It does not currently include support for folding or
shape inference. This will be added in a later commit.
freebsd-base.7: Fix stray -r
Remote stray "-r" from the example of installing a toolchain
to alternate root.
Reviewed by: ivy
Differential Revision: https://reviews.freebsd.org/D54611
Port the FreeBSD change
Remove remnants of optimization for > pagesize allocations.
In the past, this allocator seems to have allocated things larger than
a page seperately. Much of this code was removed at some point (perhaps
along with sbrk() used) so remove the rest. Instead, keep allocating in
power-of-two bins up to FIRST_BUCKET_SIZE << (NBUCKETS - 1). If we want
something more efficent, we should use a fancier allocator.
While here, remove some vestages of sbrk() use. Most importantly, don't
try to page align the pagepool since it's always page aligned by mmap().
[InstCombine] Guard foldICmpSRemConstant against zero divisors (#173702)
instcombine can create srem X, 0 or icmp ult X, 0 mid-pass when
operands fold to zero, which trips assertions in foldICmpSRemConstant.
Bail out on zero divisors / zero ULT constants instead of asserting,
and add a regression test from the minimized reproducer.
This was found by a fuzzer I'm working on. The high-level design is to
randomly generate LLVM IR, run a pass on it, and then run the original
and new IR through the interpreter. They should produce the same
results. Right now I'm only fuzzing instcombine.
[Instcombine] Fix crash in foldMinimumMaximumSharedOp (#173705)
We were missing a check that the inner intrinsic is in fact a min/max
op. We'd crash if it was any other intrinsic!
This was found by a fuzzer I'm working on. The high-level design is to
randomly generate LLVM IR, run a pass on it, and then run the original
and new IR through the interpreter. They should produce the same
results. Right now I'm only fuzzing instcombine.
[Instcombine] Fix infinite loop in visitSelectInst (#173704)
Doing a nop replaceOperand leads us into an infinite loop here.
This was found by a fuzzer I'm working on. The high-level design is to
randomly generate LLVM IR, run a pass on it, and then run the original
and new IR through the interpreter. They should produce the same
results. Right now I'm only fuzzing instcombine.
[Instcombine] Ensure simplifyValueKnownNonZero adds instrs in dominance order (#173703)
This was found by a fuzzer I'm working on. The high-level design is to
randomly generate LLVM IR, run a pass on it, and then run the original
and new IR through the interpreter. They should produce the same
results. Right now I'm only fuzzing instcombine.
[AArch64] Optimize ANDS(CSET, CSET) to CCMP. (#174919)
We have existing optimizations for and(cset, cset) and or(cset, cset),
converting them to more optimal ccmp chains. This makes use of the same
optimization for ANDS instructions that do not require the result of the
AND (i.e. TSTs). We generate a cmp from a cset, for the flags produced
by the ANDS. This will then be optimised away in many cases, leaving the
ccmp and use of the flags.