[all-commits] [llvm/llvm-project] 6ed61a: [mlir] Simplify and better document std.view seman...

Nicolas Vasilache via All-commits all-commits at lists.llvm.org
Mon May 11 09:31:17 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 6ed61a26c21c2d7cf59b2e6144f78c1407853f6d
      https://github.com/llvm/llvm-project/commit/6ed61a26c21c2d7cf59b2e6144f78c1407853f6d
  Author: Nicolas Vasilache <ntv at google.com>
  Date:   2020-05-11 (Mon, 11 May 2020)

  Changed paths:
    M mlir/include/mlir/Dialect/StandardOps/IR/Ops.td
    M mlir/lib/Conversion/StandardToLLVM/StandardToLLVM.cpp
    M mlir/lib/Dialect/Linalg/Transforms/Promotion.cpp
    M mlir/lib/Dialect/StandardOps/IR/Ops.cpp
    M mlir/test/Conversion/StandardToLLVM/convert-to-llvmir.mlir
    M mlir/test/Dialect/Linalg/affine.mlir
    M mlir/test/Dialect/Linalg/canonicalize.mlir
    M mlir/test/Dialect/Linalg/loops.mlir
    M mlir/test/Dialect/Linalg/promote.mlir
    M mlir/test/Dialect/Linalg/roundtrip.mlir
    M mlir/test/Dialect/Linalg/transform-patterns.mlir
    M mlir/test/IR/core-ops.mlir
    M mlir/test/IR/invalid-ops.mlir
    M mlir/test/Transforms/canonicalize.mlir
    M mlir/test/mlir-cpu-runner/linalg_integration_test.mlir

  Log Message:
  -----------
  [mlir] Simplify and better document std.view semantics

This [discussion](https://llvm.discourse.group/t/viewop-isnt-expressive-enough/991/2) raised some concerns with ViewOp.

In particular, the handling of offsets is incorrect and does not match the op description.
Note that with an elemental type change, offsets cannot be part of the type in general because sizeof(srcType) != sizeof(dstType).

Howerver, offset is a poorly chosen term for this purpose and is renamed to byte_shift.

Additionally, for all intended purposes, trying to support non-identity layouts for this op does not bring expressive power but rather increases code complexity.

This revision simplifies the existing semantics and implementation.
This simplification effort is voluntarily restrictive and acts as a stepping stone towards supporting richer semantics: treat the non-common cases as YAGNI for now and reevaluate based on concrete use cases once a round of simplification occurred.

Differential revision: https://reviews.llvm.org/D79541




More information about the All-commits mailing list