summaryrefslogtreecommitdiff
path: root/llvm
diff options
context:
space:
mode:
authorZaara Syeda <syzaara@ca.ibm.com>2019-01-15 15:08:01 +0000
committerZaara Syeda <syzaara@ca.ibm.com>2019-01-15 15:08:01 +0000
commit14c0955d14f4b956304280ef19e129f542b4fbf9 (patch)
tree1653dccada29835f8f984ddd24aa9fa257941085 /llvm
parent7c8e93a1ca4f975be396dc50f11a3eb9c05fbc22 (diff)
[SimpleLoopUnswitch] Increment stats counter for unswitching switch instruction
Increment statistics counter NumSwitches at unswitchNontrivialInvariants() for unswitching a non-trivial switch instruction. This is to fix a bug that it increments NumBranches even for the case of switch instruction. There is no functional change in this patch. Differential Revision: https://reviews.llvm.org/D56408
Diffstat (limited to 'llvm')
-rw-r--r--llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp b/llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp
index abec9183f0f..5a67178cef3 100644
--- a/llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp
+++ b/llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp
@@ -2281,7 +2281,10 @@ static void unswitchNontrivialInvariants(
if (MSSAU && VerifyMemorySSA)
MSSAU->getMemorySSA()->verifyMemorySSA();
- ++NumBranches;
+ if (BI)
+ ++NumBranches;
+ else
+ ++NumSwitches;
}
/// Recursively compute the cost of a dominator subtree based on the per-block