Skip to content

Missing Function and Call attributes  #1039

@ghehg

Description

@ghehg

CIR Codegen are missing function and call site attributes such as noalias, noundef, nonnull
example code

void test_basic() {
  __builtin_operator_delete(__builtin_operator_new(4));
}

Traditional clang (OG) generated code: like

 %call = call noalias noundef nonnull ptr @_Znwm(i64 noundef 4)
...
declare noundef nonnull ptr @_Znwm(i64 noundef)

Currently, CIR generates code like:

%1 = call ptr @_Znwm(i64 4)

declare !dbg !3 ptr @_Znwm(i64)

The difference may come from the fact [CIRGenModule::constructAttributeList] not finished (

void CIRGenModule::constructAttributeList(StringRef Name,
)
comparing to OG CodeGenModule::ConstructAttributeList

Metadata

Metadata

Assignees

No one assigned

    Labels

    IR differenceA difference in ClangIR-generated LLVM IR that could complicate reusing original CodeGen tests

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions