Skip to content

Commit

Permalink
Merge pull request #17 from skatrak/atd/fix-opt-test
Browse files Browse the repository at this point in the history
[OpenMP][LLVM] Fix opt test
  • Loading branch information
skatrak committed Jan 24, 2024
2 parents efa5f1d + e8a4a9b commit 2fca6ea
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions llvm/lib/Transforms/IPO/OpenMPOpt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,20 @@ struct OMPInformationCache : public InformationCache {
OpenMPPostLink(OpenMPPostLink) {

OMPBuilder.Config.IsTargetDevice = isOpenMPDevice(OMPBuilder.M);
const Triple T(OMPBuilder.M.getTargetTriple());
switch (T.getArch()) {
case llvm::Triple::nvptx:
case llvm::Triple::nvptx64:
case llvm::Triple::amdgcn:
assert(OMPBuilder.Config.IsTargetDevice &&
"OpenMP AMDGPU/NVPTX is only prepared to deal with device code.");
OMPBuilder.Config.IsGPU = true;
break;
default:
OMPBuilder.Config.IsGPU = false;
break;
}

OMPBuilder.initialize();
initializeRuntimeFunctions(M);
initializeInternalControlVars();
Expand Down

0 comments on commit 2fca6ea

Please sign in to comment.