This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP] Avoid remainder operations for loop index values on a collapsed loop nest.
ClosedPublic

Authored by gtbercea on Jan 7 2019, 2:09 PM.

Details

Summary

Change the strategy for computing loop index variables after collapsing a loop nest via the collapse clause by replacing the expensive remainder operation with multiplications and additions.

Diff Detail

Repository
rC Clang

Event Timeline

gtbercea created this revision.Jan 7 2019, 2:09 PM
ABataev added inline comments.Jan 8 2019, 8:48 AM
lib/Sema/SemaOpenMP.cpp
5598

No need for .get() here

5599

Use preincrement

5608
  1. Preincrement.
  2. Format.
gtbercea updated this revision to Diff 180709.Jan 8 2019, 11:40 AM
Invert accumulation direction.
gtbercea updated this revision to Diff 180711.Jan 8 2019, 11:40 AM

Fix update.

gtbercea marked 3 inline comments as done.Jan 8 2019, 11:41 AM
ABataev added inline comments.Jan 8 2019, 11:47 AM
lib/Sema/SemaOpenMP.cpp
5603–5617

Do you need to initialize Iter here?

gtbercea updated this revision to Diff 180713.Jan 8 2019, 11:54 AM

Remove redundant initalization.

gtbercea marked an inline comment as done.Jan 8 2019, 11:54 AM
This revision is now accepted and ready to land.Jan 8 2019, 11:55 AM
This revision was automatically updated to reflect the committed changes.