summaryrefslogtreecommitdiffstats
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
commitb7dff9c9af26108df8fdc9603b8d954e6d4721a5 (patch)
tree2dd4bb8f0d2e684018a9fd979c8089aa6321c524
parent3687c3e90653fa0c8da9e70d12ab50877bc691af (diff)
downloadbcm5719-llvm-b7dff9c9af26108df8fdc9603b8d954e6d4721a5.tar.gz
bcm5719-llvm-b7dff9c9af26108df8fdc9603b8d954e6d4721a5.zip
[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 llvm-svn: 351193
-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
OpenPOWER on IntegriCloud