Closed digikar99 closed 1 day ago
For this PR, my suggestion is to keep it very simple:
I think we should attack constantness one case at a time so we can thoroughly deliberate it. For now, let's just get the basic behavior in.
@amorphedstar @digikar99 Any remaining outstanding items?
boolean constants
Do you mean CL booleans or Coalton booleans? If the former, could you provide a sample code where they get used in Coalton code?
EDIT: This PR aims to propagate constant literals or other constant objects such as obtained from node-lisp or dict-variables/codegen-syms required to resolve method instances.
Two issues remain for future work:
Consider the following example:
Without the constant-propagation pass,
(lookup-code 'add-df-caller)
returns a node containing a let with a variable binding followed by direct-application:With constant-propagation in place, the constant let bindings are substituted with the literals instead: