diff options
author | Alexander Belyaev <pifon@google.com> | 2020-08-13 18:53:07 +0200 |
---|---|---|
committer | Alexander Belyaev <pifon@google.com> | 2020-08-13 19:10:21 +0200 |
commit | fed9ff511711762ac8cccbb9954eb4c0554fe622 (patch) | |
tree | 4bf143218f07cf83d51035f3fe165a0d5803ec63 /llvm/lib/ExecutionEngine/Orc/ThreadSafeModule.cpp | |
parent | 2632c625ed9b7cb5d384242e9a792a8c5703fda4 (diff) | |
download | llvm-fed9ff511711762ac8cccbb9954eb4c0554fe622.zip llvm-fed9ff511711762ac8cccbb9954eb4c0554fe622.tar.gz llvm-fed9ff511711762ac8cccbb9954eb4c0554fe622.tar.bz2 |
[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
Diffstat (limited to 'llvm/lib/ExecutionEngine/Orc/ThreadSafeModule.cpp')
0 files changed, 0 insertions, 0 deletions