Method and apparatus for instrumentation of an executable computer program
that includes a predicated branch-call instruction followed by a call-shadow instruction.
The predicated branch-call instruction and the call-shadow instruction is stored
in a first bundle of instructions, which is followed by a second bundle. The predicated
branch-call instruction is changed to a predicated branch instruction that targets
a fifth bundle of instructions, and the predicate of the predicated branch instruction
is the same as the predicate of the predicated branch-call instruction. Third,
fourth, and fifth bundles are created to preserve program semantics. The third
bundle is inserted following the first bundle and includes the call-shadow instruction.
The fourth bundle is inserted following the third bundle and includes a branch
instruction that targets the second bundle. The fifth bundle is inserted following
the fourth bundle and includes a branch-call instruction that has a target address
equal to the target address of the predicated branch-call instruction. Instrumentation
instructions are then inserted.