[MemProf][NewPM] Make memprof passes required
authorArthur Eubanks <aeubanks@google.com>
Thu, 12 Nov 2020 21:40:03 +0000 (13:40 -0800)
committerArthur Eubanks <aeubanks@google.com>
Fri, 13 Nov 2020 23:15:27 +0000 (15:15 -0800)
Just like other sanitizers.
Fixes check-memprof under NPM.

Reviewed By: leonardchan

Differential Revision: https://reviews.llvm.org/D91389

clang/test/CodeGen/no-skipped-passes-O0-opt-bisect.c
llvm/include/llvm/Transforms/Instrumentation/MemProfiler.h

index 8acba73..1d85f88 100644 (file)
@@ -9,6 +9,7 @@
 // RUN: %clang_cc1 -triple x86_64-linux-gnu -mllvm -enable-npm-optnone -O0 -fexperimental-new-pass-manager %s -fdebug-pass-manager -emit-llvm -o /dev/null -fsanitize=local-bounds 2>&1 | FileCheck %s
 // RUN: %clang_cc1 -triple x86_64-linux-gnu -mllvm -enable-npm-optnone -O0 -fexperimental-new-pass-manager %s -fdebug-pass-manager -emit-llvm -o /dev/null -fsanitize=dataflow 2>&1 | FileCheck %s
 // RUN: %clang_cc1 -triple x86_64-linux-gnu -mllvm -enable-npm-optnone -O0 -fexperimental-new-pass-manager %s -fdebug-pass-manager -emit-llvm -o /dev/null -fsanitize-coverage-trace-pc-guard 2>&1 | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-linux-gnu -mllvm -enable-npm-optnone -O0 -fexperimental-new-pass-manager %s -fdebug-pass-manager -emit-llvm -o /dev/null -fmemory-profile 2>&1 | FileCheck %s
 
 // RUN: %clang_cc1 -triple x86_64-linux-gnu -mllvm -opt-bisect-limit=0 -fexperimental-new-pass-manager %s -fdebug-pass-manager -emit-llvm -o /dev/null 2>&1 | FileCheck %s
 // RUN: %clang_cc1 -triple x86_64-linux-gnu -mllvm -opt-bisect-limit=0 -fexperimental-new-pass-manager %s -fdebug-pass-manager -emit-llvm -o /dev/null -fcoroutines-ts 2>&1 | FileCheck %s
@@ -19,6 +20,7 @@
 // RUN: %clang_cc1 -triple x86_64-linux-gnu -mllvm -opt-bisect-limit=0 -fexperimental-new-pass-manager %s -fdebug-pass-manager -emit-llvm -o /dev/null -fsanitize=local-bounds 2>&1 | FileCheck %s
 // RUN: %clang_cc1 -triple x86_64-linux-gnu -mllvm -opt-bisect-limit=0 -fexperimental-new-pass-manager %s -fdebug-pass-manager -emit-llvm -o /dev/null -fsanitize=dataflow 2>&1 | FileCheck %s
 // RUN: %clang_cc1 -triple x86_64-linux-gnu -mllvm -opt-bisect-limit=0 -fexperimental-new-pass-manager %s -fdebug-pass-manager -emit-llvm -o /dev/null -fsanitize-coverage-trace-pc-guard 2>&1 | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-linux-gnu -mllvm -opt-bisect-limit=0 -fexperimental-new-pass-manager %s -fdebug-pass-manager -emit-llvm -o /dev/null -fmemory-profile 2>&1 | FileCheck %s
 
 // CHECK-NOT: Skipping pass
 
index 6918a24..ac6a07d 100644 (file)
@@ -30,6 +30,7 @@ class MemProfilerPass : public PassInfoMixin<MemProfilerPass> {
 public:
   explicit MemProfilerPass();
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
+  static bool isRequired() { return true; }
 };
 
 /// Public interface to the memory profiler module pass for instrumenting code
@@ -38,6 +39,7 @@ class ModuleMemProfilerPass : public PassInfoMixin<ModuleMemProfilerPass> {
 public:
   explicit ModuleMemProfilerPass();
   PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
+  static bool isRequired() { return true; }
 };
 
 // Insert MemProfiler instrumentation