xls
xls copied to clipboard
[enhancement] Validator that checks no nodes are dead out of the DSLX frontend IR conversion
What's hard to do? (limit 100 words)
We noticed there are sometimes literals that are there for unclear reasons, e.g. literal.3 here:
top proc __test_module__P_0_next(__token: token, __state: bits[32], init={42}) {
literal.5: bits[32] = literal(value=1, id=5)
send.4: token = send(__token, __state, channel=test_module__s, id=4)
literal.3: bits[1] = literal(value=1, id=3)
new_state: bits[32] = add(__state, literal.5, id=6)
after_all.7: token = after_all(__token, send.4, id=7)
next (after_all.7, new_state)
}
It suggests maybe we could have a validator after IR conversion that checked there weren't dead non-side-effecting nodes just to make sure our DSLX-to-IR converter is spitting out IR without lots of junk in it.
Current best alternative workaround (limit 100 words)
Just living with the junk nodes, they'll get DCE'd anyway.
Your view of the "best case XLS enhancement" (limit 100 words)
We add the validator as described and fix up any code paths that flag validation issues.