-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[mlir][ods] Enable basic string interpolation in constraint summary. #153603
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
Changes from 4 commits
904e1fd
f51414d
83da7e2
a41b032
ebb3987
8d8d2eb
1e88105
9339056
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,7 +16,7 @@ def AType : Type<ATypePred, "a type">; | |
| def OtherType : Type<ATypePred, "another type">; | ||
|
|
||
| def AnAttrPred : CPred<"attrPred($_self, $_op)">; | ||
| def AnAttr : Attr<AnAttrPred, "an attribute">; | ||
| def AnAttr : Attr<AnAttrPred, "an attribute (got {{reformat($_self)}})">; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We're missing an equivalent test for the op case I think?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure I follow, this is used by an attribute constraint for an op (e.g., this is via OpDefinitionsGen invocation of CodeGenHelper).
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm trying to see the result of
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The tests here show that (both forms are used and CHECK'd in the constraints file), but I think you also wanted to see an interpolation one for both kinds. Added and removed the unit test.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks! The change around the |
||
| def OtherAttr : Attr<AnAttrPred, "another attribute">; | ||
|
|
||
| def ASuccessorPred : CPred<"successorPred($_self, $_op)">; | ||
|
|
@@ -71,10 +71,10 @@ def OpC : NS_Op<"op_c"> { | |
| // CHECK: static ::llvm::LogicalResult [[$A_ATTR_CONSTRAINT:__mlir_ods_local_attr_constraint.*]]( | ||
| // CHECK: if (attr && !((attrPred(attr, *op)))) | ||
| // CHECK-NEXT: return emitError() << "attribute '" << attrName | ||
| // CHECK-NEXT: << "' failed to satisfy constraint: an attribute"; | ||
| // CHECK-NEXT: << "' failed to satisfy constraint: an attribute (got " << reformat(attr) << ")"; | ||
|
|
||
| /// Test that duplicate attribute constraint was not generated. | ||
| // CHECK-NOT: << "' failed to satisfy constraint: an attribute"; | ||
| // CHECK-NOT: << "' failed to satisfy constraint: an attribute | ||
|
|
||
| /// Test that a attribute constraint with a different description was generated. | ||
| // CHECK: static ::llvm::LogicalResult [[$O_ATTR_CONSTRAINT:__mlir_ods_local_attr_constraint.*]]( | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.