Skip to content

Conversation

@chapuni
Copy link
Contributor

@chapuni chapuni commented Jun 14, 2024

Bias doesn't change after startup.

The test is enhanced for optimized sequences and atomic ops.

Bias doesn't change after startup.
@chapuni chapuni requested review from ellishg and ornata June 14, 2024 19:16
@llvmbot llvmbot added PGO Profile Guided Optimizations llvm:transforms labels Jun 14, 2024
@llvmbot
Copy link
Member

llvmbot commented Jun 14, 2024

@llvm/pr-subscribers-llvm-transforms

Author: NAKAMURA Takumi (chapuni)

Changes

Bias doesn't change after startup.

The test is enhanced for optimized sequences and atomic ops.


Full diff: https://github.com/llvm/llvm-project/pull/95588.diff

3 Files Affected:

  • (modified) llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp (+3)
  • (modified) llvm/test/Instrumentation/InstrProfiling/runtime-counter-relocation.ll (+33-9)
  • (modified) llvm/test/Transforms/PGOProfile/counter_promo_with_bias.ll (+1-1)
diff --git a/llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp b/llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
index 0c79eaa812b5f..8ea76f89b7dd2 100644
--- a/llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
+++ b/llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
@@ -927,6 +927,9 @@ Value *InstrLowerer::getCounterAddress(InstrProfCntrInstBase *I) {
         Bias->setComdat(M.getOrInsertComdat(Bias->getName()));
     }
     BiasLI = EntryBuilder.CreateLoad(Int64Ty, Bias);
+    // Bias doesn't change after startup.
+    BiasLI->setMetadata(LLVMContext::MD_invariant_load,
+                        MDNode::get(M.getContext(), std::nullopt));
   }
   auto *Add = Builder.CreateAdd(Builder.CreatePtrToInt(Addr, Int64Ty), BiasLI);
   return Builder.CreateIntToPtr(Add, Addr->getType());
diff --git a/llvm/test/Instrumentation/InstrProfiling/runtime-counter-relocation.ll b/llvm/test/Instrumentation/InstrProfiling/runtime-counter-relocation.ll
index 44a2efd4a959a..3f0dbef387d2f 100644
--- a/llvm/test/Instrumentation/InstrProfiling/runtime-counter-relocation.ll
+++ b/llvm/test/Instrumentation/InstrProfiling/runtime-counter-relocation.ll
@@ -1,25 +1,49 @@
 ; RUN: opt < %s -S -passes=instrprof | FileCheck %s
 ; RUN: opt < %s -S -passes=instrprof -runtime-counter-relocation | FileCheck -check-prefixes=RELOC %s
+; RUN: opt < %s -S -passes=instrprof,inline,gvn -runtime-counter-relocation | FileCheck -check-prefixes=RELOC,RELOCOPT %s
+; RUN: opt < %s -S -passes=instrprof            -runtime-counter-relocation -instrprof-atomic-counter-update-all | FileCheck -check-prefixes=ATOMIC %s
+; RUN: opt < %s -S -passes=instrprof,inline,gvn -runtime-counter-relocation -instrprof-atomic-counter-update-all | FileCheck -check-prefixes=ATOMIC,ATOMICOPT %s
 
 target triple = "x86_64-unknown-linux-gnu"
 
 @__profn_foo = private constant [3 x i8] c"foo"
+@__profn_bar = private constant [3 x i8] c"bar"
 ; RELOC: $__llvm_profile_counter_bias = comdat any
 ; RELOC: @__llvm_profile_counter_bias = linkonce_odr hidden global i64 0, comdat
 
 ; CHECK-LABEL: define void @foo
-; CHECK-NEXT: %pgocount = load i64, ptr @__profc_foo
-; CHECK-NEXT: %1 = add i64 %pgocount, 1
-; CHECK-NEXT: store i64 %1, ptr @__profc_foo
+; CHECK-NEXT: %[[PGOCOUNT:.+]] = load i64, ptr @__profc_foo
+; CHECK-NEXT: %[[PGOCOUNTINC:.+]] = add i64 %[[PGOCOUNT]], 1
+; CHECK-NEXT: store i64 %[[PGOCOUNTINC]], ptr @__profc_foo
 ; RELOC-LABEL: define void @foo
-; RELOC-NEXT: %1 = load i64, ptr @__llvm_profile_counter_bias
-; RELOC-NEXT: %2 = add i64 ptrtoint (ptr @__profc_foo to i64), %1
-; RELOC-NEXT: %3 = inttoptr i64 %2 to ptr
-; RELOC-NEXT: %pgocount = load i64, ptr %3
-; RELOC-NEXT: %4 = add i64 %pgocount, 1
-; RELOC-NEXT: store i64 %4, ptr %3
+; RELOC-NEXT: %[[BIAS:.+]] = load i64, ptr @__llvm_profile_counter_bias, align 8, !invariant.load !0
+; RELOC-NEXT: %[[PROFC_BIAS:.+]] = add i64 ptrtoint (ptr @__profc_foo to i64), %[[BIAS]]
+; RELOC-NEXT: %[[PROFC_ADDR:.+]] = inttoptr i64 %[[PROFC_BIAS]] to ptr
+; RELOC-NEXT: %[[PGOCOUNT:.+]] = load i64, ptr %[[PROFC_ADDR]]
+; RELOC-NEXT: %[[PGOCOUNTINC:.+]] = add i64 %[[PGOCOUNT]], 1
+; RELOC-NEXT: store i64 %[[PGOCOUNTINC]], ptr %[[PROFC_ADDR]]
+; RELOCOPT-NEXT: %[[PROFC_BIAS1:.+]] = add i64 ptrtoint (ptr @__profc_bar to i64), %[[BIAS]]
+; RELOCOPT-NEXT: %[[PROFC_ADDR1:.+]] = inttoptr i64 %[[PROFC_BIAS1]] to ptr
+; RELOCOPT-NEXT: %[[PGOCOUNT1:.+]] = load i64, ptr %[[PROFC_ADDR1]]
+; RELOCOPT-NEXT: %[[PGOCOUNTINC1:.+]] = add i64 %[[PGOCOUNT1]], 1
+; RELOCOPT-NEXT: store i64 %[[PGOCOUNTINC1]], ptr %[[PROFC_ADDR1]]
+; ATOMIC-LABEL: define void @foo
+; ATOMIC-NEXT: %[[BIAS:.+]] = load i64, ptr @__llvm_profile_counter_bias, align 8, !invariant.load !0
+; ATOMIC-NEXT: %[[PROFC_BIAS:.+]] = add i64 ptrtoint (ptr @__profc_foo to i64), %[[BIAS]]
+; ATOMIC-NEXT: %[[PROFC_ADDR:.+]] = inttoptr i64 %[[PROFC_BIAS]] to ptr
+; ATOMIC-NEXT: %[[PGOCOUNTINC:.+]] = atomicrmw add ptr %[[PROFC_ADDR]], i64 1 monotonic
+; ATOMICOPT-NEXT: %[[PROFC_BIAS1:.+]] = add i64 ptrtoint (ptr @__profc_bar to i64), %[[BIAS]]
+; ATOMICOPT-NEXT: %[[PROFC_ADDR1:.+]] = inttoptr i64 %[[PROFC_BIAS1]] to ptr
+; ATOMICOPT-NEXT: %[[PGOCOUNTINC1:.+]] = atomicrmw add ptr %[[PROFC_ADDR1]], i64 1 monotonic
+
+define void @bar() {
+  call void @llvm.instrprof.increment(ptr @__profn_bar, i64 0, i32 1, i32 0)
+  ret void
+}
+
 define void @foo() {
   call void @llvm.instrprof.increment(ptr @__profn_foo, i64 0, i32 1, i32 0)
+  call void @bar()
   ret void
 }
 
diff --git a/llvm/test/Transforms/PGOProfile/counter_promo_with_bias.ll b/llvm/test/Transforms/PGOProfile/counter_promo_with_bias.ll
index c489a9f8eea84..7b1da764e776e 100644
--- a/llvm/test/Transforms/PGOProfile/counter_promo_with_bias.ll
+++ b/llvm/test/Transforms/PGOProfile/counter_promo_with_bias.ll
@@ -6,7 +6,7 @@ target triple = "x86_64-unknown-linux-gnu"
 
 define void @foo(i1 %c) {
 entry:
-; CHECK: %[[BIAS:[0-9]+]] = load i64, ptr @__llvm_profile_counter_bias
+; CHECK: %[[BIAS:.+]] = load i64, ptr @__llvm_profile_counter_bias
   br label %while.cond
 
 while.cond:                                       ; preds = %land.rhs, %while.cond.preheader

@llvmbot
Copy link
Member

llvmbot commented Jun 14, 2024

@llvm/pr-subscribers-pgo

Author: NAKAMURA Takumi (chapuni)

Changes

Bias doesn't change after startup.

The test is enhanced for optimized sequences and atomic ops.


Full diff: https://github.com/llvm/llvm-project/pull/95588.diff

3 Files Affected:

  • (modified) llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp (+3)
  • (modified) llvm/test/Instrumentation/InstrProfiling/runtime-counter-relocation.ll (+33-9)
  • (modified) llvm/test/Transforms/PGOProfile/counter_promo_with_bias.ll (+1-1)
diff --git a/llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp b/llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
index 0c79eaa812b5f..8ea76f89b7dd2 100644
--- a/llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
+++ b/llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
@@ -927,6 +927,9 @@ Value *InstrLowerer::getCounterAddress(InstrProfCntrInstBase *I) {
         Bias->setComdat(M.getOrInsertComdat(Bias->getName()));
     }
     BiasLI = EntryBuilder.CreateLoad(Int64Ty, Bias);
+    // Bias doesn't change after startup.
+    BiasLI->setMetadata(LLVMContext::MD_invariant_load,
+                        MDNode::get(M.getContext(), std::nullopt));
   }
   auto *Add = Builder.CreateAdd(Builder.CreatePtrToInt(Addr, Int64Ty), BiasLI);
   return Builder.CreateIntToPtr(Add, Addr->getType());
diff --git a/llvm/test/Instrumentation/InstrProfiling/runtime-counter-relocation.ll b/llvm/test/Instrumentation/InstrProfiling/runtime-counter-relocation.ll
index 44a2efd4a959a..3f0dbef387d2f 100644
--- a/llvm/test/Instrumentation/InstrProfiling/runtime-counter-relocation.ll
+++ b/llvm/test/Instrumentation/InstrProfiling/runtime-counter-relocation.ll
@@ -1,25 +1,49 @@
 ; RUN: opt < %s -S -passes=instrprof | FileCheck %s
 ; RUN: opt < %s -S -passes=instrprof -runtime-counter-relocation | FileCheck -check-prefixes=RELOC %s
+; RUN: opt < %s -S -passes=instrprof,inline,gvn -runtime-counter-relocation | FileCheck -check-prefixes=RELOC,RELOCOPT %s
+; RUN: opt < %s -S -passes=instrprof            -runtime-counter-relocation -instrprof-atomic-counter-update-all | FileCheck -check-prefixes=ATOMIC %s
+; RUN: opt < %s -S -passes=instrprof,inline,gvn -runtime-counter-relocation -instrprof-atomic-counter-update-all | FileCheck -check-prefixes=ATOMIC,ATOMICOPT %s
 
 target triple = "x86_64-unknown-linux-gnu"
 
 @__profn_foo = private constant [3 x i8] c"foo"
+@__profn_bar = private constant [3 x i8] c"bar"
 ; RELOC: $__llvm_profile_counter_bias = comdat any
 ; RELOC: @__llvm_profile_counter_bias = linkonce_odr hidden global i64 0, comdat
 
 ; CHECK-LABEL: define void @foo
-; CHECK-NEXT: %pgocount = load i64, ptr @__profc_foo
-; CHECK-NEXT: %1 = add i64 %pgocount, 1
-; CHECK-NEXT: store i64 %1, ptr @__profc_foo
+; CHECK-NEXT: %[[PGOCOUNT:.+]] = load i64, ptr @__profc_foo
+; CHECK-NEXT: %[[PGOCOUNTINC:.+]] = add i64 %[[PGOCOUNT]], 1
+; CHECK-NEXT: store i64 %[[PGOCOUNTINC]], ptr @__profc_foo
 ; RELOC-LABEL: define void @foo
-; RELOC-NEXT: %1 = load i64, ptr @__llvm_profile_counter_bias
-; RELOC-NEXT: %2 = add i64 ptrtoint (ptr @__profc_foo to i64), %1
-; RELOC-NEXT: %3 = inttoptr i64 %2 to ptr
-; RELOC-NEXT: %pgocount = load i64, ptr %3
-; RELOC-NEXT: %4 = add i64 %pgocount, 1
-; RELOC-NEXT: store i64 %4, ptr %3
+; RELOC-NEXT: %[[BIAS:.+]] = load i64, ptr @__llvm_profile_counter_bias, align 8, !invariant.load !0
+; RELOC-NEXT: %[[PROFC_BIAS:.+]] = add i64 ptrtoint (ptr @__profc_foo to i64), %[[BIAS]]
+; RELOC-NEXT: %[[PROFC_ADDR:.+]] = inttoptr i64 %[[PROFC_BIAS]] to ptr
+; RELOC-NEXT: %[[PGOCOUNT:.+]] = load i64, ptr %[[PROFC_ADDR]]
+; RELOC-NEXT: %[[PGOCOUNTINC:.+]] = add i64 %[[PGOCOUNT]], 1
+; RELOC-NEXT: store i64 %[[PGOCOUNTINC]], ptr %[[PROFC_ADDR]]
+; RELOCOPT-NEXT: %[[PROFC_BIAS1:.+]] = add i64 ptrtoint (ptr @__profc_bar to i64), %[[BIAS]]
+; RELOCOPT-NEXT: %[[PROFC_ADDR1:.+]] = inttoptr i64 %[[PROFC_BIAS1]] to ptr
+; RELOCOPT-NEXT: %[[PGOCOUNT1:.+]] = load i64, ptr %[[PROFC_ADDR1]]
+; RELOCOPT-NEXT: %[[PGOCOUNTINC1:.+]] = add i64 %[[PGOCOUNT1]], 1
+; RELOCOPT-NEXT: store i64 %[[PGOCOUNTINC1]], ptr %[[PROFC_ADDR1]]
+; ATOMIC-LABEL: define void @foo
+; ATOMIC-NEXT: %[[BIAS:.+]] = load i64, ptr @__llvm_profile_counter_bias, align 8, !invariant.load !0
+; ATOMIC-NEXT: %[[PROFC_BIAS:.+]] = add i64 ptrtoint (ptr @__profc_foo to i64), %[[BIAS]]
+; ATOMIC-NEXT: %[[PROFC_ADDR:.+]] = inttoptr i64 %[[PROFC_BIAS]] to ptr
+; ATOMIC-NEXT: %[[PGOCOUNTINC:.+]] = atomicrmw add ptr %[[PROFC_ADDR]], i64 1 monotonic
+; ATOMICOPT-NEXT: %[[PROFC_BIAS1:.+]] = add i64 ptrtoint (ptr @__profc_bar to i64), %[[BIAS]]
+; ATOMICOPT-NEXT: %[[PROFC_ADDR1:.+]] = inttoptr i64 %[[PROFC_BIAS1]] to ptr
+; ATOMICOPT-NEXT: %[[PGOCOUNTINC1:.+]] = atomicrmw add ptr %[[PROFC_ADDR1]], i64 1 monotonic
+
+define void @bar() {
+  call void @llvm.instrprof.increment(ptr @__profn_bar, i64 0, i32 1, i32 0)
+  ret void
+}
+
 define void @foo() {
   call void @llvm.instrprof.increment(ptr @__profn_foo, i64 0, i32 1, i32 0)
+  call void @bar()
   ret void
 }
 
diff --git a/llvm/test/Transforms/PGOProfile/counter_promo_with_bias.ll b/llvm/test/Transforms/PGOProfile/counter_promo_with_bias.ll
index c489a9f8eea84..7b1da764e776e 100644
--- a/llvm/test/Transforms/PGOProfile/counter_promo_with_bias.ll
+++ b/llvm/test/Transforms/PGOProfile/counter_promo_with_bias.ll
@@ -6,7 +6,7 @@ target triple = "x86_64-unknown-linux-gnu"
 
 define void @foo(i1 %c) {
 entry:
-; CHECK: %[[BIAS:[0-9]+]] = load i64, ptr @__llvm_profile_counter_bias
+; CHECK: %[[BIAS:.+]] = load i64, ptr @__llvm_profile_counter_bias
   br label %while.cond
 
 while.cond:                                       ; preds = %land.rhs, %while.cond.preheader

Conflicts:
	llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
	llvm/test/Instrumentation/InstrProfiling/runtime-counter-relocation.ll
Comment on lines 930 to 931
/// using the index represented by the a temp value into a bitmap.
void lowerMCDCTestVectorBitmapUpdate(InstrProfMCDCTVBitmapUpdate *Ins);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ellishg I've confirmed it works fine if FunctionToProfileBiasMap is eliminated and make this load in-place, since redundant BiasLI is optimized out.
Do you think this shall be preserved? (6e23cd2)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think as long as you don't rely on Fn->getEntryBlock().front() it should be fine.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll do in the next time. I have to reconfirm the effort of "counter promotion".

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ellishg I meant, "I'll do in the next opportunity."

I tried sinking LoadLI from the entry to each used block. It made things worse since they weren't optimized out in larger functions.

For now, I'll leave LoadLI untouched. I have to investigate and re-evaluate register spills.

@chapuni
Copy link
Contributor Author

chapuni commented Jun 21, 2024

This eliminates 679 loads in clang++ -Os lli.cpp.

@chapuni
Copy link
Contributor Author

chapuni commented Jul 8, 2024

@ellishg Ping. Any other concerns?

Copy link
Contributor

@ellishg ellishg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems fine to me!

@chapuni chapuni merged commit cfc2260 into llvm:main Jul 20, 2024
@chapuni
Copy link
Contributor Author

chapuni commented Jul 20, 2024

@ellishg Thanks!

@llvm-ci
Copy link
Collaborator

llvm-ci commented Jul 20, 2024

LLVM Buildbot has detected a new failure on builder llvm-clang-aarch64-darwin running on doug-worker-5 while building llvm at step 6 "test-build-unified-tree-check-all".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/190/builds/2237

Here is the relevant piece of the build log for the reference:

Step 6 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'LLVM :: Instrumentation/InstrProfiling/runtime-counter-relocation.ll' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 1: /Users/buildbot/buildbot-root/aarch64-darwin/build/bin/opt < /Users/buildbot/buildbot-root/aarch64-darwin/llvm-project/llvm/test/Instrumentation/InstrProfiling/runtime-counter-relocation.ll -S -passes=instrprof | /Users/buildbot/buildbot-root/aarch64-darwin/build/bin/FileCheck /Users/buildbot/buildbot-root/aarch64-darwin/llvm-project/llvm/test/Instrumentation/InstrProfiling/runtime-counter-relocation.ll
+ /Users/buildbot/buildbot-root/aarch64-darwin/build/bin/FileCheck /Users/buildbot/buildbot-root/aarch64-darwin/llvm-project/llvm/test/Instrumentation/InstrProfiling/runtime-counter-relocation.ll
+ /Users/buildbot/buildbot-root/aarch64-darwin/build/bin/opt -S -passes=instrprof
/Users/buildbot/buildbot-root/aarch64-darwin/build/bin/opt: warning: failed to infer data layout: unable to get target for 'x86_64-unknown-linux-gnu', see --version and --triple.
/Users/buildbot/buildbot-root/aarch64-darwin/build/bin/opt: WARNING: failed to create target machine for 'x86_64-unknown-linux-gnu': unable to get target for 'x86_64-unknown-linux-gnu', see --version and --triple.
RUN: at line 2: /Users/buildbot/buildbot-root/aarch64-darwin/build/bin/opt < /Users/buildbot/buildbot-root/aarch64-darwin/llvm-project/llvm/test/Instrumentation/InstrProfiling/runtime-counter-relocation.ll -S -passes=instrprof -runtime-counter-relocation | /Users/buildbot/buildbot-root/aarch64-darwin/build/bin/FileCheck -check-prefixes=RELOC /Users/buildbot/buildbot-root/aarch64-darwin/llvm-project/llvm/test/Instrumentation/InstrProfiling/runtime-counter-relocation.ll
+ /Users/buildbot/buildbot-root/aarch64-darwin/build/bin/opt -S -passes=instrprof -runtime-counter-relocation
+ /Users/buildbot/buildbot-root/aarch64-darwin/build/bin/FileCheck -check-prefixes=RELOC /Users/buildbot/buildbot-root/aarch64-darwin/llvm-project/llvm/test/Instrumentation/InstrProfiling/runtime-counter-relocation.ll
/Users/buildbot/buildbot-root/aarch64-darwin/build/bin/opt: warning: failed to infer data layout: unable to get target for 'x86_64-unknown-linux-gnu', see --version and --triple.
/Users/buildbot/buildbot-root/aarch64-darwin/build/bin/opt: WARNING: failed to create target machine for 'x86_64-unknown-linux-gnu': unable to get target for 'x86_64-unknown-linux-gnu', see --version and --triple.
�[1m/Users/buildbot/buildbot-root/aarch64-darwin/llvm-project/llvm/test/Instrumentation/InstrProfiling/runtime-counter-relocation.ll:19:15: �[0m�[0;1;31merror: �[0m�[1mRELOC-NEXT: expected string not found in input
�[0m; RELOC-NEXT: %[[BIAS:.+]] = load i64, ptr @__llvm_profile_counter_bias, align 8, !invariant.load !0
�[0;1;32m              ^
�[0m�[1m<stdin>:30:17: �[0m�[0;1;30mnote: �[0m�[1mscanning from here
�[0mdefine void @foo() {
�[0;1;32m                ^
�[0m�[1m<stdin>:31:8: �[0m�[0;1;30mnote: �[0m�[1mpossible intended match here
�[0m %profc_bias = load i64, ptr @__llvm_profile_counter_bias, align 4, !invariant.load !0
�[0;1;32m       ^
�[0m
Input file: <stdin>
Check file: /Users/buildbot/buildbot-root/aarch64-darwin/llvm-project/llvm/test/Instrumentation/InstrProfiling/runtime-counter-relocation.ll

-dump-input=help explains the following input dump.

Input was:
<<<<<<
�[1m�[0m�[0;1;30m            1: �[0m�[1m�[0;1;46m; ModuleID = '<stdin>' �[0m
�[0;1;30m            2: �[0m�[1m�[0;1;46msource_filename = "<stdin>" �[0m
�[0;1;30m            3: �[0m�[1m�[0;1;46mtarget triple = "x86_64-unknown-linux-gnu" �[0m
�[0;1;30m            4: �[0m�[1m�[0;1;46m �[0m
�[0;1;30m            5: �[0m�[1m�[0;1;46m$__profc_bar = comdat nodeduplicate �[0m
�[0;1;30m            6: �[0m�[1m�[0;1;46m �[0m
�[0;1;30m            7: �[0m�[1m�[0;1;46m$__profc_foo = comdat nodeduplicate �[0m
�[0;1;30m            8: �[0m�[1m�[0;1;46m �[0m
�[0;1;30m            9: �[0m�[1m�[0;1;46m�[0m$__llvm_profile_counter_bias = comdat any�[0;1;46m �[0m
�[0;1;32mcheck:11       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
�[0m�[0;1;30m           10: �[0m�[1m�[0;1;46m �[0m
�[0;1;30m           11: �[0m�[1m�[0;1;46m@__profc_bar = private global [1 x i64] zeroinitializer, section "__llvm_prf_cnts", comdat, align 8 �[0m
�[0;1;30m           12: �[0m�[1m�[0;1;46m@__profd_bar = private global { i64, i64, i64, i64, ptr, ptr, i32, [3 x i16], i32 } { i64 -2012135647395072713, i64 0, i64 sub (i64 ptrtoint (ptr @__profc_bar to i64), i64 ptrtoint (ptr @__profd_bar to i64)), i64 0, ptr null, ptr null, i32 1, [3 x i16] zeroinitializer, i32 0 }, section "__llvm_prf_data", comdat($__profc_bar), align 8 �[0m
�[0;1;30m           13: �[0m�[1m�[0;1;46m@__profc_foo = private global [1 x i64] zeroinitializer, section "__llvm_prf_cnts", comdat, align 8 �[0m
�[0;1;30m           14: �[0m�[1m�[0;1;46m@__profd_foo = private global { i64, i64, i64, i64, ptr, ptr, i32, [3 x i16], i32 } { i64 6699318081062747564, i64 0, i64 sub (i64 ptrtoint (ptr @__profc_foo to i64), i64 ptrtoint (ptr @__profd_foo to i64)), i64 0, ptr null, ptr null, i32 1, [3 x i16] zeroinitializer, i32 0 }, section "__llvm_prf_data", comdat($__profc_foo), align 8 �[0m
�[0;1;30m           15: �[0m�[1m�[0;1;46m�[0m@__llvm_profile_counter_bias = linkonce_odr hidden global i64 0, comdat�[0;1;46m �[0m
�[0;1;32mcheck:12       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
�[0m�[0;1;30m           16: �[0m�[1m�[0;1;46m@__llvm_prf_nm = private constant [17 x i8] c"\07\0Fx\DAKJ,bL\CB\CF\07\00\09\B8\02{", section "__llvm_prf_names", align 1 �[0m
...

@llvm-ci
Copy link
Collaborator

llvm-ci commented Jul 20, 2024

LLVM Buildbot has detected a new failure on builder clang-armv8-quick running on linaro-clang-armv8-quick while building llvm at step 5 "ninja check 1".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/154/builds/1661

Here is the relevant piece of the build log for the reference:

Step 5 (ninja check 1) failure: stage 1 checked (failure)
******************** TEST 'LLVM :: Instrumentation/InstrProfiling/runtime-counter-relocation.ll' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 1: /home/tcwg-buildbot/worker/clang-armv8-quick/stage1/bin/opt < /home/tcwg-buildbot/worker/clang-armv8-quick/llvm/llvm/test/Instrumentation/InstrProfiling/runtime-counter-relocation.ll -S -passes=instrprof | /home/tcwg-buildbot/worker/clang-armv8-quick/stage1/bin/FileCheck /home/tcwg-buildbot/worker/clang-armv8-quick/llvm/llvm/test/Instrumentation/InstrProfiling/runtime-counter-relocation.ll
+ /home/tcwg-buildbot/worker/clang-armv8-quick/stage1/bin/opt -S -passes=instrprof
+ /home/tcwg-buildbot/worker/clang-armv8-quick/stage1/bin/FileCheck /home/tcwg-buildbot/worker/clang-armv8-quick/llvm/llvm/test/Instrumentation/InstrProfiling/runtime-counter-relocation.ll
/home/tcwg-buildbot/worker/clang-armv8-quick/stage1/bin/opt: warning: failed to infer data layout: unable to get target for 'x86_64-unknown-linux-gnu', see --version and --triple.
/home/tcwg-buildbot/worker/clang-armv8-quick/stage1/bin/opt: WARNING: failed to create target machine for 'x86_64-unknown-linux-gnu': unable to get target for 'x86_64-unknown-linux-gnu', see --version and --triple.
RUN: at line 2: /home/tcwg-buildbot/worker/clang-armv8-quick/stage1/bin/opt < /home/tcwg-buildbot/worker/clang-armv8-quick/llvm/llvm/test/Instrumentation/InstrProfiling/runtime-counter-relocation.ll -S -passes=instrprof -runtime-counter-relocation | /home/tcwg-buildbot/worker/clang-armv8-quick/stage1/bin/FileCheck -check-prefixes=RELOC /home/tcwg-buildbot/worker/clang-armv8-quick/llvm/llvm/test/Instrumentation/InstrProfiling/runtime-counter-relocation.ll
+ /home/tcwg-buildbot/worker/clang-armv8-quick/stage1/bin/opt -S -passes=instrprof -runtime-counter-relocation
+ /home/tcwg-buildbot/worker/clang-armv8-quick/stage1/bin/FileCheck -check-prefixes=RELOC /home/tcwg-buildbot/worker/clang-armv8-quick/llvm/llvm/test/Instrumentation/InstrProfiling/runtime-counter-relocation.ll
/home/tcwg-buildbot/worker/clang-armv8-quick/stage1/bin/opt: warning: failed to infer data layout: unable to get target for 'x86_64-unknown-linux-gnu', see --version and --triple.
/home/tcwg-buildbot/worker/clang-armv8-quick/stage1/bin/opt: WARNING: failed to create target machine for 'x86_64-unknown-linux-gnu': unable to get target for 'x86_64-unknown-linux-gnu', see --version and --triple.
/home/tcwg-buildbot/worker/clang-armv8-quick/llvm/llvm/test/Instrumentation/InstrProfiling/runtime-counter-relocation.ll:19:15: error: RELOC-NEXT: expected string not found in input
; RELOC-NEXT: %[[BIAS:.+]] = load i64, ptr @__llvm_profile_counter_bias, align 8, !invariant.load !0
              ^
<stdin>:30:17: note: scanning from here
define void @foo() {
                ^
<stdin>:31:8: note: possible intended match here
 %profc_bias = load i64, ptr @__llvm_profile_counter_bias, align 4, !invariant.load !0
       ^

Input file: <stdin>
Check file: /home/tcwg-buildbot/worker/clang-armv8-quick/llvm/llvm/test/Instrumentation/InstrProfiling/runtime-counter-relocation.ll

-dump-input=help explains the following input dump.

Input was:
<<<<<<
           .
           .
           .
          25:  %3 = add i64 %pgocount, 1 
          26:  store i64 %3, ptr %2, align 4 
          27:  ret void 
          28: } 
          29:  
          30: define void @foo() { 
next:19'0                     X~~~~ error: no match found
          31:  %profc_bias = load i64, ptr @__llvm_profile_counter_bias, align 4, !invariant.load !0 
next:19'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
next:19'1            ?                                                                                possible intended match
          32:  %1 = add i64 ptrtoint (ptr @__profc_foo to i64), %profc_bias 
next:19'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          33:  %2 = inttoptr i64 %1 to ptr 
next:19'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          34:  %pgocount = load i64, ptr %2, align 4 
...

@llvm-ci
Copy link
Collaborator

llvm-ci commented Jul 20, 2024

LLVM Buildbot has detected a new failure on builder clang-aarch64-quick running on linaro-clang-aarch64-quick while building llvm at step 5 "ninja check 1".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/65/builds/1669

Here is the relevant piece of the build log for the reference:

Step 5 (ninja check 1) failure: stage 1 checked (failure)
******************** TEST 'LLVM :: Instrumentation/InstrProfiling/runtime-counter-relocation.ll' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 1: /home/tcwg-buildbot/worker/clang-aarch64-quick/stage1/bin/opt < /home/tcwg-buildbot/worker/clang-aarch64-quick/llvm/llvm/test/Instrumentation/InstrProfiling/runtime-counter-relocation.ll -S -passes=instrprof | /home/tcwg-buildbot/worker/clang-aarch64-quick/stage1/bin/FileCheck /home/tcwg-buildbot/worker/clang-aarch64-quick/llvm/llvm/test/Instrumentation/InstrProfiling/runtime-counter-relocation.ll
+ /home/tcwg-buildbot/worker/clang-aarch64-quick/stage1/bin/opt -S -passes=instrprof
+ /home/tcwg-buildbot/worker/clang-aarch64-quick/stage1/bin/FileCheck /home/tcwg-buildbot/worker/clang-aarch64-quick/llvm/llvm/test/Instrumentation/InstrProfiling/runtime-counter-relocation.ll
/home/tcwg-buildbot/worker/clang-aarch64-quick/stage1/bin/opt: warning: failed to infer data layout: unable to get target for 'x86_64-unknown-linux-gnu', see --version and --triple.
/home/tcwg-buildbot/worker/clang-aarch64-quick/stage1/bin/opt: WARNING: failed to create target machine for 'x86_64-unknown-linux-gnu': unable to get target for 'x86_64-unknown-linux-gnu', see --version and --triple.
RUN: at line 2: /home/tcwg-buildbot/worker/clang-aarch64-quick/stage1/bin/opt < /home/tcwg-buildbot/worker/clang-aarch64-quick/llvm/llvm/test/Instrumentation/InstrProfiling/runtime-counter-relocation.ll -S -passes=instrprof -runtime-counter-relocation | /home/tcwg-buildbot/worker/clang-aarch64-quick/stage1/bin/FileCheck -check-prefixes=RELOC /home/tcwg-buildbot/worker/clang-aarch64-quick/llvm/llvm/test/Instrumentation/InstrProfiling/runtime-counter-relocation.ll
+ /home/tcwg-buildbot/worker/clang-aarch64-quick/stage1/bin/opt -S -passes=instrprof -runtime-counter-relocation
+ /home/tcwg-buildbot/worker/clang-aarch64-quick/stage1/bin/FileCheck -check-prefixes=RELOC /home/tcwg-buildbot/worker/clang-aarch64-quick/llvm/llvm/test/Instrumentation/InstrProfiling/runtime-counter-relocation.ll
/home/tcwg-buildbot/worker/clang-aarch64-quick/stage1/bin/opt: warning: failed to infer data layout: unable to get target for 'x86_64-unknown-linux-gnu', see --version and --triple.
/home/tcwg-buildbot/worker/clang-aarch64-quick/stage1/bin/opt: WARNING: failed to create target machine for 'x86_64-unknown-linux-gnu': unable to get target for 'x86_64-unknown-linux-gnu', see --version and --triple.
/home/tcwg-buildbot/worker/clang-aarch64-quick/llvm/llvm/test/Instrumentation/InstrProfiling/runtime-counter-relocation.ll:19:15: error: RELOC-NEXT: expected string not found in input
; RELOC-NEXT: %[[BIAS:.+]] = load i64, ptr @__llvm_profile_counter_bias, align 8, !invariant.load !0
              ^
<stdin>:30:17: note: scanning from here
define void @foo() {
                ^
<stdin>:31:8: note: possible intended match here
 %profc_bias = load i64, ptr @__llvm_profile_counter_bias, align 4, !invariant.load !0
       ^

Input file: <stdin>
Check file: /home/tcwg-buildbot/worker/clang-aarch64-quick/llvm/llvm/test/Instrumentation/InstrProfiling/runtime-counter-relocation.ll

-dump-input=help explains the following input dump.

Input was:
<<<<<<
           .
           .
           .
          25:  %3 = add i64 %pgocount, 1 
          26:  store i64 %3, ptr %2, align 4 
          27:  ret void 
          28: } 
          29:  
          30: define void @foo() { 
next:19'0                     X~~~~ error: no match found
          31:  %profc_bias = load i64, ptr @__llvm_profile_counter_bias, align 4, !invariant.load !0 
next:19'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
next:19'1            ?                                                                                possible intended match
          32:  %1 = add i64 ptrtoint (ptr @__profc_foo to i64), %profc_bias 
next:19'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          33:  %2 = inttoptr i64 %1 to ptr 
next:19'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          34:  %pgocount = load i64, ptr %2, align 4 
...

@llvm-ci
Copy link
Collaborator

llvm-ci commented Jul 20, 2024

LLVM Buildbot has detected a new failure on builder clang-solaris11-sparcv9 running on solaris11-sparcv9 while building llvm at step 5 "ninja check 1".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/13/builds/922

Here is the relevant piece of the build log for the reference:

Step 5 (ninja check 1) failure: stage 1 checked (failure)
******************** TEST 'LLVM :: Instrumentation/InstrProfiling/runtime-counter-relocation.ll' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 1: /opt/llvm-buildbot/home/solaris11-sparcv9/clang-solaris11-sparcv9/stage1/bin/opt < /opt/llvm-buildbot/home/solaris11-sparcv9/clang-solaris11-sparcv9/llvm/llvm/test/Instrumentation/InstrProfiling/runtime-counter-relocation.ll -S -passes=instrprof | /opt/llvm-buildbot/home/solaris11-sparcv9/clang-solaris11-sparcv9/stage1/bin/FileCheck /opt/llvm-buildbot/home/solaris11-sparcv9/clang-solaris11-sparcv9/llvm/llvm/test/Instrumentation/InstrProfiling/runtime-counter-relocation.ll
+ /opt/llvm-buildbot/home/solaris11-sparcv9/clang-solaris11-sparcv9/stage1/bin/opt -S -passes=instrprof
+ /opt/llvm-buildbot/home/solaris11-sparcv9/clang-solaris11-sparcv9/stage1/bin/FileCheck /opt/llvm-buildbot/home/solaris11-sparcv9/clang-solaris11-sparcv9/llvm/llvm/test/Instrumentation/InstrProfiling/runtime-counter-relocation.ll
/opt/llvm-buildbot/home/solaris11-sparcv9/clang-solaris11-sparcv9/stage1/bin/opt: warning: failed to infer data layout: unable to get target for 'x86_64-unknown-linux-gnu', see --version and --triple.
/opt/llvm-buildbot/home/solaris11-sparcv9/clang-solaris11-sparcv9/stage1/bin/opt: WARNING: failed to create target machine for 'x86_64-unknown-linux-gnu': unable to get target for 'x86_64-unknown-linux-gnu', see --version and --triple.
RUN: at line 2: /opt/llvm-buildbot/home/solaris11-sparcv9/clang-solaris11-sparcv9/stage1/bin/opt < /opt/llvm-buildbot/home/solaris11-sparcv9/clang-solaris11-sparcv9/llvm/llvm/test/Instrumentation/InstrProfiling/runtime-counter-relocation.ll -S -passes=instrprof -runtime-counter-relocation | /opt/llvm-buildbot/home/solaris11-sparcv9/clang-solaris11-sparcv9/stage1/bin/FileCheck -check-prefixes=RELOC /opt/llvm-buildbot/home/solaris11-sparcv9/clang-solaris11-sparcv9/llvm/llvm/test/Instrumentation/InstrProfiling/runtime-counter-relocation.ll
+ /opt/llvm-buildbot/home/solaris11-sparcv9/clang-solaris11-sparcv9/stage1/bin/opt -S -passes=instrprof -runtime-counter-relocation
+ /opt/llvm-buildbot/home/solaris11-sparcv9/clang-solaris11-sparcv9/stage1/bin/FileCheck -check-prefixes=RELOC /opt/llvm-buildbot/home/solaris11-sparcv9/clang-solaris11-sparcv9/llvm/llvm/test/Instrumentation/InstrProfiling/runtime-counter-relocation.ll
/opt/llvm-buildbot/home/solaris11-sparcv9/clang-solaris11-sparcv9/stage1/bin/opt: warning: failed to infer data layout: unable to get target for 'x86_64-unknown-linux-gnu', see --version and --triple.
/opt/llvm-buildbot/home/solaris11-sparcv9/clang-solaris11-sparcv9/stage1/bin/opt: WARNING: failed to create target machine for 'x86_64-unknown-linux-gnu': unable to get target for 'x86_64-unknown-linux-gnu', see --version and --triple.
/opt/llvm-buildbot/home/solaris11-sparcv9/clang-solaris11-sparcv9/llvm/llvm/test/Instrumentation/InstrProfiling/runtime-counter-relocation.ll:19:15: error: RELOC-NEXT: expected string not found in input
; RELOC-NEXT: %[[BIAS:.+]] = load i64, ptr @__llvm_profile_counter_bias, align 8, !invariant.load !0
              ^
<stdin>:30:17: note: scanning from here
define void @foo() {
                ^
<stdin>:31:8: note: possible intended match here
 %profc_bias = load i64, ptr @__llvm_profile_counter_bias, align 4, !invariant.load !0
       ^

Input file: <stdin>
Check file: /opt/llvm-buildbot/home/solaris11-sparcv9/clang-solaris11-sparcv9/llvm/llvm/test/Instrumentation/InstrProfiling/runtime-counter-relocation.ll

-dump-input=help explains the following input dump.

Input was:
<<<<<<
           .
           .
           .
          25:  %3 = add i64 %pgocount, 1 
          26:  store i64 %3, ptr %2, align 4 
          27:  ret void 
          28: } 
          29:  
          30: define void @foo() { 
next:19'0                     X~~~~ error: no match found
          31:  %profc_bias = load i64, ptr @__llvm_profile_counter_bias, align 4, !invariant.load !0 
next:19'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
next:19'1            ?                                                                                possible intended match
          32:  %1 = add i64 ptrtoint (ptr @__profc_foo to i64), %profc_bias 
next:19'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          33:  %2 = inttoptr i64 %1 to ptr 
next:19'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          34:  %pgocount = load i64, ptr %2, align 4 
...

@llvm-ci
Copy link
Collaborator

llvm-ci commented Jul 20, 2024

LLVM Buildbot has detected a new failure on builder clang-arm64-windows-msvc running on linaro-armv8-windows-msvc-04 while building llvm at step 5 "ninja check 1".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/161/builds/735

Here is the relevant piece of the build log for the reference:

Step 5 (ninja check 1) failure: stage 1 checked (failure)
******************** TEST 'LLVM :: Instrumentation/InstrProfiling/runtime-counter-relocation.ll' FAILED ********************
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 1
c:\users\tcwg\llvm-worker\clang-arm64-windows-msvc\stage1\bin\opt.exe < C:\Users\tcwg\llvm-worker\clang-arm64-windows-msvc\llvm\llvm\test\Instrumentation\InstrProfiling\runtime-counter-relocation.ll -S -passes=instrprof | c:\users\tcwg\llvm-worker\clang-arm64-windows-msvc\stage1\bin\filecheck.exe C:\Users\tcwg\llvm-worker\clang-arm64-windows-msvc\llvm\llvm\test\Instrumentation\InstrProfiling\runtime-counter-relocation.ll
# executed command: 'c:\users\tcwg\llvm-worker\clang-arm64-windows-msvc\stage1\bin\opt.exe' -S -passes=instrprof
# .---command stderr------------
# | c:\users\tcwg\llvm-worker\clang-arm64-windows-msvc\stage1\bin\opt.exe: warning: failed to infer data layout: unable to get target for 'x86_64-unknown-linux-gnu', see --version and --triple.
# | c:\users\tcwg\llvm-worker\clang-arm64-windows-msvc\stage1\bin\opt.exe: WARNING: failed to create target machine for 'x86_64-unknown-linux-gnu': unable to get target for 'x86_64-unknown-linux-gnu', see --version and --triple.
# `-----------------------------
# executed command: 'c:\users\tcwg\llvm-worker\clang-arm64-windows-msvc\stage1\bin\filecheck.exe' 'C:\Users\tcwg\llvm-worker\clang-arm64-windows-msvc\llvm\llvm\test\Instrumentation\InstrProfiling\runtime-counter-relocation.ll'
# RUN: at line 2
c:\users\tcwg\llvm-worker\clang-arm64-windows-msvc\stage1\bin\opt.exe < C:\Users\tcwg\llvm-worker\clang-arm64-windows-msvc\llvm\llvm\test\Instrumentation\InstrProfiling\runtime-counter-relocation.ll -S -passes=instrprof -runtime-counter-relocation | c:\users\tcwg\llvm-worker\clang-arm64-windows-msvc\stage1\bin\filecheck.exe -check-prefixes=RELOC C:\Users\tcwg\llvm-worker\clang-arm64-windows-msvc\llvm\llvm\test\Instrumentation\InstrProfiling\runtime-counter-relocation.ll
# executed command: 'c:\users\tcwg\llvm-worker\clang-arm64-windows-msvc\stage1\bin\opt.exe' -S -passes=instrprof -runtime-counter-relocation
# .---command stderr------------
# | c:\users\tcwg\llvm-worker\clang-arm64-windows-msvc\stage1\bin\opt.exe: warning: failed to infer data layout: unable to get target for 'x86_64-unknown-linux-gnu', see --version and --triple.
# | c:\users\tcwg\llvm-worker\clang-arm64-windows-msvc\stage1\bin\opt.exe: WARNING: failed to create target machine for 'x86_64-unknown-linux-gnu': unable to get target for 'x86_64-unknown-linux-gnu', see --version and --triple.
# `-----------------------------
# executed command: 'c:\users\tcwg\llvm-worker\clang-arm64-windows-msvc\stage1\bin\filecheck.exe' -check-prefixes=RELOC 'C:\Users\tcwg\llvm-worker\clang-arm64-windows-msvc\llvm\llvm\test\Instrumentation\InstrProfiling\runtime-counter-relocation.ll'
# .---command stderr------------
# | C:\Users\tcwg\llvm-worker\clang-arm64-windows-msvc\llvm\llvm\test\Instrumentation\InstrProfiling\runtime-counter-relocation.ll:19:15: error: RELOC-NEXT: expected string not found in input
# | ; RELOC-NEXT: %[[BIAS:.+]] = load i64, ptr @__llvm_profile_counter_bias, align 8, !invariant.load !0
# |               ^
# | <stdin>:30:17: note: scanning from here
# | define void @foo() {
# |                 ^
# | <stdin>:31:8: note: possible intended match here
# |  %profc_bias = load i64, ptr @__llvm_profile_counter_bias, align 4, !invariant.load !0
# |        ^
# | 
# | Input file: <stdin>
# | Check file: C:\Users\tcwg\llvm-worker\clang-arm64-windows-msvc\llvm\llvm\test\Instrumentation\InstrProfiling\runtime-counter-relocation.ll
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |            .
# |            .
# |            .
# |           25:  %3 = add i64 %pgocount, 1 
# |           26:  store i64 %3, ptr %2, align 4 
# |           27:  ret void 
# |           28: } 
# |           29:  
# |           30: define void @foo() { 
# | next:19'0                     X~~~~ error: no match found
# |           31:  %profc_bias = load i64, ptr @__llvm_profile_counter_bias, align 4, !invariant.load !0 
...

@llvm-ci
Copy link
Collaborator

llvm-ci commented Jul 20, 2024

LLVM Buildbot has detected a new failure on builder llvm-clang-win-x-aarch64 running on as-builder-2 while building llvm at step 8 "test-check-llvm".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/193/builds/1141

Here is the relevant piece of the build log for the reference:

Step 8 (test-check-llvm) failure: Test just built components for check-llvm completed (failure)
******************** TEST 'LLVM :: Instrumentation/InstrProfiling/runtime-counter-relocation.ll' FAILED ********************
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 1
c:\buildbot\as-builder-2\x-aarch64\build\bin\opt.exe < C:\buildbot\as-builder-2\x-aarch64\llvm-project\llvm\test\Instrumentation\InstrProfiling\runtime-counter-relocation.ll -S -passes=instrprof | c:\buildbot\as-builder-2\x-aarch64\build\bin\filecheck.exe C:\buildbot\as-builder-2\x-aarch64\llvm-project\llvm\test\Instrumentation\InstrProfiling\runtime-counter-relocation.ll
# executed command: 'c:\buildbot\as-builder-2\x-aarch64\build\bin\opt.exe' -S -passes=instrprof
# .---command stderr------------
# | c:\buildbot\as-builder-2\x-aarch64\build\bin\opt.exe: warning: failed to infer data layout: unable to get target for 'x86_64-unknown-linux-gnu', see --version and --triple.
# | c:\buildbot\as-builder-2\x-aarch64\build\bin\opt.exe: WARNING: failed to create target machine for 'x86_64-unknown-linux-gnu': unable to get target for 'x86_64-unknown-linux-gnu', see --version and --triple.
# `-----------------------------
# executed command: 'c:\buildbot\as-builder-2\x-aarch64\build\bin\filecheck.exe' 'C:\buildbot\as-builder-2\x-aarch64\llvm-project\llvm\test\Instrumentation\InstrProfiling\runtime-counter-relocation.ll'
# RUN: at line 2
c:\buildbot\as-builder-2\x-aarch64\build\bin\opt.exe < C:\buildbot\as-builder-2\x-aarch64\llvm-project\llvm\test\Instrumentation\InstrProfiling\runtime-counter-relocation.ll -S -passes=instrprof -runtime-counter-relocation | c:\buildbot\as-builder-2\x-aarch64\build\bin\filecheck.exe -check-prefixes=RELOC C:\buildbot\as-builder-2\x-aarch64\llvm-project\llvm\test\Instrumentation\InstrProfiling\runtime-counter-relocation.ll
# executed command: 'c:\buildbot\as-builder-2\x-aarch64\build\bin\opt.exe' -S -passes=instrprof -runtime-counter-relocation
# .---command stderr------------
# | c:\buildbot\as-builder-2\x-aarch64\build\bin\opt.exe: warning: failed to infer data layout: unable to get target for 'x86_64-unknown-linux-gnu', see --version and --triple.
# | c:\buildbot\as-builder-2\x-aarch64\build\bin\opt.exe: WARNING: failed to create target machine for 'x86_64-unknown-linux-gnu': unable to get target for 'x86_64-unknown-linux-gnu', see --version and --triple.
# `-----------------------------
# executed command: 'c:\buildbot\as-builder-2\x-aarch64\build\bin\filecheck.exe' -check-prefixes=RELOC 'C:\buildbot\as-builder-2\x-aarch64\llvm-project\llvm\test\Instrumentation\InstrProfiling\runtime-counter-relocation.ll'
# .---command stderr------------
# | C:\buildbot\as-builder-2\x-aarch64\llvm-project\llvm\test\Instrumentation\InstrProfiling\runtime-counter-relocation.ll:19:15: error: RELOC-NEXT: expected string not found in input
# | ; RELOC-NEXT: %[[BIAS:.+]] = load i64, ptr @__llvm_profile_counter_bias, align 8, !invariant.load !0
# |               ^
# | <stdin>:30:17: note: scanning from here
# | define void @foo() {
# |                 ^
# | <stdin>:31:8: note: possible intended match here
# |  %profc_bias = load i64, ptr @__llvm_profile_counter_bias, align 4, !invariant.load !0
# |        ^
# | 
# | Input file: <stdin>
# | Check file: C:\buildbot\as-builder-2\x-aarch64\llvm-project\llvm\test\Instrumentation\InstrProfiling\runtime-counter-relocation.ll
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |            .
# |            .
# |            .
# |           25:  %3 = add i64 %pgocount, 1 
# |           26:  store i64 %3, ptr %2, align 4 
# |           27:  ret void 
# |           28: } 
# |           29:  
# |           30: define void @foo() { 
# | next:19'0                     X~~~~ error: no match found
# |           31:  %profc_bias = load i64, ptr @__llvm_profile_counter_bias, align 4, !invariant.load !0 
...

@chapuni
Copy link
Contributor Author

chapuni commented Jul 20, 2024

Sorry, I'll fix shortly.

chapuni added a commit that referenced this pull request Jul 20, 2024
This shall fix aarch64 builders.
@MaskRay
Copy link
Member

MaskRay commented Jul 20, 2024

Nice load optimization!

llvm::MemoryDependenceResults::getSimplePointerDependencyFrom <--...-- llvm::GVNPass::processLoad

yuxuanchen1997 pushed a commit that referenced this pull request Jul 25, 2024
Summary:
Bias doesn't change after startup.

The test is enhanced for optimized sequences and atomic ops.

Test Plan: 

Reviewers: 

Subscribers: 

Tasks: 

Tags: 


Differential Revision: https://phabricator.intern.facebook.com/D60251439
yuxuanchen1997 pushed a commit that referenced this pull request Jul 25, 2024
Summary: This shall fix aarch64 builders.

Test Plan: 

Reviewers: 

Subscribers: 

Tasks: 

Tags: 


Differential Revision: https://phabricator.intern.facebook.com/D60251402
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

llvm:transforms PGO Profile Guided Optimizations

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants