From 4937c9db28245bf5a24c07802c1e09365e25347c Mon Sep 17 00:00:00 2001 From: Misha Brukman Date: Tue, 17 May 2005 02:27:30 +0000 Subject: [PATCH] Recommend writing new instruction selectors using pattern-based mechanisms git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22098 91177308-0d34-0410-b5e6-96231b3b80d8 --- docs/WritingAnLLVMBackend.html | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/docs/WritingAnLLVMBackend.html b/docs/WritingAnLLVMBackend.html index 3bd23b46040..abf91feb8a8 100644 --- a/docs/WritingAnLLVMBackend.html +++ b/docs/WritingAnLLVMBackend.html @@ -109,15 +109,14 @@ described the instruction set with the assembly printer generator in mind, that step can be almost automated. -

Now, for static code generation you also need to write an instruction -selector for your platform: see lib/Target/*/*ISelSimple.cpp which -is no longer "simple" but it gives you the idea: you have to be able to create -MachineInstrs for any given LLVM instruction using the InstVisitor -pattern, and produce a MachineFunction with -MachineBasicBlocks full of MachineInstrs for a -corresponding LLVM Function. Creating an instruction selector is perhaps the -most time-consuming part of creating a back-end.

+

You also need to write an instruction selector for your platform. The +recommended method is the pattern-matching instruction selector. You can see +examples in other targets: lib/Target/*/*ISelPattern.cpp. The former +method for writing instruction selectors (not recommended) is +encapsulated in lib/Target/*/*ISelSimple.cpp, which are +InstVisitor-based translators, generating code for an LLVM instruction +at a time. Creating an instruction selector is perhaps the most time-consuming +part of creating a back-end.

To create a JIT for your platform:

-- 2.34.1