xref: /aosp_15_r20/external/llvm/docs/HistoricalNotes/2001-02-13-Reference-MemoryResponse.txt (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard WorkerDate: Tue, 13 Feb 2001 18:25:42 -0600
2*9880d681SAndroid Build Coastguard WorkerFrom: Vikram S. Adve <[email protected]>
3*9880d681SAndroid Build Coastguard WorkerTo: Chris Lattner <[email protected]>
4*9880d681SAndroid Build Coastguard WorkerSubject: RE: LLVM Concerns...
5*9880d681SAndroid Build Coastguard Worker
6*9880d681SAndroid Build Coastguard Worker> 1. Reference types
7*9880d681SAndroid Build Coastguard Worker>    Right now, I've spec'd out the language to have a pointer type, which
8*9880d681SAndroid Build Coastguard Worker>    works fine for lots of stuff... except that Java really has
9*9880d681SAndroid Build Coastguard Worker>    references: constrained pointers that cannot be manipulated: added and
10*9880d681SAndroid Build Coastguard Worker>    subtracted, moved, etc... Do we want to have a type like this?  It
11*9880d681SAndroid Build Coastguard Worker>    could be very nice for analysis (pointer always points to the start of
12*9880d681SAndroid Build Coastguard Worker>    an object, etc...) and more closely matches Java semantics.  The
13*9880d681SAndroid Build Coastguard Worker>    pointer type would be kept for C++ like semantics.  Through analysis,
14*9880d681SAndroid Build Coastguard Worker>    C++ pointers could be promoted to references in the LLVM
15*9880d681SAndroid Build Coastguard Worker>    representation.
16*9880d681SAndroid Build Coastguard Worker
17*9880d681SAndroid Build Coastguard Worker
18*9880d681SAndroid Build Coastguard WorkerYou're right, having references would be useful.  Even for C++ the *static*
19*9880d681SAndroid Build Coastguard Workercompiler could generate references instead of pointers with fairly
20*9880d681SAndroid Build Coastguard Workerstraightforward analysis.  Let's include a reference type for now.  But I'm
21*9880d681SAndroid Build Coastguard Workeralso really concerned that LLVM is becoming big and complex and (perhaps)
22*9880d681SAndroid Build Coastguard Workertoo high-level.  After we get some initial performance results, we may have
23*9880d681SAndroid Build Coastguard Workera clearer idea of what our goals should be and we should revisit this
24*9880d681SAndroid Build Coastguard Workerquestion then.
25*9880d681SAndroid Build Coastguard Worker
26*9880d681SAndroid Build Coastguard Worker> 2. Our "implicit" memory references in assembly language:
27*9880d681SAndroid Build Coastguard Worker>    After thinking about it, this model has two problems:
28*9880d681SAndroid Build Coastguard Worker>       A. If you do pointer analysis and realize that two stores are
29*9880d681SAndroid Build Coastguard Worker>          independent and can share the same memory source object,
30*9880d681SAndroid Build Coastguard Worker
31*9880d681SAndroid Build Coastguard Workernot sure what you meant by "share the same memory source object"
32*9880d681SAndroid Build Coastguard Worker
33*9880d681SAndroid Build Coastguard Worker> there is
34*9880d681SAndroid Build Coastguard Worker>          no way to represent this in either the bytecode or assembly.
35*9880d681SAndroid Build Coastguard Worker>       B. When parsing assembly/bytecode, we effectively have to do a full
36*9880d681SAndroid Build Coastguard Worker>          SSA generation/PHI node insertion pass to build the dependencies
37*9880d681SAndroid Build Coastguard Worker>          when we don't want the "pinned" representation.  This is not
38*9880d681SAndroid Build Coastguard Worker>          cool.
39*9880d681SAndroid Build Coastguard Worker
40*9880d681SAndroid Build Coastguard WorkerI understand the concern.  But again, let's focus on the performance first
41*9880d681SAndroid Build Coastguard Workerand then look at the language design issues.  E.g., it would be good to know
42*9880d681SAndroid Build Coastguard Workerhow big the bytecode files are before expanding them further.  I am pretty
43*9880d681SAndroid Build Coastguard Workerkeen to explore the implications of LLVM for mobile devices.  Both bytecode
44*9880d681SAndroid Build Coastguard Workersize and power consumption are important to consider there.
45*9880d681SAndroid Build Coastguard Worker
46*9880d681SAndroid Build Coastguard Worker--Vikram
47*9880d681SAndroid Build Coastguard Worker
48