momchil-velikov wrote:

Another things that "works" is changing the codegen for `__builtin_bit_cast` 
(https://github.com/llvm/llvm-project/blob/32bc029be6265838833623fdd88cc665d5658dc7/clang/lib/CodeGen/CGExprScalar.cpp#L2295).
It stores a value with one type and loads it back with another type which is 
not handled by `mem2reg` 
(https://github.com/llvm/llvm-project/blob/32bc029be6265838833623fdd88cc665d5658dc7/llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp#L72)
Instead it could perform a load with the original type and then emit an LLVM IR 
`bitcast`, just like it does for "C-style" bitcast: 
https://github.com/llvm/llvm-project/blob/32bc029be6265838833623fdd88cc665d5658dc7/clang/lib/CodeGen/CGExprScalar.cpp#L2425


https://github.com/llvm/llvm-project/pull/121801
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to