-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[mlir][c-api] expose elideLargeResourceString #98050
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Expose `elideLargeResourceString` to the c api. This was done in the same way as `elideLargeElementsAttrs` is exposed. The docs were grabbed from the `elideLargeResourceString` method and forwarded here.
Thank you for submitting a Pull Request (PR) to the LLVM Project! This PR will be automatically labeled and the relevant teams will be If you wish to, you can add reviewers by using the "Reviewers" section on this page. If this is not working for you, it is probably because you do not have write If you have received no comments on your PR for a week, you can request a review If you have further questions, they may be answered by the LLVM GitHub User Guide. You can also ask questions in a comment on this PR, on the LLVM Discord or on the forums. |
@llvm/pr-subscribers-mlir Author: Brendan Hansknecht (bhansconnect) ChangesExpose Full diff: https://github.com/llvm/llvm-project/pull/98050.diff 2 Files Affected:
diff --git a/mlir/include/mlir-c/IR.h b/mlir/include/mlir-c/IR.h
index 694591fd99dc6..b8a6f08b15981 100644
--- a/mlir/include/mlir-c/IR.h
+++ b/mlir/include/mlir-c/IR.h
@@ -428,6 +428,14 @@ MLIR_CAPI_EXPORTED void
mlirOpPrintingFlagsElideLargeElementsAttrs(MlirOpPrintingFlags flags,
intptr_t largeElementLimit);
+/// Enables the elision of large resources strings by omitting them from the
+/// `dialect_resources` section. The `largeResourceLimit` is used to configure
+/// what is considered to be a "large" resource by providing an upper limit to
+/// the string size.
+MLIR_CAPI_EXPORTED void
+mlirOpPrintingFlagsElideLargeResourceString(MlirOpPrintingFlags flags,
+ intptr_t largeResourceLimit);
+
/// Enable or disable printing of debug information (based on `enable`). If
/// 'prettyForm' is set to true, debug information is printed in a more readable
/// 'pretty' form. Note: The IR generated with 'prettyForm' is not parsable.
diff --git a/mlir/lib/CAPI/IR/IR.cpp b/mlir/lib/CAPI/IR/IR.cpp
index 2edc311e2f85f..5eb531b70aee0 100644
--- a/mlir/lib/CAPI/IR/IR.cpp
+++ b/mlir/lib/CAPI/IR/IR.cpp
@@ -202,6 +202,11 @@ void mlirOpPrintingFlagsElideLargeElementsAttrs(MlirOpPrintingFlags flags,
unwrap(flags)->elideLargeElementsAttrs(largeElementLimit);
}
+void mlirOpPrintingFlagsElideLargeResourceString(MlirOpPrintingFlags flags,
+ intptr_t largeResourceLimit) {
+ unwrap(flags)->elideLargeResourceString(largeResourceLimit);
+}
+
void mlirOpPrintingFlagsEnableDebugInfo(MlirOpPrintingFlags flags, bool enable,
bool prettyForm) {
unwrap(flags)->enableDebugInfo(enable, /*prettyForm=*/prettyForm);
|
cc: @Mogball super minor mlir c-api PR that is convenient for some Modular debugging. |
@bhansconnect Congratulations on having your first Pull Request (PR) merged into the LLVM Project! Your changes will be combined with recent changes from other authors, then tested Please check whether problems have been caused by your change specifically, as How to do this, and the rest of the post-merge process, is covered in detail here. If your change does cause a problem, it may be reverted, or you can revert it yourself. If you don't get any reports, no action is required from you. Your changes are working as expected, well done! |
Expose
elideLargeResourceString
to the c api.This was done in the same way as
elideLargeElementsAttrs
is exposed.The docs were grabbed from the
elideLargeResourceString
method and forwarded here.