[Mlir-commits] [mlir] [mlir][Transforms] `remove-dead-values`: Rely on canonicalizer for region simplification (PR #173505)

Ivan Butygin llvmlistbot at llvm.org
Thu Jan 1 05:01:25 PST 2026


================
@@ -226,23 +228,12 @@ static void dropUsesAndEraseResults(Operation *op, BitVector toErase) {
   unsigned indexOfNextNewCallOpResultToReplace = 0;
   for (auto [index, result] : llvm::enumerate(op->getResults())) {
     assert(result && "expected result to be non-null");
-    if (toErase[index]) {
-      result.dropAllUses();
-    } else {
+    if (!toErase[index]) {
       result.replaceAllUsesWith(
----------------
Hardcode84 wrote:

`rewriter.replaceAllUsesWith`?

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


More information about the Mlir-commits mailing list