diff options
author | Justin Bogner <mail@justinbogner.com> | 2014-01-13 21:24:25 +0000 |
---|---|---|
committer | Justin Bogner <mail@justinbogner.com> | 2014-01-13 21:24:25 +0000 |
commit | 3fac6498e1540100c0d597d3662287e38e5826ff (patch) | |
tree | ce966b6e4fc7ec47a987b4bbacf1e76b52da463c /clang | |
parent | 0718a3a42004047fa034c31bc7b0b72e2fc24888 (diff) | |
download | bcm5719-llvm-3fac6498e1540100c0d597d3662287e38e5826ff.tar.gz bcm5719-llvm-3fac6498e1540100c0d597d3662287e38e5826ff.zip |
CodeGen: Clarify a comment about PGO in case statement ranges
llvm-svn: 199140
Diffstat (limited to 'clang')
-rw-r--r-- | clang/lib/CodeGen/CGStmt.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CGStmt.cpp b/clang/lib/CodeGen/CGStmt.cpp index 79db4184868..880e801189a 100644 --- a/clang/lib/CodeGen/CGStmt.cpp +++ b/clang/lib/CodeGen/CGStmt.cpp @@ -999,9 +999,10 @@ void CodeGenFunction::EmitCaseStmtRange(const CaseStmt &S) { // Range is small enough to add multiple switch instruction cases. uint64_t Total = CaseCnt.getCount() - CaseCnt.getParentCount(); unsigned NCases = Range.getZExtValue() + 1; - // Divide the weights evenly between the cases, ensuring that the total - // weight is preserved. Ie, a weight of 5 over three cases will be - // distributed as weights of 2, 2, and 1. + // We only have one region counter for the entire set of cases here, so we + // need to divide the weights evenly between the generated cases, ensuring + // that the total weight is preserved. Ie, a weight of 5 over three cases + // will be distributed as weights of 2, 2, and 1. uint64_t Weight = Total / NCases, Rem = Total % NCases; for (unsigned I = 0; I != NCases; ++I) { if (SwitchWeights) |