Fix trip count calculation for parallel loops in runtime
authorJonathan Peyton <jonathan.l.peyton@intel.com>
Mon, 18 Apr 2016 21:38:29 +0000 (21:38 +0000)
committerJonathan Peyton <jonathan.l.peyton@intel.com>
Mon, 18 Apr 2016 21:38:29 +0000 (21:38 +0000)
commit5235a1b603db838df51c91782ca98155d892ff9f
treebecf0fe49a098ddc803ba2b0b06cc08d09045849
parentd8ce87f850ad4b04770b3af7b18ae2dbefd5f012
Fix trip count calculation for parallel loops in runtime

The trip count calculation was incorrect for loops with large bounds. For example,
for(int i=-2,000,000,000; i < 2,000,000,000; i+=50000000), the trip count
calculation had overflow (trying to calculate 2,000,000,000 + 2,000,000,000 with
signed integers) and wasn't giving the right value. This patch fixes this error
in the runtime by using unsigned integers instead. There is still a bug in the
clang compiler component because it warns that there is overflow in the
test case file when there isn't. This error isn't there for the Intel Compiler.
So for now, the test case is designated as XFAIL.

Differential Revision: http://reviews.llvm.org/D19078

llvm-svn: 266677
openmp/runtime/src/kmp_dispatch.cpp
openmp/runtime/src/kmp_sched.cpp
openmp/runtime/test/worksharing/for/omp_for_bigbounds.c [new file with mode: 0644]