brintos

brintos / llvm-project-archived public Read only

0
0
Text · 985 B · a3fd633 Raw
24 lines · plain
1// RUN: mlir-opt %s --transform-interpreter --split-input-file | FileCheck %s2 3func.func @select_single_i1_vector(%cond : i1) -> vector<1xi1> {4  %true = arith.constant dense<true> : vector<1xi1>5  %false = arith.constant dense<false> : vector<1xi1>6  %select = arith.select %cond, %true, %false : i1, vector<1xi1>7  return %select : vector<1xi1>8}9 10module attributes {transform.with_named_sequence} {11  transform.named_sequence @__transform_main(%root : !transform.any_op {transform.readonly}) {12    %func_op = transform.structured.match ops{["func.func"]} in %root : (!transform.any_op) -> !transform.op<"func.func">13    transform.apply_patterns to %func_op {14      transform.apply_patterns.vector.materialize_masks15    } : !transform.op<"func.func">16    transform.yield17  }18}19 20// CHECK-LABEL: func @select_single_i1_vector21// CHECK-SAME: %[[COND:.*]]: i122// CHECK:      %[[BCAST:.*]] = vector.broadcast %[[COND]] : i1 to vector<1xi1>23// CHECK:      return %[[BCAST]] : vector<1xi1>24