[all-commits] [llvm/llvm-project] a700a1: [mlir] use shared pointer to prevent vector resize...

Ashay Rane via All-commits all-commits at lists.llvm.org
Fri Jul 7 08:42:12 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a700a1db8bbaffe3cff09da4ee11419ab3a057b3
      https://github.com/llvm/llvm-project/commit/a700a1db8bbaffe3cff09da4ee11419ab3a057b3
  Author: Ashay Rane <ashay at users.noreply.github.com>
  Date:   2023-07-07 (Fri, 07 Jul 2023)

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

  Log Message:
  -----------
  [mlir] use shared pointer to prevent vector resizes from destroying ops

The `MapVector` type stores key-value pairs in a vector, which, when
resized, copies the entries and destroys the old ones.  This causes the
underlying operations to be deleted, subsequently causing segfaults.

This patch makes the `mappings` map type refer to a shared pointer
instead, so that resizing the vector doesn't call the operations'
destructors.

Reviewed By: springerm

Differential Revision: https://reviews.llvm.org/D154511




More information about the All-commits mailing list