[PATCH] D88621: [OpenMP] Add Missing Runtime Call for Globalization Remarks
Joseph Huber via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 1 18:21:47 PDT 2020
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG82453e759c77: [OpenMP] Add Missing Runtime Call for Globalization Remarks (authored by jhuber6).
Changed prior to commit:
https://reviews.llvm.org/D88621?vs=295425&id=295709#toc
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D88621/new/
https://reviews.llvm.org/D88621
Files:
llvm/lib/Transforms/IPO/OpenMPOpt.cpp
llvm/test/Transforms/OpenMP/globalization_remarks.ll
Index: llvm/test/Transforms/OpenMP/globalization_remarks.ll
===================================================================
--- llvm/test/Transforms/OpenMP/globalization_remarks.ll
+++ llvm/test/Transforms/OpenMP/globalization_remarks.ll
@@ -59,7 +59,7 @@
br i1 %.not, label %.non-spmd, label %.exit
.non-spmd: ; preds = %entry
- %1 = tail call i8* @__kmpc_data_sharing_coalesced_push_stack(i64 128, i16 0) #4, !dbg !31
+ %1 = tail call i8* @__kmpc_data_sharing_push_stack(i64 128, i16 0) #4, !dbg !31
%2 = bitcast i8* %1 to %struct._globalized_locals_ty*
br label %.exit
@@ -86,6 +86,8 @@
declare i8* @__kmpc_data_sharing_coalesced_push_stack(i64, i16) local_unnamed_addr
+declare i8* @__kmpc_data_sharing_push_stack(i64, i16) local_unnamed_addr
+
; Function Attrs: nounwind readnone
declare i32 @llvm.nvvm.read.ptx.sreg.tid.x() #1
Index: llvm/lib/Transforms/IPO/OpenMPOpt.cpp
===================================================================
--- llvm/lib/Transforms/IPO/OpenMPOpt.cpp
+++ llvm/lib/Transforms/IPO/OpenMPOpt.cpp
@@ -705,24 +705,29 @@
}
void analysisGlobalization() {
- auto &RFI =
- OMPInfoCache.RFIs[OMPRTL___kmpc_data_sharing_coalesced_push_stack];
-
- auto checkGlobalization = [&](Use &U, Function &Decl) {
- if (CallInst *CI = getCallIfRegularCall(U, &RFI)) {
- auto Remark = [&](OptimizationRemarkAnalysis ORA) {
- return ORA
- << "Found thread data sharing on the GPU. "
- << "Expect degraded performance due to data globalization.";
- };
- emitRemark<OptimizationRemarkAnalysis>(CI, "OpenMPGlobalization",
- Remark);
- }
+ RuntimeFunction GlobalizationRuntimeIDs[] = {
+ OMPRTL___kmpc_data_sharing_coalesced_push_stack,
+ OMPRTL___kmpc_data_sharing_push_stack};
+
+ for (const auto GlobalizationCallID : GlobalizationRuntimeIDs) {
+ auto &RFI = OMPInfoCache.RFIs[GlobalizationCallID];
+
+ auto CheckGlobalization = [&](Use &U, Function &Decl) {
+ if (CallInst *CI = getCallIfRegularCall(U, &RFI)) {
+ auto Remark = [&](OptimizationRemarkAnalysis ORA) {
+ return ORA
+ << "Found thread data sharing on the GPU. "
+ << "Expect degraded performance due to data globalization.";
+ };
+ emitRemark<OptimizationRemarkAnalysis>(CI, "OpenMPGlobalization",
+ Remark);
+ }
- return false;
- };
+ return false;
+ };
- RFI.foreachUse(SCC, checkGlobalization);
+ RFI.foreachUse(SCC, CheckGlobalization);
+ }
return;
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D88621.295709.patch
Type: text/x-patch
Size: 2749 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201002/a1e21b61/attachment.bin>
More information about the llvm-commits
mailing list