This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Silence GCC warnings
ClosedPublic

Authored by dcaballe on Feb 2 2021, 4:19 PM.

Details

Summary

One question below. Sorry to bother you about this nit. :)

Diff Detail

Event Timeline

dcaballe created this revision.Feb 2 2021, 4:19 PM
dcaballe requested review of this revision.Feb 2 2021, 4:19 PM
dcaballe added inline comments.Feb 2 2021, 4:20 PM
mlir/lib/Dialect/SPIRV/IR/SPIRVTypes.cpp
328 ↗(On Diff #320943)

Any idea how we can silence these warnings? I'm seeing quite a few here and in TypeDetail.h. Mostly for all the bitfields. I think the problem is that the underlying type of the enums is int by default so we could assign random int values to the enum variables which would require more bits than the specified by the bitfield.

I think this is a problem with old versions of GCC, I see these with gcc5 but not gcc7 and above.

I think this is a problem with old versions of GCC, I see these with gcc5 but not gcc7 and above.

I'm using GCC 7.5.0. Ok, if those bitfields are not problematic and there is no easy way to silence them, I'll remove the comments then.

I think this is a problem with old versions of GCC, I see these with gcc5 but not gcc7 and above.

I'm using GCC 7.5.0. Ok, if those bitfields are not problematic and there is no easy way to silence them, I'll remove the comments then.

Ah maybe it is only gcc 8 and above then, here is our CI log with gcc8 : https://buildkite.com/organizations/mlir/pipelines/mlir-core/builds/11292/jobs/e2dcad00-1ff4-4abd-ac86-d68668fcc673/raw_log

dcaballe updated this revision to Diff 321177.Feb 3 2021, 11:44 AM

Removing "warning" comments.
If no more comments, I'll commit this since it's a trivial change.
Thanks!

rriddle accepted this revision.Feb 3 2021, 11:50 AM
rriddle added inline comments.
mlir/lib/Dialect/Affine/Transforms/SuperVectorize.cpp
1339

It honestly looks like this function should just return a result, and uses of it should assert that it returns success.

This revision is now accepted and ready to land.Feb 3 2021, 11:50 AM
dcaballe updated this revision to Diff 321188.Feb 3 2021, 12:24 PM

Addressing River's feedback.
Thanks, River! It makes more sense to return a result.

mehdi_amini accepted this revision.Feb 3 2021, 12:26 PM

Thanks for the cleanup :)

This revision was landed with ongoing or failed builds.Feb 4 2021, 10:55 AM
This revision was automatically updated to reflect the committed changes.