Skip to content

Lowering of GlobalOp ignores attributes #1442

Closed
@AdUhTkJm

Description

@AdUhTkJm

Consider the following global variable:

cir.global @x = #cir.const_struct<{
  #cir.int<1> : !s32i,
}> : !ty_anon_struct {section = ".abc"}

On lowering, the {section = ".abc"} attribute is ignored. That is because in LoweringToLLVM.cpp, the function CIRToLLVMGlobalOpLowering::matchAndRewrite can exit prematurely before the variable attributes is used at the end of the function.

I'm not sure how to fix it -- I tried removing those early returns, but it won't work and results in a crash.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions