[PATCH] InstCombine: scalarize vector phis

Shemer, Anat anat.shemer at intel.com
Tue Apr 16 13:11:52 PDT 2013


Hi,

I would like to add to InstCombineVectorOps.cpp a function that sclarizes a vector phi instruction if its only use is an extract operation of one element at a constant location. Such vector phi might be created by the vectorization phase and the generated code is non-optimal.
In addition, in the function InstCombiner::visitExtractElementInst I removed the limitation that extract is promoted over a cast only if the cast has only one use. To make this work I replaced the use of Builder->CreateExtractElement() call with InsertNewInstWith(ExtractElementInst::Create()..), which also inserts the new instruction into the worklist.

I also added a test for these 2 cases.

I will appreciate your feedback.

Thanks, Anat




---------------------------------------------------------------------
Intel Israel (74) Limited

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130416/3550e296/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: InstCombineVectorPHI.diff
Type: application/octet-stream
Size: 6931 bytes
Desc: InstCombineVectorPHI.diff
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130416/3550e296/attachment.obj>


More information about the llvm-commits mailing list