From 557d3de09e89c71aa82403b113bd9b863ae3fb0d Mon Sep 17 00:00:00 2001 From: Leonard Chan Date: Mon, 24 Jun 2019 16:44:27 +0000 Subject: [PATCH] [clang][NewPM] Remove exception handling before loading pgo sample profile data This patch ensures that SimplifyCFGPass comes before SampleProfileLoaderPass on PGO runs in the new PM and fixes clang/test/CodeGen/pgo-sample.c. Differential Revision: https://reviews.llvm.org/D63626 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@364201 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/CodeGen/pgo-sample.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/test/CodeGen/pgo-sample.c b/test/CodeGen/pgo-sample.c index e7d2fa61aa..f0e73ec076 100644 --- a/test/CodeGen/pgo-sample.c +++ b/test/CodeGen/pgo-sample.c @@ -1,6 +1,13 @@ // Test if PGO sample use passes are invoked. // // Ensure Pass PGOInstrumentationGenPass is invoked. -// RUN: %clang_cc1 -O2 -fprofile-sample-use=%S/Inputs/pgo-sample.prof %s -mllvm -debug-pass=Structure -emit-llvm -o - 2>&1 | FileCheck %s -// CHECK: Remove unused exception handling info -// CHECK: Sample profile pass +// RUN: %clang_cc1 -O2 -fno-experimental-new-pass-manager -fprofile-sample-use=%S/Inputs/pgo-sample.prof %s -mllvm -debug-pass=Structure -emit-llvm -o - 2>&1 | FileCheck %s --check-prefix=LEGACY +// RUN: %clang_cc1 -O2 -fexperimental-new-pass-manager -fprofile-sample-use=%S/Inputs/pgo-sample.prof %s -fdebug-pass-manager -emit-llvm -o - 2>&1 | FileCheck %s --check-prefix=NEWPM + +// LEGACY: Remove unused exception handling info +// LEGACY: Sample profile pass + +// NEWPM: SimplifyCFGPass +// NEWPM: SampleProfileLoaderPass + +int func(int a) { return a; } -- 2.50.1