This is an archive of the discontinued LLVM Phabricator instance.

Update the maximum integer bitwidth in MLIR.
ClosedPublic

Authored by darthscsi on Jan 5 2021, 1:16 PM.

Details

Summary

Large integers are generated in Circt commonly which exceed 4kbits. This aligns the maximum bitwidth in MLIR and LLVM.

Diff Detail

Event Timeline

darthscsi created this revision.Jan 5 2021, 1:16 PM
darthscsi requested review of this revision.Jan 5 2021, 1:16 PM
rriddle added inline comments.Jan 5 2021, 1:17 PM
mlir/include/mlir/IR/BuiltinTypes.h
142

How did you come up with this number?

LLVM uses "MAX_INT_BITS = (1<<24)-1". Unless there is a reason to be different, it would probably be good to align with that.

darthscsi updated this revision to Diff 314902.Jan 6 2021, 8:03 AM

Align with llvm

Nit: on review description, this is updating the maximum _bitwidth_ of integer types, not maximum integer size (i4096 can represent integers up to 1.04e+1233)

mehdi_amini accepted this revision.Jan 6 2021, 3:21 PM
mehdi_amini added inline comments.
mlir/include/mlir/IR/BuiltinTypes.h
142

Can you just also document that this is aligned with LLVM?

This revision is now accepted and ready to land.Jan 6 2021, 3:21 PM
lattner accepted this revision.Jan 6 2021, 5:16 PM

Nice, thanks darthscsi

bondhugula requested changes to this revision.EditedJan 6 2021, 6:14 PM
bondhugula added a subscriber: bondhugula.

Can you please add a proper commit summary with the rationale (basically whatever is in the discussion now)? Also, as @jpienaar points out, the commit title isn't really accurate.

This revision now requires changes to proceed.Jan 6 2021, 6:14 PM
darthscsi updated this revision to Diff 315213.Jan 7 2021, 12:43 PM
darthscsi marked an inline comment as done.

Update the maximum integer bitwidth in MLIR.

Large integers are generated in Circt commonly which exceed 4k. This aligns MLIR's width to llvm.

darthscsi retitled this revision from Update the maximum integer size in MLIR. Large integers are generated in Circt commonly which exceed 4k. to Update the maximum integer bitwidth in MLIR. .Jan 7 2021, 12:45 PM
darthscsi edited the summary of this revision. (Show Details)
rriddle accepted this revision.Jan 8 2021, 12:31 PM
rriddle added inline comments.
mlir/include/mlir/IR/BuiltinTypes.h
142
This revision was not accepted when it landed; it landed in state Needs Review.Jan 8 2021, 3:29 PM
This revision was automatically updated to reflect the committed changes.
darthscsi marked an inline comment as done.