[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 19:47:44 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:
Can you move this default-is-unreachable into a helper on SwitchInst instead of repeating it twice?
https://github.com/llvm/llvm-project/pull/77856
More information about the llvm-commits
mailing list