diff options
author | Gheorghe-Teodor Bercea <gheorghe-teod.bercea@ibm.com> | 2018-09-27 20:29:00 +0000 |
---|---|---|
committer | Gheorghe-Teodor Bercea <gheorghe-teod.bercea@ibm.com> | 2018-09-27 20:29:00 +0000 |
commit | 8233af90e1e459425042d43075c13aef5b81e0fc (patch) | |
tree | f73323099039f4f58c9eb09cfc77e9abfd5c29a5 /clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp | |
parent | 9da26b20da9d66cb5d2df265c67c05f59a08557f (diff) | |
download | bcm5719-llvm-8233af90e1e459425042d43075c13aef5b81e0fc.tar.gz bcm5719-llvm-8233af90e1e459425042d43075c13aef5b81e0fc.zip |
[OpenMP] Make default parallel for schedule in NVPTX target regions in SPMD mode achieve coalescing
Summary: Set default schedule for parallel for loops to schedule(static, 1) when using SPMD mode on the NVPTX device offloading toolchain to ensure coalescing.
Reviewers: ABataev, Hahnfeld, caomhin
Reviewed By: ABataev
Subscribers: jholewinski, guansong, cfe-commits
Differential Revision: https://reviews.llvm.org/D52629
llvm-svn: 343260
Diffstat (limited to 'clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp b/clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp index 56b244d0ae8..14fd4a3113b 100644 --- a/clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp +++ b/clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp @@ -4093,3 +4093,14 @@ void CGOpenMPRuntimeNVPTX::getDefaultDistScheduleAndChunk( S.getIterationVariable()->getType(), S.getBeginLoc()); } } + +void CGOpenMPRuntimeNVPTX::getDefaultScheduleAndChunk( + CodeGenFunction &CGF, const OMPLoopDirective &S, + OpenMPScheduleClauseKind &ScheduleKind, + llvm::Value *&Chunk) const { + if (getExecutionMode() == CGOpenMPRuntimeNVPTX::EM_SPMD) { + ScheduleKind = OMPC_SCHEDULE_static; + Chunk = CGF.Builder.getIntN(CGF.getContext().getTypeSize( + S.getIterationVariable()->getType()), 1); + } +} |