US 12,299,426 B2
Vectorizing a loop
Gil Rapaport, Moledet (IL); and Ayal Zaks, Mitzpe Aviv (IL)
Assigned to Mobileye Vision Technologies Ltd., Jerusalem (IL)
Appl. No. 18/284,752
Filed by Mobileye Vision Technologies Ltd., Jerusalem (IL)
PCT Filed Mar. 28, 2022, PCT No. PCT/IB2022/000188
§ 371(c)(1), (2) Date Sep. 28, 2023,
PCT Pub. No. WO2022/208173, PCT Pub. Date Oct. 6, 2022.
Claims priority of provisional application 63/169,500, filed on Apr. 1, 2021.
Prior Publication US 2024/0184554 A1, Jun. 6, 2024
Int. Cl. G06F 8/41 (2018.01)
CPC G06F 8/452 (2013.01) 26 Claims
OG exemplary drawing
 
1. A method for vectorizing a loop, comprising:
receiving, by a compiler operating on a computing system, input code that comprises a loop that operates on a first array of elements and a second array of elements, wherein during an iteration of the loop a first operation is performed on an element of the first array of elements, or a second operation is performed on an element of the second array of elements;
generating a first compound operation that operates on a predetermined number of elements of the first array of elements, the first compound operation resulting in a first intermediate vector, wherein the first compound operation is executed in parallel in hardware;
generating a second compound operation that operates on the predetermined number of elements of the second array of elements, the second compound operation resulting in a second intermediate vector, wherein the second compound operation is executed in parallel in hardware;
interleaving the first intermediate vector and the second intermediate vector to produce an interleaved result, and storing the interleaved result in a temporary vector; and summing the interleaved result in the temporary vector using an order-preserving sum.