[llvm] 8b57ed0 - [OpenMP] Prevent Attributor from deleting functions in OpenMPOptCGSCC pass
via llvm-commits
llvm-commits at lists.llvm.org
Thu May 13 13:36:34 PDT 2021
Author: Joseph Huber
Date: 2021-05-13T16:35:23-04:00
New Revision: 8b57ed09bd238b00b5d096f9be7ef9f831428044
URL: https://github.com/llvm/llvm-project/commit/8b57ed09bd238b00b5d096f9be7ef9f831428044
DIFF: https://github.com/llvm/llvm-project/commit/8b57ed09bd238b00b5d096f9be7ef9f831428044.diff
LOG: [OpenMP] Prevent Attributor from deleting functions in OpenMPOptCGSCC pass
Summary:
This patch prevents the Attributor instances made in the CGSCC pass from
deleting functions. This prevents the attributor from changing the call
graph while OpenMPOpt is working with it.
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D102363
Added:
Modified:
llvm/lib/Transforms/IPO/OpenMPOpt.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/IPO/OpenMPOpt.cpp b/llvm/lib/Transforms/IPO/OpenMPOpt.cpp
index 4ea2e848e3903..a05c7539ae43f 100644
--- a/llvm/lib/Transforms/IPO/OpenMPOpt.cpp
+++ b/llvm/lib/Transforms/IPO/OpenMPOpt.cpp
@@ -2547,7 +2547,7 @@ PreservedAnalyses OpenMPOptCGSCCPass::run(LazyCallGraph::SCC &C,
OMPInformationCache InfoCache(*(Functions.back()->getParent()), AG, Allocator,
/*CGSCC*/ Functions, OMPInModule.getKernels());
- Attributor A(Functions, InfoCache, CGUpdater);
+ Attributor A(Functions, InfoCache, CGUpdater, nullptr, false);
OpenMPOpt OMPOpt(SCC, CGUpdater, OREGetter, InfoCache, A);
bool Changed = OMPOpt.run(false);
@@ -2556,6 +2556,7 @@ PreservedAnalyses OpenMPOptCGSCCPass::run(LazyCallGraph::SCC &C,
return PreservedAnalyses::all();
}
+
namespace {
struct OpenMPOptCGSCCLegacyPass : public CallGraphSCCPass {
@@ -2622,7 +2623,7 @@ struct OpenMPOptCGSCCLegacyPass : public CallGraphSCCPass {
*(Functions.back()->getParent()), AG, Allocator,
/*CGSCC*/ Functions, OMPInModule.getKernels());
- Attributor A(Functions, InfoCache, CGUpdater);
+ Attributor A(Functions, InfoCache, CGUpdater, nullptr, false);
OpenMPOpt OMPOpt(SCC, CGUpdater, OREGetter, InfoCache, A);
return OMPOpt.run(false);
More information about the llvm-commits
mailing list