This explanation is a bit confusing to me. SPIR-V spec allows variables to have initializers; it's the Vulkan spec requires WorkgroupSize to be decorated onto constants. What about using the following:
... This is separate because in Vulkan workgroup size is exposed to shaders via a constant with WorkgroupSize decoration. So here we cannot generate a builtin variable; instead the infromation ...
Nit: getLaunchConfigIndex ? This actually does not check what the op is; it's just querying the launch configuration index.
Sort these alphabetically
Let's add some notes here to explain where this magic number comes from.
I think we should either require that the gpu.launch has the same constant argument than what the SPIR-V lowering uses or update the description of the operation to state that the provided dimensions are just guidelines.
I do not understand where the need to pass the workgroup size comes from. Wouldn't it be sufficient to require that the arguments to the launch are constants? The pass that constructs the launch and earlier passes that do the tiling need to know this value anyway. So they could manifest them in IR as constant arguments to launch.
Maybe use a constant other than 1 here to differentiate from the default.