This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Do not print back 0 alignment in LLVM dialect 'alloca' op
ClosedPublic

Authored by ftynse on Oct 26 2020, 11:21 AM.

Details

Summary

The alignment attribute in the 'alloca' op treats the '0' value as 'unset'.
When parsing the custom form of the 'alloca' op, ignore the alignment attribute
with if its value is '0' instead of actually creating it and producing a
slightly different textually yet equivalent semantically form in the output.

Diff Detail

Event Timeline

ftynse created this revision.Oct 26 2020, 11:21 AM
ftynse requested review of this revision.Oct 26 2020, 11:21 AM
rriddle accepted this revision.Oct 26 2020, 11:23 AM

Nice, was just looking for something like this.

mlir/include/mlir/IR/OperationSupport.h
261

nit: was erased

This revision is now accepted and ready to land.Oct 26 2020, 11:23 AM
ftynse updated this revision to Diff 300750.Oct 26 2020, 11:30 AM

Address review