You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
-j --legacy-codegen: give each closure a name unique in the program, so that a program with closures can use the parallel check #4012
vxc -j N --legacy-codegen (PR #4006, for #3139) cannot compile a program that has a closure on the parallel path. It sends the program to a normal compile and prints a note on stderr.
The reason: the checker names each closure with a counter (Closure_1, Closure_2, ...), and that name is in the MLIR. A normal compile keeps one counter for the whole program. A parallel check starts the counter again in each function. So two functions can both make a Closure_1. Without the rule in #4006, the second closure runs the body of the first one, and the closure fixture of #4006 prints 12 instead of 6.
Done when:
The parallel check gives each closure a name that no other function of the program uses. It should not depend on the thread count. For example, prefix the name with the name of the function, or number the closures after all checks end.
-j N --legacy-codegen on a program with closures takes the parallel path. Its bytes match the normal --legacy-codegen compile at -j 1, -j 2 and -j 8.
The names that ?, vec! and tasks get from counters do not need this. They stay in one function, and a normal compile also starts them again in each function.
Activity