This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Fix generating checks for multiple funcs in generate-test-checks
ClosedPublic

Authored by benmxwl-arm on Jul 28 2023, 8:07 AM.

Details

Summary

This regressed in D154458 due to the added tracking of used variable
names that now also has to be cleared alongside the counter.

Diff Detail

Event Timeline

benmxwl-arm created this revision.Jul 28 2023, 8:07 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 28 2023, 8:07 AM
benmxwl-arm requested review of this revision.Jul 28 2023, 8:07 AM
c-rhodes accepted this revision.Jul 31 2023, 9:55 AM

LGTM cheers

This revision is now accepted and ready to land.Jul 31 2023, 9:55 AM
awarzynski accepted this revision.Jul 31 2023, 10:54 AM

This makes sense to me, but it would make even more sense if I saw an example of what triggers the issue and how it manifests itself ;-) That's only a nice-to-have.

LGTM, ta!

The issue is a simple one :)
Pass some MLIR with multiple functions to generate-test-checks.py and it'll (incorrectly) throw "VAL_0: duplicate variable name".

func.func @func_a(...) {
 // SSA values in here.
 // The script names them VAL_0, 1, 2, 3 etc..
} 
// End of function: clear counter, but forget to clear used_attribute_names.

func.func @func_b(...) {
 // More SSA values in here.
 // Since counter is at zero VAL_0 is used again, but VAL_0 is still in used_attribute_names.
 // Erroneously throw "duplicate variable name"
}
rafaelubalmw accepted this revision.Jul 31 2023, 11:46 AM