Commit Graph

25873 Commits

Author SHA1 Message Date
Vlad Tsyrklevich
3bda4ed0ec Revert "AMDGPU: Force inlining if LDS global address is used"
This reverts commit r336587, it was causing test failures on the
sanitizer bots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@336623 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-10 00:46:07 +00:00
Heejin Ahn
b737b070e3 [WebAssembly] Support for binary atomic RMW instructions
Summary:
This adds support for binary atomic read-modify-write instructions:
add, sub, and, or, xor, and xchg.

This does not yet support translations of some of LLVM IR atomicrmw
instructions (nand, max, min, umax, and umin) that do not have a direct
counterpart in wasm instructions.

Reviewers: dschuff

Subscribers: sbc100, jgravelle-google, sunfish, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@336615 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-09 22:30:51 +00:00
Simon Pilgrim
211f0307b2 Fix line endings. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@336602 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-09 20:52:07 +00:00
Stefan Pintilie
7ee7123814 [Power9] Add __float128 builtins for Rounding Operations
Added __float128 support for a number of rounding operations:

trunc
rint
nearbyint
round
floor
ceil

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@336601 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-09 20:38:40 +00:00
Heejin Ahn
7b10083711 [WebAssembly] Improve readability of load/stores and tests. NFC.
Summary:
- Changed variable/function names to be more consistent
- Improved comments in test files
- Added more tests
- Fixed a few typos
- Misc. cosmetic changes

Reviewers: dschuff

Subscribers: sbc100, jgravelle-google, sunfish, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@336598 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-09 20:18:21 +00:00
Stefan Pintilie
8e48754afe [Power9] [LLVM] Add __float128 support for trunc to double round to odd
Add support for this builtin:
double builtin_truncf128_round_to_odd(float128)

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@336595 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-09 20:09:22 +00:00
Mark Searles
88b9c13528 RenameIndependentSubregs: Fix handling of undef tied operands
Ensure that, if updating a tied operand pair, to only update
that pair.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@336593 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-09 20:07:03 +00:00
Daniel Sanders
d700c295ab [globalisel][irtranslator] Add support for atomicrmw and (strong) cmpxchg
Summary:
This patch adds support for the atomicrmw instructions and the strong
cmpxchg instruction to the IRTranslator.

I've left out weak cmpxchg because LangRef.rst isn't entirely clear on what
difference it makes to the backend. As far as I can tell from the code, it
only matters to AtomicExpandPass which is run at the LLVM-IR level.

Reviewers: ab, t.p.northover, qcolombet, rovka, aditya_nandakumar, volkan, javed.absar

Reviewed By: qcolombet

Subscribers: kristof.beyls, javed.absar, igorb, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@336589 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-09 19:33:40 +00:00
Matt Arsenault
12d30e1e27 AMDGPU: Force inlining if LDS global address is used
These won't work for the forseeable future. These aren't allowed
from OpenCL, but IPO optimizations can make them appear.

Also directly set the attributes on functions, regardless
of the linkage rather than cloning functions like before.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@336587 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-09 19:22:22 +00:00
Roman Lebedev
9e386ad60d [X86][TLI] DAGCombine: Unfold variable bit-clearing mask to two shifts.
Summary:
This adds a reverse transform for the instcombine canonicalizations
that were added in D47980, D47981.

As discussed later, that was worse at least for the code size,
and potentially for the performance, too.

https://rise4fun.com/Alive/Zmpl

Reviewers: craig.topper, RKSimon, spatel

Reviewed By: spatel

Subscribers: reames, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@336585 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-09 19:06:42 +00:00
Stefan Pintilie
3ea14f7d95 [Power9] Add __float128 builtins for Round To Odd
GCC has builtins for these round to odd instructions:

__float128 __builtin_sqrtf128_round_to_odd (__float128)
__float128 __builtin_{add,sub,mul,div}f128_round_to_odd (__float128, __float128)
__float128 __builtin_fmaf128_round_to_odd (__float128, __float128, __float128)

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@336578 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-09 18:50:06 +00:00
Craig Topper
eb849ef795 [X86] In combineFMA, make sure we bitcast the result of isFNEG back the expected type before creating the new FMA node.
Previously, we were creating malformed SDNodes, but nothing noticed because the type constraints prevented isel from noticing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@336566 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-09 17:43:24 +00:00
Simon Pilgrim
18f7f341df [X86][AVX] Regenerate AVX1 fast-isel tests.
Let the update script merge 32/64 tests where possible

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@336565 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-09 17:38:00 +00:00
Stefan Pintilie
0b08bea28b [Power9] Add __float128 support for compare operations
Added handling for the select f128.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@336548 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-09 13:36:14 +00:00
Craig Topper
2ad74abae5 [X86] Enhance combineFMA to look for FNEG behind an EXTRACT_VECTOR_ELT.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@336514 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-08 18:04:00 +00:00
Simon Pilgrim
6656bc9f25 [X86][SSE] Combine v16i8 SHL by constants to multiplies
Pre-AVX512 (which can perform a quick extend/shift/truncate), extending to 2 v8i16 for the PMULLW and then truncating is more performant than relying on the generic PBLENDVB vXi8 shift path and uses a similar amount of mask constant pool data.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@336513 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-08 12:47:50 +00:00
Craig Topper
455fcc664f [X86] Add new scalar fma intrinsics with rounding mode that use f32/f64 types.
This allows us to handle masking in a very similar way to the default rounding version that uses llvm.fma.

I had to add new rounding mode CodeGenOnly instructions to support isel when we can't find a movss to grab the upper bits from to use the b_Int instruction.

Fast-isel tests have been updated to match new clang codegen.

We are currently having trouble folding fneg into the new intrinsic. I'm going to correct that in a follow up patch to keep the size of this one down.

A future patch will also remove the old intrinsics.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@336506 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-08 01:10:43 +00:00
Craig Topper
560d937f1d [X86] Use a rounding mode other than 4 in the scalar fma intrinsic fast-isel tests to match clang test cases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@336505 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-08 00:32:56 +00:00
Simon Pilgrim
7bae6f41ce [X86] Regenerate PR14088 test. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@336496 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-07 20:08:27 +00:00
Simon Pilgrim
7671355ab9 [DAGCombiner] Add EXTRACT_SUBVECTOR to SimplifyDemandedVectorElts
As discussed on PR37989, this patch adds EXTRACT_SUBVECTOR handling to TargetLowering::SimplifyDemandedVectorElts and calls it from DAGCombiner::visitEXTRACT_SUBVECTOR.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@336490 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-07 17:30:06 +00:00
Gabor Buella
df921c6747 NFC - Typo fixes in X86 flags-copy-lowering.mir test
Differential Revision: https://reviews.llvm.org/D48934


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@336484 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-07 16:09:15 +00:00
Yvan Roux
7d30103927 [MachineOutliner] Add missing liveness tracking info in MIR test.
This should bring the bots back to green state.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@336482 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-07 08:42:31 +00:00
Nico Weber
5b4b9a07e8 Revert 336426 (and follow-ups 428, 440), it very likely caused PR38084.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@336453 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-06 17:37:24 +00:00
Sjoerd Meijer
f36b7500f8 [ARM] ParallelDSP: added statistics, NFC.
Added statistics for the number of SMLAD instructions created, and
als renamed the pass name to -arm-parallel-dsp.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@336441 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-06 14:47:09 +00:00
Diogo N. Sampaio
ef8af9b997 Commit rL336426 cause buildbot failures
http://green.lab.llvm.org/green/job/clang-stage1-cmake-RA-incremental/50537/testReport/junit/LLVM/CodeGen_AArch64/FoldRedundantShiftedMasking_ll/

This removes the comments of the function label causing this error.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@336440 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-06 14:41:09 +00:00
Diogo N. Sampaio
eaaa4f4cfc [SelectionDAG] https://reviews.llvm.org/D48278
D48278

Allow to reduce redundant shift masks.
For example:
x1 = x & 0xAB00
x2 = (x >> 8) & 0xAB

can be reduced to:
x1 = x & 0xAB00
x2 = x1 >> 8
It only allows folding when the masks and shift values are constants.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@336426 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-06 09:42:25 +00:00
Craig Topper
a4e191b323 [X86] Remove FMA4 scalar intrinsics. Use llvm.fma intrinsic instead.
The intrinsics can be implemented with a f32/f64 llvm.fma intrinsic and an insert into a zero vector.

There are a couple regressions here due to SelectionDAG not being able to pull an fneg through an extract_vector_elt. I'm not super worried about this though as InstCombine should be able to do it before we get to SelectionDAG.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@336416 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-06 07:14:41 +00:00
Craig Topper
89a40a3e5c [X86] Remove all of the avx512 masked packed fma intrinsics. Use llvm.fma or unmasked 512-bit intrinsics with rounding mode.
This upgrades all of the intrinsics to use fneg instructions to convert fma into fmsub/fnmsub/fnmadd/fmsubadd. And uses a select instruction for masking.

This matches how clang uses the intrinsics these days.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@336409 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-06 03:42:09 +00:00
Craig Topper
e12c938bca [X86] Cleanup some of the avx512 masked fma tests to prepare for removing and autoupgrading.
-Split cases that call 2 intrinsics in the same case.
-Remove testing mask3 and maskz intrinsics with an all ones mask. These won't be interesting after the upgrade.
-Restore test cases for some intrinsics that are marked for deletion, but haven't been deleted yet.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@336408 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-06 03:42:06 +00:00
Stefan Pintilie
0b9754cd9a [Power9] Add __float128 library call for frem
Power 9 does not have a hardware instruction for frem but we can call fmodf128.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@336406 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-06 02:47:02 +00:00
Easwaran Raman
04d15315b2 [x86]Add a test case to show missed vfnmadd generation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@336404 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-06 00:31:33 +00:00
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
6e0b82fc61 [X86] Add SHUF128 to target shuffle decoding.
Differential Revision: https://reviews.llvm.org/D48954

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@336376 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-05 17:10:17 +00:00
Matt Arsenault
5ad067fad4 AMDGPU: Don't use spir_kernel in a test
Also use verify-machineinstrs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@336374 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-05 17:01:29 +00:00
Matt Arsenault
e5d3d15134 AMDGPU/GlobalISel: Implement custom kernel arg lowering
Avoid using allocateKernArg / AssignFn. We do not want any
of the type splitting properties of normal calling convention
lowering.

For now at least this exists alongside the IR argument lowering
pass. This is necessary to handle struct padding correctly while
some arguments are still skipped by the IR argument lowering
pass.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@336373 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-05 17:01:20 +00:00
Lei Huang
37aa5135e5 [Power9] Add lib calls for float128 operations with no equivalent PPC instructions
Map the following instructions to the proper float128 lib calls:
  pow[i], exp[2], log[2|10], sin, cos, fmin, fmax

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@336361 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-05 15:21:37 +00:00
Simon Pilgrim
a86a3c2c45 [X86][SSE] Add srem x, (1 << c) combine tests
Now that D45806 has landed we can start trying to avoid scalarizing srem by constant - these tests demonstrate some example cases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@336360 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-05 15:15:47 +00:00
Sanjay Patel
b06fd49497 [AArch64, PowerPC, x86] add tests for signbit bit hacks; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@336348 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-05 13:16:46 +00:00
Ryan Taylor
e941c76442 [AMDGPU] Add VALU to V_INTERP Instructions
Wait states are not properly being inserted after buffer_store for v_interp instructions.

Add VALU to V_INTERP instructions so that the GCNHazardRecognizer can
check and insert the appropriate wait states when needed.

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

Change-Id: Id540c9b074fc69b5c1de6b182276aa089c74aa64

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@336339 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-05 12:02:07 +00:00
Krasimir Georgiev
816b1d58d7 Partially revert r336268 in address-offsets.ll
Summary: There the typos are intentional, explicitly introduced to disable these cases in r280285.

Reviewers: bkramer

Reviewed By: bkramer

Subscribers: dschuff, sbc100, jgravelle-google, aheejin, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@336336 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-05 11:30:15 +00:00
Simon Pilgrim
5ad902a628 [X86][SSE] Add extra v16i16 shl x,c -> pmullw test
We want to compare shifts with repeated vs non-repeated v8i16 shuffle masks (for PBLENDW ymm) 

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@336333 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-05 09:54:53 +00:00
Aleksandar Beserminji
f9df18f4ce [mips] Fix atomic operations at O0, v3
Similar to PR/25526, fast-regalloc introduces spills at the end of basic
blocks. When this occurs in between an ll and sc, the stores can cause the
atomic sequence to fail.

This patch fixes the issue by introducing more pseudos to represent atomic
operations and moving their lowering to after the expansion of postRA
pseudos.

This version addresses issues with the initial implementation and covers
all atomic operations.

This resolves PR/32020.

Thanks to James Cowgill for reporting the issue!

Patch By: Simon Dardis

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@336328 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-05 09:27:05 +00:00
Ivan A. Kosarev
e816e74216 [NEON] Fix combining of vldx_dup intrinsics with updating of base addresses
Resolves:
Unsupported ARM Neon intrinsics in Target-specific DAG combine
function for VLDDUP
https://bugs.llvm.org/show_bug.cgi?id=38031

Related diff: D48439

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@336325 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-05 08:59:49 +00:00
Mikael Holmen
53a066525e Partial revert of "NFC - Various typo fixes in tests"
This partially reverts r336268 since it causes buildbot failures.

Added FIXME at the places where the CHECKs are misspelled.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@336323 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-05 08:42:16 +00:00
Sjoerd Meijer
802e5e3d9a [ARM] ParallelDSP: only support i16 loads for now
We were miscompiling i8 loads, so reject them as unsupported narrow operations
for now.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@336319 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-05 08:21:40 +00:00
Lei Huang
bd76e146be [Power9] Optimize codgen for conversions of int to float128
Optimize code sequences for integer conversion to fp128 when the integer is a result of:
  * float->int
  * float->long
  * double->int
  * double->long

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@336316 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-05 07:46:01 +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
Lei Huang
e5da5ca56a [Power9][NFC] add back-end tests for passing homogeneous fp128 aggregates by value
Tests to verify that we are passing fp128 via VSX registers as per ABI.
These are related to clang commit rL336308.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@336314 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-05 06:51:38 +00:00
Lei Huang
d50e092736 [Power9] Add tests for passing float128 in VSX reg for non-homogenous aggregates
Add missing testcase for rL336310

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@336313 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-05 06:29:28 +00:00
Lei Huang
1ae65deb24 [Power9]Legalize and emit code for quad-precision convert from single-precision
Legalize and emit code for quad-precision floating point operation conversion of
single-precision value to quad-precision.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@336307 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-05 04:18:37 +00:00