[PATCH] D55812: [PowerPC]Exploit P9 vabsdu for some unsigned integer vselect patterns
Kewen Lin via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 18 00:30:56 PST 2018
jedilyn created this revision.
jedilyn added reviewers: nemanjai, jsji, hfinkel, echristo, inouehrs.
Herald added a subscriber: hiraditya.
define <4 x i32> @absd_int32_ugt(<4 x i32>, <4 x i32>) {
%3 = icmp ugt <4 x i32> %0, %1
%4 = sub <4 x i32> %0, %1
%5 = sub <4 x i32> %1, %0
%6 = select <4 x i1> %3, <4 x i32> %4, <4 x i32> %5
ret <4 x i32> %6
}
For the above vector select case, even on Power9, we generate
vcmpgtuw v4, v2, v3
vsubuwm v5, v2, v3
vsubuwm v2, v3, v2
xxsel v2, v2, v5, v4
blr
Power9 new instructions vabsdu* can be used and got the below optimized code:
vabsduw v2, v2, v3
blr
Repository:
rL LLVM
https://reviews.llvm.org/D55812
Files:
llvm/lib/Target/PowerPC/PPCISelLowering.cpp
llvm/lib/Target/PowerPC/PPCISelLowering.h
llvm/test/CodeGen/PowerPC/ppc64-P9-vabsd.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D55812.178602.patch
Type: text/x-patch
Size: 9084 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181218/e235e172/attachment.bin>
More information about the llvm-commits
mailing list