brintos

brintos / llvm-project-archived public Read only

0
0
Text · 685 B · 660f59d Raw
33 lines · plain
1// RUN: mlir-opt %s -inline | FileCheck %s2 3// These tests verify that regions with operations from Lingalg dialect4// can be inlined.5 6#accesses = [7  affine_map<(i) -> (i)>,8  affine_map<(i) -> (i)>9]10 11#trait = {12  indexing_maps = #accesses,13  iterator_types = ["parallel"]14}15 16func.func @inline_into(%arg0: memref<?xf32>) {17  // CHECK: linalg.generic18  call @inlined_fn(%arg0) : (memref<?xf32>) -> ()19  return20}21 22func.func @inlined_fn(%arg0: memref<?xf32>) {23  // CHECK: linalg.generic24  linalg.generic #trait25     ins(%arg0 : memref<?xf32>)26    outs(%arg0 : memref<?xf32>) {27    ^bb(%0 : f32, %1 : f32) :28      %2 = arith.addf %0, %0: f3229      linalg.yield %2 : f3230  }31  return32}33