llvm-project/mlir/test/Transforms
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
..
buffer-placement-preparation-allowed-memref-results.mlir [mlir] Support unranked types in func signature conversion in BufferPlacement. 2020-07-07 19:43:48 +02:00
buffer-placement-preparation.mlir [mlir] Support unranked types in func signature conversion in BufferPlacement. 2020-07-07 19:43:48 +02:00
buffer-placement.mlir [mlir] Extended Buffer Assignment to support AllocaOps. 2020-08-03 11:20:30 +02:00
canonicalize-block-merge.mlir [mlir] Change dialect namespace loop->scf 2020-05-13 19:20:21 +02:00
canonicalize-dce.mlir Enable FileCheck -enable-var-scope by default in MLIR test 2020-06-12 00:43:09 +00:00
canonicalize.mlir Enable FileCheck -enable-var-scope by default in MLIR test 2020-06-12 00:43:09 +00:00
constant-fold.mlir [mlir][Standard] Allow unranked memrefs as operands to dim and rank 2020-07-29 14:42:58 +02:00
copy-removal.mlir [mlir] Add redundant copy removal transform 2020-07-03 15:36:25 +02:00
cse.mlir [mlir] Refactor BoolAttr to be a special case of IntegerAttr 2020-06-04 16:41:24 -07:00
inlining-dce.mlir [mlir][Inliner] Properly handle callgraph node deletion 2020-06-17 15:45:56 -07:00
inlining.mlir [mlir] Refactor BoolAttr to be a special case of IntegerAttr 2020-06-04 16:41:24 -07:00
location-snapshot.mlir Enable FileCheck -enable-var-scope by default in MLIR test 2020-06-12 00:43:09 +00:00
loop-coalescing.mlir [mlir] Change dialect namespace loop->scf 2020-05-13 19:20:21 +02:00
loop-fusion-dependence-check.mlir Add a flag on the context to protect against creation of operations in unregistered dialects 2020-03-30 19:37:31 +00:00
loop-fusion-slice-computation.mlir [mlir] Change dialect namespace loop->scf 2020-05-13 19:20:21 +02:00
loop-fusion-transformation.mlir [MLIR] Give AffineStoreOp and AffineLoadOp Memory SideEffects. 2020-04-28 15:45:25 +02:00
loop-fusion.mlir [MLIR][Affine] Fix createPrivateMemRef in affine fusion 2020-08-04 12:17:48 -07:00
loop-invariant-code-motion.mlir [mlir] Change dialect namespace loop->scf 2020-05-13 19:20:21 +02:00
memref-bound-check.mlir [MLIR] Fix memref region compute for 0-d memref accesses 2020-06-16 13:59:53 +05:30
memref-dataflow-opt.mlir [MLIR] Vector store to load forwarding 2020-07-28 11:30:54 -07:00
memref-dependence-check.mlir [MLIR] Consider AffineIfOp when getting the index set of an Op wrapped in nested loops 2020-08-09 03:16:03 +05:30
normalize-memrefs.mlir [MLIR] Support for ReturnOps in memref map layout normalization 2020-08-13 19:10:47 +05:30
parallel-loop-collapsing.mlir [mlir] fix off-by-one error in collapseParallelLoops 2020-06-26 15:39:46 +02:00
parametric-mapping.mlir [mlir] Change dialect namespace loop->scf 2020-05-13 19:20:21 +02:00
parametric-tiling.mlir [mlir] Change dialect namespace loop->scf 2020-05-13 19:20:21 +02:00
pipeline-data-transfer.mlir Enable FileCheck -enable-var-scope by default in MLIR test 2020-06-12 00:43:09 +00:00
sccp-callgraph.mlir Change filecheck default to dump input on failure 2020-06-09 18:57:46 +00:00
sccp-structured.mlir [mlir] Change dialect namespace loop->scf 2020-05-13 19:20:21 +02:00
sccp.mlir [mlir] Refactor BoolAttr to be a special case of IntegerAttr 2020-06-04 16:41:24 -07:00
scf-if-utils.mlir [mlir][SCF] Add utility to outline the then and else branches of an scf.IfOp 2020-08-07 14:49:49 -04:00
scf-loop-utils.mlir [mlir][SCF] Add utility to outline the then and else branches of an scf.IfOp 2020-08-07 14:49:49 -04:00
single-parallel-loop-collapsing.mlir [mlir] fix off-by-one error in collapseParallelLoops 2020-06-26 15:39:46 +02:00
strip-debuginfo.mlir Add a flag on the context to protect against creation of operations in unregistered dialects 2020-03-30 19:37:31 +00:00
test-canonicalize.mlir Add a flag on the context to protect against creation of operations in unregistered dialects 2020-03-30 19:37:31 +00:00
test-convert-call-op.mlir [mlir] Test CallOp STD->LLVM conversion. 2020-08-13 19:10:21 +02:00
test-inlining.mlir Add a flag on the context to protect against creation of operations in unregistered dialects 2020-03-30 19:37:31 +00:00
test-legalize-erased-op-with-uses.mlir [mlir][DialectConversion] Emit an error if an operation marked as erased has live users after conversion 2020-07-14 13:06:08 -07:00
test-legalize-remapped-value.mlir Add getRemappedValue to ConversionPatternRewriter 2019-11-19 11:09:39 -08:00
test-legalize-type-conversion.mlir [mlir][DialectConversion] Enable deeper integration of type conversions 2020-07-23 19:40:31 -07:00
test-legalize-unknown-root.mlir [mlir] Allow for patterns to match any root kind. 2020-06-18 13:58:47 -07:00
test-legalizer-analysis.mlir Add a flag on the context to protect against creation of operations in unregistered dialects 2020-03-30 19:37:31 +00:00
test-legalizer-full.mlir Add a flag on the context to protect against creation of operations in unregistered dialects 2020-03-30 19:37:31 +00:00
test-legalizer.mlir [mlir][DialectConversion] Refactor how block argument types get converted 2020-06-18 15:59:22 -07:00
test-merge-blocks.mlir [mlir][DialectConversion] Add support for mergeBlocks in ConversionPatternRewriter. 2020-08-03 10:06:04 -07:00
test-operation-folder.mlir [mlir] Add a test for OperationFolder 2020-05-07 12:39:24 +02:00
test-symbol-dce.mlir [mlir][SymbolDCE][NFC] Fix the visibility of the symbols within the test and 2020-04-13 00:33:11 -07:00