llvm/mlir
Alexander Belyaev fed9ff5117 [mlir] Test CallOp STD->LLVM conversion.
This exercises the corner case that was fixed in
https://reviews.llvm.org/rG8979a9cdf226066196f1710903d13492e6929563.

The bug can be reproduced when there is a @callee with a custom type argument and @caller has a producer of this argument passed to the @callee.

Example:
func @callee(!test.test_type) -> i32
func @caller() -> i32 {
  %arg = "test.type_producer"() : () -> !test.test_type
  %out = call @callee(%arg) : (!test.test_type) -> i32
  return %out : i32
}

Even though there is a type conversion for !test.test_type, the output IR (before the fix) contained a DialectCastOp:

module {
  llvm.func @callee(!llvm.ptr<i8>) -> !llvm.i32
  llvm.func @caller() -> !llvm.i32 {
    %0 = llvm.mlir.null : !llvm.ptr<i8>
    %1 = llvm.mlir.cast %0 : !llvm.ptr<i8> to !test.test_type
    %2 = llvm.call @callee(%1) : (!test.test_type) -> !llvm.i32
    llvm.return %2 : !llvm.i32
  }
}

instead of

module {
  llvm.func @callee(!llvm.ptr<i8>) -> !llvm.i32
  llvm.func @caller() -> !llvm.i32 {
    %0 = llvm.mlir.null : !llvm.ptr<i8>
    %1 = llvm.call @callee(%0) : (!llvm.ptr<i8>) -> !llvm.i32
    llvm.return %1 : !llvm.i32
  }
}

Differential Revision: https://reviews.llvm.org/D85914
2020-08-13 19:10:21 +02:00
..
cmake/modules Install the MLIRTableGen static library. 2020-06-11 18:23:24 -07:00
docs Merge OpFolderDialectInterface with DialectFoldInterface (NFC) 2020-08-13 00:39:22 +00:00
examples [mlir] Remove the need to define kindof on attribute and type classes. 2020-08-07 13:43:25 -07:00
include [mlir][openacc] Introduce OpenACC dialect with parallel, data, loop operations 2020-08-13 10:01:30 -04:00
integration_test [mlir] [VectorOps] Add masked load/store operations to Vector dialect 2020-08-05 16:45:24 -07:00
lib [mlir][openacc] Introduce OpenACC dialect with parallel, data, loop operations 2020-08-13 10:01:30 -04:00
test [mlir] Test CallOp STD->LLVM conversion. 2020-08-13 19:10:21 +02:00
tools [mlir] Test CallOp STD->LLVM conversion. 2020-08-13 19:10:21 +02:00
unittests [MLIR][TableGen] Fix ambiguous build methods when inferring result types. 2020-08-10 10:05:06 -07:00
utils [mlir][NFC] Remove usernames and google bug numbers from TODO comments. 2020-07-07 01:40:52 -07:00
.clang-format
.clang-tidy
CMakeLists.txt [mlir] Initial version of C APIs 2020-08-05 15:04:08 +02:00
LICENSE.TXT
README.md

Multi-Level Intermediate Representation

See https://mlir.llvm.org/ for more information.