Skip to content
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

backend: (riscv) add 1d, 3d, and 4d snitch stream lowerings #1781

Merged
merged 5 commits into from
Nov 14, 2023

Conversation

superlopuh
Copy link
Member

tested in the experiments repo that this works

Comment on lines -8 to -20
%0 = "snitch_stream.stride_pattern"() {"ub" = [#builtin.int<2>, #builtin.int<3>], "strides" = [#builtin.int<24>, #builtin.int<8>], "dm" = #builtin.int<31>} : () -> !snitch_stream.stride_pattern_type
// CHECK-NEXT: %0 = riscv.li 2 : () -> !riscv.reg<>
// CHECK-NEXT: %1 = riscv.li 3 : () -> !riscv.reg<>
// CHECK-NEXT: %2 = riscv.li 24 : () -> !riscv.reg<>
// CHECK-NEXT: %3 = riscv.li 8 : () -> !riscv.reg<>
// CHECK-NEXT: %4 = riscv.addi %0, -1 : (!riscv.reg<>) -> !riscv.reg<>
// CHECK-NEXT: %5 = riscv.addi %1, -1 : (!riscv.reg<>) -> !riscv.reg<>
// CHECK-NEXT: "snitch.ssr_set_dimension_bound"(%4) {"dm" = #builtin.int<31>, "dimension" = #builtin.int<0>} : (!riscv.reg<>) -> ()
// CHECK-NEXT: "snitch.ssr_set_dimension_bound"(%5) {"dm" = #builtin.int<31>, "dimension" = #builtin.int<1>} : (!riscv.reg<>) -> ()
// CHECK-NEXT: "snitch.ssr_set_dimension_stride"(%2) {"dm" = #builtin.int<31>, "dimension" = #builtin.int<0>} : (!riscv.reg<>) -> ()
// CHECK-NEXT: %6 = riscv.mul %4, %2 : (!riscv.reg<>, !riscv.reg<>) -> !riscv.reg<>
// CHECK-NEXT: %7 = riscv.sub %3, %6 : (!riscv.reg<>, !riscv.reg<>) -> !riscv.reg<>
// CHECK-NEXT: "snitch.ssr_set_dimension_stride"(%7) {"dm" = #builtin.int<31>, "dimension" = #builtin.int<1>} : (!riscv.reg<>) -> ()
Copy link
Member Author

Choose a reason for hiding this comment

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

git got confused by the {{.*}} changes, but the only meaningful change is the addition of riscv.li 0, which will be optimised out anyway

Copy link

codecov bot commented Nov 13, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Files Coverage Δ
.../riscv/lowering/convert_snitch_stream_to_snitch.py 100.00% <100.00%> (ø)

... and 7 files with indirect coverage changes

📢 Thoughts on this report? Let us know!

@superlopuh
Copy link
Member Author

I'll double check that this works on simulator before merging, looking to merge today

@superlopuh superlopuh merged commit d67edc1 into main Nov 14, 2023
10 checks passed
@superlopuh superlopuh deleted the sasha/snitch/1d-3d-streams branch November 14, 2023 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants