Issue 148100
Summary Loss of Element Type in Opaque Pointer: Difficulty Handling Precise Type Transformations in LLVM 17
Labels new issue
Assignees
Reporter Gunse11er
    Starting from LLVM 15, opaque pointers are the default, and PointerType::getElementType() has been removed. While this simplifies the type system, it presents a practical challenge in transformation passes that need to understand or modify the element type a pointer was originally pointing to.

I’m currently developing a mixed-precision transformation pass in LLVM 17. As part of this, I need to change the type of floating-point variables (e.g., from double to float) and update all relevant IR instructions accordingly. This includes loads, stores, GEPs, and call arguments. In many cases, I rely on debug metadata (DWARF/DIType) or static analysis to recover the original element type. However, LLVM’s opaque pointer system makes it impossible to reliably recover the pointee type for intermediate values that are the result of transformations (e.g., after a load or GEP).
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to