[llvm] [CSSPGO] Return error_code for missing probe profile (PR #102085)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 8 07:39:42 PDT 2024
================
@@ -0,0 +1,327 @@
+; RUN: opt < %s -passes=sample-profile --overwrite-existing-weights -sample-profile-file=%S/Inputs/pseudo-probe-missing-probe.prof | opt -passes='print<branch-prob>' -disable-output 2>&1 | FileCheck %s
+
+; CHECK: edge %while.body -> %if.then probability is 0x7212005e / 0x80000000 = 89.12% [HOT edge]
+; CHECK: edge %while.body -> %if.else probability is 0x0dedffa2 / 0x80000000 = 10.88%
+
+; CHECK-NOT: edge %while.body -> %if.then probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge]
+; CHECK-NOT: edge %while.body -> %if.else probability is 0x00000000 / 0x80000000 = 0.00%
+
+target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
+target triple = "x86_64-unknown-linux-gnu"
+
+ at x = dso_local global i32 0, align 4, !dbg !0
+
+; Function Attrs: noinline nounwind uwtable
+define dso_local void @bar(i32 noundef %i) #0 !dbg !47 !prof !52 {
----------------
WenleiHe wrote:
> so this needs a post-link IR. Also use --overwrite-existing-weights to be exactly repro the issue.
ok that works, though I think you can also simply remove the profile metadata on inlined IR, and then you don't need `--overwrite-existing-weights`.
https://github.com/llvm/llvm-project/pull/102085
More information about the llvm-commits
mailing list