Skip to content

Commit b7dff9c

Browse files
committedJan 15, 2019
[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
1 parent 3687c3e commit b7dff9c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed
 

‎llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -2281,7 +2281,10 @@ static void unswitchNontrivialInvariants(
22812281
if (MSSAU && VerifyMemorySSA)
22822282
MSSAU->getMemorySSA()->verifyMemorySSA();
22832283

2284-
++NumBranches;
2284+
if (BI)
2285+
++NumBranches;
2286+
else
2287+
++NumSwitches;
22852288
}
22862289

22872290
/// Recursively compute the cost of a dominator subtree based on the per-block

0 commit comments

Comments
 (0)
Please sign in to comment.