From 2ab87702231e193ca170aa8ad4caa9f98bc7ced1 Mon Sep 17 00:00:00 2001 From: Arthur Eubanks Date: Wed, 30 Sep 2020 09:42:49 -0700 Subject: [PATCH] [test][SampleProfile][NewPM] Fix some tests under NPM --- llvm/test/Transforms/SampleProfile/branch.ll | 6 +++--- llvm/test/Transforms/SampleProfile/calls.ll | 4 ++-- llvm/test/Transforms/SampleProfile/discriminator.ll | 6 +++--- llvm/test/Transforms/SampleProfile/fnptr.ll | 8 ++++---- llvm/test/Transforms/SampleProfile/offset.ll | 4 ++-- llvm/test/Transforms/SampleProfile/propagate.ll | 4 ++-- llvm/test/Transforms/SampleProfile/remap.ll | 6 +++--- 7 files changed, 19 insertions(+), 19 deletions(-) diff --git a/llvm/test/Transforms/SampleProfile/branch.ll b/llvm/test/Transforms/SampleProfile/branch.ll index 6e7a9eb..32c857c 100644 --- a/llvm/test/Transforms/SampleProfile/branch.ll +++ b/llvm/test/Transforms/SampleProfile/branch.ll @@ -1,5 +1,5 @@ -; RUN: opt < %s -sample-profile -sample-profile-file=%S/Inputs/branch.prof | opt -analyze -branch-prob | FileCheck %s -; RUN: opt < %s -passes=sample-profile -sample-profile-file=%S/Inputs/branch.prof | opt -analyze -branch-prob | FileCheck %s +; RUN: opt < %s -sample-profile -sample-profile-file=%S/Inputs/branch.prof | opt -analyze -branch-prob -enable-new-pm=0 | FileCheck %s +; RUN: opt < %s -passes=sample-profile -sample-profile-file=%S/Inputs/branch.prof | opt -passes='print' -disable-output 2>&1 | FileCheck %s ; Original C++ code for this test case: ; @@ -30,7 +30,7 @@ ; Function Attrs: uwtable define i32 @main(i32 %argc, i8** %argv) #0 !dbg !6 { -; CHECK: Printing analysis 'Branch Probability Analysis' for function 'main': +; CHECK: Printing analysis {{.*}} for function 'main': entry: %retval = alloca i32, align 4 diff --git a/llvm/test/Transforms/SampleProfile/calls.ll b/llvm/test/Transforms/SampleProfile/calls.ll index f92bf54..ecd188f 100644 --- a/llvm/test/Transforms/SampleProfile/calls.ll +++ b/llvm/test/Transforms/SampleProfile/calls.ll @@ -1,5 +1,5 @@ -; RUN: opt < %s -instcombine -sample-profile -sample-profile-file=%S/Inputs/calls.prof | opt -analyze -branch-prob | FileCheck %s -; RUN: opt < %s -passes="function(instcombine),sample-profile" -sample-profile-file=%S/Inputs/calls.prof | opt -analyze -branch-prob | FileCheck %s +; RUN: opt < %s -instcombine -sample-profile -sample-profile-file=%S/Inputs/calls.prof | opt -analyze -branch-prob -enable-new-pm=0 | FileCheck %s +; RUN: opt < %s -passes="function(instcombine),sample-profile" -sample-profile-file=%S/Inputs/calls.prof | opt -passes='print' -disable-output 2>&1 | FileCheck %s ; Original C++ test case ; diff --git a/llvm/test/Transforms/SampleProfile/discriminator.ll b/llvm/test/Transforms/SampleProfile/discriminator.ll index 4908c31..7e2d23e 100644 --- a/llvm/test/Transforms/SampleProfile/discriminator.ll +++ b/llvm/test/Transforms/SampleProfile/discriminator.ll @@ -1,5 +1,5 @@ -; RUN: opt < %s -sample-profile -sample-profile-file=%S/Inputs/discriminator.prof | opt -analyze -branch-prob | FileCheck %s -; RUN: opt < %s -passes=sample-profile -sample-profile-file=%S/Inputs/discriminator.prof | opt -analyze -branch-prob | FileCheck %s +; RUN: opt < %s -sample-profile -sample-profile-file=%S/Inputs/discriminator.prof | opt -analyze -branch-prob -enable-new-pm=0 | FileCheck %s +; RUN: opt < %s -passes=sample-profile -sample-profile-file=%S/Inputs/discriminator.prof | opt -passes='print' -disable-output 2>&1 | FileCheck %s ; Original code ; @@ -23,7 +23,7 @@ ; but the then branch (line 3.1) is only executed 5 times. define i32 @foo(i32 %i) #0 !dbg !4 { -; CHECK: Printing analysis 'Branch Probability Analysis' for function 'foo': +; CHECK: Printing analysis {{.*}} for function 'foo': entry: %i.addr = alloca i32, align 4 %x = alloca i32, align 4 diff --git a/llvm/test/Transforms/SampleProfile/fnptr.ll b/llvm/test/Transforms/SampleProfile/fnptr.ll index c22fc84..94925b4 100644 --- a/llvm/test/Transforms/SampleProfile/fnptr.ll +++ b/llvm/test/Transforms/SampleProfile/fnptr.ll @@ -2,11 +2,11 @@ ; formats. This checks that we produce the same profile annotations regardless ; of the profile format. ; -; RUN: opt < %s -sample-profile -sample-profile-file=%S/Inputs/fnptr.prof | opt -analyze -branch-prob | FileCheck %s -; RUN: opt < %s -sample-profile -sample-profile-file=%S/Inputs/fnptr.binprof | opt -analyze -branch-prob | FileCheck %s +; RUN: opt < %s -sample-profile -sample-profile-file=%S/Inputs/fnptr.prof | opt -analyze -branch-prob -enable-new-pm=0 | FileCheck %s +; RUN: opt < %s -sample-profile -sample-profile-file=%S/Inputs/fnptr.binprof | opt -analyze -branch-prob -enable-new-pm=0| FileCheck %s -; RUN: opt < %s -passes=sample-profile -sample-profile-file=%S/Inputs/fnptr.prof | opt -analyze -branch-prob | FileCheck %s -; RUN: opt < %s -passes=sample-profile -sample-profile-file=%S/Inputs/fnptr.binprof | opt -analyze -branch-prob | FileCheck %s +; RUN: opt < %s -passes=sample-profile -sample-profile-file=%S/Inputs/fnptr.prof | opt -passes='print' -disable-output 2>&1 | FileCheck %s +; RUN: opt < %s -passes=sample-profile -sample-profile-file=%S/Inputs/fnptr.binprof | opt -passes='print' -disable-output 2>&1 | FileCheck %s ; CHECK: edge for.body3 -> if.then probability is 0x1a56a56a / 0x80000000 = 20.58% ; CHECK: edge for.body3 -> if.else probability is 0x65a95a96 / 0x80000000 = 79.42% diff --git a/llvm/test/Transforms/SampleProfile/offset.ll b/llvm/test/Transforms/SampleProfile/offset.ll index 8451efe..b537b24 100644 --- a/llvm/test/Transforms/SampleProfile/offset.ll +++ b/llvm/test/Transforms/SampleProfile/offset.ll @@ -1,5 +1,5 @@ -; RUN: opt < %s -sample-profile -sample-profile-file=%S/Inputs/offset.prof | opt -analyze -branch-prob | FileCheck %s -; RUN: opt < %s -passes=sample-profile -sample-profile-file=%S/Inputs/offset.prof | opt -analyze -branch-prob | FileCheck %s +; RUN: opt < %s -sample-profile -sample-profile-file=%S/Inputs/offset.prof | opt -analyze -branch-prob -enable-new-pm=0 | FileCheck %s +; RUN: opt < %s -passes=sample-profile -sample-profile-file=%S/Inputs/offset.prof | opt -passes='print' -disable-output 2>&1 | FileCheck %s ; Original C++ code for this test case: ; diff --git a/llvm/test/Transforms/SampleProfile/propagate.ll b/llvm/test/Transforms/SampleProfile/propagate.ll index b8db9f6..74a6a70 100644 --- a/llvm/test/Transforms/SampleProfile/propagate.ll +++ b/llvm/test/Transforms/SampleProfile/propagate.ll @@ -1,5 +1,5 @@ -; RUN: opt < %s -sample-profile -sample-profile-file=%S/Inputs/propagate.prof | opt -analyze -branch-prob | FileCheck %s -; RUN: opt < %s -passes=sample-profile -sample-profile-file=%S/Inputs/propagate.prof | opt -analyze -branch-prob | FileCheck %s +; RUN: opt < %s -sample-profile -sample-profile-file=%S/Inputs/propagate.prof | opt -analyze -branch-prob -enable-new-pm=0 | FileCheck %s +; RUN: opt < %s -passes=sample-profile -sample-profile-file=%S/Inputs/propagate.prof | opt -passes='print' -disable-output 2>&1 | FileCheck %s ; Original C++ code for this test case: ; diff --git a/llvm/test/Transforms/SampleProfile/remap.ll b/llvm/test/Transforms/SampleProfile/remap.ll index b7b3fb1..090f4b3 100644 --- a/llvm/test/Transforms/SampleProfile/remap.ll +++ b/llvm/test/Transforms/SampleProfile/remap.ll @@ -1,15 +1,15 @@ -; RUN: opt %s -passes=sample-profile -sample-profile-file=%S/Inputs/remap.prof -sample-profile-remapping-file=%S/Inputs/remap.map | opt -analyze -branch-prob | FileCheck %s +; RUN: opt %s -passes=sample-profile -sample-profile-file=%S/Inputs/remap.prof -sample-profile-remapping-file=%S/Inputs/remap.map | opt -passes='print' -disable-output 2>&1 | FileCheck %s ; ; Check whether profile remapping work with loading profile on demand used by extbinary format profile. ; RUN: llvm-profdata merge -sample -extbinary %S/Inputs/remap.prof -o %t.extbinary.afdo -; RUN: opt %s -passes=sample-profile -sample-profile-file=%t.extbinary.afdo -sample-profile-remapping-file=%S/Inputs/remap.map | opt -analyze -branch-prob | FileCheck %s +; RUN: opt %s -passes=sample-profile -sample-profile-file=%t.extbinary.afdo -sample-profile-remapping-file=%S/Inputs/remap.map | opt -passes='print' -disable-output 2>&1 | FileCheck %s ; ; Reduced from branch.ll declare i1 @foo() define void @_ZN3foo3barERKN1M1XINS_6detail3quxEEE() #0 !dbg !2 { -; CHECK: Printing analysis 'Branch Probability Analysis' for function '_ZN3foo3barERKN1M1XINS_6detail3quxEEE': +; CHECK: Printing analysis {{.*}} for function '_ZN3foo3barERKN1M1XINS_6detail3quxEEE': entry: %cmp = call i1 @foo(), !dbg !6 -- 2.7.4