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

Empty union in initialized with undef values in OG and with zeroinitializer in CIR #1272

Open
bcardosolopes opened this issue Jan 9, 2025 · 0 comments
Labels
IR difference A difference in ClangIR-generated LLVM IR that could complicate reusing original CodeGen tests

Comments

@bcardosolopes
Copy link
Member

There are some differences from the OG LLVM for unions for C++ code...

The empty union in initialized with undef values in OG and with zeroinitializer in CIR:

union U { int a; long long b;};
union U u = {};
// OG
@u = dso_local global { i32, [4 x i8] } { i32 0, [4 x i8] undef }, align 8

// CIR enabled
@u = global { i32, [4 x i8] } zeroinitializer, align  8

This is a difference - and soon or later we may want to fix it.

Originally posted by @gitoleg in #1257 (comment)

@bcardosolopes bcardosolopes added the IR difference A difference in ClangIR-generated LLVM IR that could complicate reusing original CodeGen tests label Jan 9, 2025
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