[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

GitOrigin-RevId: 56223b1e91ed444a054aa9bd20878d0b62c7b53b
3 files changed