From 6106b90044720fb6e2336571d102d45aa26afdac Mon Sep 17 00:00:00 2001 From: Jarrett Revels Date: Fri, 4 May 2018 16:12:15 -0400 Subject: [PATCH] don't require varargs to be in last position to exploit cached type info --- base/compiler/ssair/inlining2.jl | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/base/compiler/ssair/inlining2.jl b/base/compiler/ssair/inlining2.jl index 5b5f1810f8cd15..73d9a21695de9e 100644 --- a/base/compiler/ssair/inlining2.jl +++ b/base/compiler/ssair/inlining2.jl @@ -576,18 +576,7 @@ function analyze_method!(idx, f, ft, metharg, methsp, method, stmt, atypes, sv, return ConstantCase(quoted(linfo.inferred_const), method, Any[methsp...], metharg) end - # Handle vararg functions - prevararg_rewritten_atypes = atypes - isva = na > 0 && method.isva - if isva - @assert length(atypes) >= na - 1 - va_type = tuple_tfunc(Tuple{Any[widenconst(atypes[i]) for i in 1:length(atypes)]...}) - atypes = Any[atypes[1:(na - 1)]..., va_type] - end - - # Go see if we already have a pre-inferred result. Use prevararg_rewritten_atypes - # for the lookup, since that's what inference used when it populated the cache. - res = find_inferred(linfo, prevararg_rewritten_atypes, sv) + res = find_inferred(linfo, atypes, sv) res === nothing && return nothing if length(res::Tuple) == 1