|
109 | 109 | step can be almost automated.</li>
|
110 | 110 | </ul>
|
111 | 111 |
|
112 |
| -<p>Now, for static code generation you also need to write an instruction |
113 |
| -selector for your platform: see <tt>lib/Target/*/*ISelSimple.cpp</tt> which |
114 |
| -is no longer "simple" but it gives you the idea: you have to be able to create |
115 |
| -MachineInstrs for any given LLVM instruction using the <tt>InstVisitor</tt> |
116 |
| -pattern, and produce a <tt>MachineFunction</tt> with |
117 |
| -<tt>MachineBasicBlock</tt>s full of <tt><a |
118 |
| -href="CodeGenerator.html#machineinstr">MachineInstr</a></tt>s for a |
119 |
| -corresponding LLVM Function. Creating an instruction selector is perhaps the |
120 |
| -most time-consuming part of creating a back-end.</p> |
| 112 | +<p>You also need to write an instruction selector for your platform. The |
| 113 | +recommended method is the <a |
| 114 | +href="CodeGenerator.html#instselect">pattern-matching instruction selector</a>, |
| 115 | +examples of which you can see in other targets: |
| 116 | +<tt>lib/Target/*/*ISelPattern.cpp</tt>. The former method for writing |
| 117 | +instruction selectors (<b>not</b> recommended for new targets) is evident in |
| 118 | +<tt>lib/Target/*/*ISelSimple.cpp</tt>, which are <tt>InstVisitor</tt>-based |
| 119 | +translators, generating code for an LLVM instruction at a time. Creating an |
| 120 | +instruction selector is perhaps the most time-consuming part of creating a |
| 121 | +back-end.</p> |
121 | 122 |
|
122 | 123 | <p>To create a JIT for your platform:</p>
|
123 | 124 |
|
|
229 | 230 | <ul>
|
230 | 231 | <li><a href="CodeGenerator.html">Code generator</a> -
|
231 | 232 | describes some of the classes in code generation at a high level, but
|
232 |
| - it is not (yet) complete.</li> |
| 233 | + it is not (yet) complete</li> |
233 | 234 | <li><a href="TableGenFundamentals.html">TableGen fundamentals</a> -
|
234 |
| - describes how to use TableGen to describe your target information succinctly |
235 |
| -</li> |
| 235 | + describes how to use TableGen to describe your target information |
| 236 | + succinctly</li> |
| 237 | +<li><a href="HowToSubmitABug.html#codegen">Debugging code generation with |
| 238 | + bugpoint</a> - shows bugpoint usage scenarios to simplify backend |
| 239 | + development</li> |
236 | 240 | </ul>
|
237 | 241 |
|
238 | 242 | </div>
|
|
0 commit comments