xref: /aosp_15_r20/external/llvm/docs/HistoricalNotes/2000-12-06-MeetingSummary.txt (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard WorkerSUMMARY
2*9880d681SAndroid Build Coastguard Worker-------
3*9880d681SAndroid Build Coastguard Worker
4*9880d681SAndroid Build Coastguard WorkerWe met to discuss the LLVM instruction format and bytecode representation:
5*9880d681SAndroid Build Coastguard Worker
6*9880d681SAndroid Build Coastguard WorkerISSUES RESOLVED
7*9880d681SAndroid Build Coastguard Worker---------------
8*9880d681SAndroid Build Coastguard Worker
9*9880d681SAndroid Build Coastguard Worker1. We decided that we shall use a flat namespace to represent our
10*9880d681SAndroid Build Coastguard Worker   variables in SSA form, as opposed to having a two dimensional namespace
11*9880d681SAndroid Build Coastguard Worker   of the original variable and the SSA instance subscript.
12*9880d681SAndroid Build Coastguard Worker
13*9880d681SAndroid Build Coastguard WorkerARGUMENT AGAINST:
14*9880d681SAndroid Build Coastguard Worker   * A two dimensional namespace would be valuable when doing alias
15*9880d681SAndroid Build Coastguard Worker     analysis because the extra information can help limit the scope of
16*9880d681SAndroid Build Coastguard Worker     analysis.
17*9880d681SAndroid Build Coastguard Worker
18*9880d681SAndroid Build Coastguard WorkerARGUMENT FOR:
19*9880d681SAndroid Build Coastguard Worker   * Including this information would require that all users of the LLVM
20*9880d681SAndroid Build Coastguard Worker     bytecode would have to parse and handle it.  This would slow down the
21*9880d681SAndroid Build Coastguard Worker     common case and inflate the instruction representation with another
22*9880d681SAndroid Build Coastguard Worker     infinite variable space.
23*9880d681SAndroid Build Coastguard Worker
24*9880d681SAndroid Build Coastguard WorkerREASONING:
25*9880d681SAndroid Build Coastguard Worker   * It was decided that because original variable sources could be
26*9880d681SAndroid Build Coastguard Worker     reconstructed from SSA form in linear time, that it would be an
27*9880d681SAndroid Build Coastguard Worker     unjustified expense for the common case to include the extra
28*9880d681SAndroid Build Coastguard Worker     information for one optimization.  Alias analysis itself is typically
29*9880d681SAndroid Build Coastguard Worker     greater than linear in asymptotic complexity, so this extra analaysis
30*9880d681SAndroid Build Coastguard Worker     would not affect the runtime of the optimization in a significant
31*9880d681SAndroid Build Coastguard Worker     way.  Additionally, this would be an unlikely optimization to do at
32*9880d681SAndroid Build Coastguard Worker     runtime.
33*9880d681SAndroid Build Coastguard Worker
34*9880d681SAndroid Build Coastguard Worker
35*9880d681SAndroid Build Coastguard WorkerIDEAS TO CONSIDER
36*9880d681SAndroid Build Coastguard Worker-----------------
37*9880d681SAndroid Build Coastguard Worker
38*9880d681SAndroid Build Coastguard Worker1. Including dominator information in the LLVM bytecode
39*9880d681SAndroid Build Coastguard Worker   representation.  This is one example of an analysis result that may be
40*9880d681SAndroid Build Coastguard Worker   packaged with the bytecodes themselves.  As a conceptual implementation
41*9880d681SAndroid Build Coastguard Worker   idea, we could include an immediate dominator number for each basic block
42*9880d681SAndroid Build Coastguard Worker   in the LLVM bytecode program.  Basic blocks could be numbered according
43*9880d681SAndroid Build Coastguard Worker   to the order of occurrence in the bytecode representation.
44*9880d681SAndroid Build Coastguard Worker
45*9880d681SAndroid Build Coastguard Worker2. Including loop header and body information.  This would facilitate
46*9880d681SAndroid Build Coastguard Worker   detection of intervals and natural loops.
47*9880d681SAndroid Build Coastguard Worker
48*9880d681SAndroid Build Coastguard WorkerUNRESOLVED ISSUES
49*9880d681SAndroid Build Coastguard Worker-----------------
50*9880d681SAndroid Build Coastguard Worker
51*9880d681SAndroid Build Coastguard Worker1. Will oSUIF provide enough of an infrastructure to support the research
52*9880d681SAndroid Build Coastguard Worker   that we will be doing?  We know that it has less than stellar
53*9880d681SAndroid Build Coastguard Worker   performance, but hope that this will be of little importance for our
54*9880d681SAndroid Build Coastguard Worker   static compiler.  This could affect us if we decided to do some IP
55*9880d681SAndroid Build Coastguard Worker   research.  Also we do not yet understand the level of exception support
56*9880d681SAndroid Build Coastguard Worker   currently implemented.
57*9880d681SAndroid Build Coastguard Worker
58*9880d681SAndroid Build Coastguard Worker2. Should we consider the requirements of a direct hardware implementation
59*9880d681SAndroid Build Coastguard Worker   of the LLVM when we design it?  If so, several design issues should
60*9880d681SAndroid Build Coastguard Worker   have their priorities shifted.  The other option is to focus on a
61*9880d681SAndroid Build Coastguard Worker   software layer interpreting the LLVM in all cases.
62*9880d681SAndroid Build Coastguard Worker
63*9880d681SAndroid Build Coastguard Worker3. Should we use some form of packetized format to improve forward
64*9880d681SAndroid Build Coastguard Worker   compatibility?  For example, we could design the system to encode a
65*9880d681SAndroid Build Coastguard Worker   packet type and length field before analysis information, to allow a
66*9880d681SAndroid Build Coastguard Worker   runtime to skip information that it didn't understand in a bytecode
67*9880d681SAndroid Build Coastguard Worker   stream.  The obvious benefit would be for compatibility, the drawback
68*9880d681SAndroid Build Coastguard Worker   is that it would tend to splinter that 'standard' LLVM definition.
69*9880d681SAndroid Build Coastguard Worker
70*9880d681SAndroid Build Coastguard Worker4. Should we use fixed length instructions or variable length
71*9880d681SAndroid Build Coastguard Worker   instructions?  Fetching variable length instructions is expensive (for
72*9880d681SAndroid Build Coastguard Worker   either hardware or software based LLVM runtimes), but we have several
73*9880d681SAndroid Build Coastguard Worker   'infinite' spaces that instructions operate in (SSA register numbers,
74*9880d681SAndroid Build Coastguard Worker   type spaces, or packet length [if packets were implemented]).  Several
75*9880d681SAndroid Build Coastguard Worker   options were mentioned including:
76*9880d681SAndroid Build Coastguard Worker     A. Using 16 or 32 bit numbers, which would be 'big enough'
77*9880d681SAndroid Build Coastguard Worker     B. A scheme similar to how UTF-8 works, to encode infinite numbers
78*9880d681SAndroid Build Coastguard Worker        while keeping small number small.
79*9880d681SAndroid Build Coastguard Worker     C. Use something similar to Huffman encoding, so that the most common
80*9880d681SAndroid Build Coastguard Worker        numbers are the smallest.
81*9880d681SAndroid Build Coastguard Worker
82*9880d681SAndroid Build Coastguard Worker-Chris
83*9880d681SAndroid Build Coastguard Worker
84