Revise usage of const_struct
and const_array
to enhance codegen parity
#181
Labels
enhancement
New feature or request
clangir/clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp
Lines 694 to 712 in d5f6e2b
Note: This is indeed an interesting difference, if we forget about LLVM and think only about CIR for a moment, we're also not being uniform right now (my fault), given that const_struct attrs are used inline within cir.const and others are going through globals, at some point we need to migrate more.
Originally posted by @bcardosolopes in #171 (review)
I wonder if this approach is actually better than what clang does, given the lack of memcopy/globals being involved - OTOH we might be loosing uniquing from unnamed address tagged globals. Any thoughts @htyu ?
Originally posted by @bcardosolopes in #171 (comment)
An explicit assignment better supports later optimization passes than a memcpy does, which always requires an additional step of analysis. However from performance point of view an explicit assignment would be as less efficient as memcpy does, but I guess we can always push the conversion to memcpy to llvm.
Originally posted by @htyu in #171 (comment)
The text was updated successfully, but these errors were encountered: