Changes

Summary

  1. [mlir][linalg] Lower subtensor(pad_tensor) to pad_tensor(subtensor) (details)
  2. [ORC][examples] Add missing library dependence (details)
  3. [RISCV][test] Add new tests for add-mul optimization in the zba extension with SH*ADD (details)
  4. [RISCV] Optimize add-mul in the zba extension with SH*ADD (details)
  5. [LoopUnroll] Push runtime unrolling decision up into tryToUnrollLoop() (details)
  6. [mlir] Add EmitC dialect (details)
Commit 24199f534f61d9ac7d2d9dcde7b9cac93c84d4f0 by springerm
[mlir][linalg] Lower subtensor(pad_tensor) to pad_tensor(subtensor)

Only high padding is supported at the moment. Low padding will be added in a separate commit.

Differential Revision: https://reviews.llvm.org/D104357
The file was modifiedmlir/lib/Dialect/Linalg/Transforms/Transforms.cpp
The file was modifiedmlir/test/lib/Dialect/Linalg/TestLinalgTransforms.cpp
The file was modifiedmlir/include/mlir/Dialect/Linalg/Transforms/Transforms.h
The file was addedmlir/test/Dialect/Linalg/subtensor-of-padtensor.mlir
Commit 382b3fe043380c02bcffc8e3fba928bea12c0f5a by Lang Hames
[ORC][examples] Add missing library dependence
The file was modifiedllvm/examples/OrcV2Examples/OrcV2CBindingsIRTransforms/CMakeLists.txt
Commit 31190738c024298745d877a47ef95a5263ea5c9e by powerman1st
[RISCV][test] Add new tests for add-mul optimization in the zba extension with SH*ADD

These tests will show the following optimization by future patches.

Rx + Ry * 18  => (SH1ADD (SH3ADD Rx, Rx), Ry)
Rx + Ry * 20  => (SH2ADD (SH2ADD Rx, Rx), Ry)
Rx + Ry * 24  => (SH3ADD (SH1ADD Rx, Rx), Ry)
Rx + Ry * 36  => (SH2ADD (SH3ADD Rx, Rx), Ry)
Rx + Ry * 40  => (SH3ADD (SH2ADD Rx, Rx), Ry)
Rx + Ry * 72  => (SH3ADD (SH3ADD Rx, Rx), Ry)
Rx * (3 << C) => (SLLI (SH1ADD Rx, Rx), C)
Rx * (5 << C) => (SLLI (SH2ADD Rx, Rx), C)
Rx * (9 << C) => (SLLI (SH3ADD Rx, Rx), C)

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D104507
The file was modifiedllvm/test/CodeGen/RISCV/rv32zba.ll
The file was modifiedllvm/test/CodeGen/RISCV/rv64zba.ll
Commit d934b72809cb3cbc9f646a2b505e781e0b8b3d7b by powerman1st
[RISCV] Optimize add-mul in the zba extension with SH*ADD

This patch does the following optimization.

Rx + Ry * 18 => (SH1ADD (SH3ADD Rx, Rx), Ry)
Rx + Ry * 20 => (SH2ADD (SH2ADD Rx, Rx), Ry)
Rx + Ry * 24 => (SH3ADD (SH1ADD Rx, Rx), Ry)
Rx + Ry * 36 => (SH2ADD (SH3ADD Rx, Rx), Ry)
Rx + Ry * 40 => (SH3ADD (SH2ADD Rx, Rx), Ry)
Rx + Ry * 72 => (SH3ADD (SH3ADD Rx, Rx), Ry)

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D104588
The file was modifiedllvm/lib/Target/RISCV/RISCVInstrInfo.td
The file was modifiedllvm/test/CodeGen/RISCV/rv64zba.ll
The file was modifiedllvm/lib/Target/RISCV/RISCVInstrInfoB.td
The file was modifiedllvm/test/CodeGen/RISCV/rv32zba.ll
Commit 1bd4085e0bbc14ec61ab69c83464098622b2df56 by nikita.ppv
[LoopUnroll] Push runtime unrolling decision up into tryToUnrollLoop()

Currently, UnrollLoop() is passed an AllowRuntime flag and decides
itself whether runtime unrolling should be used or not. This patch
pushes the decision into the caller and allows us to eliminate the
ULO.TripCount and ULO.TripMultiple parameters.

Differential Revision: https://reviews.llvm.org/D104487
The file was modifiedllvm/lib/Transforms/Utils/LoopUnroll.cpp
The file was modifiedllvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp
The file was modifiedllvm/include/llvm/Transforms/Utils/UnrollLoop.h
The file was modifiedllvm/lib/Transforms/Scalar/LoopUnrollPass.cpp
The file was modifiedllvm/lib/Transforms/Utils/LoopUnrollAndJam.cpp
Commit 876de062f94650f9ded56a22b062236f711fcd18 by marius.brehler
[mlir] Add EmitC dialect

This upstreams the EmitC dialect and the corresponding Cpp target, both
initially presented with [1], from [2] to MLIR core. For the related
discussion, see [3].

[1] https://reviews.llvm.org/D76571
[2] https://github.com/iml130/mlir-emitc
[3] https://llvm.discourse.group/t/emitc-generating-c-c-from-mlir/3388

Co-authored-by: Jacques Pienaar <jpienaar@google.com>
Co-authored-by: Simon Camphausen <simon.camphausen@iml.fraunhofer.de>
Co-authored-by: Oliver Scherf <oliver.scherf@iml.fraunhofer.de>

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D103969
The file was addedmlir/lib/Dialect/EmitC/IR/CMakeLists.txt
The file was addedmlir/include/mlir/Dialect/EmitC/IR/EmitC.td
The file was addedmlir/lib/Dialect/EmitC/IR/EmitC.cpp
The file was addedmlir/include/mlir/Dialect/EmitC/CMakeLists.txt
The file was modifiedmlir/test/mlir-opt/commandline.mlir
The file was addedmlir/include/mlir/Dialect/EmitC/IR/EmitCAttributes.td
The file was addedmlir/include/mlir/Dialect/EmitC/IR/EmitCBase.td
The file was addedmlir/include/mlir/Dialect/EmitC/IR/EmitCTypes.td
The file was addedmlir/include/mlir/Dialect/EmitC/IR/CMakeLists.txt
The file was modifiedmlir/include/mlir/Dialect/CMakeLists.txt
The file was addedmlir/lib/Dialect/EmitC/CMakeLists.txt
The file was addedmlir/test/Dialect/EmitC/ops.mlir
The file was addedmlir/test/Dialect/EmitC/types.mlir
The file was modifiedmlir/include/mlir/InitAllDialects.h
The file was modifiedmlir/lib/Dialect/CMakeLists.txt
The file was addedmlir/include/mlir/Dialect/EmitC/IR/EmitC.h
The file was addedmlir/test/Dialect/EmitC/invalid_ops.mlir