This patch is a small optimization to only generate a call to __kmpc_global_thread_num if the result is actually used.