21bd4540f3133cc0bb34049ff1f65bcac0feebfa
Introduce a type-safe way of building a 'for' loop with max/min bounds in EDSC. Define new types MaxExpr and MinExpr in C++ EDSC API and expose them to Python bindings. Use values of these type to construct 'for' loops with max/min in newly introduced overloads of the `edsc::For` factory function. Note that in C APIs, we still must expose MaxMinFor as a different function because C has no overloads. Also note that MaxExpr and MinExpr do _not_ derive from Expr because they are not allowed to be used in a regular Expr context (which may produce `affine.apply` instructions not expecting `min` or `max`). Factory functions `Min` and `Max` in Python can be further overloaded to produce chains of comparisons and selects on non-index types. This is not trivial in C++ since overloaded functions cannot differ by the return type only (`MaxExpr` or `Expr`) and making `MaxExpr` derive from `Expr` defies the purpose of type-safe construction. PiperOrigin-RevId: 234786131
Description
Full LLVM 23.1.5 fork for TMS34010 (compiler target + clang bit-address changes)
3.2 GiB
0 Stars
1 Watchers
0 Forks
Languages
LLVM
42.2%
C++
29.9%
C
12.6%
Assembly
10.2%
MLIR
1.7%
Other
2.9%