krzysz00 wrote: Ok, no, I worked out part of the issue. The reason `canonicalize` is deleting your gpu.launch body is because it doesn't *do* anything. You need to, for example, store that vector in a memref https://github.com/llvm/llvm-project/pull/123904