-
Notifications
You must be signed in to change notification settings - Fork 204
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Backport to 16] [OpaquePointers] Adjust builtin variable tracking to support i8 geps. (#1892) #2060
[Backport to 16] [OpaquePointers] Adjust builtin variable tracking to support i8 geps. (#1892) #2060
Conversation
… support i8 geps. (KhronosGroup#1892) The existing logic for the replacement of builtin variables with calls to functions relies on relatively brittle tracking that is broken when opaque pointers is turned on, and will be even more thoroughly broken if/when typed geps are replaced with i8 geps or ptradd. This patch replaces that logic with a less brittle variant that is able to handle any sequence of bitcast, gep, or addrspacecast instructions between the global variable and the ultimate load instruction. It still will error out if the variable is used in too insane of a fashion (say, trying to load an i32 out of the i64, or a misaligned vector type).
Just wanted to point out that I saw something similar still being bitcasted on printf. Not sure if this should also get addressed as it is generally useful for implementations to know what variable a printf call refers to. But I think it's also simple to support in implementations and just look behind the cast.
and that gets turned into something like this:
|
Same happens with the usage of |
restarting CI |
The existing logic for the replacement of builtin variables with calls to
functions relies on relatively brittle tracking that is broken when opaque
pointers is turned on, and will be even more thoroughly broken if/when typed
geps are replaced with i8 geps or ptradd. This patch replaces that logic with a
less brittle variant that is able to handle any sequence of bitcast, gep, or
addrspacecast instructions between the global variable and the ultimate load
instruction.
It still will error out if the variable is used in too insane of a fashion (say,
trying to load an i32 out of the i64, or a misaligned vector type).