// RUN: mlir-opt %s -pass-pipeline="builtin.module(func.func(linalg-detensorize{aggressive-mode}))" | FileCheck %s -check-prefix=DET-ALL // RUN: mlir-opt %s -pass-pipeline="builtin.module(func.func(linalg-detensorize))" | FileCheck %s -check-prefix=DET-CF #map0 = affine_map<() -> ()> #attrs = { indexing_maps = [#map0, #map0, #map0], iterator_types = [] } func.func @main(%farg0 : tensor) -> (tensor) attributes {} { %c10 = arith.constant 10 : i32 %1 = tensor.from_elements %c10 : tensor %3 = tensor.empty() : tensor %4 = linalg.generic #attrs ins(%farg0, %1 : tensor, tensor) outs(%3 : tensor) { ^bb0(%arg0: i32, %arg1: i32, %arg2: i1): %8 = arith.cmpi slt, %arg0, %arg1 : i32 linalg.yield %8 : i1 } -> tensor return %4 : tensor } // DET-ALL-LABEL: func @main(%{{.*}}: tensor) // DET-ALL-NEXT: arith.constant 10 // DET-ALL-NEXT: tensor.extract %{{.*}}[] // DET-ALL-NEXT: arith.cmpi slt, %{{.*}}, %{{.*}} // DET-ALL-NEXT: tensor.from_elements %{{.*}} // DET-ALL-NEXT: return %{{.*}} : tensor // DET-ALL-NEXT: } // DET-CF-LABEL: func @main(%{{.*}}: tensor) // DET-CF-NEXT: arith.constant dense<10> : tensor // DET-CF-NEXT: tensor.empty() : tensor // DET-CF-NEXT: linalg.generic // DET-CF-NEXT: ^{{.*}}(%{{.*}}: i32, %{{.*}}: i32, %{{.*}}: i1) // DET-CF-NEXT: arith.cmpi slt, %{{.*}}, %{{.*}} // DET-CF-NEXT: linalg.yield %{{.*}} // DET-CF-NEXT: } -> tensor // DET-CF-NEXT: return %{{.*}} // DET-CF-NEXT: }