3 ms·
Gotcha. I think I see what you're talking about now. I have crude familiarity with SSA (no personal experience but I've read a book once) but not with LLVM's t
by dragontamer 5y ago
Gotcha. I think I see what you're talking about now.
I have crude familiarity with SSA (no personal experience but I've read a book once) but not with LLVM's terminology. I'm looking at the example in the blogpost, and I can see that its clearly adding in the important Phi functions needed
Strange that llvm names their aggressive SSA step in this manner. But yes, adding the phi functions in this manner is a very important step before we can think about optimizations.
The "inductive variable" is far easier to detect once its in a "Phi-form" so to speak.
- woodruffw 5y agoIt's an extremely confusing naming choice! I don't know why they did it, but to take a guess: a lot of compiler literature refers to SSA values as "registers," since the SSA model of a computer program directly corresponds to the concept of an (infinite) register machine in abstract computation. The end result being that we have the same word "register" referring to two opposed resources (one infinite, one extremely finite) :-).
- gsnedders 5y agoAt least historically LLVM has itself been inconsistent in the naming of SSA "values", and mem2reg is arguably just the most prominent example of the "register" name being used.
- ufo 5y agoIt's not the only place where this terminology confuses people. Another one is "register-based virtual machine", in the context of interpreters. In that case the registers belong to the VM and are actually stored in stack memory, not on actual CPU registers. However, people get that confused all the time!