[all-commits] [llvm/llvm-project] 7403b6: [MLIR] Stop visiting unreachable blocks in the wal...

Mehdi Amini via All-commits all-commits at lists.llvm.org
Mon Aug 18 13:38:51 PDT 2025


  Branch: refs/heads/users/joker-eph/walk_unreachable
  Home:   https://github.com/llvm/llvm-project
  Commit: 7403b6dbbe1d1ba8fbfdcf8c1af247caf7166151
      https://github.com/llvm/llvm-project/commit/7403b6dbbe1d1ba8fbfdcf8c1af247caf7166151
  Author: Mehdi Amini <joker.eph at gmail.com>
  Date:   2025-08-18 (Mon, 18 Aug 2025)

  Changed paths:
    M mlir/include/mlir/Transforms/WalkPatternRewriteDriver.h
    M mlir/lib/Transforms/Utils/WalkPatternRewriteDriver.cpp
    M mlir/test/IR/test-walk-pattern-rewrite-driver.mlir

  Log Message:
  -----------
  [MLIR] Stop visiting unreachable blocks in the walkAndApplyPatterns driver

This is similar to the fix to the greedy driver in #153957 ; except that
instead of removing unreachable code, we just ignore it.

Operations like:

%add = arith.addi %add, %add : i64

are legal in unreachable code.
Unfortunately many patterns would be unsafe to apply on such IR and can
lead to crashes or infinite loops.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list