[llvm] [InstrProf] Support conditional counter updates (PR #102542)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 13 19:20:09 PDT 2024
================
@@ -0,0 +1,17 @@
+; RUN: opt < %s -S -passes=instrprof -conditional-counter-update | FileCheck %s
+
+target triple = "x86_64-unknown-linux-gnu"
+
+ at __profn_foo = private constant [3 x i8] c"foo"
+
+; CHECK-LABEL: define void @foo
+; CHECK-NEXT: %pgocount = load i8, ptr @__profc_foo, align 1
+; CHECK-NEXT: %pgocount.ifnonzero = icmp ne i8 %pgocount, 0
+; CHECK-NEXT: br i1 %pgocount.ifnonzero, label %1, label %2
+; CHECK: 1: ; preds = %0
+; CHECK-NEXT: store i8 0, ptr @__profc_foo, align 1
+; CHECK-NEXT: br label %2
+define void @foo() {
----------------
gulfemsavrun wrote:
I added another function with multiple blocks.
https://github.com/llvm/llvm-project/pull/102542
More information about the llvm-commits
mailing list