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

RISC V vector predication support intrinsics support #7119

Merged
merged 47 commits into from
Oct 26, 2022
Merged

Conversation

zvookin
Copy link
Member

@zvookin zvookin commented Oct 25, 2022

Have RISC V use LLVM vector predication intrinsics and add support for some architecture specific intrinsics.

Z Stern added 30 commits September 16, 2022 19:27
useful for RISC V, but it may be a simpler, better optimized path, for
Halide vector operations in general.

Add support for a maximum vector size that might be larger than the
native vector size. RISC V vector LMUL support is an example of an
architecture supporting this.
improving the calling convention and naming of the new routines to
generate the intrinsics.
caveperson programmer habits die hard.

Improve comments.
Change TODO(zalman) to TODO(zvookin) uniformly.

Few other cleanups.
strided load for dense case. Add some comments.
src/CodeGen_RISCV.cpp Outdated Show resolved Hide resolved
Copy link
Contributor

@steven-johnson steven-johnson left a comment

Choose a reason for hiding this comment

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

Looks good, mostly nits

src/CodeGen_RISCV.cpp Outdated Show resolved Hide resolved
src/CodeGen_RISCV.cpp Show resolved Hide resolved
src/CodeGen_RISCV.cpp Outdated Show resolved Hide resolved
src/CodeGen_RISCV.cpp Show resolved Hide resolved
src/CodeGen_RISCV.cpp Outdated Show resolved Hide resolved
src/CodeGen_RISCV.cpp Show resolved Hide resolved
src/CodeGen_RISCV.cpp Show resolved Hide resolved
src/CodeGen_RISCV.cpp Show resolved Hide resolved
src/CodeGen_RISCV.cpp Outdated Show resolved Hide resolved
src/CodeGen_RISCV.cpp Outdated Show resolved Hide resolved
@rootjalex
Copy link
Member

@steven-johnson Do the buildbots test RISC-V cross-compilation?

If so, this PR should probably make an addition to simd_op_check, to check for the added vector instructions in this PR.

@steven-johnson
Copy link
Contributor

@steven-johnson Do the buildbots test RISC-V cross-compilation?

If so, this PR should probably make an addition to simd_op_check, to check for the added vector instructions in this PR.

Not currently, no. We should definitely add that.

@zvookin
Copy link
Member Author

zvookin commented Oct 25, 2022

Added an issue for simd_op_check coverage. #7122

@zvookin
Copy link
Member Author

zvookin commented Oct 25, 2022 via email

@zvookin
Copy link
Member Author

zvookin commented Oct 26, 2022

Had to do a number of bug fixes on the vector predication work as I messed up on the test coverage previously. It works better with the code in this branch...

@zvookin
Copy link
Member Author

zvookin commented Oct 26, 2022

I believe I have addressed the feedback raised. In a couple cases, by opening tracking issues, but mostly by incorporating the changes suggested or fixing the problems raised. If I've missed anything please let me know. I also did some better testing. Obviously that should get rolled into the real tests, which is effectively the simd_op_check issue. This should be ready to land.

@steven-johnson steven-johnson self-requested a review October 26, 2022 16:21
Copy link
Contributor

@steven-johnson steven-johnson left a comment

Choose a reason for hiding this comment

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

LGTM pending green

Copy link
Member

@rootjalex rootjalex left a comment

Choose a reason for hiding this comment

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

Also LGTM with a nit

@zvookin
Copy link
Member Author

zvookin commented Oct 26, 2022

I improved naming and comments around the handling of all the integer type widths.

Vector efficiency improvement oer code review feedback.
@zvookin zvookin merged commit da87cb2 into main Oct 26, 2022
ardier pushed a commit to ardier/Halide-mutation that referenced this pull request Mar 3, 2024
Turn on vector predication support for RISC V. (First architecture to use this code. Bug fixes included here.) Add architecture specific vector intrinsics support as well. Should not affect anything outside of RISC V.
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