Commit Graph

157293 Commits

Author SHA1 Message Date
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
Rafael Espindola
7c8f4b01f6 Allow TempFile::discard to be called twice.
We already allowed keep+discard. It is important to be able to discard
a temporary if a rename fail. It is also convenient as it allows the
use of RAII for discarding.

Allow discarding twice for similar reasons.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318867 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-22 19:59:05 +00:00
Paul Robinson
1f7a128eba Remove unnecessary include.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318861 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-22 18:39:26 +00:00
Peter Collingbourne
d159fdd448 CachePruning: Allow limiting the number of files in the cache directory.
The default limit is 1000000 but it can be configured with a cache
policy. The motivation is that some filesystems (notably ext4) have
a limit on the number of files that can be contained in a directory
(separate from the inode limit).

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318857 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-22 18:27:31 +00:00
Paul Robinson
6d6a4920f5 [DwarfDump] -debug-line=offset applies to .dwo too.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318856 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-22 18:23:55 +00:00
Craig Topper
22c5379cd1 [X86] Spell penryn correctly in some comments. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318855 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-22 18:23:40 +00:00
Yaxun Liu
ac77244cc8 [AMDGPU] Fix SITargetLowering::LowerCall for pointer info of byval argument
SITargetLowering::LowerCall uses dummy pointer info for byval argument, which causes
flat load instead of buffer load.

This patch fixes that.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318844 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-22 16:13:35 +00:00
Paul Robinson
e8850416f6 [DebugInfo] Dump a .debug_line section, including line-number program,
without any compile units.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318842 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-22 15:48:30 +00:00
Dmitry Preobrazhensky
6d338d1025 [AMDGPU][mc][tests] Updated generated lit tests for GFX8/9
Summary:
Added tests to better cover features introduced by commit rL318675.
See http://llvm.org/viewvc/llvm-project?view=revision&revision=318675

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318841 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-22 15:47:27 +00:00
Paul Robinson
229c3418bc [DWARFv5] Support DW_FORM_strp in the .debug_line.dwo header.
As a side effect, the .debug_line section will be dumped in physical
order, rather than in the order that compile units refer to their
associated portions of the .debug_line section.  These are probably
always the same order anyway, and no tests noticed the difference.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318839 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-22 15:33:17 +00:00
Paul Robinson
a513cc4aa1 [DWARF] Fix handling of extended line-number opcodes
Differential Revision: https://reviews.llvm.org/D40200

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318838 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-22 15:14:49 +00:00
Nicolai Haehnle
72bc6f1e39 AMDGPU: Consider memory dependencies with moved instructions in SILoadStoreOptimizer
Summary:
This bug seems to have gone unnoticed because critical cases with LDS
instructions are eliminated by the peephole optimizer.

However, equivalent situations arise with buffer loads and stores
as well, so this fixes regressions since r317751 ("AMDGPU: Merge
S_BUFFER_LOAD_DWORD_IMM into x2, x4").

Fixes at least:
KHR-GL45.shader_storage_buffer_object.basic-operations-case1-cs
KHR-GL45.cull_distance.functional
piglit tes-input-gl_ClipDistance.shader_test
... and probably more

Change-Id: I0e371536288eb8e6afeaa241a185266fd45d129d

Reviewers: arsenm, mareko, rampitec

Subscribers: kzhuravl, wdng, yaxunl, dstuttard, tpr, t-tye, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318829 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-22 12:25:21 +00:00
Jonas Paulsson
249b36857b [DAGCombiner] Bugfix in isAlias().
Since i1 is a legal type, this:

  NumBytes = Op1->getMemoryVT().getSizeInBits() >> 3;

is wrong and should be instead

  NumBytes = Op0->getMemoryVT().getStoreSize();

There seems to be more places where this should be fixed outside DAGCombiner.

Review: Hal Finkel
https://bugs.llvm.org/show_bug.cgi?id=35366

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318824 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-22 08:58:30 +00:00
Craig Topper
5698a7a1d6 [X86] Add an X86ISD::MSCATTER node for consistency with the X86ISD::MGATHER.
This makes the fact that X86 needs an explicit mask output not part of the type constraint for the ISD::MSCATTER.

This also gives the X86ISD::MGATHER/MSCATTER nodes a common base class simplifying the address selection code in X86ISelDAGToDAG.cpp

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318823 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-22 08:10:54 +00:00
George Rimar
808577ca74 [llvm-tblgen] - Stop using std::string in RecordKeeper.
RecordKeeper::getDef() is a hot place, it shows up in profiling
and it creates std::string instance for each search in RecordMap
though RecordKeeper::RecordMap can use StringRef as a key
instead to avoid that. Patch do that change.

Differential revision: https://reviews.llvm.org/D40170

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318822 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-22 07:53:48 +00:00
Craig Topper
fa5b169130 [X86] Lower all ISD::MGATHER nodes to X86ISD:MGATHER.
Now we consistently represent the mask result without relying on isel ignoring it.

We now have a more general SDNode and type constraints to represent these nodes in isel patterns. This allows us to present both both vXi1 and XMM/YMM mask types with a single set of constraints.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318821 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-22 07:11:03 +00:00
Craig Topper
4b9371c251 [SelectionDAG] Add a isel matcher op to check the type of node results other than result 0.
I plan to use this to check the type of the mask result of masked gathers in the X86 backend.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318820 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-22 07:11:01 +00:00
Max Kazantsev
f66b47b328 [SCEV] Strengthen variance condition in calculateLoopDisposition
Given loops `L1` and `L2` with AddRecs `AR1` and `AR2` varying in them respectively.
When identifying loop disposition of `AR2` w.r.t. `L1`, we only say that it is varying if
`L1` contains `L2`. But there is also a possible situation where `L1` and `L2` are
consecutive sibling loops within the parent loop. In this case, `AR2` is also varying
w.r.t. `L1`, but we don't correctly identify it.

It can lead, for exaple, to attempt of incorrect folding. Consider:
  AR1 = {a,+,b}<L1>
  AR2 = {c,+,d}<L2>
  EXAR2 = sext(AR1)
  MUL = mul AR1, EXAR2
If we incorrectly assume that `EXAR2` is invariant w.r.t. `L1`, we can end up trying to
construct something like: `{a * {c,+,d}<L2>,+,b * {c,+,d}<L2>}<L1>`, which is incorrect
because `AR2` is not available on entrance of `L1`.

Both situations "`L1` contains `L2`" and "`L1` preceeds sibling loop `L2`" can be handled
with one check: "header of `L1` dominates header of `L2`". This patch replaces the old
insufficient check with this one.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318819 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-22 06:21:39 +00:00
Davide Italiano
882fbe3d4c [SCCP] Pick the right lattice value for constants.
After the dataflow algorithm proves that an argument is constant,
it replaces it value with the integer constant and drops the lattice
value associated to the DEF.

e.g. in the example we have @f() that's called twice:
call @f(undef, ...)
call @f(2, ...)

`undef` MEET 2 = 2 so we replace the argument and all its uses with
the constant 2.

Shortly after, tryToReplaceWithConstantRange() tries to get the lattice
value for the argument we just replaced, causing an assertion.
This function is a little peculiar as it runs when we're doing replacement
and not as part of the solver but still queries the solver.

The fix is that of checking whether we replaced the value already and
get a temporary lattice value for the constant.

Thanks to Zhendong Su for the report!

Fixes PR35357.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318817 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-22 03:04:55 +00:00
Craig Topper
bb324a11f8 [X86] Move the information about the feature bits used by compiler-rt and shared by Host.cpp to a .def file and TargetParser.h so clang can make use of it.
Since we keep Host.cpp and compiler-rt relatively in sync, clang can use this information as a proxy.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318814 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-21 23:36:42 +00:00