Patch to fix vselect compilation on KNL.

Bader, Aleksey A aleksey.a.bader at intel.com
Tue Dec 3 13:15:40 PST 2013


Hi LLVM developers,

I need your help with reviewing and committing the patch.

Build of that program:
define <16 x i32> @test() {
entry:
  %0 = icmp slt <16 x i32> undef, undef
  %1 = select <16 x i1> %0, <16 x i32> undef, <16 x i32> zeroinitializer
  ret <16 x i32> %1
}
Fails on KNL because of optimization in PerformSELECTCombine, which replaces (x < y) ? a : 0 => (x < y) & a.
It seems to be profitable only if we keep comparison result in the same register group as 'a' (i.e. for vector architectures without dedicated mask registers).
There is no need in this optimization on KNL because vselect can be implemented as masked move (single instruction).

Thanks in advance,
Alexey

--------------------------------------------------------------------
Closed Joint Stock Company Intel A/O
Registered legal address: Krylatsky Hills Business Park, 
17 Krylatskaya Str., Bldg 4, Moscow 121614, 
Russian Federation

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/20131203/840e77a1/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: llvm.knl.vselect.diff
Type: application/octet-stream
Size: 2883 bytes
Desc: llvm.knl.vselect.diff
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20131203/840e77a1/attachment.obj>


More information about the llvm-commits mailing list