blob: 7a5abf99886f612d6a53f3a15c78bf603de14996 [file] [log] [blame]
// RUN: mlir-hlo-opt %s -split-input-file -pass-pipeline='func.func(canonicalize)' | FileCheck %s
// CHECK-LABEL:@noeffect
func.func @noeffect(%arg0: tensor<8xf32>) -> tensor<8xf32> {
// CHECK-NOT: custom_call
%0 = "mhlo.custom_call"(%arg0) {call_target_name = "foo", has_side_effect = false} : (tensor<8xf32>) -> tensor<8xf32>
func.return %arg0 : tensor<8xf32>
}
// CHECK-LABEL:@sideeffect
func.func @sideeffect(%arg0: tensor<8xf32>) -> tensor<8xf32> {
// CHECK: custom_call
%0 = "mhlo.custom_call"(%arg0) {call_target_name = "foo", has_side_effect = true} : (tensor<8xf32>) -> tensor<8xf32>
func.return %arg0 : tensor<8xf32>
}
// CHECK-LABEL:@defaulteffect
func.func @defaulteffect(%arg0: tensor<8xf32>) -> tensor<8xf32> {
// CHECK: custom_call
%0 = "mhlo.custom_call"(%arg0) {call_target_name = "foo"} : (tensor<8xf32>) -> tensor<8xf32>
func.return %arg0 : tensor<8xf32>
}