Skip to content

Commit

Permalink
Revert "Use uint64_t for branch weights instead of uint32_t"
Browse files Browse the repository at this point in the history
This reverts commit e5766f2.
Makes clang assert when building Chromium, see https://crbug.com/1142813
for a repro.
  • Loading branch information
nico committed Oct 27, 2020
1 parent b19473c commit 2a4e704
Show file tree
Hide file tree
Showing 114 changed files with 547 additions and 1,091 deletions.
36 changes: 30 additions & 6 deletions clang/lib/CodeGen/CodeGenPGO.cpp
Expand Up @@ -1013,21 +1013,42 @@ void CodeGenPGO::loadRegionCounts(llvm::IndexedInstrProfReader *PGOReader,
RegionCounts = ProfRecord->Counts;
}

/// Scale an individual branch weight (add 1).
/// Calculate what to divide by to scale weights.
///
/// Given the maximum weight, calculate a divisor that will scale all the
/// weights to strictly less than UINT32_MAX.
static uint64_t calculateWeightScale(uint64_t MaxWeight) {
return MaxWeight < UINT32_MAX ? 1 : MaxWeight / UINT32_MAX + 1;
}

/// Scale an individual branch weight (and add 1).
///
/// Scale a 64-bit weight down to 32-bits using \c Scale.
///
/// According to Laplace's Rule of Succession, it is better to compute the
/// weight based on the count plus 1, so universally add 1 to the value.
static uint64_t scaleBranchWeight(uint64_t Weight) { return Weight + 1; }
///
/// \pre \c Scale was calculated by \a calculateWeightScale() with a weight no
/// greater than \c Weight.
static uint32_t scaleBranchWeight(uint64_t Weight, uint64_t Scale) {
assert(Scale && "scale by 0?");
uint64_t Scaled = Weight / Scale + 1;
assert(Scaled <= UINT32_MAX && "overflow 32-bits");
return Scaled;
}

llvm::MDNode *CodeGenFunction::createProfileWeights(uint64_t TrueCount,
uint64_t FalseCount) const {
// Check for empty weights.
if (!TrueCount && !FalseCount)
return nullptr;

// Calculate how to scale down to 32-bits.
uint64_t Scale = calculateWeightScale(std::max(TrueCount, FalseCount));

llvm::MDBuilder MDHelper(CGM.getLLVMContext());
return MDHelper.createBranchWeights(scaleBranchWeight(TrueCount),
scaleBranchWeight(FalseCount));
return MDHelper.createBranchWeights(scaleBranchWeight(TrueCount, Scale),
scaleBranchWeight(FalseCount, Scale));
}

llvm::MDNode *
Expand All @@ -1041,10 +1062,13 @@ CodeGenFunction::createProfileWeights(ArrayRef<uint64_t> Weights) const {
if (MaxWeight == 0)
return nullptr;

SmallVector<uint64_t, 16> ScaledWeights;
// Calculate how to scale down to 32-bits.
uint64_t Scale = calculateWeightScale(MaxWeight);

SmallVector<uint32_t, 16> ScaledWeights;
ScaledWeights.reserve(Weights.size());
for (uint64_t W : Weights)
ScaledWeights.push_back(scaleBranchWeight(W));
ScaledWeights.push_back(scaleBranchWeight(W, Scale));

llvm::MDBuilder MDHelper(CGM.getLLVMContext());
return MDHelper.createBranchWeights(ScaledWeights);
Expand Down
2 changes: 1 addition & 1 deletion clang/test/CodeGen/catch-undef-behavior.c
Expand Up @@ -385,6 +385,6 @@ void call_nonnull_variadic(int a, int *b) {
nonnull_variadic(a, b);
}

// CHECK-UBSAN: ![[WEIGHT_MD]] = !{!"branch_weights", i64 1048575, i64 1}
// CHECK-UBSAN: ![[WEIGHT_MD]] = !{!"branch_weights", i32 1048575, i32 1}

// CHECK-TRAP: attributes [[NR_NUW]] = { noreturn nounwind }
4 changes: 2 additions & 2 deletions clang/test/CodeGenCXX/attr-likelihood-if-branch-weights.cpp
Expand Up @@ -142,5 +142,5 @@ void SwitchStmt() {
}
}

// CHECK: !7 = !{!"branch_weights", i64 [[UNLIKELY]], i64 [[LIKELY]]}
// CHECK: !8 = !{!"branch_weights", i64 [[LIKELY]], i64 [[UNLIKELY]]}
// CHECK: !7 = !{!"branch_weights", i32 [[UNLIKELY]], i32 [[LIKELY]]}
// CHECK: !8 = !{!"branch_weights", i32 [[LIKELY]], i32 [[UNLIKELY]]}
Expand Up @@ -221,5 +221,5 @@ void tu2(int &i) {
}
}

// CHECK: !6 = !{!"branch_weights", i64 2000, i64 1}
// CHECK: !10 = !{!"branch_weights", i64 1, i64 2000}
// CHECK: !6 = !{!"branch_weights", i32 2000, i32 1}
// CHECK: !10 = !{!"branch_weights", i32 1, i32 2000}
30 changes: 15 additions & 15 deletions clang/test/CodeGenCXX/attr-likelihood-switch-branch-weights.cpp
Expand Up @@ -177,18 +177,18 @@ void TwoCasesDefaultLNU() {
}
}

// 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}
// 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}
4 changes: 2 additions & 2 deletions clang/test/CodeGenCXX/microsoft-abi-thread-safe-statics.cpp
Expand Up @@ -96,5 +96,5 @@ int g1() {
return i;
}

// CHECK-DAG: ![[unlikely_threadlocal]] = !{!"branch_weights", i64 1, i64 1023}
// CHECK-DAG: ![[unlikely_staticlocal]] = !{!"branch_weights", i64 1, i64 1048575}
// CHECK-DAG: ![[unlikely_threadlocal]] = !{!"branch_weights", i32 1, i32 1023}
// CHECK-DAG: ![[unlikely_staticlocal]] = !{!"branch_weights", i32 1, i32 1048575}
4 changes: 2 additions & 2 deletions clang/test/CodeGenCXX/profile-remap.cpp
Expand Up @@ -24,8 +24,8 @@ namespace Foo {
//
// 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", i64 11, i64 91}
// CHECK-SAMPLES-DAG: [[BR_WEIGHTS]] = !{!"branch_weights", i32 11, i32 91}
//
// ... but not to instruction profiles.
// CHECK-INSTR-DAG: [[FUNC_ENTRY]] = !{!"function_entry_count", i64 100}
// CHECK-INSTR-DAG: [[BR_WEIGHTS]] = !{!"branch_weights", i64 10, i64 90}
// CHECK-INSTR-DAG: [[BR_WEIGHTS]] = !{!"branch_weights", i32 10, i32 90}
4 changes: 2 additions & 2 deletions clang/test/CodeGenCXX/static-initializer-branch-weights.cpp
Expand Up @@ -122,5 +122,5 @@ void use_b() {
// CHECK: icmp eq i8 {{.*}}, 0
// CHECK: br i1 {{.*}}, !prof ![[WEIGHTS_THREAD_LOCAL]]

// CHECK-DAG: ![[WEIGHTS_THREAD_LOCAL]] = !{!"branch_weights", i64 1, i64 1023}
// CHECK-DAG: ![[WEIGHTS_LOCAL]] = !{!"branch_weights", i64 1, i64 1048575}
// CHECK-DAG: ![[WEIGHTS_THREAD_LOCAL]] = !{!"branch_weights", i32 1, i32 1023}
// CHECK-DAG: ![[WEIGHTS_LOCAL]] = !{!"branch_weights", i32 1, i32 1048575}
10 changes: 5 additions & 5 deletions clang/test/Profile/c-captured.c
Expand Up @@ -47,11 +47,11 @@ void debug_captured() {
if (x) {} // This is DC2. Checked above.
}

// PGOUSE-DAG: ![[DC1]] = !{!"branch_weights", i64 2, i64 1}
// PGOUSE-DAG: ![[DC2]] = !{!"branch_weights", i64 2, i64 1}
// PGOUSE-DAG: ![[CS1]] = !{!"branch_weights", i64 2, i64 1}
// PGOUSE-DAG: ![[C11]] = !{!"branch_weights", i64 11, i64 2}
// PGOUSE-DAG: ![[C12]] = !{!"branch_weights", i64 2, i64 1}
// PGOUSE-DAG: ![[DC1]] = !{!"branch_weights", i32 2, i32 1}
// PGOUSE-DAG: ![[DC2]] = !{!"branch_weights", i32 2, i32 1}
// PGOUSE-DAG: ![[CS1]] = !{!"branch_weights", i32 2, i32 1}
// PGOUSE-DAG: ![[C11]] = !{!"branch_weights", i32 11, i32 2}
// PGOUSE-DAG: ![[C12]] = !{!"branch_weights", i32 2, i32 1}

int main(int argc, const char *argv[]) {
debug_captured();
Expand Down
49 changes: 49 additions & 0 deletions clang/test/Profile/c-counter-overflows.c
@@ -0,0 +1,49 @@
// Test that big branch weights get scaled down to 32-bits, rather than just
// truncated.

// RUN: llvm-profdata merge %S/Inputs/c-counter-overflows.proftext -o %t.profdata
// RUN: %clang_cc1 -triple x86_64-apple-macosx10.9 -main-file-name c-counter-overflows.c %s -o - -emit-llvm -fprofile-instrument-use-path=%t.profdata | FileCheck %s

typedef unsigned long long uint64_t;

int main(int argc, const char *argv[]) {
// Need counts higher than 32-bits.
// CHECK: br {{.*}} !prof ![[FOR:[0-9]+]]
// max = 0xffffffff0
// scale = 0xffffffff0 / 0xffffffff + 1 = 17
// loop-body: 0xffffffff0 / 17 + 1 = 0xf0f0f0f0 + 1 = 4042322161 => -252645135
// loop-exit: 0x000000001 / 17 + 1 = 0x00000000 + 1 = 1 => 1
for (uint64_t I = 0; I < 0xffffffff0; ++I) {
// max = 0xffffffff * 15 = 0xefffffff1
// scale = 0xefffffff1 / 0xffffffff + 1 = 16
// CHECK: br {{.*}} !prof ![[IF:[0-9]+]]
if (I & 0xf) {
// 0xefffffff1 / 16 + 1 = 0xefffffff + 1 = 4026531840 => -268435456
} else {
// 0x0ffffffff / 16 + 1 = 0x0fffffff + 1 = 268435456 => 268435456
}

// max = 0xffffffff * 5 = 0x4fffffffb
// scale = 0x4fffffffb / 0xffffffff + 1 = 6
// CHECK: ], !prof ![[SWITCH:[0-9]+]]
switch ((I & 0xf) / 5) {
case 0:
// 0x4fffffffb / 6 = 0xd5555554 + 1 = 3579139413 => -715827883
break;
case 1:
// 0x4fffffffb / 6 = 0xd5555554 + 1 = 3579139413 => -715827883
break;
case 2:
// 0x4fffffffb / 6 = 0xd5555554 + 1 = 3579139413 => -715827883
break;
default:
// 0x0ffffffff / 6 = 0x2aaaaaaa + 1 = 715827883 => 715827883
break;
}
}
return 0;
}

// CHECK-DAG: ![[FOR]] = !{!"branch_weights", i32 -252645135, i32 1}
// CHECK-DAG: ![[IF]] = !{!"branch_weights", i32 -268435456, i32 268435456}
// CHECK-DAG: ![[SWITCH]] = !{!"branch_weights", i32 715827883, i32 -715827883, i32 -715827883, i32 -715827883}
152 changes: 76 additions & 76 deletions clang/test/Profile/c-general.c
Expand Up @@ -470,82 +470,82 @@ static void static_func() {
}
}

// PGOUSE-DAG: ![[SL1]] = !{!"branch_weights", i64 101, i64 2}
// PGOUSE-DAG: ![[SL2]] = !{!"branch_weights", i64 101, i64 2}
// PGOUSE-DAG: ![[SL3]] = !{!"branch_weights", i64 76, i64 2}

// PGOUSE-DAG: ![[EE1]] = !{!"branch_weights", i64 1, i64 2}
// PGOUSE-DAG: ![[EE2]] = !{!"branch_weights", i64 52, i64 1}
// PGOUSE-DAG: ![[EE3]] = !{!"branch_weights", i64 2, i64 51}
// PGOUSE-DAG: ![[EE4]] = !{!"branch_weights", i64 26, i64 26}
// PGOUSE-DAG: ![[EE5]] = !{!"branch_weights", i64 2, i64 1}
// PGOUSE-DAG: ![[EE6]] = !{!"branch_weights", i64 2, i64 26}
// PGOUSE-DAG: ![[EE7]] = !{!"branch_weights", i64 26, i64 1}

// PGOUSE-DAG: ![[IF1]] = !{!"branch_weights", i64 101, i64 2}
// PGOUSE-DAG: ![[IF2]] = !{!"branch_weights", i64 51, i64 51}
// PGOUSE-DAG: ![[IF3]] = !{!"branch_weights", i64 51, i64 1}
// PGOUSE-DAG: ![[IF4]] = !{!"branch_weights", i64 34, i64 18}
// PGOUSE-DAG: ![[IF5]] = !{!"branch_weights", i64 34, i64 1}
// PGOUSE-DAG: ![[IF6]] = !{!"branch_weights", i64 17, i64 2}
// PGOUSE-DAG: ![[IF7]] = !{!"branch_weights", i64 100, i64 2}
// PGOUSE-DAG: ![[IF8]] = !{!"branch_weights", i64 100, i64 2}

// PGOUSE-DAG: ![[JM1]] = !{!"branch_weights", i64 2, i64 1}
// PGOUSE-DAG: ![[JM2]] = !{!"branch_weights", i64 1, i64 2}
// PGOUSE-DAG: ![[JM3]] = !{!"branch_weights", i64 1, i64 2}
// PGOUSE-DAG: ![[JM4]] = !{!"branch_weights", i64 1, i64 2}
// PGOUSE-DAG: ![[JM5]] = !{!"branch_weights", i64 3, i64 2}
// PGOUSE-DAG: ![[JM6]] = !{!"branch_weights", i64 1, i64 2}
// PGOUSE-DAG: ![[JM7]] = !{!"branch_weights", i64 1, i64 2, i64 2, i64 2}
// PGOUSE-DAG: ![[JM8]] = !{!"branch_weights", i64 11, i64 2}
// PGOUSE-DAG: ![[JM9]] = !{!"branch_weights", i64 10, i64 2}

// PGOUSE-DAG: ![[SW1]] = !{!"branch_weights", i64 16, i64 1}
// PGOUSE-DAG: ![[SW2]] = !{!"branch_weights", i64 6, i64 2, i64 3, i64 4, i64 5}
// PGOUSE-DAG: ![[SW3]] = !{!"branch_weights", i64 1, i64 2}
// PGOUSE-DAG: ![[SW4]] = !{!"branch_weights", i64 3, i64 2}
// PGOUSE-DAG: ![[SW5]] = !{!"branch_weights", i64 4, i64 1}
// PGOUSE-DAG: ![[SW6]] = !{!"branch_weights", i64 5, i64 1}
// PGOUSE-DAG: ![[SW7]] = !{!"branch_weights", i64 1, i64 2, i64 2, i64 2, i64 2}
// PGOUSE-DAG: ![[SW8]] = !{!"branch_weights", i64 5, i64 1}
// PGOUSE-DAG: ![[SW9]] = !{!"branch_weights", i64 2, i64 5}

// PGOUSE-DAG: ![[BS1]] = !{!"branch_weights", i64 33, i64 2}
// PGOUSE-DAG: ![[BS2]] = !{!"branch_weights", i64 29, i64 2, i64 2, i64 2, i64 2, i64 1}
// PGOUSE-DAG: ![[BS3]] = !{!"branch_weights", i64 1, i64 2}
// PGOUSE-DAG: ![[BS4]] = !{!"branch_weights", i64 2, i64 2}
// PGOUSE-DAG: ![[BS5]] = !{!"branch_weights", i64 12, i64 1}
// PGOUSE-DAG: ![[BS6]] = !{!"branch_weights", i64 12, i64 3}
// PGOUSE-DAG: ![[BS7]] = !{!"branch_weights", i64 2, i64 1}
// PGOUSE-DAG: ![[BS8]] = !{!"branch_weights", i64 16, i64 1}
// PGOUSE-DAG: ![[BS9]] = !{!"branch_weights", i64 16, i64 14}
// PGOUSE-DAG: ![[BS10]] = !{!"branch_weights", i64 2, i64 1}
// PGOUSE-DAG: ![[BS11]] = !{!"branch_weights", i64 3, i64 1}

// PGOUSE-DAG: ![[BO1]] = !{!"branch_weights", i64 101, i64 2}
// PGOUSE-DAG: ![[BO2]] = !{!"branch_weights", i64 67, i64 35}
// PGOUSE-DAG: ![[BO3]] = !{!"branch_weights", i64 67, i64 35}
// PGOUSE-DAG: ![[BO4]] = !{!"branch_weights", i64 67, i64 35}
// PGOUSE-DAG: ![[BO5]] = !{!"branch_weights", i64 18, i64 18}
// PGOUSE-DAG: ![[BO6]] = !{!"branch_weights", i64 51, i64 51}
// PGOUSE-DAG: ![[BO7]] = !{!"branch_weights", i64 34, i64 18}
// PGOUSE-DAG: ![[BL1]] = !{!"branch_weights", i64 52, i64 1}
// PGOUSE-DAG: ![[BL2]] = !{!"branch_weights", i64 51, i64 2}
// PGOUSE-DAG: ![[BL3]] = !{!"branch_weights", i64 26, i64 27}
// PGOUSE-DAG: ![[BL4]] = !{!"branch_weights", i64 51, i64 2}
// PGOUSE-DAG: ![[BL5]] = !{!"branch_weights", i64 52, i64 1}
// PGOUSE-DAG: ![[BL6]] = !{!"branch_weights", i64 51, i64 2}
// PGOUSE-DAG: ![[BL7]] = !{!"branch_weights", i64 26, i64 27}
// PGOUSE-DAG: ![[BL8]] = !{!"branch_weights", i64 51, i64 2}
// PGOUSE-DAG: ![[CO1]] = !{!"branch_weights", i64 1, i64 2}
// PGOUSE-DAG: ![[CO2]] = !{!"branch_weights", i64 2, i64 1}

// PGOUSE-DAG: ![[DF1]] = !{!"branch_weights", i64 11, i64 2}
// PGOUSE-DAG: ![[DF2]] = !{!"branch_weights", i64 3, i64 3}
// PGOUSE-DAG: ![[DF3]] = !{!"branch_weights", i64 9, i64 5}

// PGOUSE-DAG: ![[ST1]] = !{!"branch_weights", i64 11, i64 2}
// PGOUSE-DAG: ![[SL1]] = !{!"branch_weights", i32 101, i32 2}
// PGOUSE-DAG: ![[SL2]] = !{!"branch_weights", i32 101, i32 2}
// PGOUSE-DAG: ![[SL3]] = !{!"branch_weights", i32 76, i32 2}

// PGOUSE-DAG: ![[EE1]] = !{!"branch_weights", i32 1, i32 2}
// PGOUSE-DAG: ![[EE2]] = !{!"branch_weights", i32 52, i32 1}
// PGOUSE-DAG: ![[EE3]] = !{!"branch_weights", i32 2, i32 51}
// PGOUSE-DAG: ![[EE4]] = !{!"branch_weights", i32 26, i32 26}
// PGOUSE-DAG: ![[EE5]] = !{!"branch_weights", i32 2, i32 1}
// PGOUSE-DAG: ![[EE6]] = !{!"branch_weights", i32 2, i32 26}
// PGOUSE-DAG: ![[EE7]] = !{!"branch_weights", i32 26, i32 1}

// PGOUSE-DAG: ![[IF1]] = !{!"branch_weights", i32 101, i32 2}
// PGOUSE-DAG: ![[IF2]] = !{!"branch_weights", i32 51, i32 51}
// PGOUSE-DAG: ![[IF3]] = !{!"branch_weights", i32 51, i32 1}
// PGOUSE-DAG: ![[IF4]] = !{!"branch_weights", i32 34, i32 18}
// PGOUSE-DAG: ![[IF5]] = !{!"branch_weights", i32 34, i32 1}
// PGOUSE-DAG: ![[IF6]] = !{!"branch_weights", i32 17, i32 2}
// PGOUSE-DAG: ![[IF7]] = !{!"branch_weights", i32 100, i32 2}
// PGOUSE-DAG: ![[IF8]] = !{!"branch_weights", i32 100, i32 2}

// PGOUSE-DAG: ![[JM1]] = !{!"branch_weights", i32 2, i32 1}
// PGOUSE-DAG: ![[JM2]] = !{!"branch_weights", i32 1, i32 2}
// PGOUSE-DAG: ![[JM3]] = !{!"branch_weights", i32 1, i32 2}
// PGOUSE-DAG: ![[JM4]] = !{!"branch_weights", i32 1, i32 2}
// PGOUSE-DAG: ![[JM5]] = !{!"branch_weights", i32 3, i32 2}
// PGOUSE-DAG: ![[JM6]] = !{!"branch_weights", i32 1, i32 2}
// PGOUSE-DAG: ![[JM7]] = !{!"branch_weights", i32 1, i32 2, i32 2, i32 2}
// PGOUSE-DAG: ![[JM8]] = !{!"branch_weights", i32 11, i32 2}
// PGOUSE-DAG: ![[JM9]] = !{!"branch_weights", i32 10, i32 2}

// PGOUSE-DAG: ![[SW1]] = !{!"branch_weights", i32 16, i32 1}
// PGOUSE-DAG: ![[SW2]] = !{!"branch_weights", i32 6, i32 2, i32 3, i32 4, i32 5}
// PGOUSE-DAG: ![[SW3]] = !{!"branch_weights", i32 1, i32 2}
// PGOUSE-DAG: ![[SW4]] = !{!"branch_weights", i32 3, i32 2}
// PGOUSE-DAG: ![[SW5]] = !{!"branch_weights", i32 4, i32 1}
// PGOUSE-DAG: ![[SW6]] = !{!"branch_weights", i32 5, i32 1}
// PGOUSE-DAG: ![[SW7]] = !{!"branch_weights", i32 1, i32 2, i32 2, i32 2, i32 2}
// PGOUSE-DAG: ![[SW8]] = !{!"branch_weights", i32 5, i32 1}
// PGOUSE-DAG: ![[SW9]] = !{!"branch_weights", i32 2, i32 5}

// PGOUSE-DAG: ![[BS1]] = !{!"branch_weights", i32 33, i32 2}
// PGOUSE-DAG: ![[BS2]] = !{!"branch_weights", i32 29, i32 2, i32 2, i32 2, i32 2, i32 1}
// PGOUSE-DAG: ![[BS3]] = !{!"branch_weights", i32 1, i32 2}
// PGOUSE-DAG: ![[BS4]] = !{!"branch_weights", i32 2, i32 2}
// PGOUSE-DAG: ![[BS5]] = !{!"branch_weights", i32 12, i32 1}
// PGOUSE-DAG: ![[BS6]] = !{!"branch_weights", i32 12, i32 3}
// PGOUSE-DAG: ![[BS7]] = !{!"branch_weights", i32 2, i32 1}
// PGOUSE-DAG: ![[BS8]] = !{!"branch_weights", i32 16, i32 1}
// PGOUSE-DAG: ![[BS9]] = !{!"branch_weights", i32 16, i32 14}
// PGOUSE-DAG: ![[BS10]] = !{!"branch_weights", i32 2, i32 1}
// PGOUSE-DAG: ![[BS11]] = !{!"branch_weights", i32 3, i32 1}

// PGOUSE-DAG: ![[BO1]] = !{!"branch_weights", i32 101, i32 2}
// PGOUSE-DAG: ![[BO2]] = !{!"branch_weights", i32 67, i32 35}
// PGOUSE-DAG: ![[BO3]] = !{!"branch_weights", i32 67, i32 35}
// PGOUSE-DAG: ![[BO4]] = !{!"branch_weights", i32 67, i32 35}
// PGOUSE-DAG: ![[BO5]] = !{!"branch_weights", i32 18, i32 18}
// PGOUSE-DAG: ![[BO6]] = !{!"branch_weights", i32 51, i32 51}
// PGOUSE-DAG: ![[BO7]] = !{!"branch_weights", i32 34, i32 18}
// PGOUSE-DAG: ![[BL1]] = !{!"branch_weights", i32 52, i32 1}
// PGOUSE-DAG: ![[BL2]] = !{!"branch_weights", i32 51, i32 2}
// PGOUSE-DAG: ![[BL3]] = !{!"branch_weights", i32 26, i32 27}
// PGOUSE-DAG: ![[BL4]] = !{!"branch_weights", i32 51, i32 2}
// PGOUSE-DAG: ![[BL5]] = !{!"branch_weights", i32 52, i32 1}
// PGOUSE-DAG: ![[BL6]] = !{!"branch_weights", i32 51, i32 2}
// PGOUSE-DAG: ![[BL7]] = !{!"branch_weights", i32 26, i32 27}
// PGOUSE-DAG: ![[BL8]] = !{!"branch_weights", i32 51, i32 2}
// PGOUSE-DAG: ![[CO1]] = !{!"branch_weights", i32 1, i32 2}
// PGOUSE-DAG: ![[CO2]] = !{!"branch_weights", i32 2, i32 1}

// PGOUSE-DAG: ![[DF1]] = !{!"branch_weights", i32 11, i32 2}
// PGOUSE-DAG: ![[DF2]] = !{!"branch_weights", i32 3, i32 3}
// PGOUSE-DAG: ![[DF3]] = !{!"branch_weights", i32 9, i32 5}

// PGOUSE-DAG: ![[ST1]] = !{!"branch_weights", i32 11, i32 2}

int main(int argc, const char *argv[]) {
simple_loops();
Expand Down

0 comments on commit 2a4e704

Please sign in to comment.