1 // RUN: mlir-opt %s -test-remapped-value | FileCheck %s
3 // Simple test that exercises ConvertPatternRewriter::getRemappedValue.
5 // CHECK-LABEL: func @remap_input_1_to_1
6 // CHECK-SAME: (%[[ARG:.*]]: i32)
7 // CHECK-NEXT: %[[VAL:.*]] = "test.one_variadic_out_one_variadic_in1"(%[[ARG]], %[[ARG]])
8 // CHECK-NEXT: "test.one_variadic_out_one_variadic_in1"(%[[VAL]], %[[VAL]])
10 func.func @remap_input_1_to_1(%arg0: i32) {
11 %0 = "test.one_variadic_out_one_variadic_in1"(%arg0) : (i32) -> i32
12 %1 = "test.one_variadic_out_one_variadic_in1"(%0) : (i32) -> i32
13 "test.return"() : () -> ()
16 // Test the case where an operation is converted before its operands are.
18 // CHECK-LABEL: func @remap_unconverted
19 // CHECK-NEXT: %[[VAL:.*]] = "test.type_producer"() : () -> f64
20 // CHECK-NEXT: "test.type_consumer"(%[[VAL]]) : (f64)
21 func.func @remap_unconverted() {
22 %region_result = "test.remapped_value_region"() ({
23 %result = "test.type_producer"() : () -> f32
24 "test.return"(%result) : (f32) -> ()
26 "test.type_consumer"(%region_result) : (f32) -> ()
27 "test.return"() : () -> ()