Skip to content

LLVM: support parsing omitted !llvm. prefix when nested #952

Description

@GZGavinZhao

Context

LLVM dialect has a custom directive PrettyLLVMType that allows one to write types from the LLVM dialect without !llvm. prefix when it's already nested inside another LLVM-dialect type. For example, !llvm.array<2 x struct<...>> is the same as !llvm.array<2 x !llvm.struct<...>>.

This convenience syntax is only available for types wrapped inside the PrettyLLVMType custom directive. In practice, this convenience syntax is available wherever a nested type is allowed, so in VeIR, we just always allow it when we know we're parsing inside a !llvm. type.

Status

Since PrettyLLVMType applies to all types from the LLVM dialect, parseLLVMType needs to handle the shorthand form for all 10 types:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions