From 6e654bdc6198b4a32720f22e8551e7a5eaec254e Mon Sep 17 00:00:00 2001 From: Alex Hirsch Date: Wed, 30 Jan 2019 11:25:52 +0100 Subject: [PATCH] Provide CFG example --- images/cfg.dot | 19 +++++++++++++++++++ images/cfg.png | Bin 0 -> 18185 bytes specification.md | 25 +++++++++++++++++++++++++ 3 files changed, 44 insertions(+) create mode 100644 images/cfg.dot create mode 100644 images/cfg.png diff --git a/images/cfg.dot b/images/cfg.dot new file mode 100644 index 0000000..16e05db --- /dev/null +++ b/images/cfg.dot @@ -0,0 +1,19 @@ +digraph "CFG" { + nodesep=0.6 + node [shape=box, fontname="Roboto Mono", fontsize=11] + + B1 [xlabel="B1", label="s = 0\li = 0\ln = 10\l"]; + B2 [xlabel="B2", label="t1 = a - b\lifz t1 goto B4\l"]; + B3 [xlabel="B3", label="t2 = i * 4\ls = s + t2\l"]; + B4 [xlabel="B4", label="s = s + i"]; + B5 [xlabel="B5", label="i = i + 1\lt3 = n - i\lifnz t3 goto B2\l"]; + B6 [xlabel="B6", label="t4 = a - b"]; + + B1 -> B2; + B2 -> B3 [label="F"]; + B2 -> B4 [label="T"]; + B3 -> B5; + B4 -> B5; + B5 -> B6 [label="F"]; + B5 -> B2 [label="T"]; +} diff --git a/images/cfg.png b/images/cfg.png new file mode 100644 index 0000000000000000000000000000000000000000..fcb5170bccd819de777d0f0dded4d9abdbbef43d GIT binary patch literal 18185 zcmc({XINF)wk^6q6a^$IISYuOfaHvlGl+;v7Rfp1q-4n;B9a6IL?mYxK|qou5fBg* z$x6;hetl}4s(tp|_kHiYANN-IS>=+o=A2{n(R=HywZ6jCRprj(P~xCasPhW)(i$if zh8YTliF@`8yuxd$cOCw7#z;v{8g+vF`?5Ya9)+SuDM;VcbWd6S>ZPmcaxAenY`^}3 zTMui1($VGC1)3J+az0F6KB_^@3&y-X4oyWBwcVd(KbkOC*yOOXD_p&;!CH=6p2XbZ zdU`qYQf%`MkJ$&DQmn2BRNpE=;{BL#yzcJ3?(W4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m#Z{FAB&( zz83%t^li}6gnGw$tlND0;w>{^4zm84Fsz&hpwbU+A{hP~`<&fl zS{89fI1x0;#zsGM(ZRt1Fm$zlrVKr(>-Aw0ker%20_LPh7ki+C8L4r)EE`RGKD_lY z!c0O8(|W0MiHp;MCu6zc+sBXozka!sX-TIdCf)eo+8-wT>_0iMl^>2B%;JLR_eXbn z2gt(Y%}CATfB=W1?ctX8+-*NMFy15PY|yQqWpFQ?h4qQj$U{JZVzwkK6iljUy}kDc zfEdbOHp`*{-v?0@flqLJx=5__?5f4)$`^zee|9xCgRzzz!55LT4{;Y*PF7EjB#;g& z=Shkk@I`u_kuxo~e|BWu`LBMh$0Fw2I3UivLyDbN+{+t%!rRn z$FBY&P{oKe2-@?9|LvS20Sx?o|NA=+1Z7~5c)9QIK}A6|m_{mW*tZ1l11XFN>lu!g znt&%ff80b};3~LQ@3`oc{Xl4UIK?1ExVR)00FnmqCY7O1FC?G~q4KFqss|se+`04YL|5yNVoaY^6RlG&En0(4gXiFBJHJS6v4Hm@3!oj*H#u zKO1v1@bHiTntQ~g0Apd2;A81FbxO2aECg*if>w+Y#>MWTT?>}BJHiCqnH`DX8#3VT z0d+fDQGocX7dc`Kg6~wY9U8d<_YbG0(i0?g z1l5c##FD_4aFl}c1({%?r+=w4jdkXXWVS|yCvVVOv1xCZF|9N?A0&wZV}<`O!;dTQ z^&vBuK=r`D7c$glGkKAO%@?vo$h6V*>81avmC_F}z~1ArW6zO)2&YwpiVe@!H>Awac$SdVA=@ z5p>H%PR;Fm7v{gm?OV_2^)lu~?+F7V>RqNxI0_}=x)f7Gynv&&w+mhH z|1_lkC#8M;Op&w=*f;;0@v5blkZ9~d$D^r&dHPTPHPr=ns!lx|m;M+AsTq!pG53JG saK0S=ZEko5`+Jci*-dHbYe#;*dovwoUrCJNyKPVkGOE&rl7^4}AN73gtpET3 literal 0 HcmV?d00001 diff --git a/specification.md b/specification.md index 8cb278f..51565cd 100644 --- a/specification.md +++ b/specification.md @@ -370,6 +370,31 @@ This graph is commonly used by analyses for extracting structural information cr It is recommended to also provide a visitor mechanism for this graph. +Like the AST, it can be visualised. +The example below is taken from [Marc Moreno Maza](http://www.csd.uwo.ca/~moreno/CS447/Lectures/CodeOptimization.html/node6.html). + +Given this example IR: + +``` + s = 0 + i = 0 + n = 10 +L1: t1 = a - b + ifz t1 goto L2 + t2 = i * 4 + s = s + t2 + goto L3 +L2: s = s + i +L3: i = i + 1 + t3 = n - i + ifnz t3 goto L1 + t4 = a - b +``` + +The visualisation of the corresponding CFG could look like this: + +![CFG Example](images/cfg.png) + ### Assembly Code Generation The mC compiler targets x86 and uses GCC as back-end compiler.