Clang does not generate `__kmpc_threadprivate_register_vec` for threadprivate arrays of objects


Given an array of objects declared OpenMP threadprivate, such as:

myclass x[4];

#pragma omp threadprivate (x)

Clang generates a call to __kmpc_threadprivate_register instead of __kmpc_threadprivate_register_vec.

The __kmpc_threadprivate_register gets as size “sizeof(myclass) * array_size” so it works just fine, but I was wondering why not using the __kmpc_threadprivate_register_vec provided in the runtime?

Is there a particular reason?



Most probably, because it is not required. Everything works with the regular runtime function.

Best regards,
Alexey Bataev