157747 Commits

Author SHA1 Message Date
Gadi Haber
1d4832bccf [X86][FMA][FMA4]: Adding full coverage of MC encoding for the FMA, FMA4 isa sets.<NFC>
NFC.
 Adding MC regressions tests to cover the FMA and FMA4 ISA sets.
 This patch is part of a larger task to cover MC encoding of all X86 ISA Sets starting revision https://reviews.llvm.org/D39952

Reviewers: craig.topper, RKSimon, zvi
Differential Revision: https://reviews.llvm.org/D40880

Change-Id: Ie39c0edce69ad647076b3d4e816948b2b6e1a9e4

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320016 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-07 09:16:34 +00:00
Gadi Haber
fc3c0801ad [X86][X87]: Adding full coverage of MC encoding for all X87 ISA Sets.<NFC>
NFC.
 Currently, not all the X86 ISA Sets are covered by the MC regressions tests for X86.
 A full coverage needs to be added for each ISA set and for both 32bit and 64bit instructions + registers.
 This patch includes MC assembly tests for the X87 32bit and 64bit.

Reviewers: craigt, RKSimon, zvi
Differential Revision: https://reviews.llvm.org/D39952

Change-Id: I55e1719c09a70644a6a4073c720cb5341c80fee9

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320015 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-07 09:00:19 +00:00
Igor Laevsky
ab26b59c06 [InstSimplify] Add tests for the rL319894
Differential Revision: https://reviews.llvm.org/D40650



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320014 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-07 08:52:24 +00:00
Craig Topper
ff096475db [SelectionDAG] In SplitVecOp_EXTRACT_VECTOR_ELT, simplify the code that makes the type byte addressable.
We can just extend the original vector to vXi1 and trust that the legalization process will revisit it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320013 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-07 08:04:34 +00:00
Craig Topper
608221f7aa [SelectionDAG] Use TLI.getVectorIdxTy to determine type for an EXTRACT_VECTOR_ELT index instead of hardcoding MVT::i8.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320012 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-07 08:04:33 +00:00
Mikael Holmen
78cae93022 Skip DBG instr in OptimizePHIs when looking for dead PHI cycles
Summary:
Changed use_instructions() to use_nodbg_instructions() when
building an instruction set.

We don't want the presence of debug info to affect the code
we generate.

Reviewers: dblaikie, Eugene.Zelenko, chandlerc, aprantl

Reviewed By: aprantl

Subscribers: aprantl, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320010 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-07 07:01:21 +00:00
Leslie Zhai
57c16f9267 [AVR] Override ParseDirective
Reviewers: dylanmckay, kparzysz

Reviewed By: dylanmckay

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320009 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-07 06:56:09 +00:00
Sam Clegg
03f3a72f26 Revert "[WebAssembly] Import the linear memory and function table."
We need to a little time to prepare and lld-side change that
supports this.

Original change: https://reviews.llvm.org/D40875

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320003 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-07 03:05:45 +00:00
Sam Clegg
9310123e7f [WebAssembly] section kind can be code
Currently, when creating a named section, the Wasm
frontend forces it to use `SectionKind::Data`, whereas
in fact C++ does generate code sections with custom
names.

Patch by Nicholas Wilson

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320002 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-07 02:55:51 +00:00
Evgeniy Stepanov
6463d1106b Update BitCodeFormat.
Add 2 recently added attributes to list of well-known attributes
in BitCodeFormat.rst.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319999 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-07 01:38:20 +00:00
Davide Italiano
9855a52b5b [DebugInfo] Explicitly pass a triple to this test.
As we emit different linetables format on different operating
systems, this currently fails on linux. Speculative commit
to fix the bots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319997 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-07 01:22:10 +00:00
Davide Italiano
01e7a568cd [MC/Dwarf] Use the older DWARF linetables format on Darwin.
dsymutil doesn't yet understand the new format and the change,
among others, breaks a large fraction of the debugger tests on
mac OS.

rdar://problem/35856354

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319995 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-07 00:57:25 +00:00
Alina Sbirlea
9c87911e89 [ModRefInfo] Replace remaining bit-wise operations with wrappers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319993 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-07 00:43:19 +00:00
Dan Gohman
113753f1f6 [WebAssembly] Don't try to emit size information for unsized types
Patch by John Sully!

Fixes PR35164.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319991 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-07 00:14:30 +00:00
Vedant Kumar
dea3d88348 [Coverage] Scan ahead for the most-recent completed count (PR35495)
This extends r319391. It teaches the segment builder to emit the right
completed segment when more than one region ends at the same location.

Fixes PR35495.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319990 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-07 00:01:15 +00:00
Dan Gohman
edc3af3e9a [WebAssembly] Import the linear memory and function table.
Instead of having .o files contain linear-memory and function table
definitions, use imports. This is more consistent with the stack pointer
being imported, and it's consistent with the linker being the one to
decide whether linear memory and function table are imported or defined
in the linked output. This implements tool-conventions #23.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319989 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-06 23:57:11 +00:00
Matt Morehouse
72671d6350 [CMake] Use PRIVATE when linking LLVM fuzzers.
More fuzzers missed by r319840.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319987 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-06 23:32:46 +00:00
Alina Sbirlea
a11ad8a6e4 [ModRefInfo] Use ModRefInfo wrappers in FunctionModRefBehavior
when testing for info found only in ModRefInfo [NFC].

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319985 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-06 23:12:43 +00:00
Florian Hahn
f42965e37e [AArch64] Add patterns to replace fsub fmul with fma fneg.
Summary:
This patch adds MachineCombiner patterns for transforming
(fsub (fmul x y) z) into (fma x y (fneg z)). This has a lower
latency on micro architectures where fneg is cheap.

Patch based on work by George Steed.

Reviewers: rengolin, joelkevinjones, joel_k_jones, evandro, efriedma

Reviewed By: evandro

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

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319980 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-06 22:48:36 +00:00
Adam Nemet
d62c5bdaf9 [LV] Interleaved access vectorization: fix computing new alias info
As a new access is generated spanning across multiple fields, we need to
propagate alias info from all the fields to form the most generic alias info.

rdar://35602528

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319979 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-06 22:42:24 +00:00
Krzysztof Parzyszek
7ef89ebab9 [Hexagon] Recognize vdealb, vdealh, vshuffb and vshuffh specifically
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319978 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-06 22:41:49 +00:00
Krzysztof Parzyszek
4bae52896e [Hexagon] Handle perfect shuffles on single vectors
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319965 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-06 21:25:03 +00:00
Sanjay Patel
2b68e112a3 [InstCombine] canonicalize constant-minus-boolean to select-of-constants
This restores the half of:
https://reviews.llvm.org/rL75531
that was reverted at:
https://reviews.llvm.org/rL159230

For the x86 case mentioned there, we now produce:
leal 1(%rdi), %eax
subl %esi, %eax

We have target hooks to invert this in DAGCombiner (and x86 is enabled) with:
https://reviews.llvm.org/rL296977
https://reviews.llvm.org/rL311731

AArch64 and possibly other targets would probably benefit from enabling those hooks too. 
See PR30327:
https://bugs.llvm.org/show_bug.cgi?id=30327#c2

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319964 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-06 21:22:57 +00:00
Matthew Simpson
9044c81903 [PGO] Make indirect call promotion a utility
This patch factors out the main code transformation utilities in the pgo-driven
indirect call promotion pass and places them in Transforms/Utils. The change is
intended to be a non-functional change, letting non-pgo-driven passes share a
common implementation with the existing pgo-driven pass.

The common utilities are used to conditionally promote indirect call sites to
direct call sites. They perform the underlying transformation, and do not
consider profile information. The pgo-specific details (e.g., the computation
of branch weight metadata) have been left in the indirect call promotion pass.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319963 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-06 21:22:54 +00:00
Dan Gohman
cead076cfb [WebAssembly] Commit a file I accidentally omitted from r319956.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319962 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-06 21:16:04 +00:00
Dan Gohman
73135b400e [WebAssembly] Remove WASM_STACK_POINTER.
WASM_STACK_POINTER and the .stack_pointer directive are no longer needed
now that the stack pointer global is an import.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319956 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-06 20:56:40 +00:00
Florian Hahn
1c6190de5d [MachineCombiner] Add up latencies of all instructions in new pattern.
Summary:
When calculating the RootLatency, we add up all the latencies of the
deleted instructions. But for NewRootLatency we only add the latency of
the new root instructions, ignoring the latencies of the other
instructions inserted. This leads the combiner to underestimate the cost
of patterns which add multiple instructions. This patch fixes that by
summing up the latencies of all new instructions. For NewRootNode, the
more complex getLatency function is used.

Note that we may be slightly more precise than just summing up
all latencies. For example, consider a pattern like

    r1 = INS1 ..
    r2 = INS2 ..
    r3 = INS3 r1, r2

I think in some other places, the total latency of the pattern would be
estimated as lat(INS3) + max(lat(INS1), lat(INS2)). If you consider
that worth changing, I think it would be best to do in a follow-up
patch.

Reviewers: Gerolf, sebpop, spop, fhahn

Reviewed By: fhahn

Subscribers: evandro, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319951 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-06 20:27:33 +00:00
Alina Sbirlea
0f7d5c2f56 [ModRefInfo] Do not use ModRefInfo result in if conditions as this makes
assumptions about the values in the enum. Replace with wrapper returning
bool [NFC].

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319949 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-06 19:56:37 +00:00
Florian Hahn
7bcd8a152c [InlineFunction] Only replace call if there are VarArgs to forward.
Summary:
There is no need to replace the original call instruction if no
 VarArgs need to be forwarded. 

Reviewers: davide, rnk, majnemer, efriedma

Reviewed By: efriedma

Subscribers: eraman, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319947 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-06 19:47:24 +00:00
Sanjay Patel
62d88c5371 [LoopUtils] simplify createTargetReduction(); NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319946 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-06 19:37:00 +00:00
Simon Pilgrim
5671e842df [X86][AVX512] Tag mask reg op instruction scheduler classes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319945 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-06 19:36:00 +00:00
Tim Shen
3a9eb132e3 [Hexagon] Suppress more warnings on unused variables defined for asserts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319944 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-06 19:33:42 +00:00
Alina Sbirlea
1a8492e856 [ModRefInfo] Use createModRefInfo wrapper to create a ModRefInfo from FunctionModRefBehavior.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319941 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-06 19:23:03 +00:00
Tim Shen
ec7643b35e [Hexagon] Suppress warnings on unused variables defind for asserts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319940 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-06 19:22:19 +00:00
Rui Ueyama
6305c5b42c [COFF] Ignore semicolons in module definition identifiers
Patch by David Major.

The NSS project's .def files make heavy use of semicolons in a
frightening attempt at portability:
https://hg.mozilla.org/projects/nss/raw-file/tip/lib/ckfw/capi/nsscapi.def

lld-link was treating the semicolon as part of the export name,
resulting in unresolved symbols. This patch includes ';' in the list of
characters to split on.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319933 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-06 19:18:24 +00:00
Sanjay Patel
19c4925cc0 [LoopUtils] fix variable name to match FMF vocabulary; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319928 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-06 19:11:23 +00:00
Zachary Turner
8b348680b2 Update obj2yaml and yaml2obj for .debug$H section.
Differential Revision: https://reviews.llvm.org/D40842

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319925 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-06 18:58:48 +00:00
Davide Italiano
ee79c38757 [Target] dumpr() is defined only in debug builds.
This fixes the clang build on macOS.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319923 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-06 18:54:17 +00:00
Simon Pilgrim
6b6659a744 [X86][SSE] Regenerate vpmovm2*/vpmov*2m avx512 schedule tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319921 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-06 18:47:37 +00:00
Simon Pilgrim
229aefe1a6 [X86][AVX512] Tag scalar insert/extract instruction scheduler classes
Classes don't look great but match what we're doing on SSE/AVX

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319920 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-06 18:46:06 +00:00
Craig Topper
93798497a9 [X86] Simplify the TTI code for getInterleavedMemoryOpCost around for AVX512BW. NFCI
Previously the lambda for AVX512 passed out a flag that indicated whether AVX512BW was required and that was checked against the AVX512BW subtarget flag outside.

This patch changes the interface to pass the AVX512BW subtarget bit in and return its value if we detect 16 or 8 bit types.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319919 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-06 18:40:46 +00:00
Shoaib Meenai
e5a2c5a162 [cmake] Remove unnecessary header include in atomics check
The header include was required to work around PR19898, as noted in that
comment. That PR has since been marked resolved fixed, and the
configuration check passes without the header inclusion both when
compiling on Windows with cl and when cross-compiling on Linux using
clang-cl.

I noticed this because the inclusion was cased incorrectly (Intrin.h
instead of intrin.h), which when cross-compiling on a case sensitive
file system would cause the intrin.h from the Windows SDK to be included
(which LLVM can't handle) instead of the one from clang's resource
directory, making the check fail. This is the same issue as r309980.
Correcting the case of the inclusion makes the check pass when cross
compiling, but it seems better to get rid of the inclusion entirely,
since it appears to be unnecessary now.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319917 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-06 18:33:07 +00:00
Simon Pilgrim
1c65bd2d5a [X86][AVX2] Tag MASKMOV instruction scheduler classes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319915 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-06 18:24:48 +00:00
Craig Topper
130d6d8471 [X86] Regenerate test for r319778
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319914 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-06 18:04:39 +00:00
Simon Pilgrim
47aefda7c6 [X86][AVX512] Tag aligned/unaligned move instruction scheduler classes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319913 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-06 17:59:26 +00:00
Simon Pilgrim
72e969ff83 [X86][AVX] Regenerate vpmovm2*/vpmov*2m avx512 schedule tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319912 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-06 17:57:18 +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
Zvi Rackover
138b4f2021 InstructionSimplify: 'extractelement' with an undef index is undef
Summary:
An undef extract index can be arbitrarily chosen to be an
out-of-range index value, which would result in the instruction being undef.

This change closes a gap identified while working on lowering vector permute intrinsics
with variable index vectors to pure LLVM IR.

Reviewers: arsenm, spatel, majnemer

Reviewed By: arsenm, spatel

Subscribers: fhahn, nhaehnle, wdng, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319910 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-06 17:51:46 +00:00
Artem Belevich
47a46192bb [NVPTX,CUDA] Added llvm.nvvm.fns intrinsic and matching __nvvm_fns builtin in clang.
Differential Revision: https://reviews.llvm.org/D40872

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319909 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-06 17:50:05 +00:00
Zvi Rackover
e67db33ecd AMDGPU Tests: Change a case to be run with -O0
D40231 requires to run case with -O0 to prevent InstructionSimplify from
transforming an extractelement with undef index.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319907 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-06 17:40:09 +00:00