[all-commits] [llvm/llvm-project] 555850: [mlir][IR] Make `OpOperand` comparable (#70410)

Matthias Springer via All-commits all-commits at lists.llvm.org
Thu Oct 26 23:51:59 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5558504374cf3364310e5f088c18ce9fb5a58d65
      https://github.com/llvm/llvm-project/commit/5558504374cf3364310e5f088c18ce9fb5a58d65
  Author: Matthias Springer <me at m-sp.org>
  Date:   2023-10-27 (Fri, 27 Oct 2023)

  Changed paths:
    M mlir/include/mlir/IR/UseDefLists.h
    M mlir/lib/Dialect/Bufferization/IR/BufferizationOps.cpp
    M mlir/lib/Dialect/Tensor/Transforms/BufferizableOpInterfaceImpl.cpp

  Log Message:
  -----------
  [mlir][IR] Make `OpOperand` comparable (#70410)

Two `OpOperand`s are the same if they belong to the same owner and have
the same operand number. There are currently no comparison operators
defined on `OpOperand` and we work around this in multiple places by
comparing pointers.

Note: `OpOperand`s are stored in an op, so it is valid to compare their
pointers to determine if they are the same operand. E.g.,
`getOperandNumber` is also implemented via pointer arithmetics.




More information about the All-commits mailing list