3 ms·
"...in LLVM, all variables start with their address taken, so the optimizer needs to reason about when all uses of the address are known." Why is this? Does i
by gdwatson 5y ago
"...in LLVM, all variables start with their address taken, so the optimizer needs to reason about when all uses of the address are known."
Why is this? Does it simplify SSA construction, or is there another reason?
- jcranmer 5y agoIt simplifies code generation. LLVM has no address-of operator; instead, you start with the address of an object (be it a global variable or a local alloca), and you take the address by using the address instead of loading the value at the address. Also, this means that all lvalues start by living in memory, and this dramatically simplifies bookkeeping you need for lvalues that may not be easily representable as registers (e.g., struct values).