Skip to content

CC.statement_cost broken (called from Cthulhu) #58568

@vtjnash

Description

@vtjnash
julia> descend(Base.RefValue{Any}, (Int,))                                                        
Base.RefValue{T}(x) where T @ Base refvalue.jl:8                                                  

┌ Warning: Enable optimization to see the inlining costs.                                                                                                                                            
└ @ Cthulhu ~/.julia/dev/Cthulhu/src/CthulhuBase.jl:563                                                                                                                                              
                                                                                                  
Base.RefValue{T}(x) where T @ Base refvalue.jl:8                                                                                                                                                     
Variables                                        
  #ctor-self#::Core.Const(Base.RefValue{Any})                                                     
  x::Int64                                                                                                                                                                                           
  @_3::Int64                                 
                                                                                                  
ERROR: MethodError: no method matching statement_cost(::Core.SSAValue, ::Int64, ::Core.CodeInfo, ::Vector{Compiler.VarState}, ::Compiler.OptimizationParams)                                         
The function `statement_cost` exists, but no method is defined for this combination of argument types.                                                                                               
                                                                                                  
Closest candidates are:                          
  statement_cost(::Expr, ::Int64, ::Union{Compiler.IRCode, Core.CodeInfo}, ::Vector{Compiler.VarState}, ::Compiler.OptimizationParams)                                                               
   @ Base ~/julia/usr/share/julia/Compiler/src/optimize.jl:1344                                                                                                                                      
                                                 
Stacktrace:                                                                                                                                                                                          
  [1] statement_cost(ex::Expr, line::Int64, src::Core.CodeInfo, sptypes::Vector{Compiler.VarState}, params::Compiler.OptimizationParams)                                                             
    @ Compiler ./../usr/share/julia/Compiler/src/optimize.jl:1441                                 
  [2] statement_or_branch_cost                                                                                                                                                                       
    @ ./../usr/share/julia/Compiler/src/optimize.jl:1453 [inlined]                                
  [3] statement_costs!(cost::Vector{Int64}, body::Vector{Any}, src::Core.CodeInfo, sptypes::Vector{Compiler.VarState}, params::Compiler.OptimizationParams)                                          
    @ Compiler ./../usr/share/julia/Compiler/src/optimize.jl:1488                                 
  [4] top-level scope                                                                             
    @ ~/.julia/dev/Cthulhu/src/codeview.jl:195
  [5] top-level scope                            
    @ ~/.julia/dev/Cthulhu/src/codeview.jl:101                                                    

(unrelatedly, I'm uncertain why all of the debug info there is broken in v1.12.0-beta3 & master, but we're running most of Cthulhu in the interpreter because of Base.Experimental.@compiler_options compile=min, so we might not know how to decode that properly anymore for printing it)

Metadata

Metadata

Assignees

No one assigned

    Labels

    regression 1.12Regression in the 1.12 release

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions