[Mlir-commits] [mlir] [MLIR] Added check for IsTerminator trait (PR #79317)

Matthias Springer llvmlistbot at llvm.org
Wed Jan 24 08:38:13 PST 2024


================
@@ -598,6 +598,10 @@ 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 because this terminator is associated with either a
----------------
matthias-springer wrote:

This comment does not really fit because other ops (that are not function ops and do not implement the region branch op interface) can also have terminators.

What happened to the test case before this change? Did the pass produce invalid IR that does not verify because the terminator is missing?


https://github.com/llvm/llvm-project/pull/79317


More information about the Mlir-commits mailing list