diff options
| author | Zaara Syeda <syzaara@ca.ibm.com> | 2019-01-15 15:08:01 +0000 |
|---|---|---|
| committer | Zaara Syeda <syzaara@ca.ibm.com> | 2019-01-15 15:08:01 +0000 |
| commit | b7dff9c9af26108df8fdc9603b8d954e6d4721a5 (patch) | |
| tree | 2dd4bb8f0d2e684018a9fd979c8089aa6321c524 | |
| parent | 3687c3e90653fa0c8da9e70d12ab50877bc691af (diff) | |
| download | bcm5719-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.cpp | 5 |
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 |

