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

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 11 20:31:43 PST 2024


================
@@ -446,6 +446,8 @@ class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
     /// inline cost heuristic, but it's a generic cost model to be used in other
     /// places (e.g., in loop unrolling).
     unsigned N = SI.getNumCases();
+    bool HasDefault =
+        !isa<UnreachableInst>(SI.getDefaultDest()->getFirstNonPHIOrDbg());
----------------
arsenm wrote:

I don't think it's major enough to bother splitting out, I'd just do it directly here 

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


More information about the llvm-commits mailing list