fed9ff5117
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 |
||
---|---|---|
.. | ||
cmake/modules | ||
docs | ||
examples | ||
include | ||
integration_test | ||
lib | ||
test | ||
tools | ||
unittests | ||
utils | ||
.clang-format | ||
.clang-tidy | ||
CMakeLists.txt | ||
LICENSE.TXT | ||
README.md |
Multi-Level Intermediate Representation
See https://mlir.llvm.org/ for more information.