]> granicus.if.org Git - llvm/log
llvm
6 years ago Attempt to fix buildbot after r354972 [#1]. NFCI.
Alexey Lapshin [Wed, 27 Feb 2019 18:36:46 +0000 (18:36 +0000)]
Attempt to fix buildbot after r354972 [#1]. NFCI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355013 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[llvm-cxxfilt] Re-enable the delimiters test on Windows.
Matt Davis [Wed, 27 Feb 2019 18:04:21 +0000 (18:04 +0000)]
[llvm-cxxfilt] Re-enable the delimiters test on Windows.

The original intent was to enable this test for Windows; however, that
initial patch broke one of the build-bots.  I temporarily disabled this
test on Windows until that issue was resolved.  It was resolved in my
previous patch (cfd1d9742ee2d1b8dd6b7), and now I am re-enabling this
test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355011 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoClean up the delimiters test.
Matt Davis [Wed, 27 Feb 2019 17:39:36 +0000 (17:39 +0000)]
Clean up the delimiters test.

Ideally this is a NFCI, used single quotes in most cases.  Hopefully
this will make the Windows bot happy.

I've marked this unsupported on windows, until I get my windows box
setup with this patch to test.  I'll remove that constraint after I'm
confident this will pass on windows.  I just want to silence the
buildbots for now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355007 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRecommit r354930 "[PGO] Context sensitive PGO (part 1)"
Rong Xu [Wed, 27 Feb 2019 17:24:33 +0000 (17:24 +0000)]
Recommit r354930 "[PGO] Context sensitive PGO (part 1)"

Fixed UBSan failures.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355005 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[llvm-readobj]Add additional testing for various ELF features
James Henderson [Wed, 27 Feb 2019 16:41:59 +0000 (16:41 +0000)]
[llvm-readobj]Add additional testing for various ELF features

This patch adds testing of areas of the code that are not fully tested,
in particular dynamic table printing, ELF type printing, handling of
edge cases where things are missing/empty (relocations/program header
tables/section header table), and the --string-dump switch.

Reviewed by: grimar, higuoxing, rupprecht

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355003 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[llvm-objdump] Should print strings when dumping DT_RPATH, DT_RUNPATH, DT_SONAME...
Xing GUO [Wed, 27 Feb 2019 16:37:15 +0000 (16:37 +0000)]
[llvm-objdump] Should print strings when dumping DT_RPATH, DT_RUNPATH, DT_SONAME, DT_AUXILIARY and DT_FILTER tags in dynamic section.

Summary:
Before:
```
Dynamic Section:
  NEEDED               libpthread.so.0
  ...
  NEEDED               ld-linux-x86-64.so.2
  RPATH                0x00000000001c2e61
```

After:
```
Dynamic Section:
  NEEDED               libpthread.so.0
  ...
  NEEDED               ld-linux-x86-64.so.2
  RPATH                $ORIGIN/../lib
```

Only a small problem here, I have no idea on choosing test case. I see there's a test
file(test/tools/llvm-objdump/private-headers-dynamic-section.test). But it has no DT_RPATH and DT_RUNPATH tags. Shall I replace the ELF file in the
Inputs dir by a new one?

Reviewers: jhenderson, grimar

Reviewed By: jhenderson

Subscribers: srhines, rupprecht, jfb, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355001 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[llvm-cxxfilt] Split and demangle stdin input on certain non-alphanumerics.
Matt Davis [Wed, 27 Feb 2019 16:29:50 +0000 (16:29 +0000)]
[llvm-cxxfilt] Split and demangle stdin input on certain non-alphanumerics.

Summary:
This patch attempts to replicate GNU c++-filt behavior when splitting stdin input for demangling.

Previously, cxx-filt would split input only on spaces.  Each delimited item is then demangled.
From what I have tested, GNU c++filt also splits input on any character that does not make
up the mangled name (notably commas, but also a large set of non-alphanumeric characters).

This patch splits stdin input on any character that does not belong to the Itanium mangling
format (since Itanium is currently the only supported format in llvm-cxxfilt).

This is an update to PR39990

Reviewers: jhenderson, tejohnson, compnerd

Reviewed By: compnerd

Subscribers: erik.pilkington, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354998 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[InstCombine] Add additional add.sat overflow tests; NFC
Nikita Popov [Wed, 27 Feb 2019 16:18:29 +0000 (16:18 +0000)]
[InstCombine] Add additional add.sat overflow tests; NFC

Baseline for D58593.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354996 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[InstCombine] regenerate complete checks; NFC
Sanjay Patel [Wed, 27 Feb 2019 15:59:30 +0000 (15:59 +0000)]
[InstCombine] regenerate complete checks; NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354993 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agogn build: Merge r354989
Nico Weber [Wed, 27 Feb 2019 15:46:51 +0000 (15:46 +0000)]
gn build: Merge r354989

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354991 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agogn build: Merge r354692
Nico Weber [Wed, 27 Feb 2019 15:29:14 +0000 (15:29 +0000)]
gn build: Merge r354692

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354987 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[DebugInfo] Apply subprogram attributes on behalf of owner CU
Eugene Leviant [Wed, 27 Feb 2019 14:46:59 +0000 (14:46 +0000)]
[DebugInfo] Apply subprogram attributes on behalf of owner CU

When using full LTO it is possible that template function definition DIE
is bound to one compilation unit and it's declaration to another. We should
add function declaration attributes on behalf of its owner CU otherwise
we may end up with malformed file identifier in function declaration
DW_AT_decl_file attribute.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354978 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[AMDGPU][MC] Added register size check for VOP3/SDWA/DPP operands
Dmitry Preobrazhensky [Wed, 27 Feb 2019 13:58:48 +0000 (13:58 +0000)]
[AMDGPU][MC] Added register size check for VOP3/SDWA/DPP operands

See bug 37943: https://bugs.llvm.org/show_bug.cgi?id=37943

Reviewers: artem.tamazov, arsenm, rampitec

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354974 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[DebugInfo] add SectionedAddress to DebugInfo interfaces.
Alexey Lapshin [Wed, 27 Feb 2019 13:17:36 +0000 (13:17 +0000)]
[DebugInfo] add SectionedAddress to DebugInfo interfaces.

      That patch is the fix for https://bugs.llvm.org/show_bug.cgi?id=40703
   "wrong line number info for obj file compiled with -ffunction-sections"
   bug. The problem happened with only .o files. If object file contains
   several .text sections then line number information showed incorrectly.
   The reason for this is that DwarfLineTable could not detect section which
   corresponds to specified address(because address is the local to the
   section). And as the result it could not select proper sequence in the
   line table. The fix is to pass SectionIndex with the address. So that it
   would be possible to differentiate addresses from various sections. With
   this fix llvm-objdump shows correct line numbers for disassembled code.

   Differential review: https://reviews.llvm.org/D58194

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354972 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[AMDGPU][MC][GFX8+] Added syntactic sugar for 'vgpr index' operand of instructions...
Dmitry Preobrazhensky [Wed, 27 Feb 2019 13:12:12 +0000 (13:12 +0000)]
[AMDGPU][MC][GFX8+] Added syntactic sugar for 'vgpr index' operand of instructions s_set_gpr_idx_on and s_set_gpr_idx_mode

See bug 39331: https://bugs.llvm.org/show_bug.cgi?id=39331

Reviewers: artem.tamazov, arsenm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354969 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[llvm-objcopy] - Check for invalidated relocations when removing a section.
George Rimar [Wed, 27 Feb 2019 11:18:27 +0000 (11:18 +0000)]
[llvm-objcopy] - Check for invalidated relocations when removing a section.

This is https://bugs.llvm.org/show_bug.cgi?id=40818

Removing a section that is used by relocation is an error
we did not report. The patch fixes that.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354962 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86][AVX] Only combine loads to broadcasts for legal types
Simon Pilgrim [Wed, 27 Feb 2019 11:17:25 +0000 (11:17 +0000)]
[X86][AVX] Only combine loads to broadcasts for legal types

Thanks to @echristo for spotting this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354961 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[llvm-readobj]Fix error messages for bad archive members and add testing for archive...
James Henderson [Wed, 27 Feb 2019 11:07:08 +0000 (11:07 +0000)]
[llvm-readobj]Fix error messages for bad archive members and add testing for archive handling

llvm-readobj's error messages were broken for bad archive members. This
patch fixes them, and also adds testing for archive and thin archive
handling within llvm-readobj.

Reviewed by: rupprecht, grimar, higuoxing

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354960 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoFix Wenum-compare gcc7 warning. NFCI.
Simon Pilgrim [Wed, 27 Feb 2019 10:19:53 +0000 (10:19 +0000)]
Fix Wenum-compare gcc7 warning. NFCI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354958 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[llvm-readobj] Print DF_1_DISPRELPND
Fangrui Song [Wed, 27 Feb 2019 05:37:11 +0000 (05:37 +0000)]
[llvm-readobj] Print DF_1_DISPRELPND

The test will be added by D58677.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354955 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[BPF] Don't fail for static variables
Yonghong Song [Wed, 27 Feb 2019 05:36:15 +0000 (05:36 +0000)]
[BPF] Don't fail for static variables

Currently, the LLVM will print an error like
  Unsupported relocation: try to compile with -O2 or above,
  or check your static variable usage
if user defines more than one static variables in a single
ELF section (e.g., .bss or .data).

There is ongoing effort to support static and global
variables in libbpf and kernel. This patch removed the
assertion so user programs with static variables won't
fail compilation.

The static variable in-section offset is written to
the "imm" field of the corresponding to-be-relocated
bpf instruction. Below is an example to show how the
application (e.g., libbpf) can relate variable to relocations.

  -bash-4.4$ cat g1.c
  static volatile long a = 2;
  static volatile int b = 3;
  int test() { return a + b; }
  -bash-4.4$ clang -target bpf -O2 -c g1.c
  -bash-4.4$ llvm-readelf -r g1.o

  Relocation section '.rel.text' at offset 0x158 contains 2 entries:
      Offset             Info             Type               Symbol's Value  Symbol's Name
  0000000000000000  0000000400000001 R_BPF_64_64            0000000000000000 .data
  0000000000000018  0000000400000001 R_BPF_64_64            0000000000000000 .data
  -bash-4.4$ llvm-readelf -s g1.o

  Symbol table '.symtab' contains 6 entries:
     Num:    Value          Size Type    Bind   Vis      Ndx Name
       0: 0000000000000000     0 NOTYPE  LOCAL  DEFAULT  UND
       1: 0000000000000000     0 FILE    LOCAL  DEFAULT  ABS g1.c
       2: 0000000000000000     8 OBJECT  LOCAL  DEFAULT    4 a
       3: 0000000000000008     4 OBJECT  LOCAL  DEFAULT    4 b
       4: 0000000000000000     0 SECTION LOCAL  DEFAULT    4
       5: 0000000000000000    64 FUNC    GLOBAL DEFAULT    2 test
  -bash-4.4$ llvm-objdump -d g1.o

  g1.o:   file format ELF64-BPF

  Disassembly of section .text:
  0000000000000000 test:
       0:       18 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00         r1 = 0 ll
       2:       79 11 00 00 00 00 00 00         r1 = *(u64 *)(r1 + 0)
       3:       18 02 00 00 08 00 00 00 00 00 00 00 00 00 00 00         r2 = 8 ll
       5:       61 20 00 00 00 00 00 00         r0 = *(u32 *)(r2 + 0)
       6:       0f 10 00 00 00 00 00 00         r0 += r1
       7:       95 00 00 00 00 00 00 00         exit
  -bash-4.4$

  . from symbol table, static variable "a" is in section #4, offset 0.
  . from symbol table, static variable "b" is in section #4, offset 8.
  . the first relocation is against symbol #4:
    4: 0000000000000000     0 SECTION LOCAL  DEFAULT    4
    and in-section offset 0 (see llvm-objdump result)
  . the second relocation is against symbol #4:
    4: 0000000000000000     0 SECTION LOCAL  DEFAULT    4
    and in-section offset 8 (see llvm-objdump result)
  . therefore, the first relocation is for variable "a", and
    the second relocation is for variable "b".

Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Yonghong Song <yhs@fb.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354954 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRevert "[PGO] Context sensitive PGO (part 1)"
Vlad Tsyrklevich [Wed, 27 Feb 2019 03:45:28 +0000 (03:45 +0000)]
Revert "[PGO] Context sensitive PGO (part 1)"

This reverts commit r354930, it was causing UBSan failures.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354953 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoSupport: enable backtraces on Windows
Saleem Abdulrasool [Wed, 27 Feb 2019 03:21:50 +0000 (03:21 +0000)]
Support: enable backtraces on Windows

Some platforms, e.g. Windows, support backtraces but don't have
BACKTRACE. Checking for BACKTRACE prevents Windows from having
backtraces.

Patch by Jason Mittertreiner!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354951 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[WebAssembly] Fix ScopeTops info in CFGStackify for EH pads
Heejin Ahn [Wed, 27 Feb 2019 01:35:14 +0000 (01:35 +0000)]
[WebAssembly] Fix ScopeTops info in CFGStackify for EH pads

Summary:
When creating `ScopeTops` info for `try` ~ `catch` ~ `end_try`, we
should create not only `end_try` -> `try` mapping but also `catch` ->
`try` mapping as well. If this is not created, `block` and `end_block`
markers later added may span across an existing `catch`, resulting in
the incorrect code like:
```
try
  block     --|  (X)
catch         |
  end_block --|
end_try
```

Reviewers: dschuff

Subscribers: sunfish, sbc100, jgravelle-google, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354945 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[DWARFFormValue] Cleanup DWARFFormValue interface. (NFC)
Jonas Devlieghere [Wed, 27 Feb 2019 00:58:09 +0000 (00:58 +0000)]
[DWARFFormValue] Cleanup DWARFFormValue interface. (NFC)

DWARFFormValues can be created from a data extractor or by passing its
value directly. Until now this was done by member functions that
modified an existing object's internal state. This patch replaces a
subset of these methods with static method that return a new
DWARFFormValue.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354941 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[WebAssembly] Remove unnecessary instructions after TRY marker placement
Heejin Ahn [Wed, 27 Feb 2019 00:50:53 +0000 (00:50 +0000)]
[WebAssembly] Remove unnecessary instructions after TRY marker placement

Summary:
This removes unnecessary instructions after TRY marker placement. There
are two cases:
- `end`/`end_block` can be removed if they overlap with `try`/`end_try`
  and they have the same return types.
- `br` right before `catch` that branches to after `end_try` can be
  deleted.

Reviewers: dschuff

Subscribers: sbc100, jgravelle-google, sunfish, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354939 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[SystemZ] Pass regalloc hints to help Load-and-Test transformations.
Jonas Paulsson [Wed, 27 Feb 2019 00:18:28 +0000 (00:18 +0000)]
[SystemZ]  Pass regalloc hints to help Load-and-Test transformations.

Since there is no "Load-and-Test-High" instruction, the 32 bit load of a
register to be compared with 0 can only be implemented with LT if the virtual
GRX32 register ends up in a low part (GR32 register).

This patch detects these cases and passes the GR32 registers (low parts) as
(soft) hints in getRegAllocationHints().

Review: Ulrich Weigand.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354935 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agovim: `swiftself` is an attribute
Saleem Abdulrasool [Wed, 27 Feb 2019 00:12:11 +0000 (00:12 +0000)]
vim: `swiftself` is an attribute

Highlight the `swiftself` attribute on parameters.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354934 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[HotColdSplit] Disable splitting for sanitized functions
Vedant Kumar [Tue, 26 Feb 2019 22:55:46 +0000 (22:55 +0000)]
[HotColdSplit] Disable splitting for sanitized functions

Splitting can make sanitizer errors harder to understand, as the
trapping instruction may not be in the function where the bug was
detected.

rdar://48142697

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354931 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[PGO] Context sensitive PGO (part 1)
Rong Xu [Tue, 26 Feb 2019 22:37:46 +0000 (22:37 +0000)]
[PGO] Context sensitive PGO (part 1)

Current PGO profile counts are not context sensitive. The branch probabilities
for the inlined functions are kept the same for all call-sites, and they might
be very different from the actual branch probabilities. These suboptimal
profiles can greatly affect some downstream optimizations, in particular for
the machine basic block placement optimization.

In this patch, we propose to have a post-inline PGO instrumentation/use pass,
which we called Context Sensitive PGO (CSPGO). For the users who want the best
possible performance, they can perform a second round of PGO instrument/use on
the top of the regular PGO. They will have two sets of profile counts. The
first pass profile will be manly for inline, indirect-call promotion, and
CGSCC simplification pass optimizations. The second pass profile is for
post-inline optimizations and code-gen optimizations.

A typical usage:
// Regular PGO instrumentation and generate pass1 profile.
> clang -O2 -fprofile-generate source.c -o gen
> ./gen
> llvm-profdata merge default.*profraw -o pass1.profdata
// CSPGO instrumentation.
> clang -O2 -fprofile-use=pass1.profdata -fcs-profile-generate -o gen2
> ./gen2
// Merge two sets of profiles
> llvm-profdata merge default.*profraw pass1.profdata -o profile.profdata
// Use the combined profile. Pass manager will invoke two PGO use passes.
> clang -O2 -fprofile-use=profile.profdata -o use

This change touches many components in the compiler. The reviewed patch
(D54175) will committed in phrases.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354930 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[AMDGPU] Fixed hang during DAG combine
Stanislav Mekhanoshin [Tue, 26 Feb 2019 20:56:25 +0000 (20:56 +0000)]
[AMDGPU] Fixed hang during DAG combine

SITargetLowering::reassociateScalarOps() does not touch constants
so that DAGCombiner::ReassociateOps() does not revert the combine.
However a global address is not a ConstantSDNode.

Switched to the method used by DAGCombiner::ReassociateOps() itself
to detect constants.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354926 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoFix a small comment typo.
Eric Christopher [Tue, 26 Feb 2019 20:33:22 +0000 (20:33 +0000)]
Fix a small comment typo.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354923 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Fix bug in vectorcall calling convention
Reid Kleckner [Tue, 26 Feb 2019 19:48:16 +0000 (19:48 +0000)]
[X86] Fix bug in vectorcall calling convention

Original implementation can't correctly handle __m256 and __m512 types
passed by reference through stack. This patch fixes it.

Patch by Wei Xiao!

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354921 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[MemorySSA & SimpleLoopUnswitch] Update MemorySSA in ReplaceUsesOfWith.
Alina Sbirlea [Tue, 26 Feb 2019 19:44:52 +0000 (19:44 +0000)]
[MemorySSA & SimpleLoopUnswitch] Update MemorySSA in ReplaceUsesOfWith.

SimpleLoopUnswitch must update MemorySSA when removing instructions.
Resolves PR39197.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354919 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Use X86_CPU_SUBTYPE_COMPAT for 'cascadelake' cpu.
Craig Topper [Tue, 26 Feb 2019 19:17:12 +0000 (19:17 +0000)]
[X86] Use X86_CPU_SUBTYPE_COMPAT for 'cascadelake' cpu.

This CPU is supported by at least libgcc trunk now so we should make it available to __builtin_cpu_is.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354913 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[lit] Allow setting parallelism groups to None
Julian Lettner [Tue, 26 Feb 2019 19:03:26 +0000 (19:03 +0000)]
[lit] Allow setting parallelism groups to None

Check that we do not crash if a parallelism group is explicitly set to
None. Permits usage of the following pattern.

[lit.common.cfg]
  lit_config.parallelism_groups['my_group'] = None
  if <condition>:
    lit_config.parallelism_groups['my_group'] = 3

[project/lit.cfg]
  config.parallelism_group = 'my_group'

Reviewers: rnk

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354912 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoUpdate docs of memcpy/move/set wrt. align and len
Kristina Brooks [Tue, 26 Feb 2019 18:53:13 +0000 (18:53 +0000)]
Update docs of memcpy/move/set wrt. align and len

Fix https://bugs.llvm.org/show_bug.cgi?id=38583: Describe
how memcpy/memmove/memset behave when len=0. Also fix
some fallout from when the alignment parameter was
replaced by an attribute.

This closes PR38583.

Patch by RalfJung (Ralf)

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354911 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[TableGen] Make OpcodeMappings sort comparator deterministic NFCI
Andrew Ng [Tue, 26 Feb 2019 18:50:49 +0000 (18:50 +0000)]
[TableGen] Make OpcodeMappings sort comparator deterministic NFCI

The previous sort comparator was not deterministic, i.e. in some
situations it would be possible for lhs < rhs && rhs < lhs. This was
discovered by an STL assertion in a Windows debug build of llvm-tblgen.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354910 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[InstSimplify] remove zero-shift-guard fold for general funnel shift
Sanjay Patel [Tue, 26 Feb 2019 18:26:56 +0000 (18:26 +0000)]
[InstSimplify] remove zero-shift-guard fold for general funnel shift

As discussed on llvm-dev:
http://lists.llvm.org/pipermail/llvm-dev/2019-February/130491.html

We can't remove the compare+select in the general case because
we are treating funnel shift like a standard instruction (as
opposed to a special instruction like select/phi).

That means that if one of the operands of the funnel shift is
poison, the result is poison regardless of whether we know that
the operand is actually unused based on the instruction's
particular semantics.

The motivating case for this transform is the more specific
rotate op (rather than funnel shift), and we are preserving the
fold for that case because there is no chance of introducing
extra poison when there is no anonymous extra operand to the
funnel shift.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354905 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[MIPS GlobalISel] Select G_UADDO
Petar Avramovic [Tue, 26 Feb 2019 17:22:42 +0000 (17:22 +0000)]
[MIPS GlobalISel] Select G_UADDO

Lower G_UADDO.
Legalize G_UADDO for MIPS32

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354900 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] AMD znver2 enablement
Ganesh Gopalasubramanian [Tue, 26 Feb 2019 16:55:10 +0000 (16:55 +0000)]
[X86] AMD znver2 enablement

This patch enables the following

1) AMD family 17h "znver2" tune flag (-march, -mcpu).
2) ISAs that are enabled for "znver2" architecture.
3) For the time being, it uses the znver1 scheduler model.
4) Tests are updated.
5) Scheduler descriptions are yet to be put in place.

Reviewers: craig.topper

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354897 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[SystemZ] Wait with selection of legal vector/FP constants until Select().
Jonas Paulsson [Tue, 26 Feb 2019 16:47:59 +0000 (16:47 +0000)]
[SystemZ]  Wait with selection of legal vector/FP constants until Select().

This patch aims to make sure that any such constant that can be generated
with a vector instruction (for example VGBM) is recognized as such during
legalization and kept as a target independent node through post-legalize
DAGCombining.

Two new functions named isVectorConstantLegal() and loadVectorConstant()
replace old ways of handling vector/FP constants.

A new struct named SystemZVectorConstantInfo is used to cache the results of
isVectorConstantLegal() and pass them onto loadVectorConstant().

Support for fp128 constants in the presence of FeatureVectorEnhancements1
(z14) has been added.

Review: Ulrich Weigand
https://reviews.llvm.org/D58270

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354896 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[InstSimplify] add tests for rotate; NFC
Sanjay Patel [Tue, 26 Feb 2019 16:44:08 +0000 (16:44 +0000)]
[InstSimplify] add tests for rotate; NFC

Rotate is a special-case of funnel shift that has different
poison constraints than the general case. That's not visible
yet in the existing tests, but it needs to be corrected.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354894 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[InstCombine] remove duplicate (but not updated) tests; NFC
Sanjay Patel [Tue, 26 Feb 2019 15:25:42 +0000 (15:25 +0000)]
[InstCombine] remove duplicate (but not updated) tests; NFC

Not sure how it happened, but rL354886 was a duplicate of rL354881,
but not updated with rL354887.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354889 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[InstCombine] canonicalize more unsigned saturated add with 'not'
Sanjay Patel [Tue, 26 Feb 2019 15:18:49 +0000 (15:18 +0000)]
[InstCombine] canonicalize more unsigned saturated add with 'not'

Yet another pattern variation suggested by:
https://bugs.llvm.org/show_bug.cgi?id=14613

There are 8 more potential commuted patterns here on top of the
8 that were already handled (rL354221, rL354276, rL354393).
We have the obvious commute of the 'add' + commute of the cmp
predicate/operands (ugt/ult) + commute of the select operands:

Name: base
%notx = xor i32 %x, -1
%a = add i32 %notx, %y
%c = icmp ult i32 %x, %y
%r = select i1 %c, i32 -1, i32 %a
=>
%c2 = icmp ult i32 %a, %y
%r = select i1 %c2, i32 -1, i32 %a

Name: ugt
%notx = xor i32 %x, -1
%a = add i32 %notx, %y
%c = icmp ugt i32 %y, %x
%r = select i1 %c, i32 -1, i32 %a
=>
%c2 = icmp ult i32 %a, %y
%r = select i1 %c2, i32 -1, i32 %a

Name: commute select
%notx = xor i32 %x, -1
%a = add i32 %notx, %y
%c = icmp ult i32 %y, %x
%r = select i1 %c, i32 %a, i32 -1
=>
%c2 = icmp ult i32 %a, %y
%r = select i1 %c2, i32 -1, i32 %a

Name: ugt + commute select
%notx = xor i32 %x, -1
%a = add i32 %notx, %y
%c = icmp ugt i32 %x, %y
%r = select i1 %c, i32 %a, i32 -1
=>
%c2 = icmp ult i32 %a, %y
%r = select i1 %c2, i32 -1, i32 %a

https://rise4fun.com/Alive/den

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354887 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[InstCombine] add more tests for saturated add; NFC
Sanjay Patel [Tue, 26 Feb 2019 15:18:44 +0000 (15:18 +0000)]
[InstCombine] add more tests for saturated add; NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354886 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[DAG] Fix constant store folding to handle non-byte sizes.
Nirav Dave [Tue, 26 Feb 2019 15:02:32 +0000 (15:02 +0000)]
[DAG] Fix constant store folding to handle non-byte sizes.

Avoid crashes from zero-byte values due to sub-byte store sizes.

Reviewers: uabelho, courbet, rnk

Reviewed By: courbet

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354884 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[mips] Emit `.module softfloat` directive
Simon Atanasyan [Tue, 26 Feb 2019 14:45:17 +0000 (14:45 +0000)]
[mips] Emit `.module softfloat` directive

This change fixes crash on an assertion in case of using
`soft float` ABI for mips32r6 target.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354882 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[InstCombine] add more tests for saturated add; NFC
Sanjay Patel [Tue, 26 Feb 2019 14:40:23 +0000 (14:40 +0000)]
[InstCombine] add more tests for saturated add; NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354881 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[MCA] Always check if scheduler resources are unavailable when reporting dispatch...
Andrea Di Biagio [Tue, 26 Feb 2019 14:19:00 +0000 (14:19 +0000)]
[MCA] Always check if scheduler resources are unavailable when reporting dispatch stalls.

Dispatch stall cycles may be associated to multiple dispatch stall events.
Before this patch, each stall cycle was associated with a single stall event.
This patch also improves a couple of code comments, and adds a helper method to
query the Scheduler for dispatch stalls.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354877 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[yaml2obj][obj2yaml] - Add support for the architecture specific dynamic tags.
George Rimar [Tue, 26 Feb 2019 14:14:49 +0000 (14:14 +0000)]
[yaml2obj][obj2yaml] - Add support for the architecture specific dynamic tags.

This allows tools to parse/dump the architecture specific tags
like DT_MIPS_*, DT_PPC64_* and DT_HEXAGON_*

Also fixes a bug in DynamicTags.def which was revealed in this patch.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354876 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[AArch64] Add arithmetic zext bswap tests.
Simon Pilgrim [Tue, 26 Feb 2019 13:22:35 +0000 (13:22 +0000)]
[AArch64] Add arithmetic zext bswap tests.

As requested on D58017.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354872 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[llvm-objdump] Add `Version Definitions` dumper
Xing GUO [Tue, 26 Feb 2019 13:06:16 +0000 (13:06 +0000)]
[llvm-objdump] Add `Version Definitions` dumper

Summary: `llvm-objdump` needs a `Version Definitions` dumper.

Reviewers: grimar, jhenderson

Reviewed By: grimar, jhenderson

Subscribers: rupprecht, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354871 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[llvm-objdump] Implement -Mreg-names-raw/-std options.
Igor Kudrin [Tue, 26 Feb 2019 12:15:14 +0000 (12:15 +0000)]
[llvm-objdump] Implement -Mreg-names-raw/-std options.

The --disassembler-options, or -M, are used to customize
the disassembler and affect its output.

The two implemented options allow selecting register names on ARM:
* With -Mreg-names-raw, the disassembler uses rNN for all registers.
* With -Mreg-names-std it prints sp, lr and pc for r13, r14 and r15,
  which is the default behavior of llvm-objdump.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354870 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[AArch64] Add 'free' zext bswap tests.
Simon Pilgrim [Tue, 26 Feb 2019 12:04:37 +0000 (12:04 +0000)]
[AArch64] Add 'free' zext bswap tests.

As requested on D58017.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354869 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[ARM] Add Cortex-M35P
Luke Cheeseman [Tue, 26 Feb 2019 12:02:12 +0000 (12:02 +0000)]
[ARM] Add Cortex-M35P

- Add LLVM backend support for Cortex-M35P
- Documentation can be found at
  https://developer.arm.com/products/processors/cortex-m/cortex-m35p

Differentail Revision: https://reviews.llvm.org/D57763

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354868 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[LegalizeDAG] Use APInt::getSplat helper to create bitreverse masks. NFCI.
Simon Pilgrim [Tue, 26 Feb 2019 11:44:23 +0000 (11:44 +0000)]
[LegalizeDAG] Use APInt::getSplat helper to create bitreverse masks. NFCI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354867 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[LegalizeDAG] Expand SADDO/SSUBO using SADDSAT/SSUBSAT (PR37763)
Simon Pilgrim [Tue, 26 Feb 2019 11:27:53 +0000 (11:27 +0000)]
[LegalizeDAG] Expand SADDO/SSUBO using SADDSAT/SSUBSAT (PR37763)

If SADDSAT/SSUBSAT are legal, then we can expand SADDO/SSUBO by performing a ADD/SUB and a SADDO/SSUBO and then compare the results.

I looked at doing this for UADDO/USUBO as well but as we don't have to do as many range comparisons I didn't see any/much benefit.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354866 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[AMDGPU] Regenerate bswap/bitreverse tests.
Simon Pilgrim [Tue, 26 Feb 2019 11:01:08 +0000 (11:01 +0000)]
[AMDGPU] Regenerate bswap/bitreverse tests.

Make codegen changes more obvious in D58017

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354863 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[llvm-exegesis] Teach llvm-exegesis to handle instructions with multiple tied variables.
Clement Courbet [Tue, 26 Feb 2019 10:54:45 +0000 (10:54 +0000)]
[llvm-exegesis] Teach llvm-exegesis to handle instructions with multiple tied variables.

Reviewers: gchatelet

Subscribers: tschuett, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354862 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[llvm-objcopy] Add --set-start, --change-start and --adjust-start
Eugene Leviant [Tue, 26 Feb 2019 09:24:22 +0000 (09:24 +0000)]
[llvm-objcopy] Add --set-start, --change-start and --adjust-start

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354854 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[ThinLTO] Use defined node and edge order when dumping DOT file
Eugene Leviant [Tue, 26 Feb 2019 07:38:21 +0000 (07:38 +0000)]
[ThinLTO] Use defined node and edge order when dumping DOT file

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354850 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRevert "Improve "llvm-nm -f sysv" output for Elf files"
Vlad Tsyrklevich [Tue, 26 Feb 2019 07:04:56 +0000 (07:04 +0000)]
Revert "Improve "llvm-nm -f sysv" output for Elf files"

This reverts commit r354833, it was causing ASan test failures on
sanitizer-x86_64-linux-fast.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354849 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[NFC] Add to contributor list.
Chen Zheng [Tue, 26 Feb 2019 05:46:45 +0000 (05:46 +0000)]
[NFC] Add to contributor list.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354847 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[WebAssembly] Properly align fp128 arguments in outgoing varargs arguments
Dan Gohman [Tue, 26 Feb 2019 05:20:19 +0000 (05:20 +0000)]
[WebAssembly] Properly align fp128 arguments in outgoing varargs arguments

For outgoing varargs arguments, it's necessary to check the OrigAlign field
of the corresponding OutputArg entry to determine argument alignment, rather
than just computing an alignment from the argument value type. This is
because types like fp128 are split into multiple argument values, with
narrower types that don't reflect the ABI alignment of the full fp128.

This fixes the printf("printfL: %4.*Lf\n", 2, lval); testcase.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354846 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[ARM] Be super conservative about atomics
Philip Reames [Tue, 26 Feb 2019 04:30:33 +0000 (04:30 +0000)]
[ARM] Be super conservative about atomics

As requested during review of D57601 <https://reviews.llvm.org/D57601> https://reviews.llvm.org/D57601, be equally conservative for atomic MMOs as for volatile MMOs in all in tree backends. At the moment, all atomic MMOs are also volatile, but I'm about to change that.

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

Note: D58498 landed in several pieces as individual backends were approved.  This is the last chunk.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354845 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[WebAssembly] Fix a bug deleting instruction in a ranged for loop
Heejin Ahn [Tue, 26 Feb 2019 04:08:49 +0000 (04:08 +0000)]
[WebAssembly] Fix a bug deleting instruction in a ranged for loop

Summary: We shouldn't delete elements while iterating a ranged for loop.

Reviewers: dschuff

Subscribers: sbc100, jgravelle-google, sunfish, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354844 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[WebAssembly] Improve readability of EH tests
Heejin Ahn [Tue, 26 Feb 2019 03:29:59 +0000 (03:29 +0000)]
[WebAssembly] Improve readability of EH tests

Summary:
- Indent check lines to easily figure out try-catch-end structure
- Add the original C++ code the tests were genereated from
- Add a few more lines to make the structure more readable
- Rename a couple function / structures
- Add label and branch annotations to cfg-stackify-eh.ll
- Temporarily delete check lines for `test1` in `cfg-stackify-eh.ll`
  because it will be updated in a later CL soon and there's no point of
  making it look better here

Reviewers: dschuff

Subscribers: sunfish, sbc100, jgravelle-google, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354842 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[CodeView] Emit HasConstructorOrDestructor class option for non-trivial constructors
Aaron Smith [Tue, 26 Feb 2019 03:23:56 +0000 (03:23 +0000)]
[CodeView] Emit HasConstructorOrDestructor class option for non-trivial constructors

Reviewers: zturner, rnk, llvm-commits, aleksandr.urakov

Reviewed By: zturner, rnk

Subscribers: jdoerfert, majnemer, asmith

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354841 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[llvm-cov] Fix llvm-cov on Windows and un-XFAIL test
Reid Kleckner [Tue, 26 Feb 2019 02:30:00 +0000 (02:30 +0000)]
[llvm-cov] Fix llvm-cov on Windows and un-XFAIL test

Summary:
The llvm-cov tool needs to be able to find coverage names in the
executable, so the .lprfn and .lcovmap sections cannot be merged into
.rdata.

Also, the linker merges .lprfn$M into .lprfn, so llvm-cov needs to
handle that when looking up sections. It has to support running on both
relocatable object files and linked PE files.

Lastly, when loading .lprfn from a PE file, llvm-cov needs to skip the
leading zero byte added by the profile runtime.

Reviewers: vsk

Subscribers: hiraditya, #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354840 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Fix bug in x86_intrcc with arg copy elision
Reid Kleckner [Tue, 26 Feb 2019 02:11:25 +0000 (02:11 +0000)]
[X86] Fix bug in x86_intrcc with arg copy elision

Summary:
Use a custom calling convention handler for interrupts instead of fixing
up the locations in LowerMemArgument. This way, the offsets are correct
when constructed and we don't need to account for them in as many
places.

Depends on D56883

Replaces D56275

Reviewers: craig.topper, phil-opp

Subscribers: hiraditya, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354837 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoImprove "llvm-nm -f sysv" output for Elf files
Sunil Srivastava [Tue, 26 Feb 2019 00:19:39 +0000 (00:19 +0000)]
Improve "llvm-nm -f sysv" output for Elf files

Specifically, compute and Print Type and Section columns.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354833 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[AMDGPU] Added target to mir test. NFC.
Stanislav Mekhanoshin [Mon, 25 Feb 2019 22:59:55 +0000 (22:59 +0000)]
[AMDGPU] Added target to mir test. NFC.

Test was used without -mcpu, although tested instructions
not available on all ASICs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354830 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRegBankSelect: Handle slightly more complex value mappings
Matt Arsenault [Mon, 25 Feb 2019 22:24:13 +0000 (22:24 +0000)]
RegBankSelect: Handle slightly more complex value mappings

Try to use concat_vectors. Also remove unnecessary assert on
pointers. Fixes asserting for <4 x s16> operations and 64-bit pointers
for AMDGPU.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354828 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoAMDGPU/GlobalISel: Fix bit ops for non-power-of-2 sizes
Matt Arsenault [Mon, 25 Feb 2019 21:32:48 +0000 (21:32 +0000)]
AMDGPU/GlobalISel: Fix bit ops for non-power-of-2 sizes

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354825 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRevert "[Support] Make raw_string_ostream unbuffered"
Roman Lebedev [Mon, 25 Feb 2019 21:11:19 +0000 (21:11 +0000)]
Revert "[Support] Make raw_string_ostream unbuffered"

Shame on me, did not run all the tests, bots are angry.

This reverts commit r354819.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354822 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[LangRef] *.overflow intrinsics now support vectors
Simon Pilgrim [Mon, 25 Feb 2019 21:05:09 +0000 (21:05 +0000)]
[LangRef] *.overflow intrinsics now support vectors

We have all the necessary legalization, expansion and unrolling support required for the *.overflow intrinsics with vector types, so update the docs to make that clear.

Note: vectorization is not in place yet (the non-homogenous return types aren't well supported) so we still must explicitly use the vectors intrinsics and not reply on slp/loop.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354821 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Support] Make raw_string_ostream unbuffered
Roman Lebedev [Mon, 25 Feb 2019 20:51:49 +0000 (20:51 +0000)]
[Support] Make raw_string_ostream unbuffered

Summary:
In D58580 i have noted that `llvm::to_string()` is a memory hog.
It uses `raw_string_ostream`, and since it was buffered,
every `raw_string_ostream` had a cost of `BUFSIZ` bytes
(which is `8192` at least here). So every `llvm::to_string()`
call, even to just print an `int`, costed `8192` bytes.

In D58580, getting rid of that buffering //had// significant
performance and memory consumption improvements for `llvm-xray convert`.

Similarly, in D58580 @rnk pointed out that the `raw_svector_ostream`
is already unbuffered, and `write_unsigned_impl` and friends
do internal buffering. So it should be ok performance-wise to just
make the `raw_string_ostream` itself unbuffered.

Here, i don't have any perf measurements.
Another letdown is that i'm leaving a loose-end - not deleting the
`flush()` method. I  don't expect that cleanup to be anything more
than just fixing every new compiler error, but i'm presently unable
to do that. Will look into that later.

Reviewers: rnk, zturner

Reviewed By: rnk

Subscribers: kristina, jdoerfert, llvm-commits, rnk

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354819 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoAMDGPU/GlobalISel: Clamp max implicit_def elements
Matt Arsenault [Mon, 25 Feb 2019 20:46:06 +0000 (20:46 +0000)]
AMDGPU/GlobalISel: Clamp max implicit_def elements

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354818 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRegisterScavenger: Allow fail without spill
Matt Arsenault [Mon, 25 Feb 2019 20:29:04 +0000 (20:29 +0000)]
RegisterScavenger: Allow fail without spill

AMDGPU wants to use this in some contexts where
the spilling is either impossible, or a worse alternative
to doing something else.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354816 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoAMDGPU: Remove IntrReadMem from memtime/memrealtime intrinsics
Matt Arsenault [Mon, 25 Feb 2019 20:16:11 +0000 (20:16 +0000)]
AMDGPU: Remove IntrReadMem from memtime/memrealtime intrinsics

EarlyCSE with MemorySSA was able to use this to merge multiple calls
with no intervening store.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354814 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoGlobalISel: Make legalizer/regbankselect clear NoPHIs property
Matt Arsenault [Mon, 25 Feb 2019 20:00:25 +0000 (20:00 +0000)]
GlobalISel: Make legalizer/regbankselect clear NoPHIs property

If no phi existed in the original MIR and these introduced one, the
verifier would fail.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354813 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Improve detection of unneeded shift amount masking to also handle the case...
Craig Topper [Mon, 25 Feb 2019 19:42:47 +0000 (19:42 +0000)]
[X86] Improve detection of unneeded shift amount masking to also handle the case that the LHS has known zeroes in it

If the LHS has known zeros, the RHS immediate will have had bits removed. So call computeKnownBits to get the known zeroes so we can handle this case.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354811 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoFix a sign compare warning breaking the -Werror build.
Andrea Di Biagio [Mon, 25 Feb 2019 19:33:58 +0000 (19:33 +0000)]
Fix a sign compare warning breaking the -Werror build.

The warning was introduced at r354793.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354810 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoAMDGPU: Correct definitions for bitset instructions
Matt Arsenault [Mon, 25 Feb 2019 19:24:46 +0000 (19:24 +0000)]
AMDGPU: Correct definitions for bitset instructions

These really read and write the result register, so these need a tied
input.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354809 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Mips] Fix missing masking in fast-isel of br (PR40325)
Nikita Popov [Mon, 25 Feb 2019 18:54:17 +0000 (18:54 +0000)]
[Mips] Fix missing masking in fast-isel of br (PR40325)

Fixes https://bugs.llvm.org/show_bug.cgi?id=40325 by zero extending
(and x, 1) the condition before branching on it.

To avoid regressing trivial cases, I'm combining emission of cmp+br
sequences for the single-use + same block case (similar to what we
do in x86). icmpbr1.ll still regresses due to the cross-bb usage
of the condition.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354808 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[AArch64][GlobalISel] Refactor selectBuildVector to use MachineIRBuilder. NFC.
Amara Emerson [Mon, 25 Feb 2019 18:52:54 +0000 (18:52 +0000)]
[AArch64][GlobalISel] Refactor selectBuildVector to use MachineIRBuilder. NFC.

This is a preparatory change as I want to use emitScalarToVector() elsewhere,
and in general we want to transition to MIRBuilder instead of using BuildMI
directly.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354807 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Lanai] Be super conservative about atomics
Philip Reames [Mon, 25 Feb 2019 17:36:10 +0000 (17:36 +0000)]
[Lanai] Be super conservative about atomics

As requested during review of D57601 <https://reviews.llvm.org/D57601>, be equally conservative for atomic MMOs as for volatile MMOs in all in tree backends. At the moment, all atomic MMOs are also volatile, but I'm about to change that.

Reviewed as part of https://reviews.llvm.org/D58490, with other backends still pending review.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354800 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[SelectionDAG] Add demanded elts variants to isConstOrConstSplat helpers. NFCI.
Simon Pilgrim [Mon, 25 Feb 2019 16:31:58 +0000 (16:31 +0000)]
[SelectionDAG] Add demanded elts variants to isConstOrConstSplat helpers. NFCI.

These helpers extend the existing isConstOrConstSplat helper checks to support DemandedElts masks as well.

We already had a local version of this in SelectionDAG that computeKnownBits/ComputeNumSignBits made use of, but this adds the functionality directly to the BuildVectorSDNode node and extends isConstOrConstSplat etc. to use that.

This will allow us to reuse the functionality in SimplifyDemandedVectorElts/SimplifyDemandedBits.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354797 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[DAGCombine] Add undef shuffle elt support to partitionShuffleOfConcats
Simon Pilgrim [Mon, 25 Feb 2019 16:02:01 +0000 (16:02 +0000)]
[DAGCombine] Add undef shuffle elt support to partitionShuffleOfConcats

Support undef shuffle mask indices in the shuffle(concat_vectors, concat_vectors) -> concat_vectors fold

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354793 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[ARM] Add some more missing T1 opcodes for the peephole optimisier
David Green [Mon, 25 Feb 2019 15:50:54 +0000 (15:50 +0000)]
[ARM] Add some more missing T1 opcodes for the peephole optimisier

This adds a few extra Thumb1 opcodes to improve the peephole opimisers
ability to remove redundant cmp instructions. tADC and tSBC require
a small fixup to prevent MOVS being moved past the instruction, giving
the wrong flags.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354791 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Vectorizer] Add vectorization support for fixed smul/umul intrinsics
Simon Pilgrim [Mon, 25 Feb 2019 15:42:02 +0000 (15:42 +0000)]
[Vectorizer] Add vectorization support for fixed smul/umul intrinsics

This requires a couple of tweaks to existing vectorization functions as they were assuming that only the second call argument (ctlz/cttz/powi) could ever be the 'always scalar' argument, but for smul.fix + umul.fix its the third argument.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354790 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[AArch64] Add support for Cortex-A76 and Cortex-A76AE
Luke Cheeseman [Mon, 25 Feb 2019 15:08:27 +0000 (15:08 +0000)]
[AArch64] Add support for Cortex-A76 and Cortex-A76AE

- Add LLVM backend support for Cortex-A76 and Cortex-A76AE
- Documentation can be found at
  https://developer.arm.com/products/processors/cortex-a/cortex-a76

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354788 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[llvm-objcopy] Add --add-symbol
Eugene Leviant [Mon, 25 Feb 2019 14:12:41 +0000 (14:12 +0000)]
[llvm-objcopy] Add --add-symbol

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354787 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoFixed typos in tests: s/CHEKC/CHECK/
Dmitri Gribenko [Mon, 25 Feb 2019 13:41:59 +0000 (13:41 +0000)]
Fixed typos in tests: s/CHEKC/CHECK/

Reviewers: ilya-biryukov

Subscribers: nemanjai, javed.absar, jsji, cfe-commits, llvm-commits

Tags: #clang, #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354785 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[TTI] Add generic cost model for smul/umul overflow intrinsics
Simon Pilgrim [Mon, 25 Feb 2019 13:30:23 +0000 (13:30 +0000)]
[TTI] Add generic cost model for smul/umul overflow intrinsics

Based off smul/umul fixed costs and the implementation in TargetLowering::expandMULO.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354784 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[SLPVectorizer][X86] Add fixed smul/umul tests
Simon Pilgrim [Mon, 25 Feb 2019 13:26:30 +0000 (13:26 +0000)]
[SLPVectorizer][X86] Add fixed smul/umul tests

Baseline tests - fixed mul intrinsics aren't flagged as vectorizable yet

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354783 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[llvm-objdump] Add `Version References` dumper
Xing GUO [Mon, 25 Feb 2019 13:13:19 +0000 (13:13 +0000)]
[llvm-objdump] Add `Version References` dumper

Summary: Add symbol version dumper for [#30241](https://bugs.llvm.org/show_bug.cgi?id=30241)

Reviewers: jhenderson, MaskRay, kristina, emaste, grimar

Reviewed By: jhenderson, grimar

Subscribers: grimar, rupprecht, jakehehrlich, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354782 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoFixed typos in tests: s/CEHCK/CHECK/
Dmitri Gribenko [Mon, 25 Feb 2019 13:12:33 +0000 (13:12 +0000)]
Fixed typos in tests: s/CEHCK/CHECK/

Reviewers: ilya-biryukov

Subscribers: sanjoy, sdardis, javed.absar, jrtc27, atanasyan, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354781 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoTest commit (remove a blank space)
Ganesh Gopalasubramanian [Mon, 25 Feb 2019 12:27:49 +0000 (12:27 +0000)]
Test commit (remove a blank space)

Change-Id: I69175571d3b1defeb85e96fdd87db5c3ccadcb63

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354775 91177308-0d34-0410-b5e6-96231b3b80d8