[Mlir-commits] [mlir] [MLIR] Added check for IsTerminator trait (PR #79317)
Dmitriy Smirnov
llvmlistbot at llvm.org
Wed Jan 24 13:45:01 PST 2024
================
@@ -598,6 +598,9 @@ void RemoveDeadValues::runOnOperation() {
// Nothing to do because this terminator is associated with either a
// function op or a region branch op and gets cleaned when these ops are
// cleaned.
+ } else if (op->hasTrait<::mlir::OpTrait::IsTerminator>()) {
+ // Nothing to do here because this a terminator op and it should be
+ // honored with respect to its parent
----------------
d-smirnov wrote:
The check seems completely relevant for gpu.termnator op as it [declared](https://github.com/llvm/llvm-project/blob/72ce6294157964042b7ed5576ce2c99257eeea9d/mlir/include/mlir/Dialect/GPU/IR/GPUOps.td#L952) as:
> 952 def GPU_TerminatorOp : GPU_Op<"terminator", [HasParent<"LaunchOp">,
> 953 Pure, Terminator]>,
> 954 Arguments<(ins)>, Results<(outs)> {
>
Same for gpu.return op
https://github.com/llvm/llvm-project/pull/79317
More information about the Mlir-commits
mailing list