Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing Function and Call attributes #1039

Open
ghehg opened this issue Nov 1, 2024 · 0 comments
Open

Missing Function and Call attributes #1039

ghehg opened this issue Nov 1, 2024 · 0 comments
Labels
IR difference A difference in ClangIR-generated LLVM IR that could complicate reusing original CodeGen tests

Comments

@ghehg
Copy link
Collaborator

ghehg commented Nov 1, 2024

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

@ghehg ghehg added the IR difference A difference in ClangIR-generated LLVM IR that could complicate reusing original CodeGen tests label Nov 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
IR difference A difference in ClangIR-generated LLVM IR that could complicate reusing original CodeGen tests
Projects
None yet
Development

No branches or pull requests

1 participant