This is an archive of the discontinued LLVM Phabricator instance.

[VPlan] Add vplan native path vectorization test case for inner loop reduction
ClosedPublic

Authored by Kazhuu on Sep 12 2020, 10:28 AM.

Details

Summary

Regarding this bug I posted earlier: https://bugs.llvm.org/show_bug.cgi?id=47035

After reading through LLVM source code and getting familiar with VPlan I was able to vectorize the code using by enabling VPlan native path. After talking with @fhahn he suggested that I contribute this as a test case. So here it is. I tried to follow the available guides how to do this best I could. I modified IR code by hand to have more clear variable names instead of numbers.

One thing what I'd like to get input from someone is that is current CHECK lines sufficient enough to verify that the inner loop has been vectorized properly?

Diff Detail

Event Timeline

Kazhuu created this revision.Sep 12 2020, 10:28 AM
Kazhuu requested review of this revision.Sep 12 2020, 10:28 AM
lattner resigned from this revision.Sep 12 2020, 10:52 AM

Great idea! However, I think it would be better to get feedback from other folks who are actively contributing to the loop optimizer. Thank you for pushing on this!

Thanks for the test! I left a suggestion on how to strengthen the CHECK lines in the test

llvm/test/Transforms/LoopVectorize/vplan-vectorize-inner-loop-reduction.ll
19

I think in this case, it would be valuable to add checks for all vectorized blocks and their contents.

Kazhuu updated this revision to Diff 292578.EditedSep 17 2020, 11:55 AM

Updated FileCheck to check more detailed about vectorized basic blocks. But I'd still want to get some pointers. Is this now too detailed checking and making the check too brittle for changes?

fhahn added inline comments.Sep 18 2020, 4:01 AM
llvm/test/Transforms/LoopVectorize/vplan-vectorize-inner-loop-reduction.ll
25

please spell out the intrinsic here in the check line and below. We want to make sure the right intrinsic is called here.

Kazhuu updated this revision to Diff 292862.Sep 18 2020, 11:49 AM

Typed all used LLVM intrinsic functions.

fhahn accepted this revision.Sep 18 2020, 12:29 PM

LGTM thanks.

It looks like the latest diff is just the changes since the last review. Could you squash all changes together in a single diff?

Please let me know if you need someone to commit the change on your behalf. If so, please provide the name/email to use to set as author in git

This revision is now accepted and ready to land.Sep 18 2020, 12:29 PM
Kazhuu updated this revision to Diff 292951.EditedSep 19 2020, 12:30 AM

Squashed diff. And I need someone to commit this change for me. It can be done with the name Mauri Mustonen and email mauri_mustonen@hotmail.com, thanks.

Ping! Does someone want to commit this for me with the name Mauri Mustonen and email mauri_mustonen@hotmail.com, thanks!

fhahn added a comment.Oct 6 2020, 2:06 AM

Ping! Does someone want to commit this for me with the name Mauri Mustonen and email mauri_mustonen@hotmail.com, thanks!

I missed that, sorry! Will commit shortly.

Kazhuu added a comment.Oct 6 2020, 2:15 AM

Thank you!