forked from OSchip/llvm-project
Remove the LowerEDSCTestPass.
Most of the tests have been ported to be unit-tests and this pass is problematic in the way it depends on TableGen-generated files. This pass is also non-deterministic during multi-threading and a blocker to turning it on by default. PiperOrigin-RevId: 240889154
This commit is contained in:
parent
909a63d8bf
commit
76181a7b38
|
@ -1,61 +0,0 @@
|
|||
//===- LowerTestPass.cpp - Test pass for lowering EDSC --------------------===//
|
||||
//
|
||||
// Copyright 2019 The MLIR Authors.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// =============================================================================
|
||||
|
||||
#include "mlir/AffineOps/AffineOps.h"
|
||||
#include "mlir/EDSC/Helpers.h"
|
||||
#include "mlir/EDSC/Intrinsics.h"
|
||||
#include "mlir/IR/Builders.h"
|
||||
#include "mlir/IR/MLIRContext.h"
|
||||
#include "mlir/IR/Module.h"
|
||||
#include "mlir/IR/StandardTypes.h"
|
||||
#include "mlir/IR/Types.h"
|
||||
#include "mlir/Pass/Pass.h"
|
||||
#include "mlir/StandardOps/Ops.h"
|
||||
#include "mlir/Transforms/LoopUtils.h"
|
||||
#include "llvm/Support/raw_ostream.h"
|
||||
|
||||
using namespace mlir;
|
||||
|
||||
namespace {
|
||||
// Testing pass to lower EDSC.
|
||||
struct LowerEDSCTestPass : public FunctionPass<LowerEDSCTestPass> {
|
||||
void runOnFunction() override;
|
||||
};
|
||||
} // end anonymous namespace
|
||||
|
||||
#include "mlir/EDSC/reference-impl.inc"
|
||||
|
||||
void LowerEDSCTestPass::runOnFunction() {
|
||||
getFunction().walk([](Operation *op) {
|
||||
if (op->getName().getStringRef() == "print") {
|
||||
auto opName = op->getAttrOfType<StringAttr>("op");
|
||||
if (!opName) {
|
||||
op->emitOpError("no 'op' attribute provided for print");
|
||||
return;
|
||||
}
|
||||
auto function = op->getAttrOfType<FunctionAttr>("fn");
|
||||
if (!function) {
|
||||
op->emitOpError("no 'fn' attribute provided for print");
|
||||
return;
|
||||
}
|
||||
printRefImplementation(opName.getValue(), function.getValue());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
static PassRegistration<LowerEDSCTestPass> pass("lower-edsc-test",
|
||||
"Lower EDSC test pass");
|
|
@ -1,44 +0,0 @@
|
|||
// RUN: mlir-opt -lower-edsc-test %s | FileCheck %s
|
||||
|
||||
// CHECK-LABEL: func @t1(%arg0: memref<3x4x5x6xvector<4xi8>>, %arg1: memref<3x4x5x6xvector<4xi8>>, %arg2: memref<3x4x5x6xvector<4xi8>>) {
|
||||
func @t1(%lhs: memref<3x4x5x6xvector<4xi8>>, %rhs: memref<3x4x5x6xvector<4xi8>>, %result: memref<3x4x5x6xvector<4xi8>>) -> () {
|
||||
// CHECK: for {{.*}} = 0 to 3 {
|
||||
// CHECK: for {{.*}} = 0 to 4 {
|
||||
// CHECK: for {{.*}} = 0 to 5 {
|
||||
// CHECK: for {{.*}}= 0 to 6 {
|
||||
// CHECK: {{.*}} = load %arg1[{{.*}}] : memref<3x4x5x6xvector<4xi8>>
|
||||
// CHECK: {{.*}} = load %arg0[{{.*}}] : memref<3x4x5x6xvector<4xi8>>
|
||||
// CHECK: {{.*}} = addi {{.*}} : vector<4xi8>
|
||||
// CHECK: store {{.*}}, %arg2[{{.*}}] : memref<3x4x5x6xvector<4xi8>>
|
||||
return
|
||||
}
|
||||
|
||||
// CHECK-LABEL: func @t2(%arg0: memref<3x4xf32>, %arg1: memref<3x4xf32>, %arg2: memref<3x4xf32>) {
|
||||
func @t2(%lhs: memref<3x4xf32>, %rhs: memref<3x4xf32>, %result: memref<3x4xf32>) -> () {
|
||||
// CHECK: for {{.*}} = 0 to 3 {
|
||||
// CHECK: for {{.*}} = 0 to 4 {
|
||||
// CHECK: {{.*}} = load %arg1[{{.*}}, {{.*}}] : memref<3x4xf32>
|
||||
// CHECK: {{.*}} = load %arg0[{{.*}}, {{.*}}] : memref<3x4xf32>
|
||||
// CHECK: {{.*}} = addf {{.*}}, {{.*}} : f32
|
||||
// CHECK: store {{.*}}, %arg2[{{.*}}, {{.*}}] : memref<3x4xf32>
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
// CHECK-LABEL: func @t3(%arg0: memref<f32>, %arg1: memref<f32>, %arg2: memref<f32>) {
|
||||
func @t3(%lhs: memref<f32>, %rhs: memref<f32>, %result: memref<f32>) -> () {
|
||||
// CHECK: {{.*}} = load %arg1[] : memref<f32>
|
||||
// CHECK: {{.*}} = load %arg0[] : memref<f32>
|
||||
// CHECK: {{.*}} = addf {{.*}}, {{.*}} : f32
|
||||
// CHECK: store {{.*}}, %arg2[] : memref<f32>
|
||||
return
|
||||
}
|
||||
|
||||
func @fn() {
|
||||
"print"() {op: "x.add", fn: @t1: (memref<3x4x5x6xvector<4xi8>>, memref<3x4x5x6xvector<4xi8>>, memref<3x4x5x6xvector<4xi8>>) -> ()} : () -> ()
|
||||
"print"() {op: "x.add", fn: @t2: (memref<3x4xf32>, memref<3x4xf32>, memref<3x4xf32>) -> ()} : () -> ()
|
||||
"print"() {op: "x.add", fn: @t3: (memref<f32>, memref<f32>, memref<f32>) -> ()} : () -> ()
|
||||
return
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue