summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/BranchProbabilityInfo.cpp
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2011-12-22 09:26:37 +0000
committerChandler Carruth <chandlerc@gmail.com>2011-12-22 09:26:37 +0000
commitb024aa021d0309df9b0d078c53e981aded86b28a (patch)
treebb28ddb1530e88c9357708c23bd35f48c0f6d862 /llvm/lib/Analysis/BranchProbabilityInfo.cpp
parent1f2460ad43953b281f36ada7f294eb9c2b50ff5e (diff)
downloadbcm5719-llvm-b024aa021d0309df9b0d078c53e981aded86b28a.tar.gz
bcm5719-llvm-b024aa021d0309df9b0d078c53e981aded86b28a.zip
Make the unreachable probability much much heavier. The previous
probability wouldn't be considered "hot" in some weird loop structures or other compounding probability patterns. This makes it much harder to confuse, but isn't really a principled fix. I'd actually like it if we could model a zero probability, as it would make this much easier to reason about. Suggestions for how to do this better are welcome. llvm-svn: 147142
Diffstat (limited to 'llvm/lib/Analysis/BranchProbabilityInfo.cpp')
-rw-r--r--llvm/lib/Analysis/BranchProbabilityInfo.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/BranchProbabilityInfo.cpp b/llvm/lib/Analysis/BranchProbabilityInfo.cpp
index f9461c0b853..2730ce6c63b 100644
--- a/llvm/lib/Analysis/BranchProbabilityInfo.cpp
+++ b/llvm/lib/Analysis/BranchProbabilityInfo.cpp
@@ -65,8 +65,9 @@ static const uint32_t UR_TAKEN_WEIGHT = 1;
///
/// This is the weight for a branch not being taken toward a block that
/// terminates (eventually) in unreachable. Such a branch is essentially never
-/// taken.
-static const uint32_t UR_NONTAKEN_WEIGHT = 1023;
+/// taken. Set the weight to an absurdly high value so that nested loops don't
+/// easily subsume it.
+static const uint32_t UR_NONTAKEN_WEIGHT = 1024*1024 - 1;
static const uint32_t PH_TAKEN_WEIGHT = 20;
static const uint32_t PH_NONTAKEN_WEIGHT = 12;
OpenPOWER on IntegriCloud