brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.4 KiB · 747c997 Raw
36 lines · plain
1// RUN: mlir-opt --transform-interpreter --split-input-file %s | FileCheck %s2 3module attributes {transform.with_named_sequence} {4  transform.named_sequence @__transform_main(%module_op: !transform.any_op {transform.readonly}) {5    %func = transform.structured.match ops{["func.func"]} in %module_op : (!transform.any_op) -> !transform.any_op6    transform.apply_patterns to %func {7      transform.apply_patterns.gpu.gpu_shuffle_to_amdgpu chipset = "gfx950"8    } : !transform.any_op9    transform.yield10  }11}12 13  // CHECK-LABEL: func @gpu_shuffle_swizzle14  //  CHECK-SAME: (%[[ARG:.*]]: i32)15func.func @gpu_shuffle_swizzle(%arg0: i32) -> (i32, i1) {16  // CHECK:  %[[TRUE:.*]] = arith.constant true17  // CHECK:  %[[RES:.*]] = amdgpu.swizzle_bitmode %[[ARG]] 31 0 23 : i3218  // CHECK:  return %[[RES]], %[[TRUE]] : i32, i119  %width = arith.constant 64 : i3220  %offset = arith.constant 23 : i3221  %shfl, %pred = gpu.shuffle xor %arg0, %offset, %width : i3222  func.return %shfl, %pred : i32, i123}24 25  // CHECK-LABEL: func @gpu_shuffle_permlane_swap26  //  CHECK-SAME: (%[[ARG:.*]]: i32)27func.func @gpu_shuffle_permlane_swap(%arg0: i32) -> (i32, i1) {28  // CHECK:  %[[TRUE:.*]] = arith.constant true29  // CHECK:  %[[RES:.*]] = amdgpu.permlane_swap %[[ARG]] 32 : i3230  // CHECK:  return %[[RES]], %[[TRUE]] : i32, i131  %width = arith.constant 64 : i3232  %offset = arith.constant 32 : i3233  %shfl, %pred = gpu.shuffle xor %arg0, %offset, %width : i3234  func.return %shfl, %pred : i32, i135}36