[Openmp-commits] [PATCH] D19078: Fix trip count calculation for parallel loops in runtime

Jonathan Peyton via Openmp-commits openmp-commits at lists.llvm.org
Wed Apr 13 15:07:11 PDT 2016


jlpeyton created this revision.
jlpeyton added reviewers: AndreyChurbanov, tlwilmar.
jlpeyton added a subscriber: openmp-commits.
jlpeyton set the repository for this revision to rL LLVM.

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 testcase file when there isn't.  This error isn't there for the Intel Compiler.  So for now, the testcase is designated as XFAIL.

Repository:
  rL LLVM

http://reviews.llvm.org/D19078

Files:
  runtime/src/kmp_dispatch.cpp
  runtime/src/kmp_sched.cpp
  runtime/test/worksharing/for/omp_for_bigbounds.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D19078.53628.patch
Type: text/x-patch
Size: 6481 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20160413/f61ad195/attachment.bin>


More information about the Openmp-commits mailing list