[llvm] [InlineCost] Consider the default branch when calculating cost (PR #77856)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 6 00:21:39 PST 2024


================
@@ -65,7 +65,8 @@ class TargetTransformInfoImplBase {
     (void)PSI;
     (void)BFI;
     JTSize = 0;
-    return SI.getNumCases();
+    bool HasDefault = !SI.defaultDestUndefined();
+    return SI.getNumCases() + HasDefault;
----------------
arsenm wrote:

Seems like this was just a bug not counting the default to begin with. Maybe can submit this separately, since any regression probably comes from this?

https://github.com/llvm/llvm-project/pull/77856


More information about the llvm-commits mailing list