49943 Commits

Author SHA1 Message Date
Florian Hahn 8eaf38e0eb [CodeExtractor] Use subset of function attributes for extracted function.
In addition to target-dependent attributes, we can also preserve a
white-listed subset of target independent function attributes. The white-list
excludes problematic attributes, most prominently:

* attributes related to memory accesses, as alloca instructions
  could be moved in/out of the extracted block

* control-flow dependent attributes, like no_return or thunk, as the
  relerelevant instructions might or might not get extracted.

Thanks @efriedma and @aemerson for providing a set of attributes that cannot be
propagated.


Reviewers: efriedma, davidxl, davide, silvas

Reviewed By: efriedma

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321961 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-07 11:22:25 +00:00
Craig Topper f8f7710cb8 [X86] Add the 16 and 8-bit CRC32 instructions to the load folding tables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321958 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-07 06:48:20 +00:00
Craig Topper 82ce446218 [X86] Add 128 and 256-bit VPOPCNTD/Q instructions to load folding tables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321953 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-07 06:24:27 +00:00
Craig Topper c303d203b8 [X86] Add EVEX vcvtph2ps to the load folding tables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321951 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-07 06:24:24 +00:00
Craig Topper 1d84174569 [X86] Remove cvtps2ph xmm->xmm from store folding tables. Add the evex versions of cvtps2ph to the store folding tables.
The memory form of the xmm->xmm version only writes 64-bits. If we use it in the folding tables and its get used for a stack spill, only half the slot will be written. Then a reload may read all 128-bits which will pull in garbage. But without the spill the upper bits of the register would have been zero. By not folding we would preserve the zeros.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321950 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-07 06:24:23 +00:00
Craig Topper d71f891c9b [X86] Remove memory forms of EVEX encoded vcvttss2si/vcvttsd2si from asm matcher table.
This is also needed to fix PR35837.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321946 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-06 21:27:25 +00:00
Craig Topper fb75f48283 [X86] Add load folding pattern to EVEX vcvttss2si/vcvtsd2si.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321945 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-06 21:02:26 +00:00
Florian Hahn bb854af99f [InlineFunction] Preserve calling convention when forwarding VarArgs.
Reviewers: efriedma, rnk, davide

Reviewed By: rnk, davide

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321943 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-06 20:56:27 +00:00
Florian Hahn d9fc780bef [InlineFunction] Preserve attributes when forwarding VarArgs.
Reviewers: rnk, efriedma

Reviewed By: rnk

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321942 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-06 20:46:00 +00:00
Florian Hahn 7b0cf7929a [InlineFunction] Inline vararg functions that do not access varargs.
If the varargs are not accessed by a function, we can inline the
function.

Reviewers: dblaikie, chandlerc, davide, efriedma, rnk, hfinkel

Reviewed By: efriedma

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321940 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-06 19:45:40 +00:00
Craig Topper d9c9e989f5 [X86] Remove memory forms of EVEX encoded vcvtsd2si/vcvtss2si from the assembler matcher table
We should always prefer the VEX encoded version of these instructions. There is no advantage to the EVEX version.

Fixes PR35837.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321939 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-06 19:20:33 +00:00
Sanjay Patel 536ffae2c4 [InstCombine] relax use constraint for min/max (~a, ~b) --> ~min/max(a, b)
In the minimal case, this won't remove instructions, but it still improves
uses of existing values.

In the motivating example from PR35834, it does remove instructions, and
sets that case up to be optimized by something like D41603:
https://reviews.llvm.org/D41603


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321936 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-06 17:34:22 +00:00
Sanjay Patel 82c67ea483 [InstCombine] add more tests for max(~a, ~b) and PR35834; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321935 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-06 17:14:46 +00:00
Sanjay Patel df87029dcf [x86, MemCmpExpansion] allow 2 pairs of loads per block (PR33325)
This is the last step needed to fix PR33325:
https://bugs.llvm.org/show_bug.cgi?id=33325

We're trading branch and compares for loads and logic ops. 
This makes the code smaller and hopefully faster in most cases.

The 24-byte test shows an interesting construct: we load the trailing scalar 
elements into vector registers and generate the same pcmpeq+movmsk code that 
we expected for a pair of full vector elements (see the 32- and 64-byte tests).

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321934 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-06 16:16:04 +00:00
Craig Topper c161097e5f [X86] When parsing rounding mode operands, provide a proper end location so we don't crash when trying to print an error message using it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321930 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-06 06:41:07 +00:00
Craig Topper 5013a6d16e [X86] Call lowerShuffleAsRepeatedMaskAndLanePermute from lowerV4I64VectorShuffle.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321929 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-06 06:08:04 +00:00
Craig Topper ee663094e4 [X86] Run dos2unix on a test file. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321928 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-06 06:08:02 +00:00
Vedant Kumar 0434c3b4d6 [Debugify] Handled unsized types
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321918 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-06 00:37:01 +00:00
Craig Topper cd244770af [X86] Add vcvtsd2sil/vcvtsd2siq etc. InstAliases to the EVEX-encoded instructions.
This matches their VEX equivalents.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321912 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-05 23:13:54 +00:00
Adrian McCarthy ced21a6948 Re-land "Fix faulty assertion in debug info"
This had been reverted because the new test failed on non-X86 bots.  I moved
the new test to the appropriate subdirectory to correct this.

Differential Revision: https://reviews.llvm.org/D41264
Original submission:  r321122 (which was reverted by r321125)

This reverts commit 3c1639b5703c387a0d8cba2862803b4e68dff436.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321911 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-05 23:01:04 +00:00
Krzysztof Parzyszek ac780ae7ed [Hexagon] Even simpler patterns for sign- and zero-extending HVX vectors
Recommit r321897 with updated testcases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321908 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-05 22:31:11 +00:00
Bjorn Pettersson 39ebb68152 [DebugInfo] Align comments in debug_loc section
Summary:
This commit updates the BufferByteStreamer, used by DebugLocStream
to buffer bytes/comments to put in the debug_loc section, to
make sure that the Buffer and Comments vectors are synced.
Previously, when an SLEB128 or ULEB128 was emitted together with
a comment, the vectors could be out-of-sync if the LEB encoding
added several entries to the Buffer vectors, while we only added
a single entry to the Comments vector.

The goal with this is to get the comments in the debug_loc
section in the .s file correctly aligned.

Example (using ARM as target):
Instead of

  .byte 144                     @ sub-register DW_OP_regx
  .byte 128                     @ 256
  .byte 2                       @ DW_OP_piece
  .byte 147                     @ 8
  .byte 8                       @ sub-register DW_OP_regx
  .byte 144                     @ 257
  .byte 129                     @ DW_OP_piece
  .byte 2                       @ 8
  .byte 147                     @
  .byte 8                       @

we now get

  .byte 144                     @ sub-register DW_OP_regx
  .byte 128                     @ 256
  .byte 2                       @
  .byte 147                     @ DW_OP_piece
  .byte 8                       @ 8
  .byte 144                     @ sub-register DW_OP_regx
  .byte 129                     @ 257
  .byte 2                       @
  .byte 147                     @ DW_OP_piece
  .byte 8                       @ 8

Reviewers: JDevlieghere, rnk, aprantl

Reviewed By: aprantl

Subscribers: davide, Ka-Ka, uabelho, aemerson, javed.absar, kristof.beyls, llvm-commits, JDevlieghere

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321907 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-05 22:20:30 +00:00
Zachary Turner 135e942bcb Fix some opt-viewer test issues and disable on Windows.
Differential Revision: https://reviews.llvm.org/D41784

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321905 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-05 22:05:13 +00:00
Krzysztof Parzyszek 2dd4edf571 Revert r321894: it requires a part of another commit that is not ready yet
Commit message:
[Hexagon] Add patterns for sext_inreg of HVX vector types


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321904 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-05 21:57:43 +00:00
Craig Topper 510c34022e [X86] Add InstAliases for 'vmovd' with GR64 registers to select EVEX encoded instructions as well.
Without this we allow "vmovd %rax, %xmm0", but not "vmovd %rax, %xmm16"

This exists due to continue a silly bug where really old versions of the GNU assembler required movd instead of movq on these instructions. This compatibility hack then crept forward to avx version too, but we didn't propagate it to avx512.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321903 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-05 21:57:23 +00:00
Adrian Prantl 10a0a6794f dwarfdump: Match the --uuid output with that of Darwin dwarfdump.
This option is widely used by scripts and there is no reason to break them.

rdar://problem/36032398

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321901 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-05 21:44:17 +00:00
Craig Topper c85dd32732 [X86] Stop printing moves between VR64 and GR64 with 'movd' mnemonic. Use 'movq' instead.
This behavior existed to work with an old version of the gnu assembler on MacOS that only accepted this form. Newer versions of GNU assembler and the current LLVM derived version of the assembler on MacOS support movq as well.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321898 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-05 20:55:12 +00:00
Krzysztof Parzyszek dcbe415819 [Hexagon] Add patterns for truncating HVX vector types
Only non-bool vectors.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321895 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-05 20:48:03 +00:00
Krzysztof Parzyszek 3509d6c9b9 [Hexagon] Add patterns for sext_inreg of HVX vector types
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321894 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-05 20:46:41 +00:00
Krzysztof Parzyszek d32592f248 [Hexagon] Add a bitcast to required type in LowerHvxMul
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321893 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-05 20:45:34 +00:00
Krzysztof Parzyszek 47b41454e7 [Hexagon] Add pattern for vsplat to v8i8
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321892 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-05 20:43:56 +00:00
Douglas Yung 524c679deb [llvm-cov] Change test to use FileCheck instead of grep.
Reviewed by Paul Robinson



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321888 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-05 20:00:18 +00:00
Serge Guelton 4c23defc23 Limit size of non-GlobalValue name
Otherwise, in some extreme test case, very long names are created and the
compiler consumes large amount of memory. Size limit is set to a relatively
high value not to disturb debugging.

Compiler flag -non-global-value-max-name-size=<value> can be used to customize
the size.

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




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321886 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-05 19:41:19 +00:00
Jake Ehrlich 2107a83a28 [llvm-objcopy] Add --localize-hidden option
This change adds support in llvm-objcopy for GNU objcopy's --localize-hidden
option. This option changes every hidden or internal symbol into a local symbol.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321884 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-05 19:19:09 +00:00
Sanjay Patel d4ca29bfda [InstCombine] add folds for min(~a, b) --> ~max(a, b)
Besides the bug of omitting the inverse transform of max(~a, ~b) --> ~min(a, b),
the use checking and operand creation were off. We were potentially creating 
repeated identical instructions of existing values. This led to infinite
looping after I added the extra folds.

By using the simpler m_Not matcher and not creating new 'not' ops for a and b,
we avoid that problem. It's possible that not using IsFreeToInvert() here is
more limiting than the simpler matcher, but there are no tests for anything
more exotic. It's also possible that we should relax the use checking further
to handle a case like PR35834:
https://bugs.llvm.org/show_bug.cgi?id=35834
...but we can make that a follow-up if it is needed. 


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321882 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-05 19:01:17 +00:00
Brian Gesiak f34765b4dc [llvm-mt] Remove platform-specific path in test
Summary:
Remove a platform-specific path separator added to the llvm-mt help text test
in https://reviews.llvm.org/D41732.

Test Plan: `check-llvm`



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321881 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-05 18:23:22 +00:00
Brian Gesiak 1fed623ad6 [Option] Add 'findNearest' method to catch typos
Summary:
Add a method `OptTable::findNearest`, which allows users of OptTable to
check user input for misspelled options. In addition, have llvm-mt
check for misspelled options. For example, if a user invokes
`llvm-mt /oyt:foo`, the error message will indicate that while an
option named `/oyt:` does not exist, `/out:` does.

The method ports the functionality of the `LookupNearestOption` method
from LLVM CommandLine to libLLVMOption. This allows tools like Clang
and Swift, which do not use CommandLine, to use this functionality to
suggest similarly spelled options.

As room for future improvement, the new method as-is cannot yet properly suggest
nearby "joined" options -- that is, for an option string "-FozBar", where
"-Foo" is the correct option name and "Bar" is the value being passed along
with the misspelled option, this method will calculate an edit distance of 4,
by deleting "Bar" and changing "z" to "o". It should instead calculate an edit
distance of just 1, by changing "z" to "o" and recognizing "Bar" as a
value. This commit includes a disabled test that expresses this limitation.

Test Plan: `check-llvm`

Reviewers: yamaguchi, v.g.vassilev, teemperor, ruiu, jroelofs

Reviewed By: jroelofs

Subscribers: jroelofs, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321877 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-05 17:10:39 +00:00
Max Moroz 60fcc5623e [llvm-cov] Temporarily disable multithreaded-report.test on Windows.
Summary: The test is failing because Windows do not support "diff -r".

Reviewers: Dor1s

Reviewed By: Dor1s

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321876 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-05 16:43:24 +00:00
Adrian Prantl 6e6b8a2e80 add 'REQUIRES: object-emission' to test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321875 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-05 16:31:22 +00:00
Adrian Prantl e68ada0df5 remove unnecessary target triple from generic test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321874 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-05 16:29:24 +00:00
Davide Italiano 4b913c23b6 [BasicAA] Fix linearization of shifts beyond the bitwidth.
Thanks to Simon Pilgrim for the reduced testcase.
Fixes PR35821.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321873 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-05 16:18:47 +00:00
Alexey Bataev 3b86f03288 [SLP] Update more test checks, NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321872 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-05 16:15:17 +00:00
Max Moroz d6352cad98 [llvm-cov] Multi-threaded implementation of prepareFileReports method.
Summary:
Local testing has demonstrated a great speed improvement, compare the following:

1) Existing version:
```
$ time llvm-cov show -format=html -output-dir=report -instr-profile=... ...
The tool has been launched:                            00:00:00
Loading coverage data:                                 00:00:00
Get unique source files:                               00:00:33
Creating an index out of the source files:             00:00:34
Going into prepareFileReports:                         00:00:34
Going to emit summary information for each file:       00:28:55 <-- 28:21 min!
Going to emit links to files with no function:         00:28:55
Launching 32 threads for generating HTML files:        00:28:55

real  37m43.651s
user  112m5.540s
sys   7m39.872s
```

2) Multi-threaded version with 32 CPUs:
```
$ time llvm-cov show -format=html -output-dir=report -instr-profile=... ...
The tool has been launched:                            00:00:00
Loading coverage data:                                 00:00:00
Get unique source files:                               00:00:38
Creating an index out of the source files:             00:00:40
Going into prepareFileReports:                         00:00:40
Preparing file reports using 32 threads:               00:00:40
# Creating thread tasks for the following number of files: 16422
Going to emit summary information for each file:       00:01:57 <-- 1:17 min!
Going to emit links to files with no function:         00:01:58
Launching 32 threads for generating HTML files:        00:01:58

real  11m2.044s
user  134m48.124s
sys   7m53.388s
```

Reviewers: vsk, morehouse

Reviewed By: vsk

Subscribers: Dor1s, llvm-commits, kcc

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321871 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-05 16:15:07 +00:00
Alexey Bataev 1c740fb886 [SLP] Update test checks, NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321870 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-05 15:20:40 +00:00
Alexey Bataev 2021bac78d [SLP] Update tests checks, NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321869 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-05 14:40:04 +00:00
Simon Pilgrim a3a875b34d [X86] Regenerate illegal move test
Recommitting after fixing case-sensitive issue in the RUN command

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321868 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-05 14:24:03 +00:00
Momchil Velikov 2e4bd2aa72 [ARM] Issue an erorr when non-general-purpose registers are used in address operands
Currently the assembler would accept, e.g. `ldr r0, [s0, #12]` and similar.
This patch add checks that only general-purpose registers are used in address
operands, shifted registers, and shift amounts.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321866 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-05 13:28:10 +00:00
Florian Hahn 545ec94b43 [AArch64] Fix -mcpu option in aarch64-combine-fmul-fsub.mir (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321865 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-05 11:17:48 +00:00
Jonas Devlieghere 81a623d6d6 [DebugInfo] Don't crash when given invalid DWARFv5 line table prologue.
This patch replaces an assertion with an explicit check for the validity
of the FORM parameters. The assertion was triggered when the DWARFv5
line table contained a zero address size.

This fixes OSS-Fuzz Issue 4644
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=4644

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321863 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-05 10:03:02 +00:00
Sam Parker 8681051b9e [DAGCombine] Fix for PR37563
While searching for loads to be narrowed, equal sized loads were not
added to the list, resulting in anyext loads not being converted to
zext loads.

https://bugs.llvm.org/show_bug.cgi?id=35763

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321862 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-05 08:47:23 +00:00