annotate presentation/presen.html @ 16:c3d20ec1ec4b

spell check
author Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
date Sat, 04 Jul 2015 23:36:52 +0900
parents bbbeecda034d
children 889696aa5018
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 <!DOCTYPE html>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
2 <html>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
3 <head>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
4 <meta charset='utf-8'>
14
b9179e9084d9 spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 13
diff changeset
5 <title>Presentation</title>
3
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
6 <!-- style sheet links -->
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 <link rel="stylesheet/less" href="themes/blank/projection.css.less" media="screen,projection">
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
8 <link rel="stylesheet/less" href="themes/blank/screen.css.less" media="screen">
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
9 <link rel="stylesheet/less" href="themes/blank/print.css.less" media="print">
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
10
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
11 <link rel="stylesheet/less" href="blank.css.less" media="screen,projection">
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
12
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
13 <!-- add js libs (less, jquery) -->
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
14 <script src="js/less-1.1.4.min.js"></script>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
15 <script src="js/jquery-1.7.min.js"></script>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
16
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
17 <!-- S6 JS -->
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
18 <script src="js/jquery.slideshow.js"></script>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
19 <script src="js/jquery.slideshow.counter.js"></script>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
20 <script src="js/jquery.slideshow.controls.js"></script>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
21 <script src="js/jquery.slideshow.footer.js"></script>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
22 <script src="js/jquery.slideshow.autoplay.js"></script>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
23 <script>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
24 $(document).ready( function() {
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
25 Slideshow.init();
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
26
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
27 // Example 2: Start Off in Outline Mode
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
28 // Slideshow.init( { mode: 'outline' } );
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
29
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
30 // Example 3: Use Custom Transition
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
31 // Slideshow.transition = transitionScrollUp;
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
32 // Slideshow.init();
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
33
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
34 // Example 4: Start Off in Autoplay Mode with Custom Transition
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
35 // Slideshow.transition = transitionScrollUp;
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
36 // Slideshow.init( { mode: 'autoplay' } );
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
37 } );
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
38 </script>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
39 </head>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
40 <body>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
41
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
42 <div class="layout">
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
43 <div id="header"></div>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
44 <div id="footer">
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
45 <div align="right">
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
46 <img src="images/concurrency.png" width="200">
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
47 </div>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
48 </div>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
49 </div>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
50
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
51 <div class="presentation">
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
52
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
53 <div class='slide cover'>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
54 <table width="90%" height="90%" border="0" align="center">
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
55 <tr>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
56 <td><div align="center">
4
20257f618ddd slide: llvm structure
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 3
diff changeset
57 <h1><font color="#808db5">Implementating Continuation based language in Clang and LLVM</font></h1>
3
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
58 </div></td>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
59 </tr>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
60 <tr>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
61 <td><div align="left">
13
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
62 Kaito Tokumori, Shinji Kono <br>
15
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 14
diff changeset
63 University of the Ryukyus
3
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
64 <script>
13
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
65 document.write("<br>July 5, 2015");
3
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
66 </script>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
67 <hr style="color:#ffcc00;background-color:#ffcc00;text-align:left;border:none;width:300%;height:0.2em;">
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
68 </div></td>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
69 </tr>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
70 </table>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
71 </div>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
72
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
73 <div class='slide'>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
74 <h2>Objective</h2>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
75 <ul>
14
b9179e9084d9 spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 13
diff changeset
76 <li>Achieve Reliable computation
13
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
77 <li>Extract Concurrent Execution Automatically
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
78 <li>Modify and Improve software in a Reliable way
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
79 <li>Get more Reusablity
3
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
80 </ul>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
81 <h3>Introducing new units of programming</h3>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
82 </div>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
83
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
84
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
85 <div class='slide'>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
86 <h2>Traditional units of programming</h2>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
87 <ul>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
88 <li>Machine instruction
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
89 <li>Statements of programming language
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
90 <li>Function call / Method
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
91 <li>Module / Class / Interface
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
92 <li>Thread / Process
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
93 <li>Object
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
94 <li>Record / Table
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
95 </ul>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
96 </div>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
97
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
98 <div class='slide'>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
99 <h2>What we want to do with programming units?</h2>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
100 <ul>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
101 <li>Divide large functions into small parts.
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
102 <li>Add hidden arguments without code modification.
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
103 <li>Add meta computation.
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
104 <li>Extract concurrency from programming units.
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
105 </ul>
13
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
106 <h3>It is not easy to do this in the traditional units.</h3>
3
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
107 </div>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
108
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
109 <div class='slide'>
14
b9179e9084d9 spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 13
diff changeset
110 <h2>New programming units</h2>
3
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
111 <ul>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
112 <li>Units of programming: code segments, data segments.
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
113 <li>Code segments are units of calculation.
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
114 <li>Data segments are sets of typed data.
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
115 </ul>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
116 </div>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
117
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
118 <div class='slide'>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
119 <h2>Code segments</h2>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
120 <ul>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
121 <li>Function from input data segments to output data segments.
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
122 <li>Code segments have no states.
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
123 <li>Access in typed data in the data segments by name.
14
b9179e9084d9 spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 13
diff changeset
124 <li>Specify code segments to be executed using goto.
3
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
125 </ul>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
126 <h3>It is easy to divide or combine.</h3>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
127 </div>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
128
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
129 <div class='slide'>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
130 <h2>Data segments</h2>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
131 <ul>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
132 <li>Set of typed data.
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
133 <li>Type signatures are in meta data segments.
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
134 <li>Variable and extendable data structure.
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
135 <li>Data segments are dominated by connected code segments.
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
136 <li>Code segments atomically access connected data segments.
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
137 </ul>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
138 <h3>It is easy to divide or combine.</h3>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
139 </div>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
140
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
141 <div class='slide'>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
142 <h2>Meta code / data segments</h2>
15
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 14
diff changeset
143 <p>A thread of code segments has a context as a meta data segment</p>
3
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
144 <ul>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
145 <li>Execution contexts: Thread
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
146 <li>Type signatures of data segments.
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
147 <li>Data segment linkages: Pointer
13
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
148 <li>Machine code of code segments
3
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
149 </ul>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
150 </div>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
151
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
152 <div class='slide'>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
153 <h2>Continuation based C (CbC)</h2>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
154 <ul>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
155 <li>An implementation of code segments.
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
156 <li>CbC stands for Continuation based C.
13
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
157 <li>Basic syntax is the same as the C, except __code and goto.
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
158 <li>__code is a type of code segment
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
159 <li>Code segments end with parameterized goto.
14
b9179e9084d9 spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 13
diff changeset
160 <li>Data segments are implemented as C structures.
3
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
161 </ul>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
162 </div>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
163
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
164 <div class='slide'>
13
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
165 <h2>code segment syntax</h2>
3
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
166 <table border='1' align='center' width='80%'>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
167 <tr><td width='50%'>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
168 <pre class='small_code'>
9
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
169 __code f() {
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
170 goto g();
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
171 }
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
172
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
173 __code g() {
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
174 goto h();
3
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
175 }
9
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
176 </pre>
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
177 </td><td valign='top'>
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
178 <ul>
13
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
179 <li>code segment transition is goto.
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
180 <li>Code segments have no return statement.
9
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
181 <li>There are no return values.
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
182 </ul>
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
183 </td></tr>
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
184 </table>
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
185 </div>
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
186
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
187 <div class='slide'>
13
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
188 <h2>code segment syntax with data segments</h2>
9
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
189 <table border='1' align='center' width='80%'>
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
190 <tr><td width='50%'>
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
191 <pre class='small_code'>
13
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
192 __code code1(struct Allocate* allocate,
10
81195c2fcf4a fix typo
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 9
diff changeset
193 struct Element* element) {
4
20257f618ddd slide: llvm structure
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 3
diff changeset
194 element ->value = 10;
13
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
195 struct List* list = (struct List *)malloc(sizeof( struct List));
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
196 goto append(allocate,list, element);
3
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
197 }
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
198
13
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
199 __code append(struct Allocate* allocate, struct List* list, struct Element* element) {
4
20257f618ddd slide: llvm structure
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 3
diff changeset
200 if(list->head) {
20257f618ddd slide: llvm structure
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 3
diff changeset
201 list->tail->next = element;
20257f618ddd slide: llvm structure
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 3
diff changeset
202 } else {
20257f618ddd slide: llvm structure
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 3
diff changeset
203 list->head = element;
20257f618ddd slide: llvm structure
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 3
diff changeset
204 }
20257f618ddd slide: llvm structure
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 3
diff changeset
205 list->tail = element;
20257f618ddd slide: llvm structure
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 3
diff changeset
206 list->tail->next = 0;
13
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
207 goto code2(allocate,list, element);
4
20257f618ddd slide: llvm structure
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 3
diff changeset
208 }
20257f618ddd slide: llvm structure
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 3
diff changeset
209 </pre>
3
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
210 </td><td valign='top'>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
211 <ul>
13
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
212 <li>data segments are arguments of a code segment and a goto statement.
4
20257f618ddd slide: llvm structure
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 3
diff changeset
213 </ul>
3
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
214 </td></tr>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
215 </table>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
216 </div>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
217
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
218 <div class='slide'>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
219 <h2>CbC compilers</h2>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
220 <ul>
13
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
221 <li>Micro-C(one pass standalone compiler) 2001
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
222 <li>on GCC(GNU Compiler Collection) 2008
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
223 <li>on LLVM and Clang (Compiler framework) 2014
3
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
224 <ul>
4
20257f618ddd slide: llvm structure
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 3
diff changeset
225 <li><font color='red'>The latest!</font>
3
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
226 </ul>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
227 </ul>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
228 </div>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
229
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
230 <div class='slide'>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
231 <h2>LLVM and Clang's compilation flow</h2>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
232 <ul>
13
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
233 <li>AST : Abstract Syntax Tree (C++ object)
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
234 <li>LLVM IR is Intermediate Representation (bit code).
4
20257f618ddd slide: llvm structure
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 3
diff changeset
235 <li>Clang translate C/C++/Obj-C into LLVM IR.
14
b9179e9084d9 spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 13
diff changeset
236 <li>SelectionDAG : Code generator internal
13
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
237 <li>Machine Code : LLVM Machine code
3
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
238 </ul>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
239 <div align="center"><img src="fig/clang_llvm_structure.svg" width="45%"></div>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
240 </div>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
241
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
242 <div class='slide'>
13
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
243 <h2>Advantage of LLVM implementation</h2>
9
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
244 <ul>
13
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
245 <li>Apple supported (working on OS X).
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
246 <li>OS X default compiler.
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
247 <li>LLVM IR is well documented.
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
248 <li>better than GCC
9
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
249 </ul>
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
250 </div>
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
251
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
252 <div class='slide'>
13
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
253 <h2>CbC implementation strategy</h2>
9
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
254 <ul>
14
b9179e9084d9 spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 13
diff changeset
255 <li>define special type __code for code segments
b9179e9084d9 spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 13
diff changeset
256 <li>no code segment prototyping (otherwise it becomes quite messy )
13
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
257 <li>code segments are implemented as tail call force functions
14
b9179e9084d9 spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 13
diff changeset
258 <li>Do not modify IR (Intermediate representations )
b9179e9084d9 spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 13
diff changeset
259 <li>goto statement is actually a function call with following return statement <br>
13
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
260 goto f() --> { f() ; return; }
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
261 <li>allow mixing code segments and normal function calls ( goto with environment )
9
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
262 </ul>
3
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
263 </div>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
264
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
265 <div class='slide'>
9
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
266 <h2>LLVM IR</h2>
3
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
267 <ul>
13
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
268 <li>Intermediate Representation (bit code).
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
269 <li>Three forms: in-memory IR, bitcode stream, human readable language.
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
270 <li>it has precise type, data size, alignment
14
b9179e9084d9 spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 13
diff changeset
271 <li>function call flags : tail, fastcc, cc10, cc11, Erlang, ghc
3
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
272 </ul>
9
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
273 <table width='100%'>
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
274 <tr>
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
275 <td style="border: double;">
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
276 <pre class='code'>
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
277 define fastcc void @factorial(i32 %x) #0 {
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
278 entry:
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
279 tail call fastcc void @factorial0(i32 1, i32 %x)
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
280 ret void
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
281 }
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
282 </pre>
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
283 </td>
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
284 </tr>
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
285 </table>
3
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
286 </div>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
287
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
288 <div class='slide'>
13
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
289 <h2>CbC implementation strategy</h2>
3
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
290 <ul>
13
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
291 <li>Code segments are implemented by C functions with return-type __code.
3
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
292 <li>Data segments are implemented by C structs.
14
b9179e9084d9 spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 13
diff changeset
293 <li>Goto statement is implemented by setting tail call flag.
3
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
294 <li>Goto with environment is implemented by setjmp and longjmp.
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
295 </ul>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
296 </div>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
297
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
298
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
299 <div class='slide'>
9
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
300 <h2>Prototype declaration generating</h2>
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
301 <ul>
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
302 <li>In CbC, programmer write a lot of code segments.
12
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 11
diff changeset
303 <li>Automatically prototype declarator support it.
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 11
diff changeset
304 <!-- <li>When parser meet a code segment call, it stop current parsing and search called code segment declaration.-->
14
b9179e9084d9 spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 13
diff changeset
305 <li>If the declaration was not found, search definition and generate declaration.
9
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
306 <ul>
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
307 <li>Of course you can write declaration yourself too.
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
308 </ul>
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
309 </ul>
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
310 <table border='1' width='80%' align='center'>
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
311 <tr>
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
312 <td>original input code
14
b9179e9084d9 spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 13
diff changeset
313 <td>Clang generates it internally
9
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
314 </tr>
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
315 <tr>
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
316 <td><pre class='small_code'>
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
317 __code code1(int a, int b) {
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
318 :
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
319 goto code2(a,b);
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
320 }
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
321
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
322 __code code2(int a, int b){
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
323 :
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
324 }
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
325 </pre>
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
326 <td><pre class='small_code'>
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
327 <font color='red'>__code code2(int a, int b);</font>
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
328 __code code1(int a, int b) {
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
329 :
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
330 goto code2(a,b);
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
331 }
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
332
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
333 __code code2(int a, int b){
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
334 :
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
335 }
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
336 </pre>
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
337 </tr>
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
338 </table>
3
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
339 </div>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
340
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
341 <div class='slide'>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
342 <h2>goto syntax for transition</h2>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
343 <ul>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
344 <li>Add return statement after goto transition.
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
345 <li>It is one the requirement force to tail call elimination.
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
346 </ul>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
347 <table border='1' width='80%' align='center'>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
348 <tr>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
349 <td>original input code
14
b9179e9084d9 spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 13
diff changeset
350 <td>Clang generates it
3
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
351 </tr>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
352 <tr>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
353 <td><pre class='small_code'>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
354 __code code1() {
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
355 :
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
356 goto code2();
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
357 }
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
358 </pre>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
359 <td><pre class='small_code'>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
360 void code1() {
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
361 :
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
362 code2();
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
363 <font color='red'>return;</font>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
364 }
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
365 </pre>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
366 </tr>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
367 </table>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
368 </div>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
369
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
370 <div class='slide'>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
371 <h2>Forcing Tail Call Elimination</h2>
14
b9179e9084d9 spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 13
diff changeset
372 <p>Tail call flag is set in CodeGen.</p>
13
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
373 <p>Ensure TCE in SelectionDAGISel.</p>
11
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 10
diff changeset
374 <div align='center'><img src="fig/clang_llvm_slide_cg_DAG.svg" width="60%"></div>
3
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
375 </div>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
376
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
377 <div class='slide'>
11
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 10
diff changeset
378 <!-- <h2>Jmp instruction based transition</h2> -->
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 10
diff changeset
379 <h2>What is tail call elimination?</h2>
9
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
380 <ul>
13
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
381 <li>Tail call is a function call immediately followed by return.
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
382 <li>If stack frame have to be unchanged,
9
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
383 <li>Tail call elimination replace tail call's call instructions with jmp instructions.
13
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
384 <li>that is tail call function should have the same arguments and the same return type
9
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
385 </ul>
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
386 <div align='center'><img src="fig/TCE.svg" width="40%"></div>
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
387 </div>
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
388
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
389
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
390 <div class='slide'>
13
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
391 <h2>Tail Call Elimination requirements</h2>
3
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
392 <ul>
9
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
393 <li>Set tail flag at the code segments call.
13
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
394 <li>Tailcallopt path is enabled in the compiler.
14
b9179e9084d9 spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 13
diff changeset
395 <li>The caller and callee's calling conventions must be the same and their types should be cc10, cc11 or fastcc.
9
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
396 <li>Return value type has to be the same as the caller's.
3
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
397 </ul>
5
ac2ec4334d49 implementation
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
398 </div>
ac2ec4334d49 implementation
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
399
ac2ec4334d49 implementation
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
400 <div class='slide'>
ac2ec4334d49 implementation
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
401 <h2>Forcing Tail Call Elimination</h2>
3
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
402 <ul>
9
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
403 <li>Always add tail call elimination pass.
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
404 <li>Tailcallopt is enabled in CbC.
3
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
405 <li>Fast cc is used consistently in code segments call.
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
406 <li>All the code segments return value type is void.
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
407 </ul>
15
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 14
diff changeset
408 <p>This is the reason why we need __code type for code segments.</p>
13
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
409 </div>
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
410
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
411 <div class='slide'>
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
412 <h2>goto a code segment from a normal C function</h2>
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
413 <ul>
14
b9179e9084d9 spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 13
diff changeset
414 <li>Assume we have code segment g and normal function f
13
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
415 <li>simply goto g() in C function f()
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
416 <li>goto g() never returns to function f
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
417 </ul>
15
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 14
diff changeset
418 <p>How to return to C from a code segment?</p>
3
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
419 </div>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
420
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
421 <div class='slide'>
12
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 11
diff changeset
422 <h2>Goto with environment</h2>
13
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
423 <p>
16
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
424 We want provide continuation of function f.<br>
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
425 The continuation is not a simple code segment,<br>
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
426 because code segment has not state.<br>
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
427 We represent the continuation with a code segment (__return) and a meta data segment (__environment).<br>
3
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
428 </ul>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
429 </div>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
430
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
431 <div class='slide'>
13
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
432 <h2>Syntax of Goto with environment</h2>
3
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
433 <table width='100%'>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
434 <tr><td valign='top'>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
435 <ul>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
436 <li>Use new keywords __return and __environment.
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
437 <li>__return is a code segment pointer for C functions.
14
b9179e9084d9 spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 13
diff changeset
438 <li>__environment is a environment for C functions.
3
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
439 <li>Code1 use a continuation with environments to return main function.
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
440 </ul>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
441 <td style="border: double;">
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
442 <pre class='small_code'><div class='highlight'>__code code1(int n,__code(*exit_code)(int,void *),void *exit_env){
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
443 printf("code1 : code entry1\n");
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
444 goto exit_code(n,exit_env);
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
445 }
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
446
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
447 int caller(){
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
448 printf("caller : main1 entry\n");
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
449 __code (*__ret)(int, void *) = <font color='red'>__return</font>;
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
450 struct __CbC_env *__env = <font color='red'>__environment</font>;
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
451 goto code1(1, __ret, __env);
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
452 return 0;
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
453 }
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
454
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
455 int main(){
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
456 int n;
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
457 n = caller();
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
458 printf("return = %d\n",n);
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
459 return 0;
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
460 } </div></pre>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
461 </tr>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
462 </table>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
463 </div>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
464
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
465 <div class='slide'>
13
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
466 <h2>Implementation of goto with environment</h2>
15
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 14
diff changeset
467 <p>Several ways to implementation</p>
3
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
468 <ul>
14
b9179e9084d9 spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 13
diff changeset
469 <li>setjmp/longjmp (LLVM)
13
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
470 <li>nested function closure with thread safe variable (GCC)
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
471 <li>direct manipulation of frame pointer and return value (Micro-C)
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
472 </ul>
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
473 </div>
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
474
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
475 <div class='slide'>
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
476 <h2>LLVM Implementation of goto with environment</h2>
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
477 <ul>
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
478 <li>Include setjmp.h internally.
3
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
479 <li>Generate C struct for saving environment.
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
480 <ul>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
481 <li>This struct is __environment.
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
482 </ul>
16
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
483 <li>Insert setjmp in C function, when __return is used.
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
484 <li>Generate longjmp code segment as __return.
3
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
485 </ul>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
486 </div>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
487
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
488
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
489 <div class='slide'>
5
ac2ec4334d49 implementation
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
490 <h2>Compiling result</h2>
ac2ec4334d49 implementation
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
491 <table width='100%' align='center' border='1'>
ac2ec4334d49 implementation
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
492 <tr>
ac2ec4334d49 implementation
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
493 <td valign='top'>
ac2ec4334d49 implementation
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
494 <pre class='small_code'>
ac2ec4334d49 implementation
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
495
ac2ec4334d49 implementation
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
496 __code caller(int x)
ac2ec4334d49 implementation
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
497 {
ac2ec4334d49 implementation
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
498 goto code1(1, x); // should be jmp
ac2ec4334d49 implementation
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
499 }
ac2ec4334d49 implementation
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
500 </pre>
ac2ec4334d49 implementation
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
501 <td>
ac2ec4334d49 implementation
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
502 <pre class='small_code'>
ac2ec4334d49 implementation
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
503 _caller: ## @factorial
ac2ec4334d49 implementation
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
504 .cfi_startproc
ac2ec4334d49 implementation
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
505 ## BB#0: ## %entry
ac2ec4334d49 implementation
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
506 subq $24, %rsp
ac2ec4334d49 implementation
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
507 Ltmp5:
ac2ec4334d49 implementation
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
508 .cfi_def_cfa_offset 32
ac2ec4334d49 implementation
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
509 movl $1, %eax
ac2ec4334d49 implementation
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
510 movl %edi, 20(%rsp) ## 4-byte Spill
ac2ec4334d49 implementation
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
511 movl %eax, %edi
ac2ec4334d49 implementation
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
512 movl 20(%rsp), %esi ## 4-byte Reload
ac2ec4334d49 implementation
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
513 addq $24, %rsp
ac2ec4334d49 implementation
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
514 <font color='red'>jmp</font> _code1 ## TAILCALL
ac2ec4334d49 implementation
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
515 .cfi_endproc
ac2ec4334d49 implementation
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
516 </pre>
ac2ec4334d49 implementation
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
517 </tr>
ac2ec4334d49 implementation
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
518 </table>
ac2ec4334d49 implementation
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
519 <ul>
ac2ec4334d49 implementation
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
520 <li>Code1 should called by jmp instruction.
ac2ec4334d49 implementation
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
521 <li>In assembly code, code1 called by jmp instruction.
ac2ec4334d49 implementation
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
522 <li>Tail call elimination was forced.
ac2ec4334d49 implementation
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
523 <li>If tail call elimination was failed, compiler output error messages.
ac2ec4334d49 implementation
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
524 </ul>
ac2ec4334d49 implementation
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
525 </div>
16
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
526
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
527 <div class='slide'>
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
528 <h2>Usage of CbC : as an instruction description</h2>
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
529 <p>CbC can be used as a hardware description language (RTL level)</p>
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
530 <ul>
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
531 <li>VU (Vector unit) in PS2
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
532 <li>SPU in PS3
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
533 </ul>
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
534 </div>
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
535
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
536 <div class='slide'>
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
537 <h2>Usage of CbC : Parallel Task representation</h2>
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
538 <p>CbC can be used as a parallel programming language</p>
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
539 <ul>
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
540 <li>run on GPU or Many Core
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
541 <li>a code segment is a kernel in Open CL
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
542 <li>a code segment execution is atomic
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
543 <li>during an execution of code, data segments are owned by the code
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
544 <li>task structure is a meta data segment
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
545 <li>task manager is a meta code segment
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
546 </ul>
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
547 </div>
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
548
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
549 <div class='slide'>
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
550 <h2>Usage of CbC : OS API description</h2>
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
551 <ul>
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
552 <li>detailed description of open/read/write/select
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
553 <li>we can implement kernel in CbC
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
554 </ul>
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
555 </div>
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
556
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
557 <div class='slide'>
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
558 <h2>Usage of CbC : meta computation</h2>
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
559 <ul>
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
560 <li>call meta code segment during goto
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
561 <li>thread context is a meta data segment
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
562 <li>it can be seen as a monadic meta computation
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
563 </ul>
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
564 </div>
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
565
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
566 <div class='slide'>
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
567 <h2>Usage of CbC : Model checking</h2>
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
568 <ul>
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
569 <li>call meta code segment during goto
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
570 <li>try all possible non deterministic computation
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
571 <li>keep track data segment state
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
572 <li>Do the model checking without modifying the code
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
573 <li>cf. Java Pathfinder (Model checking by replacing JVM)
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
574 </ul>
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
575 </div>
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
576
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
577 <div class='slide'>
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
578 <h2>Conclusion</h2>
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
579 <ul>
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
580 <li>CbC compiler on LLVM and Clang is implemented.
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
581 <li>LLVM IR is not modified.
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
582 <li>goto with environment is implemented by setjmp and longjmp.
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
583 <li>Automatic prototype generating.
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
584 <li>Various application of CbC.
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
585 </ul>
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
586 </div>
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
587
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
588 <div class='slide'>
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
589 <h2>Future works</h2>
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
590 <ul>
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
591 <li>Write operating system in CbC.
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
592 <ul>
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
593 <li>Gears OS
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
594 </ul>
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
595 <li>Meta computation syntax.
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
596 <li>More user friendly syntax.
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
597 <li>Automatic data segment generator.
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
598 <li>Signature for data segment.
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
599 <li>Dependent type and implicit parameter
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
600 </ul>
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
601 </div>
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
602
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
603 <div class='slide'>
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
604 <h2>LLVM and Clang's intermediate representations</h2>
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
605 <table border='1' align='center' width='80%'>
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
606 <tr><td width='25%'>
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
607 Name
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
608 </td><td>
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
609 Description
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
610 </td></tr>
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
611 <tr><td>
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
612 clang AST
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
613 </td><td>
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
614 Abstract Syntax Tree. It is a representation of the structure source codes.
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
615 </td></tr>
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
616 <tr><td>
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
617 LLVM IR
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
618 </td><td>
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
619 The main intermediate representation of LLVM. It has three different forms: as an in-memory compiler IR, as an on-disk bitcode representation, and as a human readable assembly language representation.
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
620 </td></tr>
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
621 <tr><td>
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
622 SelectionDAG
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
623 </td><td>
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
624 Directed Acyclic Graph. Its nodes indicate what operation the node performs and the operands to the operation.
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
625 </td></tr>
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
626 <tr><td>
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
627 Machine Code
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
628 </td><td>
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
629 This representation is designed to support both an SSA representation for machine code, as well as register allocated, non-SSA form.
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
630 </td></tr>
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
631 <tr><td>
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
632 MC Layer
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
633 </td><td>
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
634 It is used to represent and process code at the raw machine code level. User can some kinds of file (.s, .o, .ll, a.out) by same API.
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
635 </td></tr>
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
636 </table>
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
637 </div>
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
638
c3d20ec1ec4b spell check
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
639 </div> <!-- presentation -->
5
ac2ec4334d49 implementation
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
640 <div class='slide'>
6
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
641 <h2>Execution Result</h2>
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
642 <ul>
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
643 <li>Conv1 program.
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
644 <ul>
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
645 <li>Repeat calculation program.
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
646 <li>Stack is defined in the program.
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
647 </ul>
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
648 <li>Select execution code by arguments.
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
649 <ul>
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
650 <li>1: not optimized.
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
651 <li>2,3: optimized stack operation.
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
652 </ul>
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
653 <li>Inline optimization is omitted.
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
654 </ul>
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
655 <table width='80%' align='center' border='1'>
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
656 <tr>
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
657 <td width='30%'>
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
658 <td>Argument 1
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
659 <td>Argument 2
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
660 <td>Argument 3
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
661 </tr>
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
662 <tr>
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
663 <td>Micro-C
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
664 <td>6.875
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
665 <td>2.4562
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
666 <td>3.105
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
667 </tr>
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
668 <tr>
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
669 <td>GCC -O2
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
670 <td>2.9438
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
671 <td>0.955
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
672 <td>1.265
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
673 </tr>
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
674 <tr>
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
675 <td>LLVM and Clang -O0
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
676 <td>5.835
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
677 <td>4.1887
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
678 <td>5.0625
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
679 </tr>
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
680 <tr>
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
681 <td>LLVM and Clang -O2
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
682 <td>3.3875
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
683 <td>2.29
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
684 <td>2.5087
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
685 </tr>
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
686 </table>
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
687 <table width='80%' align='center' border='0'>
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
688 <tr><td align='right'>unit : seconds</tr>
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
689 </table>
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
690 <ul>
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
691 <li>LLVM and Clang compilers are faster than Micro-C when optimize is enabled.
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
692 <li>CbC gets benefits from LLVM optimizations.
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
693 <li>LLVM can compile CbC examples.
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
694 </ul>
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
695 </div>
3
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
696 </body>
c50a033e6635 create presentation slide
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
697 </html>