Commit Graph

157212 Commits

Author SHA1 Message Date
Craig Topper
736b29235d [X86] Add some early DAG combines to turn v4i32 AND/OR/XOR into FAND/FOR/FXOR whe only SSE1 is available.
v4i32 isn't a legal type with sse1 only and would end up getting scalarized otherwise.

This isn't completely ideal as it doesn't handle cases like v8i32 that would get split to v4i32. But it at least helps with code written using the clang intrinsic header.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318967 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-25 07:20:21 +00:00
Craig Topper
cdd7d2254c Recommit r318963 "[APInt] Don't print debug messages from the APInt knuth division algorithm by default"
The previous commit had the condition in the do/while backwards.

Debug builds currently print out low level details of the Knuth division algorithm when -debug is used. This information isn't useful in most cases and just adds noise to the log.

This adds a new preprocessor flag to enable the prints in the knuth division code in APInt.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318966 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-24 20:29:04 +00:00
Craig Topper
ea90eceb33 [X86] Prevent using X * rsqrt(X) to approximate sqrt when only sse1 is enabled.
This optimization can occur after type legalization and emit a vselect with v4i32 type. But that type is not legal with sse1. This ultimately gets scalarized by the second type legalization that runs after vector op legalization, but that's really intended to handle the scalar types that might be introduced by legalizing vector ops.

For now just stop this from happening by disabling the optimization with sse1.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318965 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-24 19:57:48 +00:00
Craig Topper
0db852030c Revert 318963 "[APInt] Don't print debug messages from the APInt knuth division algorithm by default"
I seem to have botched the logic when switching to push_macro

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318964 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-24 19:32:34 +00:00
Craig Topper
5ef2d3ef7a [APInt] Don't print debug messages from the APInt knuth division algorithm by default
Debug builds currently print out low level details of the Knuth division algorithm when -debug is used. This information isn't useful in most cases and just adds noise to the log.

This adds a new preprocessor flag to enable the prints in the knuth division code in APInt.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318963 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-24 19:13:24 +00:00
Simon Dardis
be38a81dba [CodeGenPrepare] Check that erased sunken address are not reused
CodeGenPrepare sinks address computations from one basic block to another
and attempts to reuse address computations that have already been sunk. If
the same address computation appears twice with the first instance as an
operand of a load whose result is an operand to a simplifable select,
CodeGenPrepare simplifies the select and recursively erases the now dead
instructions. CodeGenPrepare then attempts to use the erased address
computation for the second load.

Fix this by erasing the cached address value if it has zero uses before
looking for the address value in the sunken address map.

This partially resolves PR35209.

Thanks to Alexander Richardson for reporting the issue!

This fixed version relands r318032 which was reverted in r318049 due to
sanitizer buildbot failures.

Reviewers: john.brawn

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318956 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-24 16:45:28 +00:00
Dmitry Preobrazhensky
1ddc19331f [AMDGPU][MC][GFX9] Added v_interp_p2_f16 and v_interp_p2_legacy_f16
See bug 33629: https://bugs.llvm.org//show_bug.cgi?id=33629

Reviewers: artem.tamazov, SamWot, arsenm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318955 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-24 15:37:14 +00:00
Dylan McKay
00a3d282d0 [AVR] Use the short form of 'clr <reg>'
r318895 made it so that the simpler instruction aliases are printed
rather than their expanded form.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318954 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-24 15:36:43 +00:00
Benjamin Kramer
9a31efbf5b Make helpers static. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318953 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-24 14:55:41 +00:00
Javed Absar
d951789cbf [SCEV] : Simplify loop to range-loop.NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318952 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-24 14:35:38 +00:00
John Brawn
f3ef7d8186 [CGP] Make optimizeMemoryInst able to combine more kinds of ExtAddrMode fields
This patch extends the recent work in optimizeMemoryInst to make it able to
combine more ExtAddrMode fields than just the BaseReg.

This fixes some benchmark regressions introduced by r309397, where GVN PRE is
hoisting a getelementptr such that it can no longer be combined into the
addressing mode of the load or store that uses it.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318949 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-24 14:10:45 +00:00
Aleksandar Beserminji
ba397bccd4 [mips] Set microMIPS ASE flag
This patch fixes an issue where microMIPS ASE flag is not set
when a function has micromips attribute or when .set micromips
directive is used.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318948 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-24 14:00:47 +00:00
Dmitry Preobrazhensky
89e87a7083 [AMDGPU][MC][GFX9] Added support of 'inst_offset' modifier for compatibility with SP3
See bug 35329: https://bugs.llvm.org//show_bug.cgi?id=35329

Reviewers: arsenm, vpykhtin, artem.tamazov

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318947 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-24 13:22:38 +00:00
Benjamin Kramer
699de77752 [YAMLParser] Fix unused variable warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318936 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-23 21:07:11 +00:00
Benjamin Kramer
01eb33b4cb [YAMLParser] Don't crash on null keys in KeyValueNodes.
Found by clangd-fuzzer!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318935 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-23 20:57:20 +00:00
Craig Topper
6dce9fbec1 [X86] Don't invert NewCC variable while processing the jcc/setcc/cmovcc instructions in optimizeCompareInstr.
The NewCC variable is calculated outside of the loop that processes jcc/setcc/cmovcc instructions. If we invert it during the loop it can cause an incorrect value to be used by a later iteration. Instead only read it during the loop and use a new variable to store the possibly inverted value.

Fixes PR35399.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318934 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-23 19:25:45 +00:00
Craig Topper
75d9c5dc23 [X86] Teach isel that X86ISD::CMPM_RND zeros the upper bits of the mask register.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318933 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-23 18:41:21 +00:00
Craig Topper
477fbd747a [X86] Remove some unneeded opcodes from getVectorMaskingNode. NFC
We never reach here with these opcodes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318932 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-23 18:41:20 +00:00
Craig Topper
7e1c537b96 [X86] Add X86ISD::CMPM_RND to getVectorMaskingNode to select ISD::AND instead of ISD::VSELECT
A later DAG combine will turn the VSELECT into an AND, but we have the other mask compare opcodes here so add this one too.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318931 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-23 18:41:19 +00:00
Craig Topper
6ab51e7c5a [X86] Remove some dead code leftover from when i1 was a legal type. NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318930 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-23 18:41:18 +00:00
Craig Topper
ef7f0073c5 [X86] Remove some dead code. NFC
AVX512 code never reaches here so we don't need to handle X86ISD::CMPM as an opcode.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318929 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-23 18:41:17 +00:00
Alexander Potapenko
7f86494ddd MSan: remove an unnecessary cast. NFC for userspace instrumenetation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318923 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-23 15:06:51 +00:00
Simon Pilgrim
b8e96eb12a [X86][SSE] Use (V)PHMINPOSUW for vXi16 SMAX/SMIN/UMAX/UMIN horizontal reductions (PR32841)
(V)PHMINPOSUW determines the UMIN element in an v8i16 input, with suitable bit flipping it can also be used for SMAX/SMIN/UMAX cases as well.

This patch matches vXi16 SMAX/SMIN/UMAX/UMIN horizontal reductions and reduces the input down to a v8i16 vector before calling (V)PHMINPOSUW.

A later patch will use this for v16i8 reductions as well (PR32841).

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318917 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-23 13:50:27 +00:00
Diana Picus
ffb04cb177 [ARM GlobalISel] Support G_FDIV for s32 and s64
TableGen already generates code for selecting a G_FDIV, so we only need
to add a test.

For the legalizer and reg bank select, we do the same thing as for the
other floating point binary operations: either mark as legal if we have
a FP unit or lower to a libcall, and map to the floating point
registers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318915 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-23 13:26:07 +00:00
Ying Yi
a16d2613ab Reverted rL318911 since it broke the sanitizer-windows.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318914 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-23 13:23:21 +00:00
Ying Yi
da18ebeb4e [lit] Implement non-pipelined ‘mkdir’, ‘diff’ and ‘rm’ commands internally
Summary:
The internal shell already supports 'cd', ‘export’ and ‘echo’ commands. 
This patch adds implementation of non-pipelined ‘mkdir’, ‘diff’ and ‘rm’ 
commands as the internal shell builtins.

Reviewers: Zachary Turner, Reid Kleckner

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318911 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-23 12:48:41 +00:00
Diana Picus
30e25c33bc [ARM GlobalISel] Support G_FMUL for s32 and s64
TableGen already generates code for selecting a G_FMUL, so we only need
to add a test for that part.

For the legalizer and reg bank select, we do the same thing as the other
floating point binary operators: either mark as legal if we have a FP
unit or lower to a libcall, and map to the floating point registers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318910 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-23 12:44:20 +00:00
Simon Dardis
a1660efdc4 [mips] Use the delay slot filler to convert branches for microMIPSR6.
The MIPS delay slot filler converts delay slot branches into compact
forms for the MIPS ISAs which support them. For branches that compare
(in)equality with with zero, it converts them into branches with implict
zero register operands. These branches have a slightly greater range
than normal two register operands branches.

Changing the branches at this point in the pipeline offers the long
branch pass the ability to mark better judgements if a long branch
sequence is required.

Reviewers: atanasyan

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318908 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-23 12:38:04 +00:00
Coby Tayree
c428967869 [x86][icelake]BITALG
2/3
vpshufbitqmb encoding
3/3
vpshufbitqmb intrinsics
Differential Revision: https://reviews.llvm.org/D40222



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318904 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-23 11:15:50 +00:00
Alexander Potapenko
a99f2a1277 [MSan] Move the access address check before the shadow access for that address
MSan used to insert the shadow check of the store pointer operand
_after_ the shadow of the value operand has been written.
This happens to work in the userspace, as the whole shadow range is
always mapped. However in the kernel the shadow page may not exist, so
the bug may cause a crash.

This patch moves the address check in front of the shadow access.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318901 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-23 08:34:32 +00:00
George Rimar
9052cc8ec7 Revert r318822 "[llvm-tblgen] - Stop using std::string in RecordKeeper."
It reported to have problems with memory sanitizers and DBUILD_SHARED_LIBS=ON.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318899 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-23 06:52:44 +00:00
Max Kazantsev
41474c8b1a [IRCE][NFC] Add no wrap flags to no-wrapping SCEV calculation
In a lambda where we expect to have result within bounds, add respective `nsw/nuw` flags to
help SCEV just in case if it fails to figure them out on its own.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318898 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-23 06:14:39 +00:00
Leslie Zhai
6d2231861c Add backend name to AVR Target to enable runtime info to be fed back into TableGen
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318895 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-23 04:11:11 +00:00
Craig Topper
9fd11b97ef [X86] Turn an if condition that should always be true into an assert. NFCI
If Values.size() == 0, we should have returned 0 or undef earlier. If it was 1, it's a splat and we already handled that too.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318894 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-23 03:24:01 +00:00
Craig Topper
7d9a6279ee [X86] Remove unnecessary check for is128BitVector. NFC
256 and 512 bit vectors were picked off earlier in the function. Lots of code between there and here already assumed 128-bit vectors.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318893 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-23 03:24:00 +00:00
Craig Topper
63c16e825e [X86] Simplify some bitmasking and use llvm_unreachable to mark an impossible case. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318892 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-23 03:23:59 +00:00
Craig Topper
ddbb4a350e [X86] Remove a ternary operator that can only ever be false. NFC
We are checking for AVX512 in an SSE1 only block.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318891 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-23 03:23:58 +00:00
Yaxun Liu
5a85a28dde [NFC] CodeGen: Handle shift amount type in DAGTypeLegalizer::SplitInteger
This patch reverts change to X86TargetLowering::getScalarShiftAmountTy in
rL318727 and move the logic to DAGTypeLegalizer::SplitInteger.

The reason is that getScalarShiftAmountTy returns a shift amount type that
is suitable for common use cases in CodeGen. DAGTypeLegalizer::SplitInteger
is a rare situation which requires a shift amount type larger than what
getScalarShiftAmountTy. In this case, it is more reasonable to do special
handling of shift amount type in DAGTypeLegalizer::SplitInteger only. If
similar situations arises the logic may be moved to a separate function.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318890 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-23 03:08:51 +00:00
David Blaikie
7b0e38dff8 Instrumentation.h: Remove dead/untested code for DFSan JIT support
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318887 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-23 00:08:40 +00:00
Craig Topper
54ab0bed54 [X86] Regenerate the vector-popcnt and vector-tzcnt tests to get BITALG CHECK linse on all functions not just the vXi16/vXi8.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318885 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-22 23:35:12 +00:00
Evandro Menezes
0a5e462901 [AArch64] Adjust the cost model for Exynos M1 and M2
Fix the modeling of some loads and stores.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318884 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-22 22:48:50 +00:00
Fedor Sergeev
a51f09141c IR printing improvement for loop passes
Summary:
Loop-pass printing is somewhat deficient since it does not provide the
context around the loop (e.g. preheader). This context information becomes
pretty essential when analyzing transformations that move stuff out of the loop.

Extending printLoop to cover preheader and exit blocks (if any).

Reviewers: sanjoy, silvas, weimingz

Reviewed By: sanjoy

Subscribers: apilipenko, skatkov, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318878 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-22 20:59:53 +00:00
Krzysztof Parzyszek
67b504e6c0 [Hexagon] Implement buildVector32 and buildVector64 as utility functions
Change LowerBUILD_VECTOR to use those functions. This commit will tempora-
rily affect constant vector generation (it will generate constant-extended
values instead of non-extended combines), but the code for the general case
should be better. The constant selection part will be fixed later.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318877 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-22 20:56:23 +00:00
Krzysztof Parzyszek
8a2f52cd96 [Hexagon] Add patterns to select A2_combine_ll and its variants
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318876 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-22 20:55:41 +00:00
Krzysztof Parzyszek
d21081d28a [Hexagon] Remove trailing spaces, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318875 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-22 20:43:00 +00:00
Paul Robinson
def4c6a791 Add a missing include found by modules bot.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318873 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-22 20:31:39 +00:00
Craig Topper
db39a5d922 [X86] Support v32i16/v64i8 CTLZ using lookup table.
Had to tweak the setcc's used by the code to use a vXi1 result type with a sign extend back to vector size.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318871 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-22 20:05:57 +00:00
Craig Topper
d93d311a7d [X86] Move the BITALG setOperationAction code into the hasBWI section to match what is done for VPOPCNTDQ in the AVX512F block. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318870 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-22 20:05:54 +00:00
Craig Topper
690ef98823 [X86] Sink the MGATHER setOperationActions for AVX2 into the AVX block where most of the rest of the AVX2 legalization lives.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318869 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-22 20:05:51 +00:00
Rafael Espindola
c4b304ca7c Remove unnecessary code.
There is already an RAII in place to discard the temporary.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318868 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-22 20:02:57 +00:00