@@ -1156,16 +1156,18 @@ function is_known_call(@nospecialize(stmt), func::Symbol, stmts::Vector{Any})
1156
1156
end
1157
1157
function is_known_getproperty (@nospecialize (stmt), func:: Symbol , stmts:: Vector{Any} )
1158
1158
isexpr (stmt, :call ) || return false
1159
+ length (stmt. args) ≥ 3 || return false
1159
1160
f = stmt. args[1 ]
1160
1161
if f isa SSAValue
1161
1162
f = stmts[f. id]
1162
1163
end
1163
- callee_matches (f, Base, :getproperty ) && length (stmt. args) ≥ 3 &&
1164
- is_quotenode_egal (stmt. args[3 ], func) && return true
1165
- callee_matches (f, Core, :getproperty ) && length (stmt. args) ≥ 3 &&
1166
- is_quotenode_egal (stmt. args[3 ], func) && return true
1167
- callee_matches (f, Core. Compiler, :getproperty ) && length (stmt. args) ≥ 3 &&
1168
- is_quotenode_egal (stmt. args[3 ], func) && return true
1164
+ if (callee_matches (f, Base, :getproperty ) ||
1165
+ callee_matches (f, Core, :getproperty ) ||
1166
+ callee_matches (f, Core. Compiler, :getproperty ))
1167
+ if is_quotenode_egal (stmt. args[3 ], func)
1168
+ return true
1169
+ end
1170
+ end
1169
1171
return false
1170
1172
end
1171
1173
@@ -1244,17 +1246,15 @@ function add_required_inplace!(concretize::BitVector, src::CodeInfo, edges, cl)
1244
1246
changed = false
1245
1247
for i = 1 : length (src. code)
1246
1248
stmt = src. code[i]
1247
- if isexpr (stmt, :call )
1249
+ if isexpr (stmt, :call ) && length (stmt . args) ≥ 2
1248
1250
func = stmt. args[1 ]
1249
1251
if (callee_matches (func, Base, :push! ) ||
1250
1252
callee_matches (func, Base, :pop! ) ||
1251
1253
callee_matches (func, Base, :empty! ) ||
1252
1254
callee_matches (func, Base, :setindex! ))
1253
- if length (stmt. args) ≥ 2
1254
- if is_arg_requested (stmt. args[2 ], concretize, edges, cl)
1255
- if ! concretize[i]
1256
- changed = concretize[i] = true
1257
- end
1255
+ if is_arg_requested (stmt. args[2 ], concretize, edges, cl)
1256
+ if ! concretize[i]
1257
+ changed = concretize[i] = true
1258
1258
end
1259
1259
end
1260
1260
end
@@ -1268,9 +1268,8 @@ function is_arg_requested(@nospecialize(arg), concretize, edges, cl)
1268
1268
return concretize[arg. id] || any (@view concretize[edges. preds[arg. id]])
1269
1269
elseif arg isa SlotNumber
1270
1270
return any (@view concretize[cl. slotassigns[arg. id]])
1271
- else
1272
- return false
1273
1271
end
1272
+ return false
1274
1273
end
1275
1274
1276
1275
function select_dependencies! (concretize:: BitVector , src:: CodeInfo , edges, cl)
0 commit comments