This is an archive of the discontinued LLVM Phabricator instance.

[mlir][NFC] Fix various warnings generated by GCC 9
ClosedPublic

Authored by unterumarmung on Jul 1 2022, 7:16 AM.

Details

Summary

Currently, there've been a lot of warnings while building MLIR.
This change fixes the warnings listed below.

.../SparseTensorUtils.cpp: In instantiation of ‘...::openSparseTensorCOO(...) [with ...]’:
.../SparseTensorUtils.cpp:1672:3:   required from here
.../SparseTensorUtils.cpp:87:21: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘PrimaryType’ [-Wformat=]

.../OptUtils.cpp:36:5: warning: this statement may fall through [-Wimplicit-fallthrough=]

.../AffineOps.cpp:1741:32: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses]

Diff Detail

Event Timeline

unterumarmung created this revision.Jul 1 2022, 7:16 AM
Herald added a project: Restricted Project. · View Herald Transcript
unterumarmung requested review of this revision.Jul 1 2022, 7:16 AM
Mogball added inline comments.Jul 1 2022, 8:19 AM
mlir/lib/ExecutionEngine/OptUtils.cpp
46

Should this be fall through?

unterumarmung added inline comments.Jul 1 2022, 9:35 AM
mlir/lib/ExecutionEngine/OptUtils.cpp
46

I'm not sure. @aeubanks is the author for this code, I think they know it better. If it should fall through, I'll change the code appropriately.
Currently, the only possible value of sizeLevel variable is 0. So at the current state of the codebase the change doesn't change behavior, but may affect it in the future.

aeubanks added inline comments.Jul 1 2022, 9:37 AM
mlir/lib/ExecutionEngine/OptUtils.cpp
46

yes the break should be there, we shouldn't be returning O3 when we have optLevel == 2

aeubanks accepted this revision.Jul 1 2022, 9:38 AM
This revision is now accepted and ready to land.Jul 1 2022, 9:38 AM
aartbik accepted this revision.Jul 1 2022, 9:55 AM
wrengr accepted this revision.Jul 1 2022, 11:09 AM
This revision was automatically updated to reflect the committed changes.