[all-commits] [llvm/llvm-project] aca901: [mlir][transform] Check for invalidated iterators ...

Matthias Springer via All-commits all-commits at lists.llvm.org
Thu Sep 14 07:34:48 PDT 2023

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: aca9019be0460a3823e22a52f1cf9c18a965a5fb
  Author: Matthias Springer <me at m-sp.org>
  Date:   2023-09-14 (Thu, 14 Sep 2023)

  Changed paths:
    M mlir/include/mlir/Dialect/Transform/IR/TransformInterfaces.h
    M mlir/lib/Dialect/Transform/IR/TransformInterfaces.cpp

  Log Message:
  [mlir][transform] Check for invalidated iterators on payload IR mappings (#66369)

Add extra error checking (in debug mode) to detect cases where an
iterator on "direct" payload IR mappings is invalidated (due to elements
being removed). Such errors are hard to debug: they are often
non-deterministic; sometimes the program crashes, sometimes it produces
wrong results. Even when it crashes, the stack trace often points to
completely unrelated code locations.

Store a timestamp with each "direct" mapping. The timestamp is increased
whenever an operation is performed that invaldiates an iterator on that
mapping. A debug iterator is added that checks the timestamp as payload
IR is enumerated.

More information about the All-commits mailing list