Skip to content

Refactor pass pipeline for better precompute globals #2154

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 23, 2021

Conversation

MaxGraey
Copy link
Member

Try to fix #2153

  • I've read the contributing guidelines
  • I've added my name and email to the NOTICE file

@dcodeIO
Copy link
Member

dcodeIO commented Nov 23, 2021

Do you think this is worth it given the regressions?

@MaxGraey
Copy link
Member Author

Well, recent commit minimize side effects

Comment on lines -999 to -1006
(local $3 i32)
(local $4 i32)
(local $5 i32)
(local $6 i32)
(local $7 i32)
(local $8 i32)
(local $9 i32)
(local $10 i32)
Copy link
Member Author

Choose a reason for hiding this comment

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

That's really good stuff

Comment on lines -999 to -1005
(local $3 i32)
(local $4 i32)
(local $5 i32)
(local $6 i32)
(local $7 i32)
(local $8 i32)
(local $9 i32)
Copy link
Member Author

Choose a reason for hiding this comment

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

again

Comment on lines -53 to -81
(func $export:possibly-null/testFalseElse (param $0 i32)
global.get $~lib/memory/__stack_pointer
i32.const 4
i32.sub
global.set $~lib/memory/__stack_pointer
global.get $~lib/memory/__stack_pointer
i32.const 1024
i32.lt_s
if
i32.const 17440
i32.const 17488
i32.const 1
i32.const 1
call $~lib/builtins/abort
unreachable
end
global.get $~lib/memory/__stack_pointer
local.get $0
i32.store
block $__inlined_func$possibly-null/testFalseElse
local.get $0
i32.eqz
br_if $__inlined_func$possibly-null/testFalseElse
end
global.get $~lib/memory/__stack_pointer
i32.const 4
i32.add
global.set $~lib/memory/__stack_pointer
)
Copy link
Member Author

Choose a reason for hiding this comment

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

also very nice

Comment on lines -14396 to -14448
(local $15 i32)
(local $16 i32)
(local $17 i32)
(local $18 i32)
(local $19 i32)
(local $20 i32)
(local $21 i32)
(local $22 i32)
(local $23 i32)
(local $24 i32)
(local $25 i32)
(local $26 i32)
(local $27 i32)
(local $28 i32)
(local $29 i32)
(local $30 i32)
(local $31 i32)
(local $32 i32)
(local $33 i32)
(local $34 i32)
(local $35 i32)
(local $36 i32)
(local $37 i32)
(local $38 i32)
(local $39 i32)
(local $40 i32)
(local $41 i32)
(local $42 i32)
(local $43 i32)
(local $44 i32)
(local $45 i32)
(local $46 i32)
(local $47 i32)
(local $48 i32)
(local $49 i32)
(local $50 i32)
(local $51 i32)
(local $52 i32)
(local $53 i32)
(local $54 i32)
(local $55 i32)
(local $56 i32)
(local $57 i32)
(local $58 i32)
(local $59 i32)
(local $60 i32)
(local $61 i32)
(local $62 i32)
(local $63 i32)
(local $64 i32)
(local $65 i32)
(local $66 i32)
(local $67 i32)
Copy link
Member Author

Choose a reason for hiding this comment

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

Look at this!

Copy link
Member

@dcodeIO dcodeIO left a comment

Choose a reason for hiding this comment

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

Heh, I'm convinced :)

@MaxGraey MaxGraey merged commit 273d7d1 into AssemblyScript:main Nov 23, 2021
@MaxGraey MaxGraey deleted the opt-globals branch November 23, 2021 18:06
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.

Flaky const expression optimizations
2 participants