Skip to content

Conversation

@aviatesk
Copy link
Member

By scalar-folding basic_blocks_starts(stmts)::BitSet.

@nanosoldier runbenchmarks("inference", vs=":master")

By scalar-folding `basic_blocks_starts(stmts)::BitSet`
@nanosoldier
Copy link
Collaborator

Your benchmark job has completed - possible performance regressions were detected. A full report can be found here.

block_for_inst(cfg::CFG, inst::Int) = block_for_inst(cfg.index, inst)

function basic_blocks_starts(stmts::Vector{Any})
@inline function basic_blocks_starts(stmts::Vector{Any})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of curiosity, why is it a good idea to force inlining of such a large function?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can perform SROA optimization by replacing BitSet created by basic_blocks_starts with "scalar"-values (internal fields of BitSet in this case) if we inline basic_blocks_starts into compute_basic_blocks.

Ideally this inlining should be performed automatically with some advanced inlining cost model, but at this moment our inlining cost model only accounts for simple code complexity and doesn't reason about SROA-profitability at all. With EscapeAnalysis.jl merged this kind of optimization is now possible, but it still doesn't happen yet.

@aviatesk aviatesk merged commit b81a20c into master May 20, 2022
@aviatesk aviatesk deleted the avi/opt branch May 20, 2022 01:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants