25TEST(NodeReductionTests, MultipleReductionsPerRegion)
30 const auto bitType = BitType::Create(32);
34 auto & graph = rvsdgModule.
Rvsdg();
36 auto & sizeArgument = GraphImport::Create(graph, bitType,
"size");
38 auto testStructuralNode = TestStructuralNode::create(&graph.GetRootRegion(), 1);
39 auto & subregion = *testStructuralNode->subregion(0);
40 auto inputVar = testStructuralNode->addInputWithArguments(sizeArgument);
53 auto outputVar = testStructuralNode->addOutputWithResults({ eqNode.output(0) });
55 GraphExport::Create(*outputVar.output,
"sum");
73 EXPECT_EQ(graph.GetRootRegion().numNodes(), 1u);
75 auto constantNode = TryGetOwnerNode<SimpleNode>(*outputVar.result[0]->origin());
76 auto constantOperation =
78 EXPECT_EQ(constantOperation->Representation().to_uint(), 0u);
83 EXPECT_EQ(nodeReductionStatistics.GetNumIterations(graph.GetRootRegion()).value(), 1u);
84 EXPECT_EQ(nodeReductionStatistics.GetNumIterations(subregion), 2u);
85 EXPECT_EQ(nodeReductionStatistics.getNumRegions(), 2u);
86 EXPECT_EQ(nodeReductionStatistics.getTotalIterations(), 3u);
87 EXPECT_EQ(nodeReductionStatistics.getMaxIterationsPerRegion(), 2u);
88 EXPECT_EQ(nodeReductionStatistics.getReductionCounters().numLoadNonVolatileReductions, 1u);