258 Commits

Author SHA1 Message Date
Craig Topper
c9994c8acf [X86] Remove the last of the 'x86.fma.' intrinsics and autoupgrade them to 'llvm.fma'. Add upgrade tests for all.
Still need to remove the AVX512 masked versions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@336383 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-05 18:43:58 +00:00
Craig Topper
5f1cfe90f3 [X86] Remove X86 specific scalar FMA intrinsics and upgrade to tart independent FMA and extractelement/insertelement.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@336315 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-05 06:52:55 +00:00
Craig Topper
3d92cb5cdd [X86] Remove some of the packed FMA3 intrinsics since we no longer use them in clang.
There's a regression in here due to inability to combine fneg inputs of X86ISD::FMSUB/FNMSUB/FNMADD nodes.

More removals to come, but I wanted to stop and fix the regression that showed up in this first.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@336303 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-05 02:52:54 +00:00
Craig Topper
8c0bb2f036 [X86] Remove masking from avx512 rotate intrinsics. Use select in IR instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@336035 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-30 01:32:04 +00:00
Craig Topper
a233e5b07a [X86] Remove masking from the avx512 packed sqrt intrinsics. Use select in IR instead.
While there improve the coverage of the intrinsic testing and add fast-isel tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@335944 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-29 05:43:26 +00:00
Craig Topper
480d03dbeb [X86] Rename the autoupgraded of packed fp compare and fpclass intrinsics that don't take a mask as input to exclude '.mask.' from their name.
I think the intrinsics named 'avx512.mask.' should refer to the previous behavior of taking a mask argument in the intrinsic instead of using a 'select' or 'and' instruction in IR to accomplish the masking. This is more consistent with the goal that eventually we will have no intrinsics that have masking builtin. When we reach that goal, we should have no intrinsics named "avx512.mask".

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@335744 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-27 15:57:53 +00:00
Craig Topper
d1d8627cf4 [X86] Redefine avx512 packed fpclass intrinsics to return a vXi1 mask and implement the mask input argument using an 'and' IR instruction.
This recommits r335562 and 335563 as a single commit.

The frontend will surround the intrinsic with the appropriate marshalling to/from a scalar type to match the sigature of the builtin that software expects.

By exposing the vXi1 type directly in the llvm intrinsic we make it available to optimizers much earlier. This can enable the scalar marshalling code to be optimized away.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@335568 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-26 01:37:02 +00:00
Craig Topper
00cc8d0f09 Revert r335562 and 335563 "[X86] Redefine avx512 packed fpclass intrinsics to return a vXi1 mask and implement the mask input argument using an 'and' IR instruction."
These were supposed to have been squashed to a single commit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@335566 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-26 01:31:53 +00:00
Craig Topper
60f122c15f foo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@335562 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-26 00:43:34 +00:00
Craig Topper
cb5e58dbd9 [X86] Remove masking from 512-bit floating max/min intrinsics. Use select instruction instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@335199 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-21 05:00:56 +00:00
Tomasz Krupa
a36133dda7 [X86] Lowering sqrt intrinsics to native IR
Summary: Complementary patch to lowering sqrt intrinsics in Clang.

Reviewers: craig.topper, spatel, RKSimon, DavidKreitzer, uriel.k

Reviewed By: craig.topper

Subscribers: tkrupa, mike.dvoretsky, llvm-commits

Differential Revision: https://reviews.llvm.org/D41599


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@334849 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-15 18:05:24 +00:00
Craig Topper
c2287211da [X86] Remove masking from avx512vbmi2 concat and shift by immediate intrinsics. Use select in IR instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@334576 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-13 07:19:21 +00:00
Craig Topper
e5d2855ab4 [X86] Remove masking from dbpsadbw intrinsics, use select in IR instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@334384 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-11 06:18:22 +00:00
Craig Topper
1eda80d0b0 [X86] Remove and autoupgrade the expandload and compressstore intrinsics.
We use the target independent intrinsics now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@334381 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-11 01:25:22 +00:00
Craig Topper
edd46a8e79 [X86] Remove masking from the 512-bit masked floating point add/sub/mul/div intrinsics. Use a select in IR instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@334358 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-10 06:01:36 +00:00
Craig Topper
93d997435d [X86] Remove and autoupgrade masked avx512vnni intrinsics using the unmasked intrinsics and select instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@333857 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-03 23:24:17 +00:00
Craig Topper
a96fa2453b [X86] Remove masked vpermi2var/vpermt2var intrinsics and autoupgrade.
We have unmasked intrinsics now and wrap them with a select. This is a net reduction of 36 intrinsics from before the unmasked intrinsics were added.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@333388 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-29 05:22:05 +00:00
Craig Topper
bfcd30f542 [X86] Remove masking from avx512ifma intrinsics. Use a select instead.
This allows us to avoid having mask and maskz variant. Reducing from 12 intrinsics to 6.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@333346 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-26 18:55:19 +00:00
Craig Topper
6e21f26495 [X86] Remove 128/256-bit cvtdq2ps, cvtudq2ps, cvtqq2pd, cvtuqq2pd intrinsics.
These can all be implemented with sitofp/uitofp instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332916 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-21 23:15:00 +00:00
Craig Topper
343a521299 [X86] Remove masking from vpternlog intrinsics. Use a select in IR instead.
This removes 6 intrinsics since we no longer need separate mask and maskz intrinsics.

Differential Revision: https://reviews.llvm.org/D47124

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332890 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-21 20:58:09 +00:00
Craig Topper
aa228ef4a3 [X86] Remove mask arguments from permvar builtins/intrinsics. Use a select in IR instead.
Someday maybe we'll use selects for all intrinsics.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332824 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-20 23:34:04 +00:00
Craig Topper
28daf68df7 [X86] Remove and autoupgrade avx512.vbroadcast.ss/avx512.vbroadcast.sd intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332271 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-14 18:21:22 +00:00
Craig Topper
d4541505a5 [X86] Remove and autoupgrade the cvtusi2sd intrinsic. Use uitofp+insertelement instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332206 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-14 00:06:49 +00:00
Craig Topper
e6d357b0ce [X86] Remove and autoupgrade masked vpermd/vpermps intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332198 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-13 18:03:59 +00:00
Craig Topper
3d518c8296 [X86] Remove an autoupgrade legacy cvtss2sd intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332187 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-13 00:29:40 +00:00
Craig Topper
fbe091db86 [X86] Remove and autoupgrade cvtsi2ss/cvtsi2sd intrinsics to match what clang has used for a very long time.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332186 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-12 23:14:39 +00:00
Craig Topper
57cc768ae7 [X86] Remove some unused masked conversion intrinsics that can be replaced with an older intrinsic and a select.
This is what clang already uses.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332170 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-12 02:34:28 +00:00
Craig Topper
c36d516fd6 [X86] Remove and autoupgrade a bunch of FMA instrinsics that are no longer used by clang.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332146 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-11 21:59:34 +00:00
Craig Topper
e12166f8ad [X86] Remove and autoupgrade the avx512.mask.store.ss intrinsic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332079 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-11 04:33:18 +00:00
Piotr Padlewski
9648b46325 Rename invariant.group.barrier to launder.invariant.group
Summary:
This is one of the initial commit of "RFC: Devirtualization v2" proposal:
https://docs.google.com/document/d/16GVtCpzK8sIHNc2qZz6RN8amICNBtvjWUod2SujZVEo/edit?usp=sharing

Reviewers: rsmith, amharc, kuhar, sanjoy

Subscribers: arsenm, nhaehnle, javed.absar, hiraditya, llvm-commits

Differential Revision: https://reviews.llvm.org/D45111

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331448 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-03 11:03:01 +00:00
Chandler Carruth
8b02b588cb [x86] Revert r330322 (& r330323): Lowering x86 adds/addus/subs/subus intrinsics
The LLVM commit introduces a crash in LLVM's instruction selection.

I filed http://llvm.org/PR37260 with the test case.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@330997 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-26 21:46:01 +00:00
Reid Kleckner
72775a354c Fix -Wtautological-compare warning with npos on Windows
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@330614 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-23 16:47:27 +00:00
Alexander Ivchenko
b6965c7c4f Lowering x86 adds/addus/subs/subus intrinsics (llvm part)
This is the patch that lowers x86 intrinsics to native IR
in order to enable optimizations. The patch also includes folding
of previously missing saturation patterns so that IR emits the same
machine instructions as the intrinsics.

Patch by tkrupa

Differential Revision: https://reviews.llvm.org/D44785


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@330322 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-19 12:13:30 +00:00
Gerolf Hoflehner
753b745329 [IR] Upgrade comment token in objc retain release marker for asm call
Older compiler issued '#' instead of ';'


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@330173 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-17 04:02:24 +00:00
Craig Topper
754a558235 [X86] Remove the pmuldq/pmuldq intrinsics and replace with native IR.
This completes the work started in r329604 and r329605 when we changed clang to no longer use the intrinsics.

We lost some InstCombine SimplifyDemandedBit optimizations through this change as we aren't able to fold 'and', bitcast, shuffle very well.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329990 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-13 06:07:18 +00:00
Craig Topper
49b10db743 [X86] Remove 128/256-bit masked pmaddubsw and pmaddwd intrinsics. Replace 512-bit masked intrinsic with unmasked intrinsic and a select.
The 128/256-bit versions were no longer used by clang. It uses the legacy SSE/AVX2 version and a select. The 512-bit was changed to the same for consistency.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329774 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-11 04:55:04 +00:00
Craig Topper
6221e95d97 [X86] Merge some of the autoupgrade handling for masked intrinsics that just need to upgrade to an unmasked version plus a select. NFCI
These are were previously grouped in small groups of similarish intrinsics. But all the intrinsics have the same number of arguments and the same order. So we can move them all into a larger group for handling.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329549 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-09 06:15:09 +00:00
Gerolf Hoflehner
7d9ae75740 [IR] Upgrade comment token in objc retain release marker
Older compiler issued '#' instead of ';'


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329248 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-05 02:44:46 +00:00
Craig Topper
b7da3a52b9 [X86] Add 512-bit unmasked pmulhrsw/pmulhw/pmulhuw intrinsics. Remove and auto upgrade 128/256/512 bit masked pmulhrsw/pmulhw/pmulhuw intrinsics.
The 128 and 256 bit versions were already not used by clang. This adds an equivalent unmasked 512 bit version. Then autoupgrades all sizes to use unmasked intrinsics plus select.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325559 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-20 07:28:14 +00:00
Craig Topper
05ca387efe [X86] Reverse the operand order of the autoupgrade of the kunpack builtins.
The second operand needs to be in the lower bits of the concatenation. This matches llvm 5.0, gcc, and icc behavior.

Fixes PR36360.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324953 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-12 22:38:34 +00:00
Craig Topper
06dc5820cf [X86] Change signatures of avx512 packed fp compare intrinsics to return a vXi1 mask type to be closer to an fcmp.
Summary:
This patch changes the signature of the avx512 packed fp compare intrinsics to return a vXi1 vector and no longer take a mask as input. The casts to scalar type will now need to be explicit in the IR. The masking node will now be an explicit and in the IR.

This makes the intrinsic look much more similar to an fcmp instruction that we wish we could use for these but can't. We already use icmp instructions for integer compares.

Previously the lowering step of isel would turn the intrinsic into an X86 specific ISD node and a emit the masking nodes as well as some bitcasts. This means DAG combines can't see the vXi1 type until somewhat late, making it more difficult to combine out gpr<->mask transition sequences. By exposing the vXi1 type explicitly in the IR and initial SelectionDAG we give earlier DAG combines and even InstCombine the chance to see it and optimize it.

This should make any issues with gpr<->mask sequences the same between integer and fp. Meaning we only have to fix them once.

Reviewers: spatel, delena, RKSimon, zvi

Reviewed By: RKSimon

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D43137

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324827 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-10 23:33:55 +00:00
Craig Topper
2206986770 [X86] Remove kortest intrinsics and replace with native IR.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324646 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-08 20:16:06 +00:00
Craig Topper
128eeec0ca [X86] Remove and autoupgrade kand/kandn/kor/kxor/kxnor/knot intrinsics.
Clang already stopped using these a couple months ago.

The test cases aren't great as there is nothing forcing the operations to stay in k-registers so some of them moved back to scalar ops due to the bitcasts being moved around.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324177 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-03 20:18:25 +00:00
Daniel Neilson
afa2e7e6a6 Remove alignment argument from memcpy/memmove/memset in favour of alignment attributes (Step 1)
Summary:
 This is a resurrection of work first proposed and discussed in Aug 2015:
   http://lists.llvm.org/pipermail/llvm-dev/2015-August/089384.html
and initially landed (but then backed out) in Nov 2015:
   http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20151109/312083.html

 The @llvm.memcpy/memmove/memset intrinsics currently have an explicit argument
which is required to be a constant integer. It represents the alignment of the
dest (and source), and so must be the minimum of the actual alignment of the
two.

 This change is the first in a series that allows source and dest to each
have their own alignments by using the alignment attribute on their arguments.

 In this change we:
1) Remove the alignment argument.
2) Add alignment attributes to the source & dest arguments. We, temporarily,
   require that the alignments for source & dest be equal.

 For example, code which used to read:
  call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 100, i32 4, i1 false)
will now read
  call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 4 %dest, i8* align 4 %src, i32 100, i1 false)

 Downstream users may have to update their lit tests that check for
@llvm.memcpy/memmove/memset call/declaration patterns. The following extended sed script
may help with updating the majority of your tests, but it does not catch all possible
patterns so some manual checking and updating will be required.

s~declare void @llvm\.mem(set|cpy|move)\.p([^(]*)\((.*), i32, i1\)~declare void @llvm.mem\1.p\2(\3, i1)~g
s~call void @llvm\.memset\.p([^(]*)i8\(i8([^*]*)\* (.*), i8 (.*), i8 (.*), i32 [01], i1 ([^)]*)\)~call void @llvm.memset.p\1i8(i8\2* \3, i8 \4, i8 \5, i1 \6)~g
s~call void @llvm\.memset\.p([^(]*)i16\(i8([^*]*)\* (.*), i8 (.*), i16 (.*), i32 [01], i1 ([^)]*)\)~call void @llvm.memset.p\1i16(i8\2* \3, i8 \4, i16 \5, i1 \6)~g
s~call void @llvm\.memset\.p([^(]*)i32\(i8([^*]*)\* (.*), i8 (.*), i32 (.*), i32 [01], i1 ([^)]*)\)~call void @llvm.memset.p\1i32(i8\2* \3, i8 \4, i32 \5, i1 \6)~g
s~call void @llvm\.memset\.p([^(]*)i64\(i8([^*]*)\* (.*), i8 (.*), i64 (.*), i32 [01], i1 ([^)]*)\)~call void @llvm.memset.p\1i64(i8\2* \3, i8 \4, i64 \5, i1 \6)~g
s~call void @llvm\.memset\.p([^(]*)i128\(i8([^*]*)\* (.*), i8 (.*), i128 (.*), i32 [01], i1 ([^)]*)\)~call void @llvm.memset.p\1i128(i8\2* \3, i8 \4, i128 \5, i1 \6)~g
s~call void @llvm\.memset\.p([^(]*)i8\(i8([^*]*)\* (.*), i8 (.*), i8 (.*), i32 ([0-9]*), i1 ([^)]*)\)~call void @llvm.memset.p\1i8(i8\2* align \6 \3, i8 \4, i8 \5, i1 \7)~g
s~call void @llvm\.memset\.p([^(]*)i16\(i8([^*]*)\* (.*), i8 (.*), i16 (.*), i32 ([0-9]*), i1 ([^)]*)\)~call void @llvm.memset.p\1i16(i8\2* align \6 \3, i8 \4, i16 \5, i1 \7)~g
s~call void @llvm\.memset\.p([^(]*)i32\(i8([^*]*)\* (.*), i8 (.*), i32 (.*), i32 ([0-9]*), i1 ([^)]*)\)~call void @llvm.memset.p\1i32(i8\2* align \6 \3, i8 \4, i32 \5, i1 \7)~g
s~call void @llvm\.memset\.p([^(]*)i64\(i8([^*]*)\* (.*), i8 (.*), i64 (.*), i32 ([0-9]*), i1 ([^)]*)\)~call void @llvm.memset.p\1i64(i8\2* align \6 \3, i8 \4, i64 \5, i1 \7)~g
s~call void @llvm\.memset\.p([^(]*)i128\(i8([^*]*)\* (.*), i8 (.*), i128 (.*), i32 ([0-9]*), i1 ([^)]*)\)~call void @llvm.memset.p\1i128(i8\2* align \6 \3, i8 \4, i128 \5, i1 \7)~g
s~call void @llvm\.mem(cpy|move)\.p([^(]*)i8\(i8([^*]*)\* (.*), i8([^*]*)\* (.*), i8 (.*), i32 [01], i1 ([^)]*)\)~call void @llvm.mem\1.p\2i8(i8\3* \4, i8\5* \6, i8 \7, i1 \8)~g
s~call void @llvm\.mem(cpy|move)\.p([^(]*)i16\(i8([^*]*)\* (.*), i8([^*]*)\* (.*), i16 (.*), i32 [01], i1 ([^)]*)\)~call void @llvm.mem\1.p\2i16(i8\3* \4, i8\5* \6, i16 \7, i1 \8)~g
s~call void @llvm\.mem(cpy|move)\.p([^(]*)i32\(i8([^*]*)\* (.*), i8([^*]*)\* (.*), i32 (.*), i32 [01], i1 ([^)]*)\)~call void @llvm.mem\1.p\2i32(i8\3* \4, i8\5* \6, i32 \7, i1 \8)~g
s~call void @llvm\.mem(cpy|move)\.p([^(]*)i64\(i8([^*]*)\* (.*), i8([^*]*)\* (.*), i64 (.*), i32 [01], i1 ([^)]*)\)~call void @llvm.mem\1.p\2i64(i8\3* \4, i8\5* \6, i64 \7, i1 \8)~g
s~call void @llvm\.mem(cpy|move)\.p([^(]*)i128\(i8([^*]*)\* (.*), i8([^*]*)\* (.*), i128 (.*), i32 [01], i1 ([^)]*)\)~call void @llvm.mem\1.p\2i128(i8\3* \4, i8\5* \6, i128 \7, i1 \8)~g
s~call void @llvm\.mem(cpy|move)\.p([^(]*)i8\(i8([^*]*)\* (.*), i8([^*]*)\* (.*), i8 (.*), i32 ([0-9]*), i1 ([^)]*)\)~call void @llvm.mem\1.p\2i8(i8\3* align \8 \4, i8\5* align \8 \6, i8 \7, i1 \9)~g
s~call void @llvm\.mem(cpy|move)\.p([^(]*)i16\(i8([^*]*)\* (.*), i8([^*]*)\* (.*), i16 (.*), i32 ([0-9]*), i1 ([^)]*)\)~call void @llvm.mem\1.p\2i16(i8\3* align \8 \4, i8\5* align \8 \6, i16 \7, i1 \9)~g
s~call void @llvm\.mem(cpy|move)\.p([^(]*)i32\(i8([^*]*)\* (.*), i8([^*]*)\* (.*), i32 (.*), i32 ([0-9]*), i1 ([^)]*)\)~call void @llvm.mem\1.p\2i32(i8\3* align \8 \4, i8\5* align \8 \6, i32 \7, i1 \9)~g
s~call void @llvm\.mem(cpy|move)\.p([^(]*)i64\(i8([^*]*)\* (.*), i8([^*]*)\* (.*), i64 (.*), i32 ([0-9]*), i1 ([^)]*)\)~call void @llvm.mem\1.p\2i64(i8\3* align \8 \4, i8\5* align \8 \6, i64 \7, i1 \9)~g
s~call void @llvm\.mem(cpy|move)\.p([^(]*)i128\(i8([^*]*)\* (.*), i8([^*]*)\* (.*), i128 (.*), i32 ([0-9]*), i1 ([^)]*)\)~call void @llvm.mem\1.p\2i128(i8\3* align \8 \4, i8\5* align \8 \6, i128 \7, i1 \9)~g

 The remaining changes in the series will:
Step 2) Expand the IRBuilder API to allow creation of memcpy/memmove with differing
   source and dest alignments.
Step 3) Update Clang to use the new IRBuilder API.
Step 4) Update Polly to use the new IRBuilder API.
Step 5) Update LLVM passes that create memcpy/memmove calls to use the new IRBuilder API,
        and those that use use MemIntrinsicInst::[get|set]Alignment() to use
        getDestAlignment() and getSourceAlignment() instead.
Step 6) Remove the single-alignment IRBuilder API for memcpy/memmove, and the
        MemIntrinsicInst::[get|set]Alignment() methods.

Reviewers: pete, hfinkel, lhames, reames, bollu

Reviewed By: reames

Subscribers: niosHD, reames, jholewinski, qcolombet, jfb, sanjoy, arsenm, dschuff, dylanmckay, mehdi_amini, sdardis, nemanjai, david2050, nhaehnle, javed.absar, sbc100, jgravelle-google, eraman, aheejin, kbarton, JDevlieghere, asb, rbar, johnrusso, simoncook, jordy.potman.lists, apazos, sabuasal, llvm-commits

Differential Revision: https://reviews.llvm.org/D41675

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322965 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-19 17:13:12 +00:00
Craig Topper
404cc91619 [X86] Autoupgrade kunpck intrinsics using vector operations instead of scalar operations
Summary: This patch changes the kunpck intrinsic autoupgrade to use vXi1 shufflevector operations to perform vector extracts and concats. This more closely matches the definition of the kunpck instructions. Currently we rely on a DAG combine to turn the scalar shift/and/or code into a concat vectors operation. By doing it in the IR we get this for free.

Reviewers: spatel, RKSimon, zvi, jina.nahias

Reviewed By: RKSimon

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D42018

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322462 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-14 19:24:10 +00:00
Craig Topper
7ef3f8d9a1 [X86] Remove llvm.x86.avx512.cvt*2mask.* intrinsics and autoupgrade to (icmp slt X, 0)
I had to drop fast-isel-abort from a test because we can't fast isel some of the mask stuff. When we used intrinsics we implicitly fell back to SelectionDAG for the intrinsic call without triggering the abort error. But with native IR that doesn't happen the same way.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322050 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-09 00:50:47 +00:00
Michael Zolotukhin
be0db55da7 Remove redundant includes from lib/IR.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320622 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-13 21:30:52 +00:00
Craig Topper
a7566ef3ef [X86] Attempt to fix a ubsan failure in the autoupgrade of kunpck intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319911 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-06 17:54:07 +00:00
Jina Nahias
03b74e4166 [x86][AVX512] Lowering kunpack intrinsics to LLVM IR
This patch, together with a matching clang patch (https://reviews.llvm.org/D39719), implements the lowering of X86 kunpack intrinsics to IR.

Differential Revision: https://reviews.llvm.org/D39720

Change-Id: I4088d9428478f9457f6afddc90bd3d66b3daf0a1

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319778 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-05 15:42:56 +00:00
Uriel Korach
377a566dce [X86] test/testn intrinsics lowering to IR. llvm part.
Remove builtins from llvm and add AutoUpgrade support.
Also add fast-isel tests for the TEST and TESTN instructions.

Differential Revision: https://reviews.llvm.org/D38736

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318036 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-13 12:51:18 +00:00