US 12,242,832 B1
Cross compilation unit sparse conditional constant propagation
Christian Wimmer, Foster City, CA (US); and Liviu Codrut Stancu, Zurich (CH)
Assigned to Oracle International Corporation, Redwood Shores, CA (US)
Filed by Oracle International Corporation, Redwood Shores, CA (US)
Filed on Aug. 21, 2023, as Appl. No. 18/452,842.
Int. Cl. G06F 8/41 (2018.01)
CPC G06F 8/4441 (2013.01) [G06F 8/433 (2013.01)] 20 Claims
OG exemplary drawing
 
1. A method comprising:
while compiling a program:
expanding a flow graph of a first compilation unit of the program,
marking a first plurality of corresponding parameter states of a first plurality of statements of the first compilation unit as empty,
processing the first plurality of statements to update the first plurality of corresponding parameter states with an exact type and a value set, wherein processing the first plurality of statements comprises:
tracking a control flow predicate of a block in the first compilation unit, wherein the block comprises a first subset of the first plurality of statements,
only after the control flow predicate indicates that the block is executable:
processing an invocation statement in the first subset of the first plurality of statements, and
expanding, responsive to the invocation statement, the flow graph for a second compilation unit of the program that is identified by the invocation statement,
wherein expanding the flow graph comprises propagating the exact type and the value set of an actual parameter state to a formal parameter state of an input parameter of the second compilation unit, the actual parameter state in the first plurality of corresponding parameter states, and
optimizing the program using the first plurality of corresponding parameter states to generate a compiled program.