[MLIR] Harden gpu.func verification
authorChristian Sigg <csigg@google.com>
Tue, 23 Aug 2022 10:45:49 +0000 (12:45 +0200)
committerChristian Sigg <csigg@google.com>
Tue, 23 Aug 2022 12:58:46 +0000 (14:58 +0200)
commit50c33a3a9cb654cd659e134a90a3242e9544eba5
treefa3a3fd32b969865c1160d3f377145d28bdb4cd1
parentbf062954364d69e0fb8e3e04ef3a65c432e8bd50
[MLIR] Harden gpu.func verification

GPUFuncOpLowering moves the body out of gpu.func op and erases it. An empty gpu.func may fail verification but should not crash it. Verification of an erased op is triggered e.g. with debug printing on.

Reviewed By: akuegel

Differential Revision: https://reviews.llvm.org/D132446
mlir/lib/Dialect/GPU/IR/GPUDialect.cpp
mlir/test/Dialect/GPU/invalid.mlir