[PATCH] D56408: [SimpleLoopUnswitch] Increment stats counter for unswitching switch instruction

Zheng Qian via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 7 13:18:42 PST 2019


qianzhen created this revision.
qianzhen added reviewers: chandlerc, asbirlea.
Herald added subscribers: llvm-commits, hiraditya.

Increment statistics counter NumSwitches at unswitchNontrivialInvariants() for unswitching a non-trivial switch instruction.
There is no functional change in this patch.


Repository:
  rL LLVM

https://reviews.llvm.org/D56408

Files:
  llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp


Index: llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp
===================================================================
--- llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp
+++ llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp
@@ -2281,7 +2281,10 @@
   if (MSSAU && VerifyMemorySSA)
     MSSAU->getMemorySSA()->verifyMemorySSA();
 
-  ++NumBranches;
+  if (BI)
+    ++NumBranches;
+  else if (SI)
+    ++NumSwitches;
 }
 
 /// Recursively compute the cost of a dominator subtree based on the per-block


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D56408.180549.patch
Type: text/x-patch
Size: 508 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190107/aa86090d/attachment.bin>


More information about the llvm-commits mailing list