Skip to content

Conversation

@tgymnich
Copy link
Contributor

@tgymnich tgymnich commented Dec 30, 2025

  • introduce NormalForm Dialect with a NormalForm module and a NormalFormAttrInterface

Copy link
Contributor

@ftynse ftynse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not for this PR, but we will likely want this op in a separate dialect, working towards generalization of normal forms.

cc @fabianmcg

@fabianmcg
Copy link

fabianmcg commented Dec 31, 2025

Nice! Thanks @ftynse for the pointer!

We realized we couldn't continue without some version of them, so we also took a stab at implementing them. Putting here our relevant files. We should likely sync at some point.

I used VerifierAttr instead of normal form because if I remember correctly, Alex's definition at LLVM dev is more general.

@tgymnich tgymnich force-pushed the tim/generalize-normal-forms branch 2 times, most recently from b6a58bd to 06e7dba Compare January 6, 2026 21:28
@tgymnich tgymnich changed the title [water] Wave Module [water] NormalForm Module Jan 6, 2026
Comment on lines 97 to 100
if (emitRemark)
return mlir::emitRemark(loc);

return mlir::emitError(loc);
Copy link
Contributor Author

@tgymnich tgymnich Jan 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pass nullstream if we don't want errors. Remarks should already not be emitted by default??? Or call abandon on inflight diagnostic

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IDK if we can create an InFlightDiagnostic that will not actually emit anything if so, we can try that. Otherwise, we can (rather heavily) have a wrapper class that holds an optional InFlightDiagnostic and has the same API so it's transparent to the caller. Another heavy-ish solution is to register a diagnostic handler that discards all errors before the interface method call and unregister it immediately after, though we may potentially discard some errors that are not specific to the interface method.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like we can just abandon the diagnostic before returning it to the verifier.

@tgymnich tgymnich linked an issue Jan 7, 2026 that may be closed by this pull request
@tgymnich tgymnich force-pushed the tim/generalize-normal-forms branch from 8219fb4 to 58a9d7e Compare January 7, 2026 12:15
@ftynse
Copy link
Contributor

ftynse commented Jan 7, 2026

I used VerifierAttr instead of normal form because if I remember correctly, Alex's definition at LLVM dev is more general.

The talk was more of an overall vision, we don't have to implement all of that. The dependencies between verifiers are a nice idea. What I also want here is a way to control error emission, so we can "discover" which forms are present without reporting errors, for example.

Signed-off-by: Tim Gymnich <[email protected]>
Signed-off-by: Tim Gymnich <[email protected]>
Signed-off-by: Tim Gymnich <[email protected]>
Signed-off-by: Tim Gymnich <[email protected]>
@tgymnich tgymnich force-pushed the tim/generalize-normal-forms branch from e3c6e37 to 21c2c40 Compare January 8, 2026 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

revisit and generalize normal forms

4 participants