Skip to content

shouldn't function_filter filter out all subsequent dynamic dispatches inside the ignored functions ? #694

@filchristou

Description

@filchristou

function_filter is filtering dynamic dispatch exactly on the functions specified.

Initially I thought I could ignore all subsequent analysis inside the ignored functions but this is not the case.

Can there by another argument that will enable ignoring all subsequent analysis inside given functions ?

E.g. Let's say I have the following functions

function entryfunction()
    a = typeunstable()
    return a
end

function typeunstable()
    a = [1, "ena", 1.0, true, :true, (1,2), (1,2,3)]
    randint = floor(Int, (rand() * 10) % length(a)) + 1
    ele = a[randint]
    return [ele ele]
end

I created typeunstable knowing that it will have type instabilities and I want to completely ignore it from the analysis.
However the following will still print errors:

function_filter_tu(@nospecialize f) = f !== typeunstable;
JET.@report_opt function_filter=function_filter_tu entryfunction()

Image

What I should do to not get errors is

function_filter_hcat(@nospecialize f) = f !== hcat;
JET.@report_opt function_filter=function_filter_hcat entryfunction()

But this

  • is tedious to specify
  • will filter hcat out of other places that I might still want

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions