Walter's talk on D backend

Dibyendu Majumdar mobile at majumdar.org.uk
Fri Sep 20 19:17:55 UTC 2024


It seems to me that Walter may have based his original 
implementation on the C compiler by Dennis Ritchie.

The DMR C compiler had expression trees and separately control 
flow IR.
Here is a snippet from DMR's explanation of how registers were 
allocated - it sounds similar to what Walter described.

     Each expression tree, as it is read in, is subjected to a 
fairly comprehensive analysis. This is performed by the optim 
routine and a number of subroutines; the major things done are

     Modifications and simplifications of the tree so its value 
may be computed more efficiently and conveniently by the code 
generator.

     Marking each interior node with an estimate of the number of 
registers required to evaluate it. This register count is needed 
to guide the code generation algorithm.

     The basic organization is simple: a depth-first scan of the 
tree.




More information about the Digitalmars-d mailing list