[llvm] [InlineCost] Consider the default branch when calculating cost (PR #77856)
Quentin Dian via llvm-commits
llvm-commits at lists.llvm.org
Sun Jan 14 06:19:32 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());
----------------
DianQK wrote:
I've added `defaultDestIsUnreachable`. `SimplifyCFG` and other places of use could be changed to this method in the future.
https://github.com/llvm/llvm-project/pull/77856
More information about the llvm-commits
mailing list