From a31c8ef47d446f071a7c48f332733e67e32a4dfe Mon Sep 17 00:00:00 2001 From: Shuhei Kadowaki <40514306+aviatesk@users.noreply.github.com> Date: Sat, 10 Jun 2023 13:12:00 +0900 Subject: [PATCH] inlining: fix the `joint_effects` calculation (#50117) There are cases when `joint_effects` already has `:nothrow` tainted while the matches are fully covered. --- base/compiler/abstractinterpretation.jl | 4 +--- base/compiler/ssair/inlining.jl | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/base/compiler/abstractinterpretation.jl b/base/compiler/abstractinterpretation.jl index 368a4054fbc46..de8fd549400ef 100644 --- a/base/compiler/abstractinterpretation.jl +++ b/base/compiler/abstractinterpretation.jl @@ -2603,11 +2603,9 @@ function abstract_eval_globalref(interp::AbstractInterpreter, g::GlobalRef, sv:: nothrow = false if isa(rt, Const) consistent = ALWAYS_TRUE + nothrow = true if is_mutation_free_argtype(rt) inaccessiblememonly = ALWAYS_TRUE - nothrow = true - else - nothrow = true end elseif isdefined_globalref(g) nothrow = true diff --git a/base/compiler/ssair/inlining.jl b/base/compiler/ssair/inlining.jl index aebcc7394e309..17df27bd5f637 100644 --- a/base/compiler/ssair/inlining.jl +++ b/base/compiler/ssair/inlining.jl @@ -1406,7 +1406,7 @@ function compute_inlining_cases(@nospecialize(info::CallInfo), flag::UInt8, sig: fully_covered &= split_fully_covered end - joint_effects = Effects(joint_effects; nothrow=fully_covered) + fully_covered || (joint_effects = Effects(joint_effects; nothrow=false)) if handled_all_cases && revisit_idx !== nothing # we handled everything except one match with unmatched sparams,