Flags some potential cases where splitting isn't happening and so could result in confusing results. Also update some test files where there were near misses in splitting that seemed unintentional. Differential Revision: https://reviews.llvm.org/D109636
93 lines
2.1 KiB
MLIR
93 lines
2.1 KiB
MLIR
// RUN: mlir-opt %s -canonicalize -split-input-file | FileCheck %s
|
|
|
|
func @testenterdataop(%a: memref<10xf32>) -> () {
|
|
%ifCond = arith.constant true
|
|
acc.enter_data if(%ifCond) create(%a: memref<10xf32>)
|
|
return
|
|
}
|
|
|
|
// CHECK: acc.enter_data create(%{{.*}} : memref<10xf32>)
|
|
|
|
// -----
|
|
|
|
func @testenterdataop(%a: memref<10xf32>) -> () {
|
|
%ifCond = arith.constant false
|
|
acc.enter_data if(%ifCond) create(%a: memref<10xf32>)
|
|
return
|
|
}
|
|
|
|
// CHECK: func @testenterdataop
|
|
// CHECK-NOT: acc.enter_data
|
|
|
|
// -----
|
|
|
|
func @testexitdataop(%a: memref<10xf32>) -> () {
|
|
%ifCond = arith.constant true
|
|
acc.exit_data if(%ifCond) delete(%a: memref<10xf32>)
|
|
return
|
|
}
|
|
|
|
// CHECK: acc.exit_data delete(%{{.*}} : memref<10xf32>)
|
|
|
|
// -----
|
|
|
|
func @testexitdataop(%a: memref<10xf32>) -> () {
|
|
%ifCond = arith.constant false
|
|
acc.exit_data if(%ifCond) delete(%a: memref<10xf32>)
|
|
return
|
|
}
|
|
|
|
// CHECK: func @testexitdataop
|
|
// CHECK-NOT: acc.exit_data
|
|
|
|
// -----
|
|
|
|
func @testupdateop(%a: memref<10xf32>) -> () {
|
|
%ifCond = arith.constant true
|
|
acc.update if(%ifCond) host(%a: memref<10xf32>)
|
|
return
|
|
}
|
|
|
|
// CHECK: acc.update host(%{{.*}} : memref<10xf32>)
|
|
|
|
// -----
|
|
|
|
func @testupdateop(%a: memref<10xf32>) -> () {
|
|
%ifCond = arith.constant false
|
|
acc.update if(%ifCond) host(%a: memref<10xf32>)
|
|
return
|
|
}
|
|
|
|
// CHECK: func @testupdateop
|
|
// CHECK-NOT: acc.update
|
|
|
|
// -----
|
|
|
|
func @testenterdataop(%a: memref<10xf32>, %ifCond: i1) -> () {
|
|
acc.enter_data if(%ifCond) create(%a: memref<10xf32>)
|
|
return
|
|
}
|
|
|
|
// CHECK: func @testenterdataop(%{{.*}}: memref<10xf32>, [[IFCOND:%.*]]: i1)
|
|
// CHECK: acc.enter_data if(%{{.*}}) create(%{{.*}} : memref<10xf32>)
|
|
|
|
// -----
|
|
|
|
func @testexitdataop(%a: memref<10xf32>, %ifCond: i1) -> () {
|
|
acc.exit_data if(%ifCond) delete(%a: memref<10xf32>)
|
|
return
|
|
}
|
|
|
|
// CHECK: func @testexitdataop(%{{.*}}: memref<10xf32>, [[IFCOND:%.*]]: i1)
|
|
// CHECK: acc.exit_data if(%{{.*}}) delete(%{{.*}} : memref<10xf32>)
|
|
|
|
// -----
|
|
|
|
func @testupdateop(%a: memref<10xf32>, %ifCond: i1) -> () {
|
|
acc.update if(%ifCond) host(%a: memref<10xf32>)
|
|
return
|
|
}
|
|
|
|
// CHECK: func @testupdateop(%{{.*}}: memref<10xf32>, [[IFCOND:%.*]]: i1)
|
|
// CHECK: acc.update if(%{{.*}}) host(%{{.*}} : memref<10xf32>)
|