[all-commits] [llvm/llvm-project] 5c36ee: [mlir] Drop the leading space when printing regions

Jeff Niu via All-commits all-commits at lists.llvm.org
Tue Jan 18 08:52:51 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5c36ee8d57fa702d8dc4ee9349978bff575a9465
      https://github.com/llvm/llvm-project/commit/5c36ee8d57fa702d8dc4ee9349978bff575a9465
  Author: Mogball <jeffniu22 at gmail.com>
  Date:   2022-01-18 (Tue, 18 Jan 2022)

  Changed paths:
    M flang/lib/Optimizer/Dialect/FIROps.cpp
    M mlir/lib/Dialect/Affine/IR/AffineOps.cpp
    M mlir/lib/Dialect/Async/IR/Async.cpp
    M mlir/lib/Dialect/GPU/IR/GPUDialect.cpp
    M mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp
    M mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
    M mlir/lib/Dialect/MemRef/IR/MemRefOps.cpp
    M mlir/lib/Dialect/OpenACC/IR/OpenACC.cpp
    M mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp
    M mlir/lib/Dialect/PDLInterp/IR/PDLInterp.cpp
    M mlir/lib/Dialect/SCF/SCF.cpp
    M mlir/lib/Dialect/SPIRV/IR/SPIRVOps.cpp
    M mlir/lib/Dialect/Shape/IR/Shape.cpp
    M mlir/lib/Dialect/StandardOps/IR/Ops.cpp
    M mlir/lib/IR/AsmPrinter.cpp
    M mlir/lib/IR/FunctionImplementation.cpp
    M mlir/test/Conversion/OpenMPToLLVM/convert-to-llvmir.mlir
    M mlir/test/Conversion/TosaToSCF/tosa-to-scf.mlir
    M mlir/test/Dialect/Affine/ops.mlir
    M mlir/test/Dialect/Bufferization/Transforms/buffer-deallocation.mlir
    M mlir/test/Dialect/GPU/invalid.mlir
    M mlir/test/Dialect/GPU/ops.mlir
    M mlir/test/Dialect/Linalg/invalid.mlir
    M mlir/test/Dialect/Linalg/named-ops.mlir
    M mlir/test/Dialect/MemRef/invalid.mlir
    M mlir/test/Dialect/Tosa/inlining.mlir
    M mlir/test/Dialect/Tosa/ops.mlir
    M mlir/test/Dialect/Tosa/tosa-infer-shapes.mlir
    M mlir/test/IR/invalid-ops.mlir
    M mlir/test/IR/parser.mlir
    M mlir/test/IR/pretty-region-args.mlir
    M mlir/test/IR/pretty_printed_region_op.mlir
    M mlir/test/IR/region.mlir
    M mlir/test/IR/wrapping_op.mlir
    M mlir/test/Target/LLVMIR/openmp-llvm.mlir
    M mlir/test/Transforms/test-merge-blocks.mlir
    M mlir/test/lib/Dialect/Test/TestDialect.cpp
    M mlir/test/mlir-lsp-server/hover.test
    M mlir/test/mlir-tblgen/op-format.mlir
    M mlir/test/python/ir/operation.py

  Log Message:
  -----------
  [mlir] Drop the leading space when printing regions

The leading space that is always printed at the beginning of regions is not consistent with other parts of the printing API. Moreover, this leading space can lead to undesirable assembly formats:

```
attr-dict-with-keyword $region
```

Prints as:

```
// Two spaces between `}` and `{`
attributes {foo}  { ... }
```

Moreover, the leading space results in the odd generic op format:

```
"test.op"() ( {...}) : () -> ()
```

Reviewed By: rriddle, mehdi_amini

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




More information about the All-commits mailing list