brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.3 KiB · 5f421a3 Raw
24 lines · plain
1// RUN: mlir-opt -allow-unregistered-dialect -split-input-file -test-legalize-patterns="allow-pattern-rollback=0" -verify-diagnostics %s | FileCheck %s2 3// CHECK-LABEL: @conditional_replacement(4//  CHECK-SAME:     %[[arg0:.*]]: i43)5//       CHECK:   %[[cast1:.*]] = "test.cast"(%[[arg0]]) : (i43) -> i426//       CHECK:   %[[legal:.*]] = "test.legal_op"() : () -> i427//       CHECK:   %[[cast2:.*]] = "test.cast"(%[[legal]], %[[legal]]) : (i42, i42) -> i428// Uses were replaced for dummy_user_1.9//       CHECK:   "test.dummy_user_1"(%[[cast2]]) {replace_uses} : (i42) -> ()10// Uses were also replaced for dummy_user_2, but not by value_replace. The uses11// were replaced due to the block signature conversion.12//       CHECK:   "test.dummy_user_2"(%[[cast1]]) : (i42) -> ()13//       CHECK:   "test.value_replace"(%[[cast1]], %[[legal]]) {conditional, is_legal} : (i42, i42) -> ()14func.func @conditional_replacement(%arg0: i42) {15  %repl = "test.legal_op"() : () -> (i42)16  // expected-remark @+1 {{is not legalizable}}17  "test.dummy_user_1"(%arg0) {replace_uses} : (i42) -> ()18  // expected-remark @+1 {{is not legalizable}}19  "test.dummy_user_2"(%arg0) {} : (i42) -> ()20  // Perform a conditional 1:N replacement.21  "test.value_replace"(%arg0, %repl) {conditional} : (i42, i42) -> ()22  "test.return"() : () -> ()23}24