You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[SYCL][NVPTX] Optimize ID queries when they fit in int (#18999)
The NVPTX target was unable to properly optimize the global ID query,
despite the user specifying the -fsycl-id-queries-fit-in-int flag.
This is because, once linked, the compiler sees the global ID builtin as
(i64 add (mul (i64 zext i32 A), (i64 zext i32 B), (i64 zext i32 C))).
Despite knowing that each of A, B and C are 32-bit values, and the final
result fits in a 32-bit value, it is not legal to replace this sequence
with (i64 zext (add i32 (mul i32 A, B), C)), which is the ideal code
here.
The solution to this problem is a new opt-in 'reflection' in the NVPTX
implementation of the global ID builtin, which selects a more optimal
version. The driver enables this reflection only when the user passes
-fsycl-id-queries-fit-in-int.
0 commit comments