[all-commits] [llvm/llvm-project] 310a27: [mlir][Transforms][NFC] Simplify handling of erase...

Matthias Springer via All-commits all-commits at lists.llvm.org
Mon Mar 4 01:21:55 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 310a278812319a7cae86239c975738019b5d90a3
      https://github.com/llvm/llvm-project/commit/310a278812319a7cae86239c975738019b5d90a3
  Author: Matthias Springer <me at m-sp.org>
  Date:   2024-03-04 (Mon, 04 Mar 2024)

  Changed paths:
    M mlir/lib/Transforms/Utils/DialectConversion.cpp

  Log Message:
  -----------
  [mlir][Transforms][NFC] Simplify handling of erased IR (#83423)

The dialect conversion uses a `SingleEraseRewriter` to ensure that an
op/block is not erased twice. This can happen during the "commit" phase
when an unresolved materialization is inserted into a block and the
enclosing op is erased by the user. In that case, the unresolved
materialization should not be erased a second time later in the "commit"
phase.

This problem cannot happen during "rollback", so ops/block can be erased
directly without using the rewriter. With this change, the
`SingleEraseRewriter` is used only during "commit"/"cleanup". At that
point, the dialect conversion is guaranteed to succeed and no rollback
can happen. Therefore, it is not necessary to store the number of erased
IR objects (because we will never "reset" the rewriter to previous a
previous state).



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