I am improving the support of arm(aarch64) mods in the stdarch project. There are currently 500+ arm instructions being blocked due to the issue about llvm IR. We should have a way to generate Struct type llvm IR without paddings.
I studied the mechanism of generating llvm IR in rustc. At present, the compiler will automatically add paddings when generating a Struct type llvm IR.(in this fuction)
I can think of two ways to tell the compiler not to add paddings: (1) Extend the #[repr] attribute, such as #[repr(no_padding)] (2) Add a new attribute separately. Either of them should be unstable, since I cannot think of a reliable method to ensure the safety of IR. I can do the corresponding implementation, if agreed.
May I have some suggestion here and wether it may be necessary to submit an rfc?