This is an archive of the discontinued LLVM Phabricator instance.

[mlir][Interfaces] ValueBoundsOpInterface: Compute constant bounds
ClosedPublic

Authored by springerm on Mar 17 2023, 6:38 AM.

Details

Summary

Add a helper function that computes a constant (int64_t) bound. The stopCondition is optional: If none is provided, the traversal continues until a constant bound could be computed.

Depends On: D145806

Diff Detail

Event Timeline

springerm created this revision.Mar 17 2023, 6:38 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 17 2023, 6:38 AM
springerm requested review of this revision.Mar 17 2023, 6:38 AM
dcaballe accepted this revision.Apr 6 2023, 3:37 PM
dcaballe added inline comments.
mlir/lib/Interfaces/ValueBoundsOpInterface.cpp
364

nit: .

372

Did you finally add the option to make UB close? (I guess I'll figure it out :))

mlir/test/Dialect/Affine/value-bounds-reification.mlir
42

For cases where constant is not provided and there are multiple bounds, are we returning now the non-constant one?

88

Nit: What about introducing a test.reify_constant_bound instead?

This revision is now accepted and ready to land.Apr 6 2023, 3:37 PM
springerm marked 4 inline comments as done.Apr 6 2023, 7:36 PM
springerm added inline comments.
mlir/lib/Interfaces/ValueBoundsOpInterface.cpp
372

Yes, it will be added as part of D146356.

mlir/test/Dialect/Affine/value-bounds-reification.mlir
42

No, we still return the constant one. That's a limitation of the FlatLinearConstraints implementation. (There's a TODO in there.)

The constant attribute here just says that the computed bound must be a constant. If it is not specified, the computed bound may be constant or not constant.

This revision was landed with ongoing or failed builds.Apr 6 2023, 7:39 PM
This revision was automatically updated to reflect the committed changes.
springerm marked 2 inline comments as done.