[exo-tflite] Introducing Pass dir and Passes.h (#7909)
author윤현식/On-Device Lab(SR)/Principal Engineer/삼성전자 <hyunsik.yoon@samsung.com>
Sun, 6 Oct 2019 23:54:16 +0000 (08:54 +0900)
committer박종현/On-Device Lab(SR)/Staff Engineer/삼성전자 <jh1302.park@samsung.com>
Sun, 6 Oct 2019 23:54:16 +0000 (08:54 +0900)
This introduces Pass dir, which is for all optimization pass for TFL nodes, and Passes.h, which is a aggregation of passes in Pass dir.

Signed-off-by: Hyun Sik Yoon <hyunsik.yoon@samsung.com>
compiler/exo-tflite/src/Convert.cpp
compiler/exo-tflite/src/Dialect/Service/TFLShapeInferenceRule.test.cpp
compiler/exo-tflite/src/Pass/ShapeInferencePass.cpp [moved from compiler/exo-tflite/src/Conversion/ShapeInferencePass.cpp with 100% similarity]
compiler/exo-tflite/src/Pass/ShapeInferencePass.h [moved from compiler/exo-tflite/src/Conversion/ShapeInferencePass.h with 87% similarity]
compiler/exo-tflite/src/Pass/TypeInferencePass.cpp [moved from compiler/exo-tflite/src/Conversion/TypeInferencePass.cpp with 100% similarity]
compiler/exo-tflite/src/Pass/TypeInferencePass.h [moved from compiler/exo-tflite/src/Conversion/TypeInferencePass.h with 87% similarity]
compiler/exo-tflite/src/Passes.cpp [new file with mode: 0644]
compiler/exo-tflite/src/Passes.h [new file with mode: 0644]
compiler/exo-tflite/src/TestHelper.h

index 7b2e524..0b63daf 100644 (file)
@@ -17,9 +17,7 @@
 #include "Convert.h"
 
 #include "Conversions.h"
-
-#include "Conversion/TypeInferencePass.h"
-#include "Conversion/ShapeInferencePass.h"
+#include "Passes.h"
 #include "ProgressReporter.h"
 #include "Knob.h"
 
index 26cf634..0b174d0 100644 (file)
@@ -20,8 +20,6 @@
 #include "Dialect/IR/TFLDialect.h"
 #include "Dialect/Service/TFLShapeInferenceRule.h"
 
-#include "Conversion/ShapeInferencePass.h"
-
 #include <loco.h>
 #include <loco/IR/CanonicalDialect.h>
 #include <loco/Service/ShapeInference.h>
@@ -14,8 +14,8 @@
  * limitations under the License.
  */
 
-#ifndef __CONVERSION_SHAPE_INFERENCE_PASS_H__
-#define __CONVERSION_SHAPE_INFERENCE_PASS_H__
+#ifndef __PASS_SHAPE_INFERENCE_PASS_H__
+#define __PASS_SHAPE_INFERENCE_PASS_H__
 
 #include <loco.h>
 #include <logo/Pass.h>
@@ -37,4 +37,4 @@ public:
 
 } // namespace exo
 
-#endif //__CONVERSION_SHAPE_INFERENCE_PASS_H__
+#endif //__PASS_SHAPE_INFERENCE_PASS_H__
  * limitations under the License.
  */
 
-#ifndef __CONVERSION_TYPE_INFERENCE_PASS_H__
-#define __CONVERSION_TYPE_INFERENCE_PASS_H__
+#ifndef __PASS_TYPE_INFERENCE_PASS_H__
+#define __PASS_TYPE_INFERENCE_PASS_H__
 
 #include <loco.h>
+
 #include <logo/Pass.h>
 
 namespace exo
@@ -38,4 +39,4 @@ public:
 
 } // namespace exo
 
-#endif //__CONVERSION_TYPE_INFERENCE_PASS_H__
+#endif //__PASS_TYPE_INFERENCE_PASS_H__
diff --git a/compiler/exo-tflite/src/Passes.cpp b/compiler/exo-tflite/src/Passes.cpp
new file mode 100644 (file)
index 0000000..99d229c
--- /dev/null
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd. All Rights Reserved
+ *
+ * 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 "Passes.h"
+
+// This file is to make sure that Passes.h be compiled
diff --git a/compiler/exo-tflite/src/Passes.h b/compiler/exo-tflite/src/Passes.h
new file mode 100644 (file)
index 0000000..37af66d
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd. All Rights Reserved
+ *
+ * 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.
+ */
+
+#ifndef __PASSES_H__
+#define __PASSES_H__
+
+// Please add in alphabetical order
+
+#include "Pass/ShapeInferencePass.h"
+#include "Pass/TypeInferencePass.h"
+
+#include <logo/RemoveDeadNodePass.h>
+#include <logo/RemoveForwardNodePass.h>
+#include <logo/SimplifyDomainConversionPass.h>
+
+#endif // __PASSES_H__
index 19097df..756793c 100644 (file)
@@ -19,8 +19,7 @@
 
 #include "Check.h"
 #include "ProgressReporter.h"
-#include "Conversion/TypeInferencePass.h"
-#include "Conversion/ShapeInferencePass.h"
+#include "Passes.h"
 
 #include <logo/Pass.h>
 #include <logo/Phase.h>