Where does the layout transform of each op happen during alter_op_layout pass?

OK, I think I know what I’m looking for and where they are. It’s in transform_layout.h where there’s a LayoutRewriter function for this purpose. Specifically, memoizer's Transform function (defined in the same file) does the job:

  Expr Transform(Expr raw, const Layout& src_layout, const Layout& dst_layout) {
    if (src_layout.Equals(dst_layout)) {
      return raw;
    }

    std::tuple<const Object*, std::string, std::string> key =
        std::make_tuple<>(raw.get(), src_layout.name(), dst_layout.name());
    auto& memo = operator->()->memo;

    auto iter = memo.find(key);
    if (iter != memo.end()) {
      return iter->second;
    } else {
      Expr transform = TransformHelper(raw, src_layout, dst_layout);
      memo[key] = transform;
      return transform;
    }
  }