llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
29.25k stars 12.07k forks source link

Missing `alias` support in `mlir::LLVM::GlobalOp` #115390

Open bcardosolopes opened 2 weeks ago

bcardosolopes commented 2 weeks ago

While working on ClangIR to LLVM lowering, we want to generate this kind of LLVM IR code:

@_ZN1BD1Ev = dso_local unnamed_addr alias void (ptr), ptr @_ZN1BD2Ev
@_ZN1CD2Ev = dso_local unnamed_addr alias void (ptr), ptr @_ZN1BD2Ev
@_ZN1CD1Ev = dso_local unnamed_addr alias void (ptr), ptr @_ZN1BD2Ev

define dso_local void @_ZN1BD2Ev(ptr noundef nonnull align 8 dereferenceable(9) %this) unnamed_addr #0 {

One of the reasons it's not possible it's because there's no support for alias (the other one will be filed in another issue)

llvmbot commented 2 weeks ago

@llvm/issue-subscribers-mlir-llvm

Author: Bruno Cardoso Lopes (bcardosolopes)

While working on ClangIR to LLVM lowering, we want to generate this kind of LLVM IR code: ``` @_ZN1BD1Ev = dso_local unnamed_addr alias void (ptr), ptr @_ZN1BD2Ev @_ZN1CD2Ev = dso_local unnamed_addr alias void (ptr), ptr @_ZN1BD2Ev @_ZN1CD1Ev = dso_local unnamed_addr alias void (ptr), ptr @_ZN1BD2Ev define dso_local void @_ZN1BD2Ev(ptr noundef nonnull align 8 dereferenceable(9) %this) unnamed_addr #0 { ``` One of the reasons it's not possible it's because there's no support for `alias` (the other one will be filed in another issue)
bcardosolopes commented 2 weeks ago

More ClangIR specific details in: https://github.com/llvm/clangir/issues/1065