Files
concrete/compiler/lib/Dialect/RT/IR/RTDialect.cpp
Andi Drebes 45577fb79e Rebase onto llvm-project f69328049e9e with local changes
This commit rebases the compiler onto commit f69328049e9e from
llvm-project.

Changes:

* Use of the one-shot bufferizer for improved memory management

* A new pass `OneShotBufferizeDPSWrapper` that converts functions
  returning tensors to destination-passing-style as required by the
  one-shot bufferizer

* A new pass `LinalgGenericOpWithTensorsToLoopsPass` that converts
  `linalg.generic` operations with value semantics to loop nests

* Rebase onto a fork of llvm-project at f69328049e9e with local
  modifications to enable bufferization of `linalg.generic` operations
  with value semantics

* Workaround for the absence of type propagation after type conversion
  via extra patterns in all dialect conversion passes

* Printer, parser and verifier definitions moved from inline
  declarations in ODS to the respective source files as required by
  upstream changes

* New tests for functions with a large number of inputs

* Increase the number of allowed task inputs as required by new tests

* Use upstream function `mlir_configure_python_dev_packages()` to
  locate Python development files for compatibility with various CMake
  versions

Co-authored-by: Quentin Bourgerie <quentin.bourgerie@zama.ai>
Co-authored-by: Ayoub Benaissa <ayoub.benaissa@zama.ai>
Co-authored-by: Antoniu Pop <antoniu.pop@zama.ai>
2022-06-14 14:35:25 +02:00

57 lines
1.6 KiB
C++

// Part of the Concrete Compiler Project, under the BSD3 License with Zama
// Exceptions. See
// https://github.com/zama-ai/concrete-compiler-internal/blob/main/LICENSE.txt
// for license information.
#include "mlir/Dialect/Func/IR/FuncOps.h"
#include "mlir/Dialect/LLVMIR/LLVMDialect.h"
#include "mlir/Dialect/MemRef/IR/MemRef.h"
#include "mlir/IR/Attributes.h"
#include "mlir/IR/Builders.h"
#include "mlir/IR/BuiltinOps.h"
#include "mlir/IR/BuiltinTypes.h"
#include "mlir/IR/DialectImplementation.h"
#include "mlir/IR/FunctionImplementation.h"
#include "mlir/IR/OpImplementation.h"
#include "mlir/IR/PatternMatch.h"
#include "mlir/IR/TypeUtilities.h"
#include "concretelang/Dialect/RT/IR/RTDialect.h"
#include "concretelang/Dialect/RT/IR/RTOps.h"
#include "concretelang/Dialect/RT/IR/RTTypes.h"
#define GET_TYPEDEF_CLASSES
#include "concretelang/Dialect/RT/IR/RTOpsTypes.cpp.inc"
#include "concretelang/Dialect/RT/IR/RTOpsDialect.cpp.inc"
using namespace mlir::concretelang::RT;
void RTDialect::initialize() {
addOperations<
#define GET_OP_LIST
#include "concretelang/Dialect/RT/IR/RTOps.cpp.inc"
>();
addTypes<
#define GET_TYPEDEF_LIST
#include "concretelang/Dialect/RT/IR/RTOpsTypes.cpp.inc"
>();
}
::mlir::Type RTDialect::parseType(::mlir::DialectAsmParser &parser) const {
mlir::Type type;
if (parser.parseOptionalKeyword("future").succeeded()) {
generatedTypeParser(parser, "future", type);
return type;
}
return type;
}
void RTDialect::printType(::mlir::Type type,
::mlir::DialectAsmPrinter &printer) const {
if (generatedTypePrinter(type, printer).failed()) {
printer.printType(type);
}
}