This is an archive of the discontinued LLVM Phabricator instance.

Make ConstantOp::getAsmResultNames() handle signfull constants

Authored by frej on Mar 16 2020, 7:02 AM.



Since IntegerAttr::getInt() was updated in
35b685270b410f6a1351c2a527021f22330c25b9 to only apply to signless
integers, trying to round trip an explicitly signed/unsigned constant
through mlir-opt has triggered an assert when
ConstantOp::getAsmResultNames() calls IntegerAttr::getInt().

This patch extends ConstantOp::getAsmResultNames() to deal with
signfull integers.

Diff Detail

Unit TestsFailed

Event Timeline

frej created this revision.Mar 16 2020, 7:02 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 16 2020, 7:02 AM
frej edited the summary of this revision. (Show Details)Mar 16 2020, 7:03 AM
frej edited the summary of this revision. (Show Details)
antiagainst accepted this revision.Mar 16 2020, 5:38 PM

LGTM. Thanks for the fix!

This revision is now accepted and ready to land.Mar 16 2020, 5:38 PM
rriddle requested changes to this revision.EditedMar 16 2020, 6:15 PM

Thanks for the patch! Unfortunately ATM, the standard dialect does not intend to support non-signless integers.

This revision now requires changes to proceed.Mar 16 2020, 6:15 PM
frej abandoned this revision.Oct 21 2020, 3:46 AM

Superseded by D76493