US 12,265,807 B2
Control flow auto-vectorization using run-time checks and compile-time analysis
Bangtian Liu, Toronto (CA); Avery Laird, Toronto (CA); Wai Hung Tsang, Markham (CA); Bardia Mahjour, Newmarket (CA); and Maryam Dehnavi, Toronto (CA)
Assigned to INTERNATIONAL BUSINESS MACHINES CORPORATION, Armonk, NY (US)
Filed by International Business Machines Corporation, Armonk, NY (US)
Filed on Mar. 30, 2023, as Appl. No. 18/192,878.
Prior Publication US 2024/0329957 A1, Oct. 3, 2024
Int. Cl. G06F 9/44 (2018.01); G06F 8/41 (2018.01)
CPC G06F 8/452 (2013.01) [G06F 8/433 (2013.01)] 20 Claims
OG exemplary drawing
 
1. A computer-implemented method comprising:
obtaining program code to be compiled, the program code comprising a loop, and the loop comprising a control-flow having divergent branch conditions; and
compiling the program code to produce compiled code, the compiling comprising:
performing compile-time analysis of the loop based on an assumption of dynamic uniformity, and determining from the compile-time analysis a vectorizable access pattern of the loop; and
vectorizing the loop as part of the compiling the program code, including compiling the loop, the vectorizing comprising:
providing run-time checks in the compiled code, the run-time checks configured for checking for dynamically uniform conditions for vector processing at run-time to control program execution flow based on a result of the checking; and
outputting the compiled code for execution.