From 44feacc736e1ae35beafdf1cbfe59f7ff6688157 Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Tue, 22 Jun 2021 14:57:52 -0400 Subject: [PATCH] [OpenMP] Change remaining globalization from an analysis remark to missed After landing the globalization optimizations, the precense of globalization on the device that was not put in shared or stack memory is a failed optimization with performance consequences so it should indicate a missed remark. Reviewed By: jdoerfert Differential Revision: https://reviews.llvm.org/D104735 --- llvm/lib/Transforms/IPO/OpenMPOpt.cpp | 7 +++---- llvm/test/Transforms/OpenMP/globalization_remarks.ll | 2 +- llvm/test/Transforms/PhaseOrdering/openmp-opt-module.ll | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/llvm/lib/Transforms/IPO/OpenMPOpt.cpp b/llvm/lib/Transforms/IPO/OpenMPOpt.cpp index c79e9dfafbd7..9822750c69a9 100644 --- a/llvm/lib/Transforms/IPO/OpenMPOpt.cpp +++ b/llvm/lib/Transforms/IPO/OpenMPOpt.cpp @@ -1145,13 +1145,12 @@ private: auto CheckGlobalization = [&](Use &U, Function &Decl) { if (CallInst *CI = getCallIfRegularCall(U, &RFI)) { - auto Remark = [&](OptimizationRemarkAnalysis ORA) { - return ORA + auto Remark = [&](OptimizationRemarkMissed ORM) { + return ORM << "Found thread data sharing on the GPU. " << "Expect degraded performance due to data globalization."; }; - emitRemark(CI, "OpenMPGlobalization", - Remark); + emitRemark(CI, "OpenMPGlobalization", Remark); } return false; diff --git a/llvm/test/Transforms/OpenMP/globalization_remarks.ll b/llvm/test/Transforms/OpenMP/globalization_remarks.ll index dfd9173de177..f1db90d0d342 100644 --- a/llvm/test/Transforms/OpenMP/globalization_remarks.ll +++ b/llvm/test/Transforms/OpenMP/globalization_remarks.ll @@ -1,4 +1,4 @@ -; RUN: opt -passes=openmp-opt -pass-remarks-analysis=openmp-opt -disable-output < %s 2>&1 | FileCheck %s +; RUN: opt -passes=openmp-opt -pass-remarks-missed=openmp-opt -disable-output < %s 2>&1 | FileCheck %s ; ModuleID = 'declare_target_codegen_globalization.cpp' source_filename = "declare_target_codegen_globalization.cpp" target datalayout = "e-i64:64-i128:128-v16:16-v32:32-n16:32:64" diff --git a/llvm/test/Transforms/PhaseOrdering/openmp-opt-module.ll b/llvm/test/Transforms/PhaseOrdering/openmp-opt-module.ll index c401da803734..e3bf6f296b23 100644 --- a/llvm/test/Transforms/PhaseOrdering/openmp-opt-module.ll +++ b/llvm/test/Transforms/PhaseOrdering/openmp-opt-module.ll @@ -1,4 +1,4 @@ -; RUN: opt -O2 -pass-remarks-analysis=openmp-opt -enable-new-pm < %s 2>&1 | FileCheck %s --check-prefix=MODULE +; RUN: opt -O2 -pass-remarks-missed=openmp-opt -enable-new-pm < %s 2>&1 | FileCheck %s --check-prefix=MODULE target datalayout = "e-i64:64-i128:128-v16:16-v32:32-n16:32:64" @.str = private unnamed_addr constant [13 x i8] c"Alloc Shared\00", align 1