This is an archive of the discontinued LLVM Phabricator instance.

[mlir][ods] Remove warning in `AttrOrTypeDef`
ClosedPublic

Authored by Mogball on Jul 19 2022, 10:26 AM.

Details

Summary

This warning was added because using attribute or type assembly formats
with skipDefaultBuilders set could cause compilation errors, since the
required builder prototype may not necessarily be generated and would
need to be checked by hand. This patch removes the warning because a
warning that the generated C++ "might" not compile is not particularly
useful. Attempting to address the TODO (i.e. detect whether a builder of
the correct prototype is provided) would be fragile since it would not
be possible to account for implicit conversions, etc.

In general, ODS should not be emitting warnings in cases like these.

Diff Detail

Event Timeline

Mogball created this revision.Jul 19 2022, 10:26 AM
Mogball requested review of this revision.Jul 19 2022, 10:26 AM
Mogball retitled this revision from [mlir][ods] (NFC) Remove warning in `AttrOrTypeDef` to [mlir][ods] Remove warning in `AttrOrTypeDef`.Jul 19 2022, 10:27 AM

Definitely agree we are getting a lot of false positives right now, which is moving the warning more into the "not helpful" territory. Do we have an idea of how many of these would go away after https://reviews.llvm.org/D129243 ? @wrengr Do you have any updates there?

Definitely agree we are getting a lot of false positives right now, which is moving the warning more into the "not helpful" territory. Do we have an idea of how many of these would go away after https://reviews.llvm.org/D129243 ? @wrengr Do you have any updates there?

I do have some updates for D129243. Unfortunately, I'm running into issues that are turning it into a rabbithole (even without doing anything more sophisticated re string matching). I'll give a more thorough discussion on that differential when I post the update later today.

Are there any false positives within the monorepo itself, or are they all in downstream repos? I didn't see any in the monorepo (else I wouldn't've landed the previous change), but I could've missed it. If they're in downstream repos, then yeah it'd be helpful to know if (the later-today version of) D129243 would be sufficient.

For the time being, I think it's fine to land this differential, though I'd like to retain a comment referring to https://github.com/llvm/llvm-project/issues/56415 so that readers have a guidepost for debugging and know where to go for further discussion/design

Are there any false positives within the monorepo itself, or are they all in downstream repos? I didn't see any in the monorepo (else I wouldn't've landed the previous change), but I could've missed it. If they're in downstream repos, then yeah it'd be helpful to know if (the later-today version of) D129243 would be sufficient.

There's one in the monorepo (TestDialect) and there are a few downstream.

Mogball updated this revision to Diff 445915.Jul 19 2022, 12:59 PM

Add a reference to the git issue

rriddle accepted this revision.Jul 19 2022, 1:01 PM
rriddle added inline comments.
mlir/lib/TableGen/AttrOrTypeDef.cpp
94
This revision is now accepted and ready to land.Jul 19 2022, 1:01 PM
Mogball updated this revision to Diff 445919.Jul 19 2022, 1:02 PM
Mogball marked an inline comment as done.

Review comments

mlir/lib/TableGen/AttrOrTypeDef.cpp
94

Nice! didn't know about this.

wrengr accepted this revision.Jul 19 2022, 4:06 PM
wrengr added inline comments.
mlir/lib/TableGen/AttrOrTypeDef.cpp
94

ooh, very nice :)

There's one in the monorepo (TestDialect) and there are a few downstream.

What's the incantation to see this? When I run CMake, it doesn't seem to dump the warnings anywhere I can find...

This revision was automatically updated to reflect the committed changes.