[loco] fix MultiDialectShapeInferenceRule.test (#6913)
author박세희/On-Device Lab(SR)/Principal Engineer/삼성전자 <saehie.park@samsung.com>
Mon, 26 Aug 2019 07:32:40 +0000 (16:32 +0900)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Mon, 26 Aug 2019 07:32:40 +0000 (16:32 +0900)
This will add CanonicalShapeInferenceRule to MultiDialectShapeInferenceRule as there are Canonical dialect node Pull and Push in the graph

Signed-off-by: SaeHie Park <saehie.park@samsung.com>
compiler/loco/src/Service/MultiDialectShapeInferenceRule.test.cpp

index 5198d1d..ace7947 100644 (file)
  * limitations under the License.
  */
 
+#include "loco/Service/CanonicalShapeInferenceRule.h"
 #include "loco/Service/MultiDialectShapeInferenceRule.h"
 #include "loco/Service/ShapeInference.h"
 
 #include <loco/IR/Dialect.h>
+#include <loco/IR/CanonicalDialect.h>
 
 #include <gtest/gtest.h>
 
@@ -103,12 +105,15 @@ TEST(MultiDialectShapeInferenceRuleTest, test1)
   ASSERT_FALSE(loco::shape_known(t45_node));
 
   // Run Type Inference
+  loco::CanonicalShapeInferenceRule canonical_rule;
   TestShapeInferenceRule<2, 3> t23_rule;
   TestShapeInferenceRule<4, 5> t45_rule;
 
   loco::MultiDialectShapeInferenceRule rules;
 
-  rules.bind(TestDialect<2, 3>::get(), &t23_rule).bind(TestDialect<4, 5>::get(), &t45_rule);
+  rules.bind(loco::CanonicalDialect::get(), &canonical_rule)
+      .bind(TestDialect<2, 3>::get(), &t23_rule)
+      .bind(TestDialect<4, 5>::get(), &t45_rule);
 
   loco::apply(&rules).to(g.get());