I would like to make some modifications to the layout of the structure in lto, such as Dead Field Elimination and Field Reorder.
But llvm16 only supports opaque pointers, which makes it difficult to find the following information:
- Where are structures and their pointers or arrays defined and used.
- Whether the struct and its pointer or array are cast.
- Whether the structure and its pointers or arrays escaped outside the current compilation unit.
My current thinking is to recompute the ptr type via the getelementptr instruction.
Is there a better suggestion for these situations?