Page MenuHomePhabricator

Fix trip count calculation for parallel loops in runtime

Authored by jlpeyton on Apr 13 2016, 3:07 PM.



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.

Diff Detail


Event Timeline

jlpeyton updated this revision to Diff 53628.Apr 13 2016, 3:07 PM
jlpeyton retitled this revision from to Fix trip count calculation for parallel loops in runtime.
jlpeyton updated this object.
jlpeyton added reviewers: AndreyChurbanov, tlwilmar.
jlpeyton set the repository for this revision to rL LLVM.
jlpeyton added a subscriber: openmp-commits.
AndreyChurbanov accepted this revision.Apr 18 2016, 10:55 AM
AndreyChurbanov edited edge metadata.


This revision is now accepted and ready to land.Apr 18 2016, 10:55 AM
This revision was automatically updated to reflect the committed changes.