Skip to content

Commit 187bd31

Browse files
Regenerate MLIR Bindings (#501)
Co-authored-by: enzyme-ci-bot[bot] <78882869+enzyme-ci-bot[bot]@users.noreply.github.com>
1 parent ff229a2 commit 187bd31

File tree

10 files changed

+10245
-3425
lines changed

10 files changed

+10245
-3425
lines changed

src/mlir/Dialects/Affine.jl

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ In the above example, `%indices:3` conceptually holds the following:
8383
%indices_2 = affine.apply #map2()[%linear_index]
8484
```
8585
86+
In other words, `%0:3 = affine.delinearize_index %x into (B, C)` produces
87+
`%0 = {%x / (B * C), (%x mod (B * C)) / C, %x mod C}`.
88+
8689
The basis may either contain `N` or `N-1` elements, where `N` is the number of results.
8790
If there are N basis elements, the first one will not be used during computations,
8891
but may be used during analysis and canonicalization to eliminate terms from
@@ -98,7 +101,12 @@ That is, the example above could also have been written
98101
%0:3 = affine.delinearize_index %linear_index into (244, 244) : index, index
99102
```
100103
101-
Note that, due to the constraints of affine maps, all the basis elements must
104+
Note that, for symmetry with `getPaddedBasis()`, if `hasOuterBound` is `true`
105+
when one of the `OpFoldResult` builders is called but the first element of the
106+
basis is `nullptr`, that first element is ignored and the builder proceeds as if
107+
there was no outer bound.
108+
109+
Due to the constraints of affine maps, all the basis elements must
102110
be strictly positive. A dynamic basis element being 0 or negative causes
103111
undefined behavior.
104112
"""
@@ -382,6 +390,9 @@ That is, for indices `%idx_0` to `%idx_{N-1}` and basis elements `b_0`
382390
sum(i = 0 to N-1) %idx_i * product(j = i + 1 to N-1) B_j
383391
```
384392
393+
In other words, `%0 = affine.linearize_index [%z, %y, %x] by (Z, Y, X)`
394+
gives `%0 = %x + %y * X + %z * X * Y`, or `%0 = %x + X * (%y + Y * (%z))`.
395+
385396
The basis may either have `N` or `N-1` elements, where `N` is the number of
386397
inputs to linearize_index. If `N` inputs are provided, the first one is not used
387398
in computation, but may be used during analysis or canonicalization as a bound
@@ -390,6 +401,10 @@ on `%idx_0`.
390401
If all `N` basis elements are provided, the linearize_index operation is said to
391402
\"have an outer bound\".
392403
404+
As a convenience, and for symmetry with `getPaddedBasis()`, ifg the first
405+
element of a set of `OpFoldResult`s passed to the builders of this operation is
406+
`nullptr`, that element is ignored.
407+
393408
If the `disjoint` property is present, this is an optimization hint that,
394409
for all `i`, `0 <= %idx_i < B_i` - that is, no index affects any other index,
395410
except that `%idx_0` may be negative to make the index as a whole negative.

src/mlir/Dialects/Enzyme.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ function autodiff(
6969
)
7070
end
7171

72-
@noinline function batch(
72+
function batch(
7373
inputs::Vector{Value}; outputs::Vector{IR.Type}, fn, batch_shape, location=Location()
7474
)
7575
op_ty_results = IR.Type[outputs...,]

src/mlir/Dialects/Func.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ that contains the operation.
219219
# Example
220220
221221
```mlir
222-
func.func @foo() : (i32, f8) {
222+
func.func @foo() -> (i32, f8) {
223223
...
224224
return %0, %1 : i32, f8
225225
}

0 commit comments

Comments
 (0)