This is an archive of the discontinued LLVM Phabricator instance.

[WIP] Add custom nested list option parser (do not commit).
AbandonedPublic

Authored by gysit on Jan 28 2022, 1:41 AM.

Details

Diff Detail

Event Timeline

gysit created this revision.Jan 28 2022, 1:41 AM
gysit requested review of this revision.Jan 28 2022, 1:41 AM
rriddle added inline comments.Jan 31 2022, 1:30 AM
mlir/include/mlir/Dialect/Linalg/Utils/Utils.h
40

Why can't the input format be [[1,2,3],[3,4],[0,1]]? Why the need for _?

gysit added inline comments.Jan 31 2022, 2:03 AM
mlir/include/mlir/Dialect/Linalg/Utils/Utils.h
40

Yeah I would prefer your notation. I did not do it in this attempt since ListOption splits the input string at every , . That means the nested lists would be split as well and InnerListOptionParser would get "[[1", "2", "3]", "[3", "4]" ... instead of "1_2_3", "3_4" ...

I think having a proper nested angular bracket notation would require a custom ListOfListOption instead of just extending ListOption, which may be the better solution anyways. The parser would then need to match opening and closing angular brackets to identify the nested lists.

rriddle added inline comments.Feb 8 2022, 12:15 AM
mlir/include/mlir/Dialect/Linalg/Utils/Utils.h
40

Hmmm, that is quite annoying. Do you know where in the code this is coming from? We could just look into refactoring this to support what we want, even if we have to diverge from llvm::cl.

gysit added inline comments.Feb 8 2022, 1:41 AM
mlir/include/mlir/Dialect/Linalg/Utils/Utils.h
40
gysit abandoned this revision.Feb 21 2022, 2:26 AM