GPGPU: Optimize kernel IR before generating assembly code