[OpenMP] Help static loop code avoid over/underflow
authorPeyton, Jonathan L <jonathan.l.peyton@intel.com>
Fri, 29 Jan 2021 20:02:38 +0000 (14:02 -0600)
committerPeyton, Jonathan L <jonathan.l.peyton@intel.com>
Mon, 22 Feb 2021 19:22:01 +0000 (13:22 -0600)
commit56223b1e91ed444a054aa9bd20878d0b62c7b53b
treeb80a531aa7a270af23763e8be03facd5fffb5b5d
parent817d343fb048b330b77a7b4ef0af0dba7450dfb2
[OpenMP] Help static loop code avoid over/underflow

This code alleviates some pathological loop parameters (lower,
upper, stride) within calculations involved in the static loop code.  It
bounds the chunk size to the trip count if it is greater than the trip
count and also minimizes problematic code for when trip count < nth.

Differential Revision: https://reviews.llvm.org/D96426
openmp/runtime/src/kmp_dispatch.cpp
openmp/runtime/src/kmp_sched.cpp
openmp/runtime/test/worksharing/for/omp_for_static_large_chunk.c [new file with mode: 0644]