A system and method of compiling source code. A compiler generates
intermediate code from the source code, generates object code instructions
from the intermediate code and schedules the object code instructions.
Object code instructions are scheduled by inserting a speculation check
into the object code instructions, storing recovery code associated with
the speculation check and generating a control flow graph. The control
flow graph is generated by converting the speculation check to a non-flow
control check instruction, attaching one or more pseudo instructions to
the check instruction and converting the non-flow control check
instruction to a flow control check instruction, wherein the pseudo
instructions represent recovery code behavior for the recovery code
associated with the check instruction.