]> granicus.if.org Git - llvm/log
llvm
6 years agoFix SupportTests.exe/AllocationTests/MappedMemoryTest.AllocAndReleaseHuge when the...
Alexandre Ganea [Thu, 28 Feb 2019 03:42:07 +0000 (03:42 +0000)]
Fix SupportTests.exe/AllocationTests/MappedMemoryTest.AllocAndReleaseHuge when the machine doesn't have large pages enabled.

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

6 years agoFix non-Windows platforms build break introduced by r355065. Fixes:
Alexandre Ganea [Thu, 28 Feb 2019 03:03:07 +0000 (03:03 +0000)]
Fix non-Windows platforms build break introduced by r355065. Fixes:

In file included from /home/buildbots/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/llvm/lib/Support/Memory.cpp:14:
/home/buildbots/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/llvm/include/llvm/Support/Memory.h:38:14: error: private field 'Flags' is not used [-Werror,-Wunused-private-field]
    unsigned Flags = 0;
             ^
1 error generated.

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

6 years ago[Memory] Add basic support for large/huge memory pages
Alexandre Ganea [Thu, 28 Feb 2019 02:47:34 +0000 (02:47 +0000)]
[Memory] Add basic support for large/huge memory pages

This patch introduces Memory::MF_HUGE_HINT which indicates that allocateMappedMemory() shall return a pointer to a large memory page.
However the flag is a hint because we're not guaranteed in any way that we will get back a large memory page. There are several restrictions:

- Large/huge memory pages aren't enabled by default on modern OSes (Windows 10 and Linux at least), and should be manually enabled/reserved.
- Once enabled, it should be kept in mind that large pages are physical only, they can't be swapped.
- Memory fragmentation can affect the availability of large pages, especially after running the OS for a long time and/or running along many other applications.

Memory::allocateMappedMemory() will fallback to 4KB pages if it can't allocate 2MB large pages (if Memory::MF_HUGE_HINT is provided)

Currently, Memory::MF_HUGE_HINT only works on Windows. The hint will be ignored on Linux, 4KB pages will always be returned.

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

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

6 years agoTemporarily revert "ArgumentPromotion should copy all metadata to new Function" and...
Eric Christopher [Thu, 28 Feb 2019 01:11:12 +0000 (01:11 +0000)]
Temporarily revert "ArgumentPromotion should copy all metadata to new Function" and the dependent patch "Refine ArgPromotion metadata handling" as they're causing segfaults in argument promotion.

This reverts commits r354032 and r353537.

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

6 years ago[X86] Use X86::LAST_VALID_COND instead of assuming X86::COND_S is the last encoding...
Craig Topper [Thu, 28 Feb 2019 01:00:31 +0000 (01:00 +0000)]
[X86] Use X86::LAST_VALID_COND instead of assuming X86::COND_S is the last encoding. NFC

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

6 years agoAMDGPU/GlobalISel: Add regbankselect test for phis
Matt Arsenault [Thu, 28 Feb 2019 00:52:36 +0000 (00:52 +0000)]
AMDGPU/GlobalISel: Add regbankselect test for phis

Add baseline for future fixes. These mostly show how this is broken
and producing illegal situations.

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

6 years agoAMDGPU: Fix typo
Matt Arsenault [Thu, 28 Feb 2019 00:52:33 +0000 (00:52 +0000)]
AMDGPU: Fix typo

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

6 years agoAMDGPU: Enable function calls by default
Matt Arsenault [Thu, 28 Feb 2019 00:40:32 +0000 (00:40 +0000)]
AMDGPU: Enable function calls by default

Fixes some crashes on illegal call situations which are unfortunately
still valid IR.

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

6 years ago[AArch64] Generate FP16 vector compare instructions.
Abderrazek Zaafrani [Thu, 28 Feb 2019 00:31:38 +0000 (00:31 +0000)]
[AArch64] Generate FP16 vector compare instructions.
https://reviews.llvm.org/D58561

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

6 years agoAMDGPU: Fix crashes in invalid call cases
Matt Arsenault [Thu, 28 Feb 2019 00:28:44 +0000 (00:28 +0000)]
AMDGPU: Fix crashes in invalid call cases

We have to at least tolerate calls to kernels, possibly with a
mismatched calling convention on the callsite.

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

6 years agoGlobalISel: Implement fewerElementsVector for phi
Matt Arsenault [Thu, 28 Feb 2019 00:16:32 +0000 (00:16 +0000)]
GlobalISel: Implement fewerElementsVector for phi

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

6 years agoGlobalISel: Implement moreElementsVector for phi
Matt Arsenault [Thu, 28 Feb 2019 00:01:05 +0000 (00:01 +0000)]
GlobalISel: Implement moreElementsVector for phi

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

6 years ago[InstrProf] Use separate comdat group for data and counters
Reid Kleckner [Wed, 27 Feb 2019 23:38:44 +0000 (23:38 +0000)]
[InstrProf] Use separate comdat group for data and counters

Summary:
I hadn't realized that instrumentation runs before inlining, so we can't
use the function as the comdat group. Doing so can create relocations
against discarded sections when references to discarded __profc_
variables are inlined into functions outside the function's comdat
group.

In the future, perhaps we should consider standardizing the comdat group
names that ELF and COFF use. It will save object file size, since
__profv_$sym won't appear in the symbol table again.

Reviewers: xur, vsk

Subscribers: eraman, hiraditya, cfe-commits, #sanitizers, llvm-commits

Tags: #clang, #sanitizers, #llvm

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

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

6 years ago[MemorySSA] Make insertDef insert corresponding phi nodes.
Alina Sbirlea [Wed, 27 Feb 2019 22:20:22 +0000 (22:20 +0000)]
[MemorySSA] Make insertDef insert corresponding phi nodes.

Summary:
The original assumption for the insertDef method was that it would not
materialize Defs out of no-where, hence it will not insert phis needed
after inserting a Def.

However, when cloning an instruction (use case used in LICM), we do
materialize Defs "out of no-where". If the block receiving a Def has at
least one other Def, then no processing is needed. If the block just
received its first Def, we must check where Phi placement is needed.
The only new usage of insertDef is in LICM, hence the trigger for the bug.

But the original goal of the method also fails to apply for the move()
method. If we move a Def from the entry point of a diamond to either the
left or right blocks, then the merge block must add a phi.
While this usecase does not currently occur, or may be viewed as an
incorrect transformation, MSSA must behave corectly given the scenario.

Resolves PR40749 and PR40754.

Reviewers: george.burgess.iv

Subscribers: sanjoy, jlebar, Prazek, jdoerfert, llvm-commits

Tags: #llvm

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

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

6 years agoDefault to Secure PLT on PPC for NetBSD and OpenBSD.
Joerg Sonnenberger [Wed, 27 Feb 2019 21:53:14 +0000 (21:53 +0000)]
Default to Secure PLT on PPC for NetBSD and OpenBSD.
This matches the default settings of clang.

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

6 years agoFixup compilation/test failures after r354960 and r355013.
James Y Knight [Wed, 27 Feb 2019 21:47:35 +0000 (21:47 +0000)]
Fixup compilation/test failures after r354960 and r355013.

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

6 years ago[llvm-cxxfilt] Re-enable split and demangle stdin input on certain non-alphanumerics.
Matt Davis [Wed, 27 Feb 2019 21:39:11 +0000 (21:39 +0000)]
[llvm-cxxfilt] Re-enable split and demangle stdin input on certain non-alphanumerics.

This restores the patch that splits demangled stdin input on
non-alphanumerics.  I had reverted this patch earlier because it broke
Windows build-bots.  I have updated the test so that it passes on
Windows.

I was running the test from powershell and never saw the issue until I
switched to the mingw shell.

This reverts commit 628ab5c6820bdf3bb5a8e494b0fd9e7312ce7150.

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

6 years ago[hwasan, asan] Intercept vfork.
Evgeniy Stepanov [Wed, 27 Feb 2019 21:11:50 +0000 (21:11 +0000)]
[hwasan, asan] Intercept vfork.

Summary:
Intercept vfork on arm, aarch64, i386 and x86_64.

Reviewers: pcc, vitalybuka

Subscribers: kubamracek, mgorny, javed.absar, krytarowski, kristof.beyls, #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

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

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

6 years agoSeperate volatility and atomicity/ordering in SelectionDAG
Philip Reames [Wed, 27 Feb 2019 20:20:08 +0000 (20:20 +0000)]
Seperate volatility and atomicity/ordering in SelectionDAG

At the moment, we mark every atomic memory access as being also volatile. This is unnecessarily conservative and prohibits many legal transforms (DCE, folding, etc..).

This patch removes MOVolatile from the MachineMemOperands of atomic, but not volatile, instructions. This should be strictly NFC after a series of previous patches which have gone in to ensure backend code is conservative about handling of isAtomic MMOs. Once it's in and baked for a bit, we'll start working through removing unnecessary bailouts one by one. We applied this same strategy to the middle end a few years ago, with good success.

To make sure this patch itself is NFC, it is build on top of a series of other patches which adjust code to (for the moment) be as conservative for an atomic access as for a volatile access and build up a test corpus (mostly in test/CodeGen/X86/atomics-unordered.ll)..

Previously landed

    D57593 Fix a bug in the definition of isUnordered on MachineMemOperand
    D57596 [CodeGen] Be conservative about atomic accesses as for volatile
    D57802 Be conservative about unordered accesses for the moment
    rL353959: [Tests] First batch of cornercase tests for unordered atomics.
    rL353966: [Tests] RMW folding tests w/unordered atomic operations.
    rL353972: [Tests] More unordered atomic lowering tests.
    rL353989: [SelectionDAG] Inline a single use helper function, and remove last non-MMO interface
    rL354740: [Hexagon, SystemZ] Be super conservative about atomics
    rL354800: [Lanai] Be super conservative about atomics
    rL354845: [ARM] Be super conservative about atomics

Attention Out of Tree Backend Owners: This patch may break you. If it does, you can use the TLI getMMOFlags hook to restore the MOVolatile to any instruction you need to. (See llvm-dev thread titled "PSA: Changes to how atomics are handled in backends" started Feb 27, 2019.)

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

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

6 years agoFixed ubsan failures in r355005.
Rong Xu [Wed, 27 Feb 2019 20:01:14 +0000 (20:01 +0000)]
Fixed ubsan failures in r355005.

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

6 years agoRevert "[llvm-cxxfilt] Split and demangle stdin input on certain non-alphanumerics."
Matt Davis [Wed, 27 Feb 2019 19:52:02 +0000 (19:52 +0000)]
Revert "[llvm-cxxfilt] Split and demangle stdin input on certain non-alphanumerics."

This reverts commit 5cd5f8f2563395f8767f94604eb4c4bea8dcbea0.
The test passes on linux, but fails on the windows build-bots.

This test failure seems to be a quoting issue between my test and
FileCheck on Windows.  I'm reverting this patch until I can replicate
and fix in my Windows environment.

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

6 years ago[InstCombine] add tests for add+ext+add; NFC
Sanjay Patel [Wed, 27 Feb 2019 19:27:45 +0000 (19:27 +0000)]
[InstCombine] add tests for add+ext+add; NFC

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

6 years ago[X86][AVX] Pull out some INSERT_SUBVECTOR combines into a combineConcatVectorOps...
Simon Pilgrim [Wed, 27 Feb 2019 18:46:32 +0000 (18:46 +0000)]
[X86][AVX] Pull out some INSERT_SUBVECTOR combines into a combineConcatVectorOps helper. NFCI

A lot of the INSERT_SUBVECTOR combines can be more generally handled as if they have come from a CONCAT_VECTORS node.

I've been investigating adding a CONCAT_VECTORS combine to X86, but this is a much easier first step that avoids the issue of handling a number of pre-legalization issues that I've encountered.

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

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

6 years ago[llvm-readobj] Print section type values for unknown sections.
Matt Davis [Wed, 27 Feb 2019 18:39:17 +0000 (18:39 +0000)]
[llvm-readobj] Print section type values for unknown sections.

Summary:
This patch displays a hexadecimal section value (Elf_Shdr::sh_type) or section-relative offset when printing unknown sections.

Here is a subset of the output (ignoring the fields following "Type" when dumping an ELF's GNU `--section-headers` table).
Section Headers:
```
  [Nr] Name              Type
  [16] android_rel       LOOS+0x1
  [17] android_rela      LOOS+0x2
  [27] unknown           0x1000: <unknown>
  [28] loos              LOOS+0
  [30] hios              VERSYM
  [31] loproc            LOPROC+0
  [33] hiproc            LOPROC+0xFFFFFFF
  [34] louser            LOUSER+0
  [36] hiuser            LOUSER+0x7FFFFFFF
```

As a comparison, the previous output looked something like the above, but with a blank "Type" field:
```
  [Nr] Name              Type
  [27] unknown
  [28] loos
  [30] hios              VERSYM
  [31] loproc
  [33] hiproc
  [34] louser
  [36] hiuser
```

This fixes PR40773

Reviewers: jhenderson, rupprecht, Bigcheese

Reviewed By: jhenderson, rupprecht, Bigcheese

Subscribers: MaskRay, Bigcheese, srhines, jdoerfert, llvm-commits

Tags: #llvm

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

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

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