This is an archive of the discontinued LLVM Phabricator instance.

Vectorize math intrinsic calls in SLPVectorizer
ClosedPublic

Authored by karthikthecool on Apr 29 2014, 11:12 PM.

Details

Summary

Part 2/2 of [ Vectorize intrinsic math function calls in SLPVectorizer ]

Splitting patch in http://reviews.llvm.org/D3535

Now that we have getIntrinsicIDForCall in VectorUtil. Use the same logic as in LoopVectorize in SLPVectorizer and use getIntrinsicIDForCall to decide if the CallInstr can be classified as an intrinsic call.
If yes calculate the appropriate cost in SLPVectorize to decide if to vectorize or not.

Thanks
Karthik Bhat

Diff Detail

Event Timeline

karthikthecool retitled this revision from to Vectorize math intrinsic calls in SLPVectorizer.
karthikthecool updated this object.
karthikthecool edited the test plan for this revision. (Show Details)
karthikthecool added subscribers: Unknown Object (MLST), zinovy.nis.

Thanks Nadav for the review.
Updated the patch to make checks less strict in the test case.
Thanks
Karthik Bhat

rsilvera added inline comments.Apr 30 2014, 10:18 AM
lib/Transforms/Vectorize/SLPVectorizer.cpp
973

*CI2 == VL[i]. Shouldn't this be *CI?

Thanks Raul for pointing it out. Yes it needs to be *CI and not *CI2.
Updated the patch to fix incorrect debug message as per Raul's review comment.
Any other inputs?
Thanks
Karthik Bhat

nadav edited edge metadata.May 2 2014, 10:23 AM

Karthik,

The patch LGTM. Did you run it on the LLVM test suite? Do you know of any workloads that improve?

Thanks,
Nadav

karthikthecool accepted this revision.May 3 2014, 3:13 AM
karthikthecool added a reviewer: karthikthecool.

Thanks Tyler, Nadav. Committed as r207901.
I have run llvm lit regressions using make check-all . I'm a bit new here not sure how to execute performance test suites for llvm. If you could guide me to some documentation i would be happy to test and see if this patch improves any workload in llvm performance test cases.
Thanks
Karthik

This revision is now accepted and ready to land.May 3 2014, 3:13 AM
hfinkel edited edge metadata.May 3 2014, 3:21 AM

http://llvm.org/docs/TestingGuide.html -- Look at the section on the test-suite (and the LNT guide: http://llvm.org/docs/lnt/quickstart.html).

If you can't install LNT for whatever reason, you can also run the test suite using the underlying makefiles. There is some (seemingly out-of-date) documentation on this linked from the testing guide as well. If you need to do this and run into problems, let me know.

Thanks Hal for the links. I will give it a try.