[PATCH] D106980: [OpenMP] Emit remark on the captured call instead of the variable
Joseph Huber via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 28 11:25:37 PDT 2021
jhuber6 created this revision.
jhuber6 added a reviewer: jdoerfert.
Herald added subscribers: ormris, okura, kuter, guansong, hiraditya, yaxunl.
jhuber6 requested review of this revision.
Herald added a reviewer: sstefan1.
Herald added subscribers: llvm-commits, bbn, sstefan1.
Herald added a reviewer: baziotis.
Herald added a project: LLVM.
Changes the remark to emit on the function call that captures the globalized
variable instead of the globalized variable itself. The user should be able to
see which variable it was in the argument list of the function.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D106980
Files:
llvm/lib/Transforms/IPO/AttributorAttributes.cpp
llvm/test/Transforms/OpenMP/globalization_remarks.ll
llvm/test/Transforms/OpenMP/remove_globalization.ll
Index: llvm/test/Transforms/OpenMP/remove_globalization.ll
===================================================================
--- llvm/test/Transforms/OpenMP/remove_globalization.ll
+++ llvm/test/Transforms/OpenMP/remove_globalization.ll
@@ -58,7 +58,7 @@
;
entry:
%0 = call i8* @__kmpc_alloc_shared(i64 4), !dbg !13
- call void @share(i8* %0)
+ call void @share(i8* %0), !dbg !13
call void @__kmpc_free_shared(i8* %0, i64 4)
ret void
}
Index: llvm/test/Transforms/OpenMP/globalization_remarks.ll
===================================================================
--- llvm/test/Transforms/OpenMP/globalization_remarks.ll
+++ llvm/test/Transforms/OpenMP/globalization_remarks.ll
@@ -17,13 +17,13 @@
%0 = call i8* @__kmpc_alloc_shared(i64 4), !dbg !10
%x_on_stack = bitcast i8* %0 to i32*
%1 = bitcast i32* %x_on_stack to i8*
- call void @share(i8* %1)
+ call void @share(i8* %1), !dbg !10
call void @__kmpc_free_shared(i8* %0)
call void @__kmpc_target_deinit(%struct.ident_t* null, i1 false, i1 true)
ret void
}
-define void @share(i8* %x) {
+define internal void @share(i8* %x) {
entry:
store i8* %x, i8** @S
ret void
@@ -31,9 +31,10 @@
declare i8* @__kmpc_alloc_shared(i64)
-declare void @__kmpc_free_shared(i8*)
+declare void @__kmpc_free_shared(i8* nocapture)
declare i32 @__kmpc_target_init(%struct.ident_t*, i1, i1, i1);
+
declare void @__kmpc_target_deinit(%struct.ident_t*, i1, i1)
!llvm.dbg.cu = !{!0}
Index: llvm/lib/Transforms/IPO/AttributorAttributes.cpp
===================================================================
--- llvm/lib/Transforms/IPO/AttributorAttributes.cpp
+++ llvm/lib/Transforms/IPO/AttributorAttributes.cpp
@@ -6165,7 +6165,7 @@
if (ValidUsesOnly &&
AI.LibraryFunctionId == LibFunc___kmpc_alloc_shared)
- A.emitRemark<OptimizationRemarkMissed>(AI.CB, "OMP113", Remark);
+ A.emitRemark<OptimizationRemarkMissed>(CB, "OMP113", Remark);
LLVM_DEBUG(dbgs() << "[H2S] Bad user: " << *UserI << "\n");
ValidUsesOnly = false;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D106980.362473.patch
Type: text/x-patch
Size: 2082 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210728/6d65a724/attachment.bin>
More information about the llvm-commits
mailing list