Skip to content

[Umbrella] ThroughMLIR path status #1411

Closed
@wenhu1024

Description

@wenhu1024

Issue Description

Encountered an error when using ClangIR through the MLIR to LLVMIR path. The direct path from CIR to LLVMIR works correctly, but the path through MLIR fails. Is there a plan in the ClangIR project to support the complete pathway from CIR through MLIR to LLVM IR for generating executable files?

Steps to Reproduce

  1. Using this simple code:
#include <stdio.h>

int main(){
    printf("hello\n");
    return 0;
}
  1. Using CIR direct to LLVMIR path (works correctly):
../bin/clang -fclangir -fclangir-direct-lowering hello.c -o hello

Execution result:

./hello
hello
  1. Using CIR through MLIR to LLVMIR path (fails):
../bin/clang -fclangir -fno-clangir-direct-lowering hello.c -o hello

Error message:

loc(fused["/usr/include/stdio.h":363:1, "/usr/include/stdio.h":363:56]): error: 'func.func' op symbol declaration cannot have public visibility
fatal error: error in backend: The pass manager failed to lower CIR to LLVMIR dialect!
clang: error: clang frontend command failed with exit code 70 (use -v to see invocation)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions