LLVM/project da6b0bamlir/include/mlir/Dialect/Linalg/Transforms Transforms.h, mlir/lib/Dialect/Linalg/Transforms ElementwiseOpFusion.cpp

[mlir][linalg] Split elementwise ops with concat inputs (#213630)

Close https://github.com/llvm/llvm-project/issues/213216

This patch tries to reorder patterns like elementwise(concat(x0, x1),
concat(y0, y1)) into concat(elementwise(x0, y0), elementwise(x1, y1)).
The transformation itself is not an optimization. But it will make the
elementwise op to be closer with the data so that the optimizer may find
more optimization oppotunities. See the above patch for an example.

For simplicity, this patch only handle cases for all concats have the
same number of inputs and the size of inputs in the concat dimension to
be the same. We also don't handle linalg.index. And if the inputs of the
elementwise op has other inputs than concat, which is not a scalar, may
be rejected too. We can relax these limitations in the future.

To make the implementation more uniform, we only handles elementwise
like linalg.generic. The elementwise op will be transoformed into
linalg.generic after -convert-elementwise-to-linalg. So the

    [7 lines not shown]
DeltaFile
+411-0mlir/test/Dialect/Linalg/fusion-elementwise-ops-with-concat.mlir
+292-0mlir/lib/Dialect/Linalg/Transforms/ElementwiseOpFusion.cpp
+9-0mlir/include/mlir/Dialect/Linalg/Transforms/Transforms.h
+712-03 files

LLVM/project b704e51llvm/lib/DWARFLinker/Parallel DependencyTracker.h DependencyTracker.cpp, llvm/test/tools/dsymutil/X86/DWARFLinkerParallel odr-shared-subtree-demotion.s

[DWARFLinker] Walk each shared subtree's dependencies once (#218072)

cdc31cfa66f0 made every root that references an already-marked subtree
re-walk that subtree to record the completeness dependencies it
contributes, which is what makes the recorded dependency set complete
and independent of thread interleaving. That walk replaced the
isAlreadyMarked short-circuit which had kept marking linear, so a widely
shared subtree is re-parsed and re-resolved once per referencing root.

Linking a RelWithDebInfo clang went from 27s to 67s of wall time and
from 242s to 1447s of CPU, peak memory grew from 35GB to 63GB, and 7.0
billion dependencies were recorded for an unchanged dSYM.

Record only that a root carries the subtree's dependencies and walk each
distinct subtree once. All of a subtree's dependencies demote the same
root, so the expansion stops at the first one that does.

A subtree contributes two kinds of dependency. One kind is recorded
under the root referencing the subtree, varies with that root, and is

    [22 lines not shown]
DeltaFile
+298-0llvm/test/tools/dsymutil/X86/DWARFLinkerParallel/odr-shared-subtree-demotion.s
+164-55llvm/lib/DWARFLinker/Parallel/DependencyTracker.cpp
+121-14llvm/lib/DWARFLinker/Parallel/DependencyTracker.h
+583-693 files

LLVM/project 01fec98clang/docs ReleaseNotes.md, clang/lib/Sema SemaCoroutine.cpp

[Clang] Fix -Wunused-parameter for implicit coroutine uses (#217518)

Clang's coroutine semantic analysis builds references to coroutine
parameters
while looking up a class-specific allocation function. When overload
resolution
falls back to a size-only `operator new`, these speculative references
currently
suppress `-Wunused-parameter`.

Preserve each parameter's referenced state while collecting placement
arguments, then mark the parameters referenced only when those arguments
are
included in the selected allocation call. Keep this distinction when
placement
arguments are replaced by `std::nothrow`.

Apply the same rule to promise initialization: when initialization using
the

    [14 lines not shown]
DeltaFile
+44-0clang/test/SemaCXX/warn-unused-parameters-coroutine.cpp
+30-3clang/lib/Sema/SemaCoroutine.cpp
+5-0clang/docs/ReleaseNotes.md
+79-33 files

LLVM/project 3de7874mlir/lib/Dialect/Vector/Transforms VectorTransforms.cpp, mlir/test/Dialect/Linalg/vectorization extract-with-patterns.mlir

[mlir] [vector] try promoting scalar when reordering broadcast/elementwise (#212180)

Inspired by https://github.com/llvm/llvm-project/pull/211208

The thread discussed the case:

```
 %0 = vector.broadcast %arg0 : vector<4xf32> to vector<3x4xf32>
 %1 = vector.broadcast %arg1 : f32 to vector<3x4xf32>
 %2 = vector.broadcast %arg2 : vector<4xf32> to vector<3x4xf32>
 %3 = vector.fma %0, %1, %2 : vector<3x4xf32>
```

The reviewer suggests "broadcasts on %arg0 and %arg2 are removed but
%arg1 is broadcasted to <4xf32>. Then FMA would happen on <4xf32>,
%followed by the broadcast to <3x4xf32>". Now this is solved and we can
see the test case at @fma_mixed_scalar_and_vector_broadcast_source in
the attached test case.

AI assisted.
DeltaFile
+55-16mlir/test/Dialect/Vector/vector-sink.mlir
+36-14mlir/lib/Dialect/Vector/Transforms/VectorTransforms.cpp
+3-3mlir/test/Dialect/Linalg/vectorization/extract-with-patterns.mlir
+94-333 files

LLVM/project 3cc275dlibc/src/__support/FPUtil FPBits.h

test
DeltaFile
+4-4libc/src/__support/FPUtil/FPBits.h
+4-41 files

LLVM/project bbd4612libc/src/__support/FPUtil float80.h, libc/test/src/__support/FPUtil float80_test.cpp

add tests
DeltaFile
+21-0libc/src/__support/FPUtil/float80.h
+15-0libc/test/src/__support/FPUtil/float80_test.cpp
+36-02 files

LLVM/project 37d452alibc/src/__support/FPUtil FPBits.h

formatting
DeltaFile
+4-4libc/src/__support/FPUtil/FPBits.h
+4-41 files

LLVM/project a9c9cfflibc/test/src/__support/FPUtil float80_test.cpp

nit
DeltaFile
+0-3libc/test/src/__support/FPUtil/float80_test.cpp
+0-31 files

LLVM/project 763a723libc/src/__support/FPUtil float80.h, libc/test/src/__support/FPUtil float80_test.cpp

suggestions and add more operators
DeltaFile
+40-16libc/src/__support/FPUtil/float80.h
+34-5libc/test/src/__support/FPUtil/float80_test.cpp
+74-212 files

LLVM/project 575ccc5libc/src/__support/FPUtil float80.h, libc/test/src/__support/FPUtil float80_test.cpp

feat: add negation and a test for it
DeltaFile
+7-0libc/src/__support/FPUtil/float80.h
+2-0libc/test/src/__support/FPUtil/float80_test.cpp
+9-02 files

LLVM/project 01df9d3libc/src/__support/FPUtil CMakeLists.txt float80.h

apply suggestion
DeltaFile
+2-6libc/src/__support/FPUtil/float80.h
+1-0libc/src/__support/FPUtil/CMakeLists.txt
+3-62 files

LLVM/project 23ea3c7libc/src/__support/FPUtil dyadic_float.h

nit
DeltaFile
+1-0libc/src/__support/FPUtil/dyadic_float.h
+1-01 files

LLVM/project 3599d8alibc/src/__support/FPUtil FPBits.h

Removed temporarliy for 128bit container only
DeltaFile
+4-4libc/src/__support/FPUtil/FPBits.h
+4-41 files

LLVM/project 20b3ea1libc/src/__support/FPUtil CMakeLists.txt

fix self dependency
DeltaFile
+1-1libc/src/__support/FPUtil/CMakeLists.txt
+1-11 files

LLVM/project 6e81a79libc/src/__support/FPUtil dyadic_float.h

add explicit bit handling for dyadic_float as per FPBits
DeltaFile
+2-0libc/src/__support/FPUtil/dyadic_float.h
+2-01 files

LLVM/project fe91cdclibc/src/__support/FPUtil float80.h

feat: add tests
DeltaFile
+16-69libc/src/__support/FPUtil/float80.h
+16-691 files

LLVM/project f0815a2libc/src/__support/FPUtil dyadic_float.h

nit
DeltaFile
+2-1libc/src/__support/FPUtil/dyadic_float.h
+2-11 files

LLVM/project 8b7aa2elibc/src/__support/FPUtil dyadic_float.h

test: limit EXTRA_FRAC_LEN to be non-negative

test

test

nit

revert

revert

only add >0 condition

format
DeltaFile
+0-4libc/src/__support/FPUtil/dyadic_float.h
+0-41 files

LLVM/project b76b05blibc/src/__support/FPUtil FPBits.h

nit
DeltaFile
+4-4libc/src/__support/FPUtil/FPBits.h
+4-41 files

LLVM/project 2c922cclibc/src/__support/FPUtil float80.h

initial temp skeleton
DeltaFile
+74-16libc/src/__support/FPUtil/float80.h
+74-161 files

LLVM/project b826b22libc/src/__support/CPP/type_traits is_floating_point.h, libc/src/__support/FPUtil float80.h dyadic_float.h

nits and cleanup
DeltaFile
+4-7libc/src/__support/FPUtil/dyadic_float.h
+0-6libc/test/src/__support/FPUtil/float80_test.cpp
+0-5libc/src/__support/FPUtil/float80.h
+2-1libc/src/__support/CPP/type_traits/is_floating_point.h
+1-0libc/src/__support/macros/properties/types.h
+7-195 files

LLVM/project eda9cc8libc/src/__support/CPP/type_traits is_floating_point.h, libc/src/__support/FPUtil CMakeLists.txt float80.h

initial temp skeleton
DeltaFile
+161-0libc/src/__support/FPUtil/float80.h
+19-0libc/test/src/__support/FPUtil/float80_test.cpp
+18-0libc/src/__support/FPUtil/CMakeLists.txt
+12-0libc/test/src/__support/FPUtil/CMakeLists.txt
+9-0libc/src/__support/macros/properties/types.h
+3-1libc/src/__support/CPP/type_traits/is_floating_point.h
+222-11 files not shown
+224-17 files

LLVM/project 3cc02e4libc/src/__support/FPUtil dyadic_float.h

add explicit bit handling for dyadic_float as per FPBits
DeltaFile
+2-0libc/src/__support/FPUtil/dyadic_float.h
+2-01 files

LLVM/project f907eb9libc/src/__support/FPUtil float80.h, libc/test/src/__support/FPUtil float80_test.cpp

feat: add tests
DeltaFile
+16-69libc/src/__support/FPUtil/float80.h
+59-0libc/test/src/__support/FPUtil/float80_test.cpp
+75-692 files

LLVM/project 1169616libc/src/__support/FPUtil cast.h

add fputiL::cast support
DeltaFile
+3-1libc/src/__support/FPUtil/cast.h
+3-11 files

LLVM/project e982b47libc/src/__support/FPUtil dyadic_float.h FPBits.h

test
DeltaFile
+4-4libc/src/__support/FPUtil/FPBits.h
+2-1libc/src/__support/FPUtil/dyadic_float.h
+6-52 files

LLVM/project 103c61clibc/src/__support/FPUtil dyadic_float.h

nit
DeltaFile
+1-0libc/src/__support/FPUtil/dyadic_float.h
+1-01 files

LLVM/project 7fcd244libc/test/src/__support/FPUtil float80_test.cpp

add edge cases test
DeltaFile
+39-1libc/test/src/__support/FPUtil/float80_test.cpp
+39-11 files

LLVM/project 710d75blibc/src/__support/FPUtil dyadic_float.h

test: limit EXTRA_FRAC_LEN to be non-negative

test

test

nit

revert

revert

only add >0 condition

format
DeltaFile
+6-8libc/src/__support/FPUtil/dyadic_float.h
+6-81 files

LLVM/project 6450cd5libc/src/__support/macros/properties types.h

nit
DeltaFile
+1-1libc/src/__support/macros/properties/types.h
+1-11 files