Use uint64_t for branch weights instead of uint32_t
CallInst::updateProfWeight() creates branch_weights with i64 instead of i32.
To be more consistent everywhere and remove lots of casts from uint64_t
to uint32_t, use i64 for branch_weights.
Reviewed By: davidxl
Differential Revision: https://reviews.llvm.org/D88609
diff --git a/clang/test/CodeGenCXX/attr-likelihood-if-branch-weights.cpp b/clang/test/CodeGenCXX/attr-likelihood-if-branch-weights.cpp
index 6327396..47725ee 100644
--- a/clang/test/CodeGenCXX/attr-likelihood-if-branch-weights.cpp
+++ b/clang/test/CodeGenCXX/attr-likelihood-if-branch-weights.cpp
@@ -142,5 +142,5 @@
}
}
-// CHECK: !7 = !{!"branch_weights", i32 [[UNLIKELY]], i32 [[LIKELY]]}
-// CHECK: !8 = !{!"branch_weights", i32 [[LIKELY]], i32 [[UNLIKELY]]}
+// CHECK: !7 = !{!"branch_weights", i64 [[UNLIKELY]], i64 [[LIKELY]]}
+// CHECK: !8 = !{!"branch_weights", i64 [[LIKELY]], i64 [[UNLIKELY]]}
diff --git a/clang/test/CodeGenCXX/attr-likelihood-if-vs-builtin-expect.cpp b/clang/test/CodeGenCXX/attr-likelihood-if-vs-builtin-expect.cpp
index 5872c4c..3994fb0 100644
--- a/clang/test/CodeGenCXX/attr-likelihood-if-vs-builtin-expect.cpp
+++ b/clang/test/CodeGenCXX/attr-likelihood-if-vs-builtin-expect.cpp
@@ -221,5 +221,5 @@
}
}
-// CHECK: !6 = !{!"branch_weights", i32 2000, i32 1}
-// CHECK: !10 = !{!"branch_weights", i32 1, i32 2000}
+// CHECK: !6 = !{!"branch_weights", i64 2000, i64 1}
+// CHECK: !10 = !{!"branch_weights", i64 1, i64 2000}
diff --git a/clang/test/CodeGenCXX/attr-likelihood-switch-branch-weights.cpp b/clang/test/CodeGenCXX/attr-likelihood-switch-branch-weights.cpp
index 5fb7a67..3046b75 100644
--- a/clang/test/CodeGenCXX/attr-likelihood-switch-branch-weights.cpp
+++ b/clang/test/CodeGenCXX/attr-likelihood-switch-branch-weights.cpp
@@ -177,18 +177,18 @@
}
}
-// CHECK: !6 = !{!"branch_weights", i32 357913942, i32 715827883}
-// CHECK: !7 = !{!"branch_weights", i32 536870912, i32 1}
-// CHECK: !8 = !{!"branch_weights", i32 238609295, i32 715827883, i32 238609295}
-// CHECK: !9 = !{!"branch_weights", i32 357913942, i32 1, i32 357913942}
-// CHECK: !10 = !{!"branch_weights", i32 357913942, i32 715827883, i32 1}
-// CHECK: !11 = !{!"branch_weights", i32 143165577, i32 143165577, i32 143165577, i32 715827883, i32 143165577}
-// CHECK: !12 = !{!"branch_weights", i32 214748365, i32 214748365, i32 214748365, i32 1, i32 214748365}
-// CHECK: !13 = !{!"branch_weights", i32 79536432, i32 79536432, i32 79536432, i32 79536432, i32 79536432, i32 79536432, i32 79536432, i32 715827883, i32 79536432}
-// CHECK: !14 = !{!"branch_weights", i32 119304648, i32 119304648, i32 119304648, i32 119304648, i32 119304648, i32 119304648, i32 119304648, i32 1, i32 119304648}
-// CHECK: !15 = !{!"branch_weights", i32 2000, i32 1}
-// CHECK: !16 = !{!"branch_weights", i32 1, i32 2000}
-// CHECK: !17 = !{!"branch_weights", i32 715827883, i32 357913942}
-// CHECK: !18 = !{!"branch_weights", i32 1, i32 536870912}
-// CHECK: !19 = !{!"branch_weights", i32 536870912, i32 536870912, i32 268435456}
-// CHECK: !20 = !{!"branch_weights", i32 1, i32 715827883, i32 357913942}
+// CHECK: !6 = !{!"branch_weights", i64 357913942, i64 715827883}
+// CHECK: !7 = !{!"branch_weights", i64 536870912, i64 1}
+// CHECK: !8 = !{!"branch_weights", i64 238609295, i64 715827883, i64 238609295}
+// CHECK: !9 = !{!"branch_weights", i64 357913942, i64 1, i64 357913942}
+// CHECK: !10 = !{!"branch_weights", i64 357913942, i64 715827883, i64 1}
+// CHECK: !11 = !{!"branch_weights", i64 143165577, i64 143165577, i64 143165577, i64 715827883, i64 143165577}
+// CHECK: !12 = !{!"branch_weights", i64 214748365, i64 214748365, i64 214748365, i64 1, i64 214748365}
+// CHECK: !13 = !{!"branch_weights", i64 79536432, i64 79536432, i64 79536432, i64 79536432, i64 79536432, i64 79536432, i64 79536432, i64 715827883, i64 79536432}
+// CHECK: !14 = !{!"branch_weights", i64 119304648, i64 119304648, i64 119304648, i64 119304648, i64 119304648, i64 119304648, i64 119304648, i64 1, i64 119304648}
+// CHECK: !15 = !{!"branch_weights", i64 2000, i64 1}
+// CHECK: !16 = !{!"branch_weights", i64 1, i64 2000}
+// CHECK: !17 = !{!"branch_weights", i64 715827883, i64 357913942}
+// CHECK: !18 = !{!"branch_weights", i64 1, i64 536870912}
+// CHECK: !19 = !{!"branch_weights", i64 536870912, i64 536870912, i64 268435456}
+// CHECK: !20 = !{!"branch_weights", i64 1, i64 715827883, i64 357913942}
diff --git a/clang/test/CodeGenCXX/microsoft-abi-thread-safe-statics.cpp b/clang/test/CodeGenCXX/microsoft-abi-thread-safe-statics.cpp
index a5bb874..2db2c33 100644
--- a/clang/test/CodeGenCXX/microsoft-abi-thread-safe-statics.cpp
+++ b/clang/test/CodeGenCXX/microsoft-abi-thread-safe-statics.cpp
@@ -96,5 +96,5 @@
return i;
}
-// CHECK-DAG: ![[unlikely_threadlocal]] = !{!"branch_weights", i32 1, i32 1023}
-// CHECK-DAG: ![[unlikely_staticlocal]] = !{!"branch_weights", i32 1, i32 1048575}
+// CHECK-DAG: ![[unlikely_threadlocal]] = !{!"branch_weights", i64 1, i64 1023}
+// CHECK-DAG: ![[unlikely_staticlocal]] = !{!"branch_weights", i64 1, i64 1048575}
diff --git a/clang/test/CodeGenCXX/profile-remap.cpp b/clang/test/CodeGenCXX/profile-remap.cpp
index b519e55..d6d43f5 100644
--- a/clang/test/CodeGenCXX/profile-remap.cpp
+++ b/clang/test/CodeGenCXX/profile-remap.cpp
@@ -24,8 +24,8 @@
//
// FIXME: Laplace's rule of succession is applied to sample profiles...
// CHECK-SAMPLES-DAG: [[FUNC_ENTRY]] = !{!"function_entry_count", i64 1}
-// CHECK-SAMPLES-DAG: [[BR_WEIGHTS]] = !{!"branch_weights", i32 11, i32 91}
+// CHECK-SAMPLES-DAG: [[BR_WEIGHTS]] = !{!"branch_weights", i64 11, i64 91}
//
// ... but not to instruction profiles.
// CHECK-INSTR-DAG: [[FUNC_ENTRY]] = !{!"function_entry_count", i64 100}
-// CHECK-INSTR-DAG: [[BR_WEIGHTS]] = !{!"branch_weights", i32 10, i32 90}
+// CHECK-INSTR-DAG: [[BR_WEIGHTS]] = !{!"branch_weights", i64 10, i64 90}
diff --git a/clang/test/CodeGenCXX/static-initializer-branch-weights.cpp b/clang/test/CodeGenCXX/static-initializer-branch-weights.cpp
index f9e7781..ebf502d 100644
--- a/clang/test/CodeGenCXX/static-initializer-branch-weights.cpp
+++ b/clang/test/CodeGenCXX/static-initializer-branch-weights.cpp
@@ -122,5 +122,5 @@
// CHECK: icmp eq i8 {{.*}}, 0
// CHECK: br i1 {{.*}}, !prof ![[WEIGHTS_THREAD_LOCAL]]
-// CHECK-DAG: ![[WEIGHTS_THREAD_LOCAL]] = !{!"branch_weights", i32 1, i32 1023}
-// CHECK-DAG: ![[WEIGHTS_LOCAL]] = !{!"branch_weights", i32 1, i32 1048575}
+// CHECK-DAG: ![[WEIGHTS_THREAD_LOCAL]] = !{!"branch_weights", i64 1, i64 1023}
+// CHECK-DAG: ![[WEIGHTS_LOCAL]] = !{!"branch_weights", i64 1, i64 1048575}