This is an archive of the discontinued LLVM Phabricator instance.

[mlir][ODS] Use c++ types for integer attributes of fixed width when possible.
ClosedPublic

Authored by rriddle on Aug 27 2020, 2:40 PM.

Details

Summary

Unsigned and Signless attributes use uintN_t and signed attributes use intN_t, where N is the fixed width. The 1-bit variants use bool.

Diff Detail

Event Timeline

rriddle created this revision.Aug 27 2020, 2:40 PM
rriddle requested review of this revision.Aug 27 2020, 2:40 PM
rriddle updated this revision to Diff 288460.Aug 27 2020, 2:43 PM

Fix accidental getSExtValue for unsigned

ftynse accepted this revision.Aug 31 2020, 12:31 AM
ftynse added inline comments.
mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
218

Can we just drop this? AFAICS, there are three users in this file, which do let verifier = alignmentVerifierCode;, which can be removed too.

mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp
918

Nit: this looks like a tab for some reason

This revision is now accepted and ready to land.Aug 31 2020, 12:31 AM
rriddle updated this revision to Diff 289275.Sep 1 2020, 1:32 PM
rriddle marked 2 inline comments as done.

Resolve comments

mehdi_amini added inline comments.Sep 1 2020, 8:14 PM
mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp
918

This is just how Phab indicates that it is only an indentation increase.

Very nice, thank you again for implementing this!