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