1*9880d681SAndroid Build Coastguard WorkerDate: Tue, 13 Feb 2001 13:29:52 -0600 (CST) 2*9880d681SAndroid Build Coastguard WorkerFrom: Chris Lattner <[email protected]> 3*9880d681SAndroid Build Coastguard WorkerTo: Vikram S. Adve <[email protected]> 4*9880d681SAndroid Build Coastguard WorkerSubject: LLVM Concerns... 5*9880d681SAndroid Build Coastguard Worker 6*9880d681SAndroid Build Coastguard Worker 7*9880d681SAndroid Build Coastguard WorkerI've updated the documentation to include load store and allocation 8*9880d681SAndroid Build Coastguard Workerinstructions (please take a look and let me know if I'm on the right 9*9880d681SAndroid Build Coastguard Workertrack): 10*9880d681SAndroid Build Coastguard Worker 11*9880d681SAndroid Build Coastguard Workerfile:/home/vadve/lattner/llvm/docs/LangRef.html#memoryops 12*9880d681SAndroid Build Coastguard Worker 13*9880d681SAndroid Build Coastguard WorkerI have a couple of concerns I would like to bring up: 14*9880d681SAndroid Build Coastguard Worker 15*9880d681SAndroid Build Coastguard Worker1. Reference types 16*9880d681SAndroid Build Coastguard Worker Right now, I've spec'd out the language to have a pointer type, which 17*9880d681SAndroid Build Coastguard Worker works fine for lots of stuff... except that Java really has 18*9880d681SAndroid Build Coastguard Worker references: constrained pointers that cannot be manipulated: added and 19*9880d681SAndroid Build Coastguard Worker subtracted, moved, etc... Do we want to have a type like this? It 20*9880d681SAndroid Build Coastguard Worker could be very nice for analysis (pointer always points to the start of 21*9880d681SAndroid Build Coastguard Worker an object, etc...) and more closely matches Java semantics. The 22*9880d681SAndroid Build Coastguard Worker pointer type would be kept for C++ like semantics. Through analysis, 23*9880d681SAndroid Build Coastguard Worker C++ pointers could be promoted to references in the LLVM 24*9880d681SAndroid Build Coastguard Worker representation. 25*9880d681SAndroid Build Coastguard Worker 26*9880d681SAndroid Build Coastguard Worker2. 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, there is 30*9880d681SAndroid Build Coastguard Worker no way to represent this in either the bytecode or assembly. 31*9880d681SAndroid Build Coastguard Worker B. When parsing assembly/bytecode, we effectively have to do a full 32*9880d681SAndroid Build Coastguard Worker SSA generation/PHI node insertion pass to build the dependencies 33*9880d681SAndroid Build Coastguard Worker when we don't want the "pinned" representation. This is not 34*9880d681SAndroid Build Coastguard Worker cool. 35*9880d681SAndroid Build Coastguard Worker I'm tempted to make memory references explicit in both the assembly and 36*9880d681SAndroid Build Coastguard Worker bytecode to get around this... what do you think? 37*9880d681SAndroid Build Coastguard Worker 38*9880d681SAndroid Build Coastguard Worker-Chris 39*9880d681SAndroid Build Coastguard Worker 40