Method for collapsing the prolog and epilog of software pipelined loops
First Claim
1. A method for reducing a code size of a software pipelined loop having a kernel and an epilog, comprising:
- evaluating at least one stage of the epilog, comprising;
selecting a stage of the epilog to evaluate;
evaluating at least one instruction in a reference stage, comprising identifying an instruction in the reference stage that is not present in the selected stage of the epilog;
determining if the identified instruction can be speculated;
noting that the identified instruction can be speculated responsive to a determination that the identified instruction can be speculated;
determining if the identified instruction can be predicated responsive to a determination that the identified instruction cannot be speculated;
marking the identified instruction as needing predication responsive to a determination that the identified instruction can be predicated;
determining if another instruction in the reference stage is not present in the selected stage of the epilog;
repeating the instruction evaluation responsive to a determination that there is another instruction in the reference stage not present in the selected stage of the epilog;
determining if there is another stage of the epilog to evaluate; and
repeating the evaluation of the stage responsive to a determination that there is another instruction in the reference stage not present in the selected stage of the epilog.
1 Assignment
0 Petitions
Accused Products
Abstract
A method for reducing a code size of a software pipelined loop, the software pipelined loop having a kernel and an epilog. The method includes first evaluating a stage of the epilog. This includes selecting a stage of the epilog to evaluate (504) and evaluating an instruction in a reference stage. This includes identifying an instruction in the reference stage that is not present in the selected stage of the epilog (506) and determining if the identified instruction can be speculated (508). If the identified instruction can be speculated, such is noted. If the instruction cannot be speculated, it is determined whether the identified instruction can be predicated (512). If the instruction can be predicated, it is marked as needing predication (514). Next, it is determined if another instruction in the reference stage is not present in the selected stage of the epilog (510). If there is, the instruction evaluation is repeated. If there is another stage of the epilog to evaluate, the evaluation is repeated (518).
-
Citations
20 Claims
-
1. A method for reducing a code size of a software pipelined loop having a kernel and an epilog, comprising:
-
evaluating at least one stage of the epilog, comprising;
selecting a stage of the epilog to evaluate;
evaluating at least one instruction in a reference stage, comprising identifying an instruction in the reference stage that is not present in the selected stage of the epilog;
determining if the identified instruction can be speculated;
noting that the identified instruction can be speculated responsive to a determination that the identified instruction can be speculated;
determining if the identified instruction can be predicated responsive to a determination that the identified instruction cannot be speculated;
marking the identified instruction as needing predication responsive to a determination that the identified instruction can be predicated;
determining if another instruction in the reference stage is not present in the selected stage of the epilog;
repeating the instruction evaluation responsive to a determination that there is another instruction in the reference stage not present in the selected stage of the epilog;
determining if there is another stage of the epilog to evaluate; and
repeating the evaluation of the stage responsive to a determination that there is another instruction in the reference stage not present in the selected stage of the epilog. - View Dependent Claims (2, 3, 4, 5, 6, 7)
-
-
8. A method for reducing a code size of a software pipelined loop having a prolog and a kernel, comprising:
-
evaluating at least one stage of the prolog, comprising;
selecting a stage of the prolog to evaluate;
evaluating at least one instruction in a reference stage, comprising identifying an instruction in the reference stage that is not present in the selected stage of the prolog;
determining if the identified instruction can be speculated;
noting that the identified instruction can be speculated responsive to a determination that the identified instruction can be speculated;
determining if the identified instruction can be predicated responsive to a determination that the identified instruction cannot be speculated;
marking the identified instruction as needing predication responsive to a determination that the identified instruction can be predicated;
determining if another instruction in the reference stage is not present in the selected stage of the prolog;
repeating the instruction evaluation responsive to a determination that there is another instruction in the reference stage not present in the selected stage of the prolog;
determining if there is another stage of the prolog to evaluate; and
repeating the evaluation of the stage responsive to a determination that there is another instruction in the reference stage not present in the selected stage of the prolog. - View Dependent Claims (9, 10, 11, 12, 13, 14, 16, 17, 18, 19, 20)
-
-
15. A method for reducing a code size of a software pipelined loop having a prolog and a kernel, said kernel having a plurality of cycles, comprising:
-
evaluating at least one stage of the prolog, comprising;
selecting a candidate stage of the prolog to evaluate;
evaluating at least one cycle of the prolog, comprising;
selecting an innermost unprocessed cycle of the selected stage to evaluate, comprising;
evaluating at least one instruction in a reference stage, comprising identifying an instruction in a cycle of the reference stage that is not present in a corresponding cycle of the candidate stage;
determining if the identified instruction can be speculated;
noting that the identified instruction can be speculated responsive to a determination that the identified instruction can be speculated;
determining if the identified instruction can be predicated responsive to a determination that the identified instruction cannot be speculated;
marking the identified instruction as predicated responsive to a determination that the identified instruction can be predicated;
determining if another instruction in the reference stage is not present in the selected cycle of the prolog;
repeating the instruction evaluation responsive to a determination that there is another instruction in the reference stage not present in the corresponding cycle of the prolog;
determining if there is another cycle of the candidate stage of the prolog to evaluate;
repeating the cycle evaluation responsive to a determination that there is another cycle to evaluate;
determining if there is another stage of the prolog to evaluate; and
repeating the evaluation of the stage responsive to a determination that there is another stage of the prolog to evaluate.
-
Specification