52 lines · plain
1// RUN: mlir-opt -view-op-graph -allow-unregistered-dialect %s -o %t 2>&1 | FileCheck -check-prefix=DFG %s2 3// DFG-LABEL: digraph G {4// DFG-NEXT: compound = true;5// DFG-NEXT: subgraph cluster_1 {6// DFG-NEXT: v2 [label = " ", shape = plain];7// DFG-NEXT: label = "builtin.module : ()\l";8// DFG-NEXT: subgraph cluster_3 {9// DFG-NEXT: v4 [label = " ", shape = plain];10// DFG-NEXT: label = "";11// DFG-NEXT: subgraph cluster_5 {12// DFG-NEXT: v6 [label = " ", shape = plain];13// DFG-NEXT: label = "test.graph_region : ()\l";14// DFG-NEXT: subgraph cluster_7 {15// DFG-NEXT: v8 [label = " ", shape = plain];16// DFG-NEXT: label = "";17// DFG-NEXT: v9 [fillcolor = "0.000000 0.3 0.95", label = "{{\{\{}}<arg_0> %0|<arg_2> %2}|op1\l|{<res_0> %0 i32}}", shape = Mrecord, style = filled];18// DFG-NEXT: subgraph cluster_10 {19// DFG-NEXT: v11 [label = " ", shape = plain];20// DFG-NEXT: label = "test.ssacfg_region : (i32)\l";21// DFG-NEXT: subgraph cluster_12 {22// DFG-NEXT: v13 [label = " ", shape = plain];23// DFG-NEXT: label = "";24// DFG-NEXT: v14 [fillcolor = "0.166667 0.3 0.95", label = "{{\{\{}}<arg_0> %0|<arg_1> %1|<arg_2> %2|<arg_3> %3}|op2\l|{<res_4> %4 i32}}", shape = Mrecord, style = filled];25// DFG-NEXT: }26// DFG-NEXT: }27// DFG-NEXT: v15 [fillcolor = "0.166667 0.3 0.95", label = "{{\{\{}}<arg_0> %0|<arg_3> %3}|op2\l|{<res_2> %2 i32}}", shape = Mrecord, style = filled];28// DFG-NEXT: v16 [fillcolor = "0.500000 0.3 0.95", label = "{{\{\{}}<arg_0> %0}|op3\l|{<res_3> %3 i32}}", shape = Mrecord, style = filled];29// DFG-NEXT: }30// DFG-NEXT: }31// DFG-NEXT: }32// DFG-NEXT: }33// DFG-NEXT: v9:res_0:s -> v9:arg_0:n[style = solid];34// DFG-NEXT: v15:res_2:s -> v9:arg_2:n[style = solid];35// DFG-NEXT: v9:res_0:s -> v14:arg_0:n[style = solid];36// DFG-NEXT: v11 -> v14:arg_1:n[ltail = cluster_10, style = solid];37// DFG-NEXT: v15:res_2:s -> v14:arg_2:n[style = solid];38// DFG-NEXT: v16:res_3:s -> v14:arg_3:n[style = solid];39// DFG-NEXT: v9:res_0:s -> v15:arg_0:n[style = solid];40// DFG-NEXT: v16:res_3:s -> v15:arg_3:n[style = solid];41// DFG-NEXT: v9:res_0:s -> v16:arg_0:n[style = solid];42// DFG-NEXT: }43 44"test.graph_region"() ({ // A Graph region45 %1 = "op1"(%1, %3) : (i32, i32) -> (i32) // OK: %1, %3 allowed here46 %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 region48 }) : () -> (i32)49 %3 = "op2"(%1, %4) : (i32, i32) -> (i32) // OK: %4 allowed here50 %4 = "op3"(%1) : (i32) -> (i32)51}) : () -> ()52