Skip to content

Commit c91edf3

Browse files
authored
irinterp: Move irinterp va processing (#54076)
Currently we perform the va transform inside the innermost construct of IRInterpretationState. However, I think it makes more sense to lift this processing one level, so that the `argtypes` for the constructor that takes `ir` matches `ir.argtypes`, while the one for the constructor that takes `mi` is the full expanded out argtypes. NFC for base, but the `ir` constructor is used in downstream external absints. However, I think this way around is better for them also, since it's not always clear what format the argtypes they have are in and the va direction is easy and well supported, so it's better to have the option.
1 parent 8d577ab commit c91edf3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

base/compiler/inferencestate.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -802,7 +802,6 @@ mutable struct IRInterpretationState
802802
given_argtypes[i] = widenslotwrapper(argtypes[i])
803803
end
804804
if isa(mi.def, Method)
805-
given_argtypes = va_process_argtypes(optimizer_lattice(interp), given_argtypes, mi)
806805
argtypes_refined = Bool[!(optimizer_lattice(interp), ir.argtypes[i], given_argtypes[i])
807806
for i = 1:length(given_argtypes)]
808807
else
@@ -832,6 +831,7 @@ function IRInterpretationState(interp::AbstractInterpreter,
832831
end
833832
method_info = MethodInfo(src)
834833
ir = inflate_ir(src, mi)
834+
argtypes = va_process_argtypes(optimizer_lattice(interp), argtypes, mi)
835835
return IRInterpretationState(interp, method_info, ir, mi, argtypes, world,
836836
codeinst.min_world, codeinst.max_world)
837837
end

0 commit comments

Comments
 (0)