From 403e4e2adc4823f8fc7ab66aa6fadb70696d9ae6 Mon Sep 17 00:00:00 2001 From: Shuhei Kadowaki <40514306+aviatesk@users.noreply.github.com> Date: Fri, 17 Mar 2023 22:31:23 +0900 Subject: [PATCH] compiler: fix performance issue introduced in #48962 (#49036) `bb_rename_pred` was captured by #48962, so this commit fixes it up. This was successfully detected by: `JET.report_opt(CC.batch_inline!, (CC.IRCode,Vector{Pair{Int,Any}},Bool,CC.OptimizationParams))` --- base/compiler/ssair/ir.jl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/base/compiler/ssair/ir.jl b/base/compiler/ssair/ir.jl index b1b7beec3f3c5..c0146c1dd2d23 100644 --- a/base/compiler/ssair/ir.jl +++ b/base/compiler/ssair/ir.jl @@ -1349,7 +1349,9 @@ function process_node!(compact::IncrementalCompact, result_idx::Int, inst::Instr elseif isa(stmt, PhiNode) if cfg_transforms_enabled # Rename phi node edges - map!(i -> bb_rename_pred[i], stmt.edges, stmt.edges) + let bb_rename_pred=bb_rename_pred + map!(i::Int32 -> bb_rename_pred[i], stmt.edges, stmt.edges) + end # Remove edges and values associated with dead blocks. Entries in # `values` can be undefined when the phi node refers to something