annotate llvm/docs/HistoricalNotes/2001-01-31-UniversalIRIdea.txt @ 164:fdfabb438fbf

...
author anatofuz
date Thu, 19 Mar 2020 17:02:53 +0900
parents 1d019706d866
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 Date: Wed, 31 Jan 2001 12:04:33 -0600
anatofuz
parents:
diff changeset
2 From: Vikram S. Adve <vadve@cs.uiuc.edu>
anatofuz
parents:
diff changeset
3 To: Chris Lattner <lattner@cs.uiuc.edu>
anatofuz
parents:
diff changeset
4 Subject: another thought
anatofuz
parents:
diff changeset
5
anatofuz
parents:
diff changeset
6 I have a budding idea about making LLVM a little more ambitious: a
anatofuz
parents:
diff changeset
7 customizable runtime system that can be used to implement language-specific
anatofuz
parents:
diff changeset
8 virtual machines for many different languages. E.g., a C vm, a C++ vm, a
anatofuz
parents:
diff changeset
9 Java vm, a Lisp vm, ..
anatofuz
parents:
diff changeset
10
anatofuz
parents:
diff changeset
11 The idea would be that LLVM would provide a standard set of runtime features
anatofuz
parents:
diff changeset
12 (some low-level like standard assembly instructions with code generation and
anatofuz
parents:
diff changeset
13 static and runtime optimization; some higher-level like type-safety and
anatofuz
parents:
diff changeset
14 perhaps a garbage collection library). Each language vm would select the
anatofuz
parents:
diff changeset
15 runtime features needed for that language, extending or customizing them as
anatofuz
parents:
diff changeset
16 needed. Most of the machine-dependent code-generation and optimization
anatofuz
parents:
diff changeset
17 features as well as low-level machine-independent optimizations (like PRE)
anatofuz
parents:
diff changeset
18 could be provided by LLVM and should be sufficient for any language,
anatofuz
parents:
diff changeset
19 simplifying the language compiler. (This would also help interoperability
anatofuz
parents:
diff changeset
20 between languages.) Also, some or most of the higher-level
anatofuz
parents:
diff changeset
21 machine-independent features like type-safety and access safety should be
anatofuz
parents:
diff changeset
22 reusable by different languages, with minor extensions. The language
anatofuz
parents:
diff changeset
23 compiler could then focus on language-specific analyses and optimizations.
anatofuz
parents:
diff changeset
24
anatofuz
parents:
diff changeset
25 The risk is that this sounds like a universal IR -- something that the
anatofuz
parents:
diff changeset
26 compiler community has tried and failed to develop for decades, and is
anatofuz
parents:
diff changeset
27 universally skeptical about. No matter what we say, we won't be able to
anatofuz
parents:
diff changeset
28 convince anyone that we have a universal IR that will work. We need to
anatofuz
parents:
diff changeset
29 think about whether LLVM is different or if has something novel that might
anatofuz
parents:
diff changeset
30 convince people. E.g., the idea of providing a package of separable
anatofuz
parents:
diff changeset
31 features that different languages select from. Also, using SSA with or
anatofuz
parents:
diff changeset
32 without type-safety as the intermediate representation.
anatofuz
parents:
diff changeset
33
anatofuz
parents:
diff changeset
34 One interesting starting point would be to discuss how a JVM would be
anatofuz
parents:
diff changeset
35 implemented on top of LLVM a bit more. That might give us clues on how to
anatofuz
parents:
diff changeset
36 structure LLVM to support one or more language VMs.
anatofuz
parents:
diff changeset
37
anatofuz
parents:
diff changeset
38 --Vikram
anatofuz
parents:
diff changeset
39