1 // RUN: mlir-opt -view-op-graph -allow-unregistered-dialect %s -o %t 2>&1 | FileCheck -check-prefix=DFG %s
3 // DFG-LABEL: digraph G {
4 // DFG: compound = true;
5 // DFG: subgraph cluster_1 {
6 // DFG: v2 [label = " ", shape = plain];
7 // DFG: label = "builtin.module : ()\n";
8 // DFG: subgraph cluster_3 {
9 // DFG: v4 [label = " ", shape = plain];
11 // DFG: subgraph cluster_5 {
12 // DFG: v6 [label = " ", shape = plain];
13 // DFG: label = "test.graph_region : ()\n";
14 // DFG: subgraph cluster_7 {
15 // DFG: v8 [label = " ", shape = plain];
17 // DFG: v9 [fillcolor = "0.000000 1.0 1.0", label = "op1 : (i32)\n", shape = ellipse, style = filled];
18 // DFG: subgraph cluster_10 {
19 // DFG: v11 [label = " ", shape = plain];
20 // DFG: label = "test.ssacfg_region : (i32)\n";
21 // DFG: subgraph cluster_12 {
22 // DFG: v13 [label = " ", shape = plain];
24 // DFG: v14 [fillcolor = "0.166667 1.0 1.0", label = "op2 : (i32)\n", shape = ellipse, style = filled];
27 // DFG: v15 [fillcolor = "0.166667 1.0 1.0", label = "op2 : (i32)\n", shape = ellipse, style = filled];
28 // DFG: v16 [fillcolor = "0.500000 1.0 1.0", label = "op3 : (i32)\n", shape = ellipse, style = filled];
33 // DFG: v9 -> v9 [label = "0", style = solid];
34 // DFG: v15 -> v9 [label = "1", style = solid];
35 // DFG: v9 -> v14 [label = "0", style = solid];
36 // DFG: v11 -> v14 [ltail = cluster_10, style = solid];
37 // DFG: v15 -> v14 [label = "2", style = solid];
38 // DFG: v16 -> v14 [label = "3", style = solid];
39 // DFG: v9 -> v15 [label = "0", style = solid];
40 // DFG: v16 -> v15 [label = "1", style = solid];
41 // DFG: v9 -> v16 [label = "", style = solid];
44 "test.graph_region"() ({ // A Graph region
45 %1 = "op1"(%1, %3) : (i32, i32) -> (i32) // OK: %1, %3 allowed here
46 %2 = "test.ssacfg_region"() ({
47 %5 = "op2"(%1, %2, %3, %4) : (i32, i32, i32, i32) -> (i32) // OK: %1, %2, %3, %4 all defined in the containing region
49 %3 = "op2"(%1, %4) : (i32, i32) -> (i32) // OK: %4 allowed here
50 %4 = "op3"(%1) : (i32) -> (i32)