@@ -8,16 +8,16 @@ target triple = "x86_64-unknown-linux-gnu"
88; RELOC: @__llvm_profile_counter_bias = linkonce_odr hidden global i64 0, comdat
99
1010; CHECK-LABEL: define void @foo
11- ; CHECK-NEXT: %pgocount = load i64, ptr @__profc_foo
12- ; CHECK-NEXT: %1 = add i64 %pgocount , 1
13- ; CHECK-NEXT: store i64 %1 , ptr @__profc_foo
11+ ; CHECK-NEXT: %[[PGOCOUNT:.+]] = load i64, ptr @__profc_foo
12+ ; CHECK-NEXT: %[[PGOCOUNTINC:.+]] = add i64 %[[PGOCOUNT]] , 1
13+ ; CHECK-NEXT: store i64 %[[PGOCOUNTINC]] , ptr @__profc_foo
1414; RELOC-LABEL: define void @foo
15- ; RELOC-NEXT: %1 = load i64, ptr @__llvm_profile_counter_bias
16- ; RELOC-NEXT: %2 = add i64 ptrtoint (ptr @__profc_foo to i64), %1
17- ; RELOC-NEXT: %3 = inttoptr i64 %2 to ptr
18- ; RELOC-NEXT: %pgocount = load i64, ptr %3
19- ; RELOC-NEXT: %4 = add i64 %pgocount , 1
20- ; RELOC-NEXT: store i64 %4 , ptr %3
15+ ; RELOC-NEXT: %[[BIAS:.+]] = load i64, ptr @__llvm_profile_counter_bias
16+ ; RELOC-NEXT: %[[PROFC_BIAS:.+]] = add i64 ptrtoint (ptr @__profc_foo to i64), %[[BIAS]]
17+ ; RELOC-NEXT: %[[PROFC_ADDR:.+]] = inttoptr i64 %[[PROFC_BIAS]] to ptr
18+ ; RELOC-NEXT: %[[PGOCOUNT:.+]] = load i64, ptr %[[PROFC_ADDR]]
19+ ; RELOC-NEXT: %[[PGOCOUNTINC:.+]] = add i64 %[[PGOCOUNT]] , 1
20+ ; RELOC-NEXT: store i64 %[[PGOCOUNTINC]] , ptr %[[PROFC_ADDR]]
2121define void @foo () {
2222 call void @llvm.instrprof.increment (ptr @__profn_foo , i64 0 , i32 1 , i32 0 )
2323 ret void
0 commit comments