From 43554fbbca6379003a5aae66e3eb5477c49b3a4c Mon Sep 17 00:00:00 2001 From: Shuhei Kadowaki <40514306+aviatesk@users.noreply.github.com> Date: Thu, 22 Feb 2024 17:05:41 +0900 Subject: [PATCH] disable the `cfg_simplify!` optimization on pre-1.11 versions (#548) --- src/interpreter.jl | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/interpreter.jl b/src/interpreter.jl index efa27aac..564cf7a1 100644 --- a/src/interpreter.jl +++ b/src/interpreter.jl @@ -121,8 +121,13 @@ end function create_cthulhu_source(@nospecialize(opt), effects::Effects) isa(opt, OptimizationState) || return opt - # get the (theoretically) same effect as the jl_compress_ir -> jl_uncompress_ir -> inflate_ir round-trip - ir = CC.compact!(CC.cfg_simplify!(CC.copy(opt.ir::IRCode))) + @static if VERSION > v"1.10" + # get the (theoretically) same effect as the jl_compress_ir -> jl_uncompress_ir -> inflate_ir round-trip + ir = CC.compact!(CC.cfg_simplify!(CC.copy(opt.ir::IRCode))) + else + # TODO do the round-trip here? + ir = CC.copy(opt.ir::IRCode) + end return OptimizedSource(ir, opt.src, opt.src.inlineable, effects) end