OSDN Git Service

android-x86/external-llvm.git
5 years ago[MCA] Make the bool conversion operator in class InstRef explicit. NFCI
Andrea Di Biagio [Thu, 23 May 2019 10:50:01 +0000 (10:50 +0000)]
[MCA] Make the bool conversion operator in class InstRef explicit. NFCI

This patch makes the bool conversion operator in InstRef explicit.
It also adds a operator< to hel comparing InstRef objects in sets.

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

5 years ago[DwarfExpression] Refactor dwarf expression (NFC)
Petar Jovanovic [Thu, 23 May 2019 10:37:13 +0000 (10:37 +0000)]
[DwarfExpression] Refactor dwarf expression (NFC)

Refactor location description kind in order to be easier for extensions
(needed for D60866).
In addition, cut off some bits from the other class fields.

Patch by Djordje Todorovic.

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

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

5 years ago[llvm-objdump][test] Improve testing of some switches #2
James Henderson [Thu, 23 May 2019 10:17:10 +0000 (10:17 +0000)]
[llvm-objdump][test] Improve testing of some switches #2

This patch focuses on adding additional testing for the --source switch.
For reference, the source-interleave-x86_64.ll test file has been split
into two parts - the input (shared with the other tests) and the test
itself.

Reviewed by: MaskRay, rupprecht, grimar

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

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

5 years ago[llvm-objcopy] - Many minor NFC changes to cleanup/improve the code in ELF/Object...
George Rimar [Thu, 23 May 2019 09:18:57 +0000 (09:18 +0000)]
[llvm-objcopy] - Many minor NFC changes to cleanup/improve the code in ELF/Object.cpp.

The code in ELF/Object.cpp is sometimes a bit hard to read because of
lots of auto used everywhere. The main intention of this patch is
to replace them with the real type for places where it is not obvious.
Also it cleanups few places.

It is NFC change, but I want to be sure that there is no objections to do that since it
is massive.

DIfferential revision: https://reviews.llvm.org/D62260

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

5 years ago[ARM][CGP] Clear SafeWrap before each search
Sam Parker [Thu, 23 May 2019 07:46:39 +0000 (07:46 +0000)]
[ARM][CGP] Clear SafeWrap before each search

The previous patch added a member set to store instructions that we
could allow to wrap. But this wasn't cleared between searches meaning
that they could get promoted, incorrectly, during the promotion of a
separate valid chain.

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

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

5 years ago[GlobalOpt] recognize dead struct fields and propagate values
Christian Bruel [Thu, 23 May 2019 05:53:10 +0000 (05:53 +0000)]
[GlobalOpt] recognize dead struct fields and propagate values

Summary:
Allow struct fields SRA and dead stores. This works by considering fields accesses from getElementPtr to be considered as a possible pointer root that can be cleaned up.
We check that the variable can be SRA by recursively checking the sub expressions with the new isSafeSubSROAGEP function.

basically this allows the array in following C code  to be optimized out

struct Expr {
  int a[2];
  int b;
};

static struct Expr e;

int foo (int i)
{
  e.b = 2;
  e.a[i] = 1;
  return e.b;
}

Reviewers: greened, bkramer, nicholas, jmolloy

Reviewed By: jmolloy

Subscribers: llvm-commits

Tags: #llvm

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

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

5 years ago[WebAssembly] Implement __builtin_return_address for emscripten
Thomas Lively [Thu, 23 May 2019 01:24:01 +0000 (01:24 +0000)]
[WebAssembly] Implement __builtin_return_address for emscripten

Summary:
In this patch, `ISD::RETURNADDR` is lowered on the emscripten target
to the new Emscripten runtime function `emscripten_return_address`, which
implements the functionality.

Patch by Guanzhong Chen

Reviewers: tlively, aheejin

Reviewed By: tlively

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

Tags: #llvm

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

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

5 years ago[X86] Support -fno-plt __tls_get_addr calls
Fangrui Song [Thu, 23 May 2019 01:05:13 +0000 (01:05 +0000)]
[X86] Support -fno-plt __tls_get_addr calls

In general dynamic/local dynamic TLS models, with -fno-plt,

* x86: emit `calll *___tls_get_addr@GOT(%ebx)` instead of `calll ___tls_get_addr@PLT`
  Note, on x86, if we can get rid of %ebx as the PIC register,
  it may be better to use a register not preserved across function calls.
* x86_64: emit `callq *__tls_get_addr@GOTPCREL(%rip)` instead of `callq __tls_get_addr@PLT`

Reorganize the code by separating 32-bit and 64-bit.

Reviewed By: rnk

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

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

5 years ago[llvm-objcopy] Add file names to error messages
Seiya Nuta [Thu, 23 May 2019 00:42:46 +0000 (00:42 +0000)]
[llvm-objcopy] Add file names to error messages

Summary:
This patch adds the file names to llvm-objcopy error messages. It makes easy to identify which file causes an error.

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

Reviewers: espindola, alexshap, rupprecht, jhenderson, jakehehrlich

Reviewed By: rupprecht, jhenderson, jakehehrlich

Subscribers: emaste, arichardson, jakehehrlich, MaskRay, llvm-commits

Tags: #llvm

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

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

5 years agogn build: Merge r361418.
Peter Collingbourne [Thu, 23 May 2019 00:31:55 +0000 (00:31 +0000)]
gn build: Merge r361418.

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

5 years ago[FileCheck] Introduce substitution subclasses
Thomas Preud'homme [Thu, 23 May 2019 00:10:29 +0000 (00:10 +0000)]
[FileCheck] Introduce substitution subclasses

Summary:
With now a clear distinction between string and numeric substitutions,
this patch introduces separate classes to represent them with a parent
class implementing the common interface. Diagnostics in
printSubstitutions() are also adapted to not require knowing which
substitution is being looked at since it does not hinder clarity and
makes the implementation simpler.

Reviewers: jhenderson, jdenny, probinson, arichardson

Subscribers: llvm-commits, probinson, arichardson, hiraditya

Tags: #llvm

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

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

5 years agoFileCheck: Improve FileCheck variable terminology
Thomas Preud'homme [Thu, 23 May 2019 00:10:14 +0000 (00:10 +0000)]
FileCheck: Improve FileCheck variable terminology

Summary:
Terminology introduced by [[#]] blocks is confusing and does not
integrate well with existing terminology.

First, variables referred by [[]] blocks are called "pattern variables"
while the text a CHECK directive needs to match is called a "CHECK
pattern". This is inconsistent with variables in [[#]] blocks since
[[#]] blocks are also found in CHECK pattern yet those variables are
called "numeric variable".

Second, the replacing of both [[]] and [[#]] blocks by the value of the
variable or expression they contain is represented by a
FileCheckPatternSubstitution class. The naming refers to being a
substitution in a CHECK pattern but could be wrongly understood as being
a substitution of a pattern variable.

Third and lastly, comments use "numeric expression" to refer both to the
[[#]] blocks as well as to the numeric expressions these blocks contain
which get evaluated at match time.

This patch solves these confusions by
- calling variables in [[]] and [[#]] blocks as string and numeric
  variables respectively;
- referring to [[]] and [[#]] as substitution *blocks*, with the former
  being a string substitution block and the latter a numeric
  substitution block;
- calling [[]] and [[#]] blocks to be replaced by the value of a
  variable or expression they contain a substitution (as opposed to
  definition when these blocks are used to defined a variable), with the
  former being a string substitution and the latter a numeric
  substitution;
- renaming the FileCheckPatternSubstitution as a FileCheckSubstitution
  class with FileCheckStringSubstitution and
  FileCheckNumericSubstitution subclasses;
- restricting the use of "numeric expression" to refer to the expression
  that is evaluated in a numeric substitution.

While numeric substitution blocks only support numeric substitutions of
numeric expressions at the moment there are plans to augment numeric
substitution blocks to support numeric definitions as well as both a
numeric definition and numeric substitution in the same numeric
substitution block.

Reviewers: jhenderson, jdenny, probinson, arichardson

Subscribers: hiraditya, arichardson, probinson, llvm-commits

Tags: #llvm

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

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

5 years ago[ORC] Remove a stray decl that accidentally found its way in to r361322.
Lang Hames [Wed, 22 May 2019 22:57:40 +0000 (22:57 +0000)]
[ORC] Remove a stray decl that accidentally found its way in to r361322.

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

5 years ago[docs] Make a note of the HowToUseLLJIT example in the ORCv2 design doc.
Lang Hames [Wed, 22 May 2019 21:44:46 +0000 (21:44 +0000)]
[docs] Make a note of the HowToUseLLJIT example in the ORCv2 design doc.

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

5 years ago[Runtimes] If LLVM_INCLUDE_TESTS=On depend on gtest
Chris Bieneman [Wed, 22 May 2019 21:42:06 +0000 (21:42 +0000)]
[Runtimes] If LLVM_INCLUDE_TESTS=On depend on gtest

Summary: If we are building the tests for the runtimes we should make them depend on gtest so that gtest is built and ready before we run any of the check-* targets.

Reviewers: phosek, compnerd

Reviewed By: compnerd

Subscribers: mgorny, winksaville, llvm-commits

Tags: #llvm

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

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

5 years agoAdd a HowToUseLLJIT example project.
Lang Hames [Wed, 22 May 2019 21:38:41 +0000 (21:38 +0000)]
Add a HowToUseLLJIT example project.

A very minimal demo of how to use the LLJIT class, along the lines of the old
HowToUseJIT example.

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

5 years agoTableGen: Handle nontrivial foreach range bounds
Matt Arsenault [Wed, 22 May 2019 21:28:20 +0000 (21:28 +0000)]
TableGen: Handle nontrivial foreach range bounds

This allows using anything that isn't a literal integer as the bounds
for a foreach. Some of the diagnostics aren't perfect, but nobody ever
accused tablegen of having good errors. For example, the existing
wording suggests a bitrange is valid, but as far as I can tell this
has never worked.

Fixes bug 41958.

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

5 years ago[runtimes] Move libunwind, libc++abi and libc++ to lib/$target/c++ and include/c++
Petr Hosek [Wed, 22 May 2019 21:08:33 +0000 (21:08 +0000)]
[runtimes] Move libunwind, libc++abi and libc++ to lib/$target/c++ and include/c++

This change is a consequence of the discussion in "RFC: Place libs in
Clang-dedicated directories", specifically the suggestion that
libunwind, libc++abi and libc++ shouldn't be using Clang resource
directory. Tools like clangd make this assumption, but this is
currently not true for the LLVM_ENABLE_PER_TARGET_RUNTIME_DIR build.
This change addresses that by moving the output of these libraries to
lib/$target/c++ and include/c++ directories, leaving resource directory
only for compiler-rt runtimes and Clang builtin headers.

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

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

5 years ago[X86] Explcitly disable VEXTRACT instruction matching for an immediate of 0. Remove...
Craig Topper [Wed, 22 May 2019 21:00:18 +0000 (21:00 +0000)]
[X86] Explcitly disable VEXTRACT instruction matching for an immediate of 0. Remove a bunch of isel patterns that become unnecessary.

We effectively had a second set of isel patterns that tried to use a
regular store instruction and an extract_subreg instruction. Or a masked move
and an extract_subreg. These patterns were intended to override the
matching of VEXTRACT instructions by taking advantage of the priority
of the explicit immediate 0 for the index.

This patch instaed just disables the immediate 0 matchin the VEXTRACT
patterns. This each of the component pieces of the larger patterns will
match by themselves.

This found a bug of sorts were we didn't use 128-bit store for 512->128
extract on KNL. Its unclear what the right thing here should be.
Using the vextract avoids constraining the register allocator to use
xmm0-15. But it always results in a longer encoding if the register
allocator ends up choosing xmm0-15 anyway.

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

5 years agoReverted r361134 because of a failing test left unattended for a long time.
Galina Kistanova [Wed, 22 May 2019 20:42:56 +0000 (20:42 +0000)]
Reverted r361134 because of a failing test left unattended for a long time.

http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win/builds/17792/steps/test-check-all/logs/stdio
Failing Tests (1):
    LLVM :: CodeGen/AMDGPU/regbank-reassign.mir

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

5 years ago[X86][InstCombine] Remove InstCombine code that turns X86 round intrinsics into llvm...
Craig Topper [Wed, 22 May 2019 20:04:55 +0000 (20:04 +0000)]
[X86][InstCombine] Remove InstCombine code that turns X86 round intrinsics into llvm.ceil/floor. Remove some isel patterns that existed because that was happening.

We were turning roundss/sd/ps/pd intrinsics with immediates of 1 or 2 into
llvm.floor/ceil.  The llvm.ceil/floor intrinsics are supposed to correspond
to the libm functions.  For the libm functions we need to disable the
precision exception so the llvm.floor/ceil functions should always map to
encodings 0x9 and 0xA.

We had a mix of isel patterns where some used 0x9 and 0xA and others used
0x1 and 0x2. We need to be consistent and always use 0x9 and 0xA.

Since we have no way in isel of knowing where the llvm.ceil/floor came
from, we can't map X86 specific intrinsics with encodings 1 or 2 to it.
We could map 0x9 and 0xA to llvm.ceil/floor instead, but I'd really like
to see a use case and optimization advantage first.

I've left the backend test cases to show the blend we now emit without
the extra isel patterns. But I've removed the InstCombine tests completely.

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

5 years ago[X86] Add more icelake model numbers to getHostCPUName.
Craig Topper [Wed, 22 May 2019 19:51:35 +0000 (19:51 +0000)]
[X86] Add more icelake model numbers to getHostCPUName.

Using model numbers found in Table 2-1 of the May 2019 version
of the Intel Software Developer's Manual Volume 4.

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

5 years agogn build: Fix check-clangd target after r359825
Nico Weber [Wed, 22 May 2019 19:03:45 +0000 (19:03 +0000)]
gn build: Fix check-clangd target after r359825

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

5 years ago[DebugInfo][AArch64] Recognise target specific instruction as mov instr
Alexey Lapshin [Wed, 22 May 2019 18:48:58 +0000 (18:48 +0000)]
[DebugInfo][AArch64] Recognise target specific instruction as mov instr

This fix is for the problem from https://bugs.llvm.org/show_bug.cgi?id=38714.
Specifically, Simple Register Coalescing creates following conversion :

 undef %0.sub_32:gpr64 = ORRWrs $wzr, %3:gpr32common, 0, debug-location !24;

It copies 32-bit value from gpr32 into gpr64. But Live DEBUG_VALUE analysis
is not able to create debug location record for that instruction. So the problem
is in that debug info for argc variable is incorrect. The fix is
to write custom isCopyInstrImpl() which would recognize the ORRWrs instr.

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

5 years ago[PGO][CHR] Speed up following long use-def chains.
Hiroshi Yamauchi [Wed, 22 May 2019 18:37:34 +0000 (18:37 +0000)]
[PGO][CHR] Speed up following long use-def chains.

Summary: Avoid visiting an instruction more than once by using a map.

Reviewers: davidxl

Reviewed By: davidxl

Subscribers: llvm-commits

Tags: #llvm

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

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

5 years ago[NFC][InstCombine] Add unary fneg tests to maxnum.ll/minnum.ll
Cameron McInally [Wed, 22 May 2019 18:27:43 +0000 (18:27 +0000)]
[NFC][InstCombine] Add unary fneg tests to maxnum.ll/minnum.ll

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

5 years agoDisable EHFrameSupport in JITLink/RuntimeDyld on AIX
Xing Xue [Wed, 22 May 2019 17:41:27 +0000 (17:41 +0000)]
Disable EHFrameSupport in JITLink/RuntimeDyld on AIX

Summary:
EH Frames aren't supported on AIX with the system compiler, but the definition of HAVE_EHTABLE_SUPPORT misses this which causes linking problems on AIX. This patch updates the definition of HAVE_EHTABLE_SUPPORT in both JITLink and RuntimeDyld.

Author: daltenty

Reviewers: sfertile, xingxue, hubert.reinterpretcase

Reviewed By: xingxue

Subscribers: hiraditya, jsji, llvm-commits

Tags: #llvm

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

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

5 years ago[NFC][X86][AArch64] Add tests for missing (x - y) + -1 -> not(y) + x fold
Roman Lebedev [Wed, 22 May 2019 16:58:26 +0000 (16:58 +0000)]
[NFC][X86][AArch64] Add tests for missing (x - y) + -1  ->  not(y) + x  fold

https://rise4fun.com/Alive/OaY

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

5 years agoAMDGPU: Move disassembler support check to constructor
Matt Arsenault [Wed, 22 May 2019 16:28:48 +0000 (16:28 +0000)]
AMDGPU: Move disassembler support check to constructor

Don't check for unsupported targets for every instruction.

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

5 years agoMC: Allow getMaxInstLength to depend on the subtarget
Matt Arsenault [Wed, 22 May 2019 16:28:41 +0000 (16:28 +0000)]
MC: Allow getMaxInstLength to depend on the subtarget

Keep it optional in cases this is ever needed in some global
context. Currently it's only used for getting an upper bound inline
asm code size.

For AMDGPU, gfx10 increases the maximum instruction size to
20-bytes. This avoids penalizing older subtargets when estimating code
size, and making some annoying branch relaxation test adjustments.

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

5 years ago[TargetLowering] Extend bool args to inline-asm according to getBooleanType
Kees Cook [Wed, 22 May 2019 16:16:15 +0000 (16:16 +0000)]
[TargetLowering] Extend bool args to inline-asm according to getBooleanType

Summary:
This extends Krzysztof Parzyszek's X86-specific solution
(https://reviews.llvm.org/D60208) to the generic code pointed out by
James Y Knight.

Reviewers: kparzysz, craig.topper, nickdesaulniers

Subscribers: efriedma, sdardis, nemanjai, javed.absar, eraman, fedor.sergeev, asb, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, jrtc27, zzheng, edward-jones, atanasyan, rogfer01, MartinMosbeck, brucehoult, the_o, PkmX, jocewei, jsji, llvm-commits, srhines, void, nickdesaulniers, jyknight

Tags: #llvm

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

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

5 years ago[TargetLowering] Add blank line (test commit)
Kees Cook [Wed, 22 May 2019 16:02:13 +0000 (16:02 +0000)]
[TargetLowering] Add blank line (test commit)

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

5 years agollvm-undname: Fix an assert-on-invalid, found by oss-fuzz
Nico Weber [Wed, 22 May 2019 15:53:23 +0000 (15:53 +0000)]
llvm-undname: Fix an assert-on-invalid, found by oss-fuzz

If a template parameter refers to a pointer to member, but the mangling
of that was a string literal instead of a real symbol, llvm-undname used
to crash instead of rejecting the input.

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

5 years ago[IR] allow fast-math-flags on select of FP values
Sanjay Patel [Wed, 22 May 2019 15:50:46 +0000 (15:50 +0000)]
[IR] allow fast-math-flags on select of FP values

This is a minimal start to correcting a problem most directly discussed in PR38086:
https://bugs.llvm.org/show_bug.cgi?id=38086

We have been hacking around a limitation for FP select patterns by using the
fast-math-flags on the condition of the select rather than the select itself.
This patch just allows FMF to appear with the 'select' opcode. No changes are
needed to "FPMathOperator" because it already includes select-of-FP because
that definition is based on the (return) value type.

Once we have this ability, we can start correcting and adding IR transforms
to use the FMF on a 'select' instruction. The instcombine and vectorizer test
diffs only show that the IRBuilder change is behaving as expected by applying
an FMF guard value to 'select'.

For reference:
rL241901 - allowed FMF with fcmp
rL255555 - allowed FMF with FP calls

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

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

5 years agoUnbreak non-PIC builds after r361340/D62174
David Zarzycki [Wed, 22 May 2019 15:48:12 +0000 (15:48 +0000)]
Unbreak non-PIC builds after r361340/D62174

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

5 years ago[NFC][ARM] addsubcarry-promotion.ll: whoops - replace '.' with '-' in check-prefix
Roman Lebedev [Wed, 22 May 2019 15:42:33 +0000 (15:42 +0000)]
[NFC][ARM] addsubcarry-promotion.ll: whoops - replace '.' with '-' in check-prefix

Does not affect update_llc_test_checks, or the actual output,
but is not accepted by the actual FileCheck.

Sorry, i should have noticed this before committing,
not the very next second after..

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

5 years ago[NFC][ARM] Autogenerate addsubcarry-promotion.ll test
Roman Lebedev [Wed, 22 May 2019 15:34:51 +0000 (15:34 +0000)]
[NFC][ARM] Autogenerate addsubcarry-promotion.ll test

Being affected by upcoming patch

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

5 years ago[NFC][X86] Autogenerate negative-offset.ll test
Roman Lebedev [Wed, 22 May 2019 15:34:43 +0000 (15:34 +0000)]
[NFC][X86] Autogenerate negative-offset.ll test

Being affected by upcoming patch

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

5 years ago[llvm-objdump] Dump inline relocations if the relocated section is specified with...
Fangrui Song [Wed, 22 May 2019 15:12:51 +0000 (15:12 +0000)]
[llvm-objdump] Dump inline relocations if the relocated section is specified with --section

This fixes PR41886: llvm-objdump -d -r -j .text doesn't show inline relocations of .text

While here, switch to stable_sort() because we don't want to change the order of relocations applied to the same location. gABI says consecutive relocation records are composed together and their order matters. In practise it is difficult to see relocations applied to the same location not consecutive, we just have to keep the relative order of relocations with the same offset.

Reviewed By: grimar

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

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

5 years agoReland r361148 with a fix to the buildbot failure.
Ilya Biryukov [Wed, 22 May 2019 14:44:45 +0000 (14:44 +0000)]
Reland r361148 with a fix to the buildbot failure.

Reverted in r361377.
Also reland the '.gn' files (reverted in r361389).

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

5 years ago[NFC][X86][AArch64] Rewrite sink-addsub-of-const.ll tests to have full permutation...
Roman Lebedev [Wed, 22 May 2019 14:42:41 +0000 (14:42 +0000)]
[NFC][X86][AArch64] Rewrite sink-addsub-of-const.ll tests to have full permutation coverage

Somehow missed some patterns initially..
While there, add comments.

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

5 years agogn build: Merge r361377
Nico Weber [Wed, 22 May 2019 14:31:22 +0000 (14:31 +0000)]
gn build: Merge r361377

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

5 years agoLoopVectorizationCostModel::selectInterleaveCount - assert we have a non-zero loop...
Simon Pilgrim [Wed, 22 May 2019 14:18:17 +0000 (14:18 +0000)]
LoopVectorizationCostModel::selectInterleaveCount - assert we have a non-zero loop cost. NFCI.

The input LoopCost value can be zero, but if so it should be recalculated with the current VF. After that it should always be non-zero.

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

5 years ago[AMDGPU][MC] Corrected parsing of op_sel* and neg_* modifiers
Dmitry Preobrazhensky [Wed, 22 May 2019 13:59:01 +0000 (13:59 +0000)]
[AMDGPU][MC] Corrected parsing of op_sel* and neg_* modifiers

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

Reviewers: artem.tamazov, arsenm

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

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

5 years ago[llvm-exegesis] Move native target initialization code to a separate file.
Clement Courbet [Wed, 22 May 2019 13:50:16 +0000 (13:50 +0000)]
[llvm-exegesis] Move native target initialization code to a separate file.

Summary: This helps building internal tools on top of the library.

Reviewers: gchatelet

Subscribers: tschuett, llvm-commits, bdb, ondrasej

Tags: #llvm

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

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

5 years ago[llvm-objcopy] Tidy up error messages
James Henderson [Wed, 22 May 2019 13:23:26 +0000 (13:23 +0000)]
[llvm-objcopy] Tidy up error messages

This patch brings various error messages into line with each other, by
removing trailing full stops, and making the first letter lower-case.
This addresses https://bugs.llvm.org/show_bug.cgi?id=40859.

Reviewed by: jhenderson, rupprecht, jakehehrlich

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

Patch by Alex Brachet

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

5 years agoUpdateTestChecks: sparc march handling
Roman Lebedev [Wed, 22 May 2019 13:04:34 +0000 (13:04 +0000)]
UpdateTestChecks: sparc march handling

Summary:
Another target that prefers to use `-march` in tests
```
llvm/test/CodeGen/SPARC$ grep -ri mtriple | wc -l
25
llvm/test/CodeGen/SPARC$ grep -ri march | wc -l
165
```

This test is being affected by a further patch,
so regenerate it to better visualize the changes

Reviewers: RKSimon, dcederman, gberry

Reviewed By: RKSimon

Subscribers: jyknight, fedor.sergeev, jrtc27, llvm-commits

Tags: #llvm

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

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

5 years ago[NFC][SystemZ] Autogenerate alloca-03.ll test to make test changes more visible
Roman Lebedev [Wed, 22 May 2019 13:04:24 +0000 (13:04 +0000)]
[NFC][SystemZ] Autogenerate alloca-03.ll test to make test changes more visible

The check lines are being affected by an upcoming patch,
regenerate the checklines to visualize the changes better.

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

5 years ago[Hexagon] assert getRegisterBitWidth returns non-zero value. NFCI.
Simon Pilgrim [Wed, 22 May 2019 12:25:46 +0000 (12:25 +0000)]
[Hexagon] assert getRegisterBitWidth returns non-zero value. NFCI.

Fixes scan-build warning.

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

5 years ago[VirtualFileSystem] Fix uninitialized variable warning. NFCI.
Simon Pilgrim [Wed, 22 May 2019 11:20:52 +0000 (11:20 +0000)]
[VirtualFileSystem] Fix uninitialized variable warning. NFCI.

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

5 years ago[TargetMachine] error message unsupported code model
Sjoerd Meijer [Wed, 22 May 2019 10:40:26 +0000 (10:40 +0000)]
[TargetMachine] error message unsupported code model

When the tiny code model is requested for a target machine that does not
support this, we get an error message (which is nice) but also this diagnostic
and request to submit a bug report:

    fatal error: error in backend: Target does not support the tiny CodeModel
    [Inferior 2 (process 31509) exited with code 0106]
    clang-9: error: clang frontend command failed with exit code 70 (use -v to see invocation)
    (gdb) clang version 9.0.0 (http://llvm.org/git/clang.git 29994b0c63a40f9c97c664170244a7bba5ecc15e) (http://llvm.org/git/llvm.git 95606fdf91c2d63a931e865f4b78b2e9828ddc74)
    Target: arm-arm-none-eabi
    Thread model: posix
    clang-9: note: diagnostic msg: PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace, preprocessed source, and associated run script.
    clang-9: note: diagnostic msg:
    ********************
    PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
    Preprocessed source(s) and associated run script(s) are located at:
    clang-9: note: diagnostic msg: /tmp/tiny-dfe1a2.c
    clang-9: note: diagnostic msg: /tmp/tiny-dfe1a2.sh
    clang-9: note: diagnostic msg:

But this is not a bug, this is a feature. :-) Not only is this not a bug, this
is also pretty confusing. This patch causes just to print the fatal error and
not the diagnostic:

fatal error: error in backend: Target does not support the tiny CodeModel

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

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

5 years ago[llvm-dlltool] Respect NONAME keyword
Martin Storsjo [Wed, 22 May 2019 09:49:54 +0000 (09:49 +0000)]
[llvm-dlltool] Respect NONAME keyword

This adds proper handling of the NONAME-keyword, which makes llvm-dlltool
generate an import using the ordinal instead of the name.

Patch by by Jannik Vogel, test added by Stefan Schmidt.

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

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

5 years agoRe-land r361257 "[MergeICmps][NFC] Make BCEAtom move-only.""
Clement Courbet [Wed, 22 May 2019 09:45:40 +0000 (09:45 +0000)]
Re-land r361257 "[MergeICmps][NFC] Make BCEAtom move-only.""

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

5 years ago[MIR] Add simple PRE pass to MachineCSE
Anton Afanasyev [Wed, 22 May 2019 07:41:34 +0000 (07:41 +0000)]
[MIR] Add simple PRE pass to MachineCSE

This is the second part of the commit fixing PR38917 (hoisting
partitially redundant machine instruction). Most of PRE (partitial
redundancy elimination) and CSE work is done on LLVM IR, but some of
redundancy arises during DAG legalization. Machine CSE is not enough
to deal with it. This simple PRE implementation works a little bit
intricately: it passes before CSE, looking for partitial redundancy
and transforming it to fully redundancy, anticipating that the next
CSE step will eliminate this created redundancy. If CSE doesn't
eliminate this, than created instruction will remain dead and eliminated
later by Remove Dead Machine Instructions pass.

The third part of the commit is supposed to refactor MachineCSE,
to make it more clear and to merge MachinePRE with MachineCSE,
so one need no rely on further Remove Dead pass to clear instrs
not eliminated by CSE.

First step: https://reviews.llvm.org/D54839

Fixes llvm.org/PR38917

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

5 years ago[PPC64] Parse -elfv1 -elfv2 when specified on target triple
Fangrui Song [Wed, 22 May 2019 07:29:59 +0000 (07:29 +0000)]
[PPC64] Parse -elfv1 -elfv2 when specified on target triple

Summary:
For big-endian powerpc64, the default ABI is ELFv1. OpenPower ABI ELFv2 is supported when -mabi=elfv2 is specified. FreeBSD support for PowerPC64 ELFv2 ABI with LLVM is in progress[1]. This patch adds an alternative way to specify ELFv2 ABI on target triple [2].

The following results are expected:

ELFv1 when using:
-target powerpc64-unknown-freebsd12.0
-target powerpc64-unknown-freebsd12.0 -mabi=elfv1
-target powerpc64-unknown-freebsd12.0-elfv1

ELFv2 when using:
-target powerpc64-unknown-freebsd12.0 -mabi=elfv2
-target powerpc64-unknown-freebsd12.0-elfv2

[1] https://wiki.freebsd.org/powerpc/llvm-elfv2
[2] https://clang.llvm.org/docs/CrossCompilation.html

Patch by Alfredo Dal'Ava Júnior!

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

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

5 years ago[AArch64] Subtarget crypto extension defaults
Sjoerd Meijer [Wed, 22 May 2019 07:10:27 +0000 (07:10 +0000)]
[AArch64] Subtarget crypto extension defaults

The Armv8.2-A crypto extensions all defaulted to true, but should default to
false, like all the other extensions.

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

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

5 years ago[X86] Don't compare i128 through vector if construction not cheap (PR41971)
Nikita Popov [Wed, 22 May 2019 06:47:06 +0000 (06:47 +0000)]
[X86] Don't compare i128 through vector if construction not cheap (PR41971)

Fix for https://bugs.llvm.org/show_bug.cgi?id=41971. Make the
combineVectorSizedSetCCEquality() transform more conservative by
checking that the bitcast to the vector type will be cheap/free
for both operands. I'm considering it cheap if it's a constant,
a load or already a vector. I've dropped the explicit check for
f128 because it should fall out naturally (in the cases where
it'd be detrimental).

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

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

5 years agoProperly categorize llvm-objdump options
Serge Guelton [Wed, 22 May 2019 06:30:46 +0000 (06:30 +0000)]
Properly categorize llvm-objdump options

Filters out noise, and distinguish Mach-O related options from others.

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

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

5 years ago[NFC] Remove a blank line (test commit)
Seiya Nuta [Wed, 22 May 2019 04:48:26 +0000 (04:48 +0000)]
[NFC] Remove a blank line (test commit)

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

5 years ago[PowerPC] use meaningful name for displacement form aligned with x-form - NFC
Chen Zheng [Wed, 22 May 2019 03:17:39 +0000 (03:17 +0000)]
[PowerPC] use meaningful name for displacement form aligned with x-form - NFC

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

5 years ago[PowerPC] [ISEL] select x-form instruction for unaligned offset
Chen Zheng [Wed, 22 May 2019 02:57:31 +0000 (02:57 +0000)]
[PowerPC] [ISEL] select x-form instruction for unaligned offset
Differential Revision: https://reviews.llvm.org/D62173

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

5 years ago[Docs] Increase Doxygen cache size
Don Hinton [Wed, 22 May 2019 00:56:42 +0000 (00:56 +0000)]
[Docs] Increase Doxygen cache size

Summary:
When building Doxygen docs for llvm and clang, it helpfully prints a warning at
the end noting that the `LOOKUP_CACHE_SIZE` value was too small to keep all
symbols in memory.

By increasing to the size it recommends, Doxygen builds have greatly improved
performance. On my machine, time to run `doxygen-llvm` changes from 34 minutes
to 22 minutes, which is a decent amount of time saved by changing a single
number.

Reviewed By: hintonda

Patch by J. Ryan Stinnett!

Tags: #clang, #llvm

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

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

5 years ago[X86] [CET] Deal with return-twice function such as vfork, setjmp when
Pengfei Wang [Wed, 22 May 2019 00:50:21 +0000 (00:50 +0000)]
[X86] [CET] Deal with return-twice function such as vfork, setjmp when
CET-IBT enabled

Return-twice functions will indirectly jump after the caller's position.
So when CET-IBT is enable, we should make sure these is endbr*
instructions follow these Return-twice function caller. Like GCC does.

Patch by Xiang Zhang (xiangzhangllvm)

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

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

5 years ago[Docs] fix formatting for bullet list; NFC
Sanjay Patel [Wed, 22 May 2019 00:48:47 +0000 (00:48 +0000)]
[Docs] fix formatting for bullet list; NFC

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

5 years ago[Analysis] Link library dependencies to Analysis plugins
Petr Hosek [Wed, 22 May 2019 00:47:37 +0000 (00:47 +0000)]
[Analysis] Link library dependencies to Analysis plugins

These are needed to avoid undefined symbols which aren't satisfied
by Clang itself.

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

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

5 years ago[InstCombine] fold shuffles of insert_subvectors
Sanjay Patel [Wed, 22 May 2019 00:32:25 +0000 (00:32 +0000)]
[InstCombine] fold shuffles of insert_subvectors

This should be a valid exception to the general rule of not creating new shuffle masks in IR...
because we already do it. :)
Also, DAG combining/legalization will undo this by widening the shuffle back out if needed.

Explanation for how we already do this: SLP or vector source can create chains of insert/extract
as shown in 1 of the examples from PR16739:
https://godbolt.org/z/NlK7rA
https://bugs.llvm.org/show_bug.cgi?id=16739

And we expect instcombine or DAGCombine to clean that up by creating relatively simple shuffles.

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

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

5 years agoAMDGPU: Assume calls read exec
Matt Arsenault [Tue, 21 May 2019 23:23:16 +0000 (23:23 +0000)]
AMDGPU: Assume calls read exec

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

5 years agoAMDGPU: Add some tests for inlineasm behavior
Matt Arsenault [Tue, 21 May 2019 23:23:12 +0000 (23:23 +0000)]
AMDGPU: Add some tests for inlineasm behavior

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

5 years agoAMDGPU: Assume call pseudos are convergent
Matt Arsenault [Tue, 21 May 2019 23:23:10 +0000 (23:23 +0000)]
AMDGPU: Assume call pseudos are convergent

There should probably be nonconvergent versions, but my guess is it
doesn't matter in practice.

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

5 years agoAMDGPU: Fix not marking new gfx10 SGPRs as CSRs
Matt Arsenault [Tue, 21 May 2019 23:23:05 +0000 (23:23 +0000)]
AMDGPU: Fix not marking new gfx10 SGPRs as CSRs

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

5 years ago[WebAssembly] Add the signature for the new llround builtin function
Dan Gohman [Tue, 21 May 2019 23:06:34 +0000 (23:06 +0000)]
[WebAssembly] Add the signature for the new llround builtin function

r360889 added new llround builtin functions. This patch adds their
signatures for the WebAssembly backend.

It also adds wasm32 support to utils/update_llc_test_checks.py, since
that's the script other targets are using for their testcases for this
feature.

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

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

5 years ago[ORC] Guarantee unique JITDylib names in lli, add usage notes to createJITDylib.
Lang Hames [Tue, 21 May 2019 22:07:53 +0000 (22:07 +0000)]
[ORC] Guarantee unique JITDylib names in lli, add usage notes to createJITDylib.

JITDylibs should have unique names. This patch adds code to lli to respect this
invariant (by refering to the exist JITDylib if a -jd <name> option is specified
more than once). It also adds usage notes to the doxygen comment for
createJITDylib method in ExecutionSession and LLJIT.

http://llvm.org/PR41937

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

5 years ago[NFC][AMDGPU] Autogenerate llvm.amdgcn.s.barrier.ll test
Roman Lebedev [Tue, 21 May 2019 21:49:14 +0000 (21:49 +0000)]
[NFC][AMDGPU] Autogenerate llvm.amdgcn.s.barrier.ll test

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

5 years ago[NFC][X86] Autogenerate ragreedy-hoist-spill.ll test
Roman Lebedev [Tue, 21 May 2019 21:49:10 +0000 (21:49 +0000)]
[NFC][X86] Autogenerate ragreedy-hoist-spill.ll test

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

5 years ago[NFC][Thumb2] Autogenerate thumb2-ldr_pre.ll test
Roman Lebedev [Tue, 21 May 2019 21:49:05 +0000 (21:49 +0000)]
[NFC][Thumb2] Autogenerate thumb2-ldr_pre.ll test

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

5 years ago[InstCombine] add more tests for shuffle folding; NFC
Sanjay Patel [Tue, 21 May 2019 21:45:24 +0000 (21:45 +0000)]
[InstCombine] add more tests for shuffle folding; NFC

As discussed in D62024, we want to limit any potential IR
transforms of shuffles to cases where we know the SDAG
conversion would result in equivalent patterns for these
IR variants.

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

5 years ago[X86] Add large integer comparison tests for PR41971; NFC
Nikita Popov [Tue, 21 May 2019 21:27:08 +0000 (21:27 +0000)]
[X86] Add large integer comparison tests for PR41971; NFC

In these cases we would prefer a direct comparison over going through
a vector type.

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

5 years ago[NFC][InstCombine] Add unary fneg tests to operand-complexity.ll.
Cameron McInally [Tue, 21 May 2019 21:07:46 +0000 (21:07 +0000)]
[NFC][InstCombine] Add unary fneg tests to operand-complexity.ll.

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

5 years ago[NFC][InstCombine] Add unary FNeg tests to X86/x86-avx512.ll
Cameron McInally [Tue, 21 May 2019 20:31:09 +0000 (20:31 +0000)]
[NFC][InstCombine] Add unary FNeg tests to X86/x86-avx512.ll

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

5 years agobuild: enable CMake policy 0077
Saleem Abdulrasool [Tue, 21 May 2019 20:28:32 +0000 (20:28 +0000)]
build: enable CMake policy 0077

Enable CMake policy 77. This alters the behavior of option. The old behavior
would remove the value of the option from the cache and create a new one. The
new behavior does not create the variable if it is defined already. This ensures
that subsequent reconfigures will behave identically. This seems better than the
setting of OLD - the desire is to ensure that it is set to OLD or NEW.

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

5 years agoMove csr-save-restore-order.ll to the right place
Yi-Hong Lyu [Tue, 21 May 2019 20:28:31 +0000 (20:28 +0000)]
Move csr-save-restore-order.ll to the right place

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

5 years ago[NFC][X86][AArch64] Add tests for sinking of add/sub by constant through add/sub
Roman Lebedev [Tue, 21 May 2019 20:14:54 +0000 (20:14 +0000)]
[NFC][X86][AArch64] Add tests for sinking of add/sub by constant through add/sub

Looks we can transform all 8 variants of the pattern:
https://rise4fun.com/Alive/auH

This comes up as an issue on the path towards
https://bugs.llvm.org/show_bug.cgi?id=41952

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

5 years agoFix register coalescer failure to prune value
Stanislav Mekhanoshin [Tue, 21 May 2019 19:32:41 +0000 (19:32 +0000)]
Fix register coalescer failure to prune value

Register coalescer fails for the test in the patch with the assertion in
JoinVals::ConflictResolution `DefMI != nullptr'. It attempts to join
live intervals for two adjacent instructions and erase the copy:

    %2:vreg_256 = COPY %1
    %3:vreg_256 = COPY killed %1

The LI needs to be adjusted to kill subrange for the erased instruction
and extend the subrange of the original def. That was done for the main
interval only but not for the subrange. As a result subrange had a VNI
pointing to the erased slot resulting in the above failure.

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

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

5 years agoFix for sphinx bot warning
Leonard Chan [Tue, 21 May 2019 19:30:25 +0000 (19:30 +0000)]
Fix for sphinx bot warning

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

5 years ago[cmake] Don't use VERSION_GREATER_EQUAL in cmake versions prior to 3.72.
Don Hinton [Tue, 21 May 2019 19:25:54 +0000 (19:25 +0000)]
[cmake] Don't use VERSION_GREATER_EQUAL in cmake versions prior to 3.72.

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

5 years ago[Intrinsic] Signed Fixed Point Saturation Multiplication Intrinsic
Leonard Chan [Tue, 21 May 2019 19:17:19 +0000 (19:17 +0000)]
[Intrinsic] Signed Fixed Point Saturation Multiplication Intrinsic

Add an intrinsic that takes 2 signed integers with the scale of them provided
as the third argument and performs fixed point multiplication on them. The
result is saturated and clamped between the largest and smallest representable
values of the first 2 operands.

This is a part of implementing fixed point arithmetic in clang where some of
the more complex operations will be implemented as intrinsics.

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

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

5 years ago[X86] Remove an unneeded ZERO_EXTEND creation from LowerINTRINSIC_W_CHAIN. NFC
Craig Topper [Tue, 21 May 2019 19:03:45 +0000 (19:03 +0000)]
[X86] Remove an unneeded ZERO_EXTEND creation from LowerINTRINSIC_W_CHAIN. NFC

We were trying to ZERO_EXTEND from an i8 X86ISD::SETCC to i8 again.

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

5 years ago[SelectionDAG] fold insert subvector of undef into undef
Sanjay Patel [Tue, 21 May 2019 18:53:53 +0000 (18:53 +0000)]
[SelectionDAG] fold insert subvector of undef into undef

DAGCombiner simplifies this more liberally as:
  // If inserting an UNDEF, just return the original vector.
  if (N1.isUndef())
    return N0;

So there's no way to make this visible in output AFAIK, but
doing this at node creation time should be slightly more efficient.

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

5 years ago[cmake] Try to make cmake happy and fix bots.
Don Hinton [Tue, 21 May 2019 18:51:21 +0000 (18:51 +0000)]
[cmake] Try to make cmake happy and fix bots.

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

5 years ago[SelectionDAG] remove redundant code; NFCI
Sanjay Patel [Tue, 21 May 2019 18:28:22 +0000 (18:28 +0000)]
[SelectionDAG] remove redundant code; NFCI

getNode() squashes concatenation of undefs via FoldCONCAT_VECTORS():
  // Concat of UNDEFs is UNDEF.
  if (llvm::all_of(Ops, [](SDValue Op) { return Op.isUndef(); }))
    return DAG.getUNDEF(VT);

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

5 years ago[cmake] Bug in r361281: make include optional and fix typo which might make a differe...
Don Hinton [Tue, 21 May 2019 18:15:01 +0000 (18:15 +0000)]
[cmake] Bug in r361281: make include optional and fix typo which might make a difference on some systems.

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

5 years ago[MergeICmps] Make sorting strongly stable on the rhs.
Clement Courbet [Tue, 21 May 2019 17:58:42 +0000 (17:58 +0000)]
[MergeICmps] Make sorting strongly stable on the rhs.

Summary:
Because the sort order was not strongly stable on the RHS, whether the
chain could merge would depend on the order of the blocks in the Phi.

EXPENSIVE_CHECKS would shuffle the blocks before sorting, resulting in
non-deterministic merging.

Reviewers: gchatelet

Subscribers: hiraditya, llvm-commits, RKSimon

Tags: #llvm

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

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

5 years ago[cmake] Add custom command to touch archives on Darwin so ninja won't rebuild them.
Don Hinton [Tue, 21 May 2019 17:56:45 +0000 (17:56 +0000)]
[cmake] Add custom command to touch archives on Darwin so ninja won't rebuild them.

Summary:
clang and newer versions of ninja use high-resolutions timestamps, but
older versions of libtool on Darwin don't, so the archive will often
get an older timestamp than the last object that was added or updated.
To fix this, we add a custom command to touch the archive after it's
been built so that ninja won't rebuild it unnecessarily the next time
it's run.

Reviewed By: beanz

Tags: #llvm

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

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

5 years ago[Bugpoint] fix use-after-move. NFC
Nick Desaulniers [Tue, 21 May 2019 17:55:26 +0000 (17:55 +0000)]
[Bugpoint] fix use-after-move. NFC

Summary:
This was flagged in https://www.viva64.com/en/b/0629/ under "Snippet No.
6".

Note that author also states:
"Note that the loop doesn't actually execute at all."

This is not true, but the author can be forgiven; there's two distinct
variables with very similar identifiers:

MiscompiledFunctions
MisCompFunctions

Reviewers: echristo, srhines, RKSimon

Reviewed By: RKSimon

Subscribers: llvm-commits

Tags: #llvm

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

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

5 years ago[Dsymutil] Remove redundant argument (NFC)
Jonas Devlieghere [Tue, 21 May 2019 17:31:51 +0000 (17:31 +0000)]
[Dsymutil] Remove redundant argument (NFC)

The dwarf streamer already holds a copy of the link options, so there's
no need to pass them as an argument.

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

5 years ago[docs] Add new document on building distributions
Chris Bieneman [Tue, 21 May 2019 16:29:31 +0000 (16:29 +0000)]
[docs] Add new document on building distributions

Summary:
This document is an attempt to provide a guide for best practices for using the LLVM build system to generate distributable LLVM-based tools.

Most of the document is geared toward distributions of LLVM-based toolchains, but much of it also applies to distributing other LLVM-based tools and libraries.

Reviewers: tstellar, phosek, jroelofs, hans, sylvestre.ledru

Reviewed By: tstellar

Subscribers: smeenai, dschuff, arphaman, winksaville, llvm-commits

Tags: #llvm

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

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

5 years ago[X86][SSE] computeKnownBitsForTargetNode - add X86ISD::ANDNP support
Simon Pilgrim [Tue, 21 May 2019 15:20:24 +0000 (15:20 +0000)]
[X86][SSE] computeKnownBitsForTargetNode - add X86ISD::ANDNP support

Fixes PACKSS-PSHUFB shuffle regressions mentioned on D61692

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

5 years ago[DAGCombiner] prevent unsafe reassociation of FP ops
Sanjay Patel [Tue, 21 May 2019 14:47:38 +0000 (14:47 +0000)]
[DAGCombiner] prevent unsafe reassociation of FP ops

There are no FP callers of DAGCombiner::reassociateOps() currently,
but we can add a fast-math check to make sure this API is not being
misused.

This was noted as a potential risk (and that risk might increase) with:
D62191

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

5 years agogn build: Merge r361264
Nico Weber [Tue, 21 May 2019 14:41:27 +0000 (14:41 +0000)]
gn build: Merge r361264

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

5 years agoRevert r361257 "[MergeICmps][NFC] Make BCEAtom move-only."
Clement Courbet [Tue, 21 May 2019 14:24:46 +0000 (14:24 +0000)]
Revert r361257 "[MergeICmps][NFC] Make BCEAtom move-only."

Broke some bots.

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