COMPOUND CONDITIONAL REORDERING FOR FASTER SHORT-CIRCUITING
First Claim
1. A computing device comprising a processor configured to:
- receive source code at a compiler, wherein the source code includes;
at least one compound conditional having a plurality of conditions; and
for each condition of the plurality of conditions, a respective code block including one or more instructions to evaluate the condition;
for each ordering of a plurality of orderings of the plurality of conditions, determine that the ordering satisfies one or more legality constraints;
for each ordering of the plurality of orderings that satisfy the one or more legality constraints, determine a respective estimated computational cost for that ordering; and
reorder the plurality of conditions to have an ordering that has a lowest estimated computational cost of the plurality of orderings that satisfy the one or more legality constraints.
1 Assignment
0 Petitions
Accused Products
Abstract
A computing device is provided, including a processor configured to receive source code at a compiler. The source code may include at least one compound conditional having a plurality of conditions. For each condition of the plurality of conditions, the source code may further include a respective code block including instructions to evaluate the condition. For each ordering of a plurality of orderings of the plurality of conditions, the processor may determine that the ordering satisfies one or more legality constraints. For each ordering of the plurality of orderings that satisfy the one or more legality constraints, the processor may determine a respective estimated computational cost for that ordering. The processor may reorder the plurality of conditions to have an ordering that has a lowest estimated computational cost of the plurality of orderings that satisfy the one or more legality constraints.
9 Citations
20 Claims
-
1. A computing device comprising a processor configured to:
-
receive source code at a compiler, wherein the source code includes; at least one compound conditional having a plurality of conditions; and for each condition of the plurality of conditions, a respective code block including one or more instructions to evaluate the condition; for each ordering of a plurality of orderings of the plurality of conditions, determine that the ordering satisfies one or more legality constraints; for each ordering of the plurality of orderings that satisfy the one or more legality constraints, determine a respective estimated computational cost for that ordering; and reorder the plurality of conditions to have an ordering that has a lowest estimated computational cost of the plurality of orderings that satisfy the one or more legality constraints. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10)
-
-
11. A method performed by a processor of a computing device, the method comprising:
-
receiving source code at a compiler, wherein the source code includes; at least one compound conditional having a plurality of conditions; and for each condition of the plurality of conditions, a respective code block including one or more instructions to evaluate the condition; for each ordering of a plurality of orderings of the plurality of conditions, determining that the ordering satisfies one or more legality constraints; for each ordering of the plurality of orderings that satisfy the one or more legality constraints, determining a respective estimated computational cost for that ordering; and reordering the plurality of conditions to have an ordering that has a lowest estimated computational cost of the plurality of orderings that satisfy the one or more legality constraints. - View Dependent Claims (12, 13, 14, 15, 16, 17, 18, 19)
-
-
20. A computing device comprising a processor configured to:
-
receive source code at a compiler, wherein the source code includes a plurality of code blocks; for each ordering of a plurality of orderings of the plurality of code blocks, determine that the ordering satisfies one or more legality constraints; for each ordering of the plurality of orderings that satisfy the one or more legality constraints, determine a respective estimated computational cost for that ordering; and reorder the plurality of code blocks to have an ordering that has a lowest estimated computational cost of the plurality of orderings that satisfy the one or more legality constraints.
-
Specification