Revert "[SDAG] (abs (add nsw a, -b)) -> (abds a, b)" (#17580) (#186068)
Reverts llvm/llvm-project#175801 while #185467 miscompilation is being investigated
libclc: Replace fmod implementation with elementwise builtin
This corresponds to frem, which for whatever reason is a first
class IR instruction. The backend has a heroic freestanding
implementation that should be nearly identical to what was here.
libclc: Replace nextafter implementation
Use a more straightforward version which allows
optimizations to delete the edge case checks, and also
codegens better. Implement in terms of new nextup and nextdown
helper functions, which are IEEE functions, and usable in other
functions.
[AArch64][SVE] Add unpacked fp ISel patterns for clastb (#185688)
Add support for selecting clastb for unpacked float, half, and
bfloat vectors.
Fixes #185670.
[LV] Fix another invalidated iterator in handleFindLastReductions (#185712)
Just collect all the initial phis into a SmallVector first instead
of trying to avoid iterator invalidation in a changing vplan.
Fixes #185682.
[AMDGPU] Use an X-macro to define ELF machine types and names. NFCI. (#185882)
This reduces the number of files that need to be touched when adding a
new CPU type.
Revert "[lldb] Consolidating platform support checks in tests." (#186071)
Reverts llvm/llvm-project#184656
This PR broke linking on Windows and possibly elsewhere. There are at
least 2 possible fixes. Revert while we decide on a single solution.
[libc++] Fix checks for terminal and flushes in std::print() (#70321)
The check whether a stream is associated with a terminal or not and the
flushing of the stream in `std::print()` is needed only on Windows.
Additionally, the correct flush should be used. When `std::print` is
called with a C stream, `std::fflush()` should be used. When it is
called with C++ `ostream`, `ostream::flush()` should be called.
Because POSIX does not have a separate Unicode API for terminal output,
checking for terminal (`isatty`) and flushing is not needed at all.
Moreover, `isatty` has noticeable performance cost.
See also https://wg21.link/LWG4044.
Fixes #70142
[LV] NFCI: Create VPExpressions in transformToPartialReductions.
With this change, all logic to generate partial reductions and
recognising them as VPExpressions is contained in
`transformToPartialReductions`, without the need for a second
transform pass.
The PR intends to be a non-functional change.
[LV] Only create partial reductions when profitable.
We want the LV cost-model to make the best possible decision of
VF and whether or not to use partial reductions. At the moment,
when the LV can use partial reductions for a given VF range, it
assumes those are always preferred. After transforming the plan to
use partial reductions, it then chooses the most profitable VF. It
is possible for a different VF to have been more profitable, if it
wouldn't have chosen to use partial reductions.
This PR changes that, to first decide whether partial reductions
are more profitable for a given chain. If not, then it won't do
the transform.
[MLIR] Make printing Value to a stream thread-safe (#185762)
Adjust `mlir::Value`'s `operator<<` and `dump()` function so that it can
be safely used with multithreading enabled.
Similar to `mlir::Operation` which uses `OpPrintingFlags` with
`localScope` enabled in printing methods.
Using `Value::print(raw_ostream &os)` creates default `OpPrintingFlags`
and with these flags print method is called on `getDefiningOp()`. With
`localScope` disabled by default, `findParent()` could go all the way up
to the `ModuleOp` which can be outside of the pass scope.
We had an instance of it in our project when multiple OperationPasses
were ran concurrently. Trying to print or dump `mlir::Value` in one of
the passes resulted in crash due to failed verifiers that got triggered
on parent op before the print.