Skip to content

Conversation

@seven-mile
Copy link
Collaborator

@seven-mile seven-mile commented Nov 10, 2024

Following #1009 and #1028, this PR removes the double white spaces in the assembly format of cir.global op.

It's basically some mlir-tablegen-builtin magic: With constBuilderCall specified, we can apply DefaultValuedAttr with any default value we can construct from constant values. Then we can easily omit the default in assembly. Hence, we don't need to compromise anything for the wrapper attribute cir::VisibilityAttr.

Similarly to #1009, an empty literal `` is used to omit the leading space emitted by inner attribute.

The test case visibility-attribute.c is modified to save the intermediate CIR to disk and reflect the effects.

Double whitespaces in other test files are removed.

Copy link
Member

@bcardosolopes bcardosolopes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you a bunch, this is great!

@bcardosolopes bcardosolopes merged commit e53464f into llvm:main Nov 11, 2024
6 checks passed
lanza pushed a commit that referenced this pull request Mar 18, 2025
…1096)

Following #1009 and #1028, this PR removes the double white spaces in
the assembly format of `cir.global` op.

It's basically some `mlir-tablegen`-builtin magic: With
`constBuilderCall` specified, we can apply `DefaultValuedAttr` with any
default value we can construct from constant values. Then we can easily
omit the default in assembly. Hence, we don't need to compromise
anything for the wrapper attribute `cir::VisibilityAttr`.

Similarly to #1009, an empty literal ``` `` ``` is used to omit the
leading space emitted by inner attribute.

The test case `visibility-attribute.c` is modified to save the
intermediate CIR to disk and reflect the effects.

Double whitespaces in other test files are removed.
terapines-osc-cir pushed a commit to Terapines/clangir that referenced this pull request Sep 2, 2025
…lvm#1096)

Following llvm#1009 and llvm#1028, this PR removes the double white spaces in
the assembly format of `cir.global` op.

It's basically some `mlir-tablegen`-builtin magic: With
`constBuilderCall` specified, we can apply `DefaultValuedAttr` with any
default value we can construct from constant values. Then we can easily
omit the default in assembly. Hence, we don't need to compromise
anything for the wrapper attribute `cir::VisibilityAttr`.

Similarly to llvm#1009, an empty literal ``` `` ``` is used to omit the
leading space emitted by inner attribute.

The test case `visibility-attribute.c` is modified to save the
intermediate CIR to disk and reflect the effects.

Double whitespaces in other test files are removed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants