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

[ARM] Distribute shifts as muls #7790

Merged
merged 9 commits into from
Aug 24, 2023
Merged

[ARM] Distribute shifts as muls #7790

merged 9 commits into from
Aug 24, 2023

Conversation

rootjalex
Copy link
Member

ARM/LLVM currently lowers a + widening_shl(b, c) into (u | s)shll and add, this PR lowers it to (u | s)mlal. I reused HVX machinery for the distribution, DistributeShiftsAsMuls. HVX lowering is not expected to change at all.

@rootjalex rootjalex requested a review from abadams August 21, 2023 20:22
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.

Nice to have it factored into common code; I suspect that RISC-V will (eventually) benefit from something similar

src/DistributeShifts.cpp Outdated Show resolved Hide resolved
src/DistributeShifts.h Outdated Show resolved Hide resolved
src/DistributeShifts.cpp Outdated Show resolved Hide resolved
@abadams
Copy link
Member

abadams commented Aug 22, 2023

There's a nifty clang tidy failure

@abadams
Copy link
Member

abadams commented Aug 22, 2023

lgtm pending green bots

@rootjalex
Copy link
Member Author

The find_intrinsics rule that helps with mixed-sign widening_shift_left appears to have broken simd_op_check_hvx, so I am reverting it. This was to handle cases like:

i16_1 + i16(u8_2) * 2 -> umlal

@pranavb-ca I'd be happy to hear if you have any ideas about fixing this. I think the particular issue was that 2 * (i16(u8_1) + i16(u8_2)) got mapped to 2 vmpys with the change, where it used to be 1 vmpa.

@rootjalex
Copy link
Member Author

Failures appear unrelated

@rootjalex rootjalex merged commit 88c75ec into main Aug 24, 2023
@rootjalex rootjalex deleted the rootjalex/arm-mlal branch August 24, 2023 17:31
ardier pushed a commit to ardier/Halide-mutation that referenced this pull request Mar 3, 2024
* [ARM] distribute shifts as muls

This reverts commit eba8f32.

---------

Co-authored-by: Steven Johnson <srj@google.com>
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.

3 participants