170074 Commits

Author SHA1 Message Date
Nekotekina
5c906fd169 MCJIT: don't finalize modules on symbol lookup (workaround)
This is extremely slow yet unnecessary with manual finalization.
In LLVM 6 this wasn't a problem.
2018-10-01 20:22:24 +03:00
Nekotekina
6232dfcc54 X86: improve SUBUS pattern (select-based)
Add AVX512BW variant
Add 32-bit variant replaced with sub + umin
2018-10-01 20:22:24 +03:00
Nekotekina
e7dc36d9ee X86: detect pattern for variable SHL/SRL shifts (AVX2+)
Remove VSELECT instruction which zeroes their result on exceeding shift amount
2018-10-01 20:20:51 +03:00
Nekotekina
b1ca8e4ce7 X86: add pattern for X86ISD::ADDUS
combineSelect: detect unsigned overflow check
2018-10-01 20:20:50 +03:00
Nekotekina
ee1e4886e8 X86: add pattern for X86ISD::VSRAV
Detect clamping ashr shift amount to max legal value
2018-10-01 20:20:50 +03:00
Nekotekina
c6b0287374 X86: expand detectAVGPattern()
Allow all integer widths in the pattern, allow ashr
Handle signed and mixed cases, allowing to replace truncation
2018-10-01 20:20:50 +03:00
Nekotekina
22d495b7cd X86: optimize VSELECT for v16i8 with shl + sign bit test 2018-10-01 20:19:05 +03:00
Nekotekina
7d2a857d67 X86: combine inversion of VPTERNLOG 2018-10-01 20:15:04 +03:00
Nekotekina
8beeeda073 X86: LowerShift: new algorithm for vector-vector shifts
Emit pair of shifts of double size if possible
2018-10-01 20:11:57 +03:00
Nekotekina
2cf62e6c19 X86: Fix/workaround Small Code Model for JIT
Force RIP-relative jump tables and global values
Force RIP-relative all zeros / all ones constants
These things were causing crashes due to use of absolute addressing
2018-10-01 20:11:56 +03:00
Nekotekina
9e81da41fd Appveyor + Travis 2018-10-01 20:11:56 +03:00
Simon Pilgrim
c442198d91 [X86][Btver2] Fix BT(C|R|S)mr & BT(C|R|S)mi schedule latency + uop counts
Match AMD Fam16h SOG + llvm-exegesis tests

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@343494 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-01 16:31:30 +00:00
Matthias Braun
c2625345a6 DAGCombiner: StoreMerging: Fix bad index calculating when adjusting mismatching vector types
This fixes a case of bad index calculation when merging mismatching
vector types. This changes the existing code to just use the existing
extract_{subvector|element} and a bitcast (instead of bitcast first and
then newly created extract_xxx) so we don't need to adjust any indices
in the first place.

rdar://44584718

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@343493 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-01 16:25:50 +00:00
Sanjay Patel
f8aaa5b2fb [x86] add tests for 256- and 512-bit vector types for scalar-to-vector transform; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@343491 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-01 16:17:18 +00:00
Simon Pilgrim
3865b5ff69 [X86] Create schedule classes for BT(C|R|S)mi and BT(C|R|S)mr instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@343490 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-01 16:12:44 +00:00
Evandro Menezes
a86f87cfc7 [AArch64] Refactor cheap cost model
Refactor the order in `TII::isAsCheapAsAMove()` to ease future development
and maintenance.  Practically NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@343489 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-01 16:11:19 +00:00
Simon Pilgrim
9a604d610c [X86] Remove unnecessary BTmi/BTmr scheduler overrides
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@343487 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-01 15:01:00 +00:00
Jesper Antonsson
6b99c7f259 [InstCombine] Handle vector compares in foldGEPIcmp(), take 2
Summary:
This is a continuation of the fix for PR34627 "InstCombine assertion at vector gep/icmp folding". (I just realized bugpoint had fuzzed the original test for me, so I had fixed another trigger of the same assert in adjacent code in InstCombine.)

This patch avoids optimizing an icmp (to look only at the base pointers) when the resulting icmp would have a different type.

The patch adds a testcase and also cleans up and shrinks the pre-existing test for the adjacent assert trigger.

Reviewers: lebedev.ri, majnemer, spatel

Reviewed By: lebedev.ri

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@343486 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-01 14:59:25 +00:00
Simon Atanasyan
b4f7a97945 [mips] Generate tests expectations using update_llc_test_checks. NFC
Generate tests expectations using update_llc_test_checks and reduce
number of "check prefixes" used in the tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@343485 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-01 14:43:07 +00:00
Simon Pilgrim
a1b6ce1b11 [X86][Btver2] Fix BTmr schedule uop counts
Match AMD Fam16h SOG + llvm-exegesis tests

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@343484 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-01 14:42:16 +00:00
Sanjay Patel
f7cc35b1ce [InstCombine] try to convert vector insert+extract to trunc; 2nd try
This was originally committed at rL343407, but reverted at 
rL343458 because it crashed trying to handle a case where
the destination type is FP. This version of the patch adds
a check for that possibility. Tests added at rL343480.

Original commit message:

This transform is requested for the backend in:
https://bugs.llvm.org/show_bug.cgi?id=39016
...but I figured it was worth doing in IR too, and it's probably
easier to implement here, so that's this patch.

In the simplest case, we are just truncating a scalar value. If the
extract index doesn't correspond to the LSBs of the scalar, then we
have to shift-right before the truncate. Endian-ness makes this tricky,
but hopefully the ASCII-art helps visualize the transform.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@343482 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-01 14:40:00 +00:00
Sanjay Patel
0b13e12729 [InstCombine] add more insert-extract tests for D52439; NFC
The first attempt at this transform:
rL343407
...was reverted:
rL343458
...because it did not handle the case where we bitcast to FP. 
The patch was already limited to avoid the case where we
bitcast from FP, but we might want to transform that too.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@343480 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-01 14:29:09 +00:00
Simon Pilgrim
3e27a44e64 [X86] Create schedule classes for BTmi and BTmr instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@343478 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-01 14:23:37 +00:00
Haojian Wu
71670be4ac Move llvm util dependencies from clang-tools-extra to add_lit_target.
Summary:
Address fixme in r301762. And would simplify the cmake file in
clang-tools-extra.

Reviewers: sammccall

Subscribers: mgorny, llvm-commits, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@343473 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-01 14:00:51 +00:00
Robert Widmann
eab58e03b0 [LLVM-C] Add an accessor for the kind of a Metadata Node
Summary: Allows for retrieving the type of a metadata node.  Has the added benefit of ensuring that the C and C++ kind APIs stay in sync as a failure to add a corresponding LLVMMetadataKind will result in the switch in the accessor being semantically malformed.

Reviewers: whitequark, deadalnix

Reviewed By: whitequark

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@343469 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-01 13:15:09 +00:00
Simon Pilgrim
1607bc84f2 [X86][Btver2] Fix masked load schedule
JFPU01 resource usage should match JFPX

Match AMD Fam16h SOG + llvm-exegesis tests

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@343468 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-01 13:12:05 +00:00
Guillaume Chatelet
ed2d3e4fff [llvm-exegesis][NFC] Move random functions from CodeTemplate to SnippetGenerator.
Summary: Just moving methods around.

Reviewers: courbet

Subscribers: tschuett, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@343461 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-01 12:19:10 +00:00
Sam McCall
a46ae18100 [Support] Listing a directory containing dangling symlinks is not an error.
Summary:
Reporting this as an error required stat()ing every file, as well as seeming
semantically questionable.

Reviewers: vsk, bkramer

Subscribers: mgrang, kristina, llvm-commits, liaoyuke

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@343460 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-01 12:17:05 +00:00
Hans Wennborg
f7f9563cf4 Revert r343407 "[InstCombine] try to convert vector insert+extract to trunc"
This caused Chromium builds to fail with "Illegal Trunc" assertion.
See https://crbug.com/890723 for repro.

> This transform is requested for the backend in:
> https://bugs.llvm.org/show_bug.cgi?id=39016
> ...but I figured it was worth doing in IR too, and it's probably
> easier to implement here, so that's this patch.
>
> In the simplest case, we are just truncating a scalar value. If the
> extract index doesn't correspond to the LSBs of the scalar, then we
> have to shift-right before the truncate. Endian-ness makes this tricky,
> but hopefully the ASCII-art helps visualize the transform.
>
> Differential Revision: https://reviews.llvm.org/D52439

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@343458 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-01 12:07:45 +00:00
Guillaume Chatelet
0640a7318b [llvm-exegesis][NFC] Make randomizeUnsetVariables a free function.
Summary: This is prelimineary to moving random functions to SnippetGenerator.

Reviewers: courbet

Subscribers: tschuett, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@343456 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-01 11:46:06 +00:00
Alexander Timofeev
00e50653ed [AMDGPU] Divergence driven instruction selection. Shift operations.
Summary: This change enables VOP3 shifts to be explicitly selected
         dependent on the divergence.

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

Reviewers: rampitec

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@343455 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-01 11:06:35 +00:00
Puyan Lotfi
2d661fe936 [NFC] Adding "REQUIRES: zlib" to a llvm-objcopy test for bots without zlib.
M    test/tools/llvm-objcopy/compress-and-decompress-debug-sections-error.test


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@343454 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-01 10:50:23 +00:00
Andrea Di Biagio
f7f974d7ef [X86][BtVer2] Teach how to identify zero-idiom VPERM2F128rr instructions.
This patch adds another variant class to identify zero-idiom VPERM2F128rr
instructions.

On Jaguar, a VPERM wih bit 3 and 7 of the mask set, is a zero-idiom.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@343452 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-01 10:35:13 +00:00
Puyan Lotfi
cc27a05389 [llvm-objcopy] Adding support for decompressing zlib compressed dwarf sections.
Summary: I had added support for compressing dwarf sections in a prior commit,
         this one adds support for decompressing. Usage is:

         llvm-objcopy --decompress-debug-sections input.o output.o

Reviewers: jakehehrlich, jhenderson, alexshap	

Reviewed By: jhenderson

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@343451 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-01 10:29:41 +00:00
Florian Hahn
9cfef4ca8f Recommit r343308: [LoopInterchange] Turn into a loop pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@343450 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-01 09:59:48 +00:00
Clement Courbet
d80543967d [X86][Sched] Update scheduling information for VZEROALL on HWS, BDW, SKX, SNB.
Summary:
    While looking at PR35606, I found out that the scheduling info is incorrect.

    One can check that it's really a P5+P6 and not a 2*P56 with:
    echo -e 'vzeroall\nvandps %xmm1, %xmm2, %xmm3' | ./bin/llvm-exegesis -mode=uops -snippets-file=-
    (vandps executes on P5 only)

    Reviewers: craig.topper, RKSimon

    Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@343447 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-01 08:37:48 +00:00
Clement Courbet
90a5fbf4c6 [X86][Sched] Add pfm uop counter definitions for SNB,BDW,SKX.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@343446 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-01 08:37:37 +00:00
Carlos Alberto Enciso
42b5443507 [DebugInfo][Dexter] Incorrect DBG_VALUE after MCP dead copy instruction removal.
When MachineCopyPropagation eliminates a dead 'copy', its associated debug information becomes invalid. as the recorded register has been removed.  It causes the debugger to display wrong variable value.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@343445 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-01 08:14:44 +00:00
Clement Courbet
e7e54cd186 [CodeGen][NFC] Add tests for heterogeneous types in MergeConsecutiveStores
Reviewers: efriedma

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@343444 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-01 07:16:22 +00:00
Craig Topper
62c612fdec [X86] Stop X86DomainReassignment from creating copies between GR8/GR16 physical registers and k-registers.
We can only copy between a k-register and a GR32/GR64 register.

This patch detects that the copy will be illegal and prevents the domain reassignment from happening for that closure.

This probably isn't the best fix, and we should probably figure out how to handle this correctly.

Fixes PR38803.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@343443 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-01 07:08:41 +00:00
Lang Hames
eaf1a19dc4 [ORC] Pass Symbols to ExecutionSession::lookup by value, potentially saving a
copy.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@343442 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-01 04:59:10 +00:00
Lang Hames
2887f2e594 [ORC] Add convenience methods for creating DynamicLibraryFallbackGenerators for
libraries on disk, and for the current process.

Avoids more boilerplate during JIT construction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@343430 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-01 00:59:28 +00:00
Lang Hames
4e8d0ef849 [ORC] Add a method to JITTargetMachineBuilder to get the default data layout
for the target machine.

This simplifies usage during setup of concurrent JIT stacks where the client
needs a DataLayout, but not a TargetMachine (TargetMachines are created on
the fly by the compile threads later).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@343429 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-01 00:59:26 +00:00
Craig Topper
6b41faf1c9 [X86] Change an llvm_unreachable to a report_fatal_error so the optimizer will stop making us reach the other report_fatal_error in this function.
There's a conditional report_fatal_error just above this llvm_unreachable. The optimizer when seeing the unreachable removes the conditional and just makes any other error trigger the existing report_fatal_error.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@343428 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-30 23:43:30 +00:00
Lang Hames
0e735f0b53 [ORC] Add an 'intern' method to ExecutionEngine for interning symbol names.
This cuts down on boilerplate by reducing 'ES.getSymbolStringPool().intern(...)'
to 'ES.intern(...)'.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@343427 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-30 23:18:24 +00:00
Fangrui Song
c466264b34 Use the container form llvm::sort(C, ...)
There are a few leftovers in rL343163 which span two lines. This commit
changes these llvm::sort(C.begin(), C.end, ...) to llvm::sort(C, ...)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@343426 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-30 22:31:29 +00:00
Simon Pilgrim
abccef1dfd [X86] Fix scheduler class for BTmi instructions
This wasn't treated as a folded load instruction

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@343424 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-30 20:19:16 +00:00
Lang Hames
04756ee526 [ORC] Extract and tidy up JITTargetMachineBuilder, add unit test.
(1) Adds comments for the API.

(2) Removes the setArch method: This is redundant: the setArchStr method on the
    triple should be used instead.

(3) Turns EmulatedTLS on by default. This matches EngineBuilder's behavior.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@343423 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-30 19:12:23 +00:00
Simon Pilgrim
62431ad72c [LLVM-MCA][X86] Add missing VCMPESTR/VCMPESTR tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@343421 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-30 18:19:00 +00:00
Craig Topper
c4936565e3 [X86] Copy memrefs when folding a load for division instruction selection.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@343419 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-30 17:47:18 +00:00