[all-commits] [llvm/llvm-project] a2ab6a: [mlir][CallOpInterface] Add `setCalleeFromCallable...

Whitney Tsang via All-commits all-commits at lists.llvm.org
Mon May 8 06:07:53 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a2ab6a5e2b8d4e10ce29b24db7d6ae18c9acbec1
      https://github.com/llvm/llvm-project/commit/a2ab6a5e2b8d4e10ce29b24db7d6ae18c9acbec1
  Author: Whitney Tsang <whitney.tsang at intel.com>
  Date:   2023-05-08 (Mon, 08 May 2023)

  Changed paths:
    M flang/include/flang/Optimizer/Dialect/FIROps.td
    M mlir/docs/Interfaces.md
    M mlir/docs/Tutorials/Toy/Ch-4.md
    M mlir/examples/toy/Ch4/mlir/Dialect.cpp
    M mlir/examples/toy/Ch5/mlir/Dialect.cpp
    M mlir/examples/toy/Ch6/mlir/Dialect.cpp
    M mlir/examples/toy/Ch7/mlir/Dialect.cpp
    M mlir/include/mlir/Dialect/Async/IR/AsyncOps.td
    M mlir/include/mlir/Dialect/Func/IR/FuncOps.td
    M mlir/include/mlir/Dialect/Transform/IR/TransformOps.td
    M mlir/include/mlir/Interfaces/CallInterfaces.td
    M mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp
    M mlir/lib/Dialect/SPIRV/IR/SPIRVOps.cpp
    M mlir/test/lib/Dialect/Test/TestOps.td

  Log Message:
  -----------
  [mlir][CallOpInterface] Add `setCalleeFromCallable` method

Currently `CallOpInterface` has a method `getCallableForCallee` to have a consistent way to get the callee from an operation with `CallOpInterface`, but missing a consistent way to set a callee for an operation with `CallOpInterface`.

A set callee method is useful for transformations that operate on `CallOpInterface`, and change the callee, e.g., a pass that specialize function, which clone the callee, and change the `CallOpInterface`'s callee to the cloned version. Without such method, transformation would need to understand the implementation for every operations with `CallOpInterface`, and have a type switch to handle them.

This review adds a method to set callee for operation with `CallOpInterface`.

Reviewed By: gysit, zero9178o

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




More information about the All-commits mailing list