Skip to content

P4HIR: Add verifySymbolUses for TableActionOp#318

Open
Lavanya-Malakalapalli wants to merge 1 commit intop4lang:mainfrom
Lavanya-Malakalapalli:table-action-symbol-uses
Open

P4HIR: Add verifySymbolUses for TableActionOp#318
Lavanya-Malakalapalli wants to merge 1 commit intop4lang:mainfrom
Lavanya-Malakalapalli:table-action-symbol-uses

Conversation

@Lavanya-Malakalapalli
Copy link
Copy Markdown

TableActionOp had SymbolUserOpInterface commented out, which meant
the DCE pass had no way to see that a table_actions block was
referencing an action. So even live actions were getting dropped.

Uncommented the interface and added verifySymbolUses(). The tricky
part was figuring out why the InlineControls tests broke -- turns out
After inlining, the action= attribute still holds the original short
name (@A1), but the FuncOp itself got renamed to something like
@d::@cinst2.a1. So looking it up hard-fails post-inlining.

Made the check soft -- if the symbol resolves, we validate it; if not
we just skip it. At that point, the action= attr is really just a
control-plane label anyway.

All 169 tests passed.
image

Signed-off-by: Lavanyampalli <lavanyampalli@gmail.com>
if (!actionAttr)
return emitOpError("requires an 'action' symbol reference attribute");

// The action attribute is the control-plane name. After inlining it may
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We should never inline action calls into table_action op. This is merely a marker. So, if this happens, then we do have the problem elsewhere.

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.

2 participants