OSDN Git Service

android-x86/external-llvm.git
5 years ago[ARM] Add a batch of MVE floating-point instructions.
Simon Tatham [Fri, 21 Jun 2019 09:35:07 +0000 (09:35 +0000)]
[ARM] Add a batch of MVE floating-point instructions.

Summary:
This includes floating-point basic arithmetic (add/sub/multiply),
complex add/multiply, unary negation and absolute value, rounding to
integer value, and conversion to/from integer formats.

Reviewers: dmgreen, samparker, SjoerdMeijer, t.p.northover

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

Tags: #llvm

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

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

5 years agoUse std::iterator_traits to infer result type of llvm::enumerate iterator wrapper
Mehdi Amini [Fri, 21 Jun 2019 05:43:08 +0000 (05:43 +0000)]
Use std::iterator_traits to infer result type of llvm::enumerate iterator wrapper

Update the llvm::enumerate helper class result_pair<R> to use the 'iterator_traits<R>::reference'
type as the result of 'value()' instead 'ValueOfRange<R> &'. This enables support for iterators
that return value types, i.e. non reference. This is a common pattern for some classes of
iterators, e.g. mapped_iterator.

Patch by: River Riddle <riverriddle@google.com>

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

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

5 years agoSimplify std::lower_bound with llvm::{bsearch,lower_bound}. NFC
Fangrui Song [Fri, 21 Jun 2019 05:40:31 +0000 (05:40 +0000)]
Simplify std::lower_bound with llvm::{bsearch,lower_bound}. NFC

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

5 years ago[LICM & MSSA] Fixed test to run only with assertions enabled as it uses -debug-only
Yevgeny Rouban [Fri, 21 Jun 2019 04:49:40 +0000 (04:49 +0000)]
[LICM & MSSA] Fixed test to run only with assertions enabled as it uses -debug-only

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

5 years ago[GN] Fix build
Vitaly Buka [Fri, 21 Jun 2019 02:15:07 +0000 (02:15 +0000)]
[GN] Fix build

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

5 years ago[MIPS GlobalISel] Fix -Wunused-variable in -DLLVM_ENABLE_ASSERTIONS=off builds after...
Fangrui Song [Fri, 21 Jun 2019 01:51:50 +0000 (01:51 +0000)]
[MIPS GlobalISel] Fix -Wunused-variable in -DLLVM_ENABLE_ASSERTIONS=off builds after D63541

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

5 years ago[GlobalISel][Localizer] Allow localization of G_INTTOPTR and chains of instructions.
Amara Emerson [Fri, 21 Jun 2019 00:36:19 +0000 (00:36 +0000)]
[GlobalISel][Localizer] Allow localization of G_INTTOPTR and chains of instructions.

G_INTTOPTR can prevent the localizer from moving G_CONSTANTs, but since it's
essentially a side effect free cast instruction we can remat both instructions.
This patch changes the localizer to enable localization of the chains by
iterating over the entry block instructions in reverse order. That way, uses will
localized first, and then the defs are free to be localized as well.

This also changes the previous SmallPtrSet of localized instructions to use a
SetVector instead. We're dealing with pointers and need deterministic iteration
order.

Overall, this change improves ARM64 -O0 CTMark code size by around 0.7% geomean.

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

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

5 years ago[llvm-objcopy][MachO] Rebuild the symbol/string table in the writer
Seiya Nuta [Fri, 21 Jun 2019 00:21:50 +0000 (00:21 +0000)]
[llvm-objcopy][MachO] Rebuild the symbol/string table in the writer

Summary: Build the string table using StringTableBuilder, reassign symbol indices, and update symbol indices in relocations to allow adding/modifying/removing symbols from the object.

Reviewers: alexshap, rupprecht, jhenderson

Reviewed By: alexshap

Subscribers: mgorny, jakehehrlich, llvm-commits

Tags: #llvm

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

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

5 years ago[Reassociate] Remove bogus assert reported in PR42349.
Cameron McInally [Thu, 20 Jun 2019 23:03:55 +0000 (23:03 +0000)]
[Reassociate] Remove bogus assert reported in PR42349.

Also, add a FIXME for the unsafe transform on a unary FNeg. A unary FNeg can only be transformed to a FMul by -1.0 when the nnan flag is present. The unary FNeg project is a WIP, so the unsafe transformation is acceptable until that work is complete.

The bogus assert with introduced in D63445.

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

5 years ago[InstSimplify] simplify power-of-2 (single bit set) sequences
Sanjay Patel [Thu, 20 Jun 2019 22:55:28 +0000 (22:55 +0000)]
[InstSimplify] simplify power-of-2 (single bit set) sequences

As discussed in PR42314:
https://bugs.llvm.org/show_bug.cgi?id=42314

Improving the canonicalization for these patterns:
rL363956
...means we should adjust/enhance the related simplification.

https://rise4fun.com/Alive/w1cp

  Name: isPow2 or zero
  %x = and i32 %xx, 2048
  %a = add i32 %x, -1
  %r = and i32 %a, %x
  =>
  %r = i32 0

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

5 years ago[CodeGen] Refactor check of suitability for a jump table (NFC)
Evandro Menezes [Thu, 20 Jun 2019 22:03:54 +0000 (22:03 +0000)]
[CodeGen] Refactor check of suitability for a jump table (NFC)

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

5 years ago[ARM GlobalISel] Tests for s64 G_ADD and G_SUB.
Eli Friedman [Thu, 20 Jun 2019 22:00:07 +0000 (22:00 +0000)]
[ARM GlobalISel] Tests for s64 G_ADD and G_SUB.

Forgot to commit these in r363989 (https://reviews.llvm.org/D63585)

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

5 years agoAMDGPU: Always use s33 for global scratch wave offset
Matt Arsenault [Thu, 20 Jun 2019 21:58:24 +0000 (21:58 +0000)]
AMDGPU: Always use s33 for global scratch wave offset

Every called function could possibly need this to calculate the
absolute address of stack objectst, and this avoids inserting a copy
around every call site in the kernel. It's also somewhat cleaner to
keep this in a callee saved SGPR.

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

5 years ago[ARM GlobalISel] Add support for s64 G_ADD and G_SUB.
Eli Friedman [Thu, 20 Jun 2019 21:56:47 +0000 (21:56 +0000)]
[ARM GlobalISel] Add support for s64 G_ADD and G_SUB.

Teach RegisterBankInfo to use the correct register class, and tell the
legalizer it's legal.  Everything else just works.

The one thing that's slightly weird about this compared to SelectionDAG
isel is that legalization can't distinguish between i64 and <1 x i64>,
so we might end up with more NEON instructions than the user expects.

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

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

5 years ago[PowerPC][NFC] Fix comments for AltVSXFMARel mapping.
Jinsong Ji [Thu, 20 Jun 2019 21:36:06 +0000 (21:36 +0000)]
[PowerPC][NFC] Fix comments for AltVSXFMARel mapping.

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

5 years ago[profile] Solaris ld supports __start___llvm_prof_data etc. labels
Rainer Orth [Thu, 20 Jun 2019 21:27:06 +0000 (21:27 +0000)]
[profile] Solaris ld supports __start___llvm_prof_data etc. labels

Currently, many profiling tests on Solaris FAIL like

  Command Output (stderr):
  --
  Undefined                       first referenced
   symbol                             in file
  __llvm_profile_register_names_function /tmp/lit_tmp_Nqu4eh/infinite_loop-9dc638.o
  __llvm_profile_register_function    /tmp/lit_tmp_Nqu4eh/infinite_loop-9dc638.o

Solaris 11.4 ld supports the non-standard GNU ld extension of adding
__start_SECNAME and __stop_SECNAME labels to sections whose names are valid
as C identifiers.  Given that we already use Solaris 11.4-only features
like ld -z gnu-version-script-compat and fully working .preinit_array
support in compiler-rt, we don't need to worry about older versions of
Solaris ld.

The patch documents that support (although the comment in
lib/Transforms/Instrumentation/InstrProfiling.cpp
(needsRuntimeRegistrationOfSectionRange) is quite cryptic what it's
actually about), and adapts the affected testcase not to expect the
alternativeq __llvm_profile_register_functions and __llvm_profile_init.
It fixes all affected tests.

Tested on amd64-pc-solaris2.11.

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

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

5 years agoAMDGPU: Add intrinsics for DS GWS semaphore instructions
Matt Arsenault [Thu, 20 Jun 2019 21:11:42 +0000 (21:11 +0000)]
AMDGPU: Add intrinsics for DS GWS semaphore instructions

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

5 years ago[LICM & MSSA] Limit unsafe sinking and hoisting.
Alina Sbirlea [Thu, 20 Jun 2019 21:09:09 +0000 (21:09 +0000)]
[LICM & MSSA] Limit unsafe sinking and hoisting.

Summary:
The getClobberingMemoryAccess API checks for clobbering accesses in a loop by walking the backedge. This may check if a memory access is being
clobbered by the loop in a previous iteration, depending how smart AA got over the course of the updates in MemorySSA (it does not occur when built from scratch).
If no clobbering access is found inside the loop, it will optimize to an access outside the loop. This however does not mean that access is safe to sink.
Given:
```
for i
  load a[i]
  store a[i]
```
The access corresponding to the load can be optimized to outside the loop, and the load can be hoisted. But it is incorrect to sink it.
In order to sink the load, we'd need to check no Def clobbers the Use in the same iteration. With this patch we currently restrict sinking to either
Defs not existing in the loop, or Defs preceding the load in the same block. An easy extension is to ensure the load (Use) post-dominates all Defs.

Caught by PR42294.

This issue also shed light on the converse problem: hoisting stores in this same scenario would be illegal. With this patch we restrict
hoisting of stores to the case when their corresponding Defs are dominating all Uses in the loop.

Reviewers: george.burgess.iv

Subscribers: jlebar, Prazek, llvm-commits

Tags: #llvm

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

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

5 years ago[InstSimplify] add tests for known-not-a-power-of-2; NFC
Sanjay Patel [Thu, 20 Jun 2019 21:04:14 +0000 (21:04 +0000)]
[InstSimplify] add tests for known-not-a-power-of-2; NFC

I added a canonicalization to create this general pattern in:
rL363956

But as noted in PR42314:
https://bugs.llvm.org/show_bug.cgi?id=42314#c11

...we have a (potentially expensive) simplification for the version
of the code that we just canonicalized away from, so we should
add/adjust that code to match.

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

5 years agoAMDGPU: Insert mem_viol check loop around GWS pre-GFX9
Matt Arsenault [Thu, 20 Jun 2019 20:54:32 +0000 (20:54 +0000)]
AMDGPU: Insert mem_viol check loop around GWS pre-GFX9

It is necessary to emit this loop around GWS operations in case the
wave is preempted pre-GFX9.

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

5 years ago[NFC][SLP] Pre-commit unary FNeg test to X86/propagate_ir_flags.ll
Cameron McInally [Thu, 20 Jun 2019 20:53:51 +0000 (20:53 +0000)]
[NFC][SLP] Pre-commit unary FNeg test to X86/propagate_ir_flags.ll

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

5 years agoUpdate LLVM test to not check for the EliminateAvailableExternallyPass
Leonard Chan [Thu, 20 Jun 2019 20:51:58 +0000 (20:51 +0000)]
Update LLVM test to not check for the EliminateAvailableExternallyPass
for lto-pre-link O2 pipeline runs.

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

5 years ago[InstCombine] fix typo in comment; NFC
Sanjay Patel [Thu, 20 Jun 2019 20:23:32 +0000 (20:23 +0000)]
[InstCombine] fix typo in comment; NFC

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

5 years ago[clang][NewPM] Do not eliminate available_externally durng `-O2 -flto` runs
Leonard Chan [Thu, 20 Jun 2019 19:44:51 +0000 (19:44 +0000)]
[clang][NewPM] Do not eliminate available_externally durng `-O2 -flto` runs

This fixes CodeGen/available-externally-suppress.c when the new pass manager is
turned on by default. available_externally was not emitted during -O2 -flto
runs when it should still be retained for link time inlining purposes. This can
be fixed by checking that we aren't LTOPrelinking when adding the
EliminateAvailableExternallyPass.

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

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

5 years ago[NFC] Add more tests for D46262
David Bolvansky [Thu, 20 Jun 2019 19:39:15 +0000 (19:39 +0000)]
[NFC] Add more tests for D46262

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

5 years ago[NFC] Updated tests for D63546
David Bolvansky [Thu, 20 Jun 2019 19:30:56 +0000 (19:30 +0000)]
[NFC] Updated tests for D63546

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

5 years ago[LFTR] Fix a (latent?) bug related to nested loops
Philip Reames [Thu, 20 Jun 2019 18:45:06 +0000 (18:45 +0000)]
[LFTR] Fix a (latent?) bug related to nested loops

I can't actually come up with a test case this triggers on without an out of tree change, but in theory, it's a bug in the recently added multiple exit LFTR support.  The root issue is that an exiting block common to two loops can (in theory) have computable exit counts for both loops.  Rewriting the exit of an inner loop in terms of the outer loops IV would cause the inner loop to either a) run forever, or b) terminate on the first iteration.

In practice, we appear to get lucky and not have the exit count computable for the outer loop, except when it's trivially zero.  Given we bail on zero exit counts, we don't appear to ever trigger this.  But I can't come up with a reason we *can't* compute an exit count for the outer loop on the common exiting block, so this may very well be triggering in some cases.

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

5 years agogn build: Merge r363948
Nico Weber [Thu, 20 Jun 2019 18:18:40 +0000 (18:18 +0000)]
gn build: Merge r363948

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

5 years ago[X86] Add BLSI to isUseDefConvertible.
Craig Topper [Thu, 20 Jun 2019 17:52:53 +0000 (17:52 +0000)]
[X86] Add BLSI to isUseDefConvertible.

Summary:
BLSI sets the C flag is the input is not zero. So if its followed
by a TEST of the input where only the Z flag is consumed, we can
replace it with the opposite check of the C flag.

We should be able to do the same for BLSMSK and BLSR, but the
naive test case for those is being optimized to a subo by
CodeGenPrepare.

Reviewers: spatel, RKSimon

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

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

5 years ago[InstCombine] canonicalize check for power-of-2
Sanjay Patel [Thu, 20 Jun 2019 17:41:15 +0000 (17:41 +0000)]
[InstCombine] canonicalize check for power-of-2

The form that compares against 0 is better because:
1. It removes a use of the input value.
2. It's the more standard form for this pattern: https://graphics.stanford.edu/~seander/bithacks.html#DetermineIfPowerOf2
3. It results in equal or better codegen (tested with x86, AArch64, ARM, PowerPC, MIPS).

This is a root cause for PR42314, but probably doesn't completely answer the codegen request:
https://bugs.llvm.org/show_bug.cgi?id=42314

Alive proof:
https://rise4fun.com/Alive/9kG

  Name: is power-of-2
  %neg = sub i32 0, %x
  %a = and i32 %neg, %x
  %r = icmp eq i32 %a, %x
  =>
  %dec = add i32 %x, -1
  %a2 = and i32 %dec, %x
  %r = icmp eq i32 %a2, 0

  Name: is not power-of-2
  %neg = sub i32 0, %x
  %a = and i32 %neg, %x
  %r = icmp ne i32 %a, %x
  =>
  %dec = add i32 %x, -1
  %a2 = and i32 %dec, %x
  %r = icmp ne i32 %a2, 0

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

5 years ago[DAGCombiner] Use getAPIntValue() instead of getZExtValue() where possible.
Simon Pilgrim [Thu, 20 Jun 2019 17:36:23 +0000 (17:36 +0000)]
[DAGCombiner] Use getAPIntValue() instead of getZExtValue() where possible.

Better handling of out-of-i64-range values due to large integer types or from fuzz tests.

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

5 years ago[DAGCombiner][NFC] Remove unused var
Jordan Rupprecht [Thu, 20 Jun 2019 17:30:01 +0000 (17:30 +0000)]
[DAGCombiner][NFC] Remove unused var

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

5 years ago[Tests] Add a tricky LFTR case for documentation purposes
Philip Reames [Thu, 20 Jun 2019 17:16:53 +0000 (17:16 +0000)]
[Tests] Add a tricky LFTR case for documentation purposes

Thought of this case while working on something else.  We appear to get it right in all of the variations I tried, but that's by accident.  So, add a test which would catch the potential bug.

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

5 years agoStore a pointer to the return value in a static alloca and let the debugger use that
Amy Huang [Thu, 20 Jun 2019 17:15:21 +0000 (17:15 +0000)]
Store a pointer to the return value in a static alloca and let the debugger use that
as the variable address for NRVO variables.

Subscribers: hiraditya, cfe-commits, llvm-commits

Tags: #clang, #llvm

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

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

5 years ago[InstCombine] cttz(-x) -> cttz(x)
David Bolvansky [Thu, 20 Jun 2019 17:04:14 +0000 (17:04 +0000)]
[InstCombine] cttz(-x) -> cttz(x)

Summary: Signedness does not change number of trailing zeros.

Reviewers: spatel, lebedev.ri, nikic

Reviewed By: spatel

Subscribers: llvm-commits

Tags: #llvm

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

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

5 years agoAMDGPU: Eliminate test usage of legacy FP elim attributes
Matt Arsenault [Thu, 20 Jun 2019 17:03:27 +0000 (17:03 +0000)]
AMDGPU: Eliminate test usage of legacy FP elim attributes

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

5 years agoAMDGPU: Fix ignoring DisableFramePointerElim in leaf functions
Matt Arsenault [Thu, 20 Jun 2019 17:03:23 +0000 (17:03 +0000)]
AMDGPU: Fix ignoring DisableFramePointerElim in leaf functions

The attribute can specify elimination for leaf or non-leaf, so it
should always be considered. I copied this bug from AArch64, which
probably should also be fixed.

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

5 years ago[CodeGen] Fix formatting and comments (NFC)
Evandro Menezes [Thu, 20 Jun 2019 16:34:00 +0000 (16:34 +0000)]
[CodeGen] Fix formatting and comments (NFC)

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

5 years ago[AMDGPU] gfx10 tests. NFC.
Stanislav Mekhanoshin [Thu, 20 Jun 2019 16:29:40 +0000 (16:29 +0000)]
[AMDGPU] gfx10 tests. NFC.

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

5 years ago[InstCombine] add commuted variants for power-of-2 checks; NFC
Sanjay Patel [Thu, 20 Jun 2019 16:27:23 +0000 (16:27 +0000)]
[InstCombine] add commuted variants for power-of-2 checks; NFC

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

5 years agoAMDGPU: Treat undef as an inline immediate
Matt Arsenault [Thu, 20 Jun 2019 16:01:09 +0000 (16:01 +0000)]
AMDGPU: Treat undef as an inline immediate

This should only matter in vectors with an undef component, since a
full undef vector would have been folded out.

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

5 years agoAMDGPU: Make test functions hidden
Matt Arsenault [Thu, 20 Jun 2019 15:38:30 +0000 (15:38 +0000)]
AMDGPU: Make test functions hidden

Reduces amount of code in the function from eliminating the GOT load.

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

5 years ago[InstCombine] add tests for checking power-of-2; NFC
Sanjay Patel [Thu, 20 Jun 2019 15:25:18 +0000 (15:25 +0000)]
[InstCombine] add tests for checking power-of-2; NFC

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

5 years ago[NFC][SLP] Pre-commit unary FNeg test to X86/phi3.ll
Cameron McInally [Thu, 20 Jun 2019 15:17:17 +0000 (15:17 +0000)]
[NFC][SLP] Pre-commit unary FNeg test to X86/phi3.ll

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

5 years ago[ARM] Add a batch of MVE integer instructions.
Simon Tatham [Thu, 20 Jun 2019 15:16:56 +0000 (15:16 +0000)]
[ARM] Add a batch of MVE integer instructions.

This includes integer arithmetic of various kinds (add/sub/multiply,
saturating and not), and the immediate forms of VMOV and VMVN that
load an immediate into all lanes of a vector.

Reviewers: dmgreen, samparker, SjoerdMeijer, t.p.northover

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

Tags: #llvm

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

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

5 years ago[AMDGPU] gfx1010 core wave32 changes
Stanislav Mekhanoshin [Thu, 20 Jun 2019 15:08:34 +0000 (15:08 +0000)]
[AMDGPU] gfx1010 core wave32 changes

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

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

5 years agoVirtualize TargetInstrInfo::getRegClass()
Stanislav Mekhanoshin [Thu, 20 Jun 2019 14:59:28 +0000 (14:59 +0000)]
Virtualize TargetInstrInfo::getRegClass()

AMDGPU target needs to override getRegClass() used during
instruction selection. We now may have either 32 or 64 bit
conditional registers used in the same instructions. For
that purpose special SReg_1 register class is created which
is dynamically resolved to either SReg_64 or SGPR_32 depending
on the subtarget attributes.

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

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

5 years ago[yaml2obj] - Convert `ELFState<ELFT>::addSymbols` method to `toELFSymbols` helper...
George Rimar [Thu, 20 Jun 2019 14:44:48 +0000 (14:44 +0000)]
[yaml2obj] - Convert `ELFState<ELFT>::addSymbols` method to `toELFSymbols` helper. NFCI.

ELFState<ELFT>::addSymbols method looks a bit strange.
User code have to create the destination symbols vector outside,
add a null symbol and then pass it to addSymbols when it seems
the more natural logic is to isolate all work with symbols inside some
function, build the list right there and return it.

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

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

5 years ago[DAGCombiner] Support (shl (zext (srl x, C)), C) -> (zext (shl (srl x, C), C)) non...
Simon Pilgrim [Thu, 20 Jun 2019 14:42:27 +0000 (14:42 +0000)]
[DAGCombiner] Support (shl (zext (srl x, C)), C) -> (zext (shl (srl x, C), C)) non-uniform folds.

Use matchBinaryPredicate instead of isConstOrConstSplat to let us handle non-uniform shift cases.

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

5 years ago[SLP][X86] Add lookahead reordering tests from D60897
Simon Pilgrim [Thu, 20 Jun 2019 12:52:58 +0000 (12:52 +0000)]
[SLP][X86] Add lookahead reordering tests from D60897

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

5 years ago[DAGCombine] Add TODOs for some combines that should support non-uniform vectors
Simon Pilgrim [Thu, 20 Jun 2019 12:48:49 +0000 (12:48 +0000)]
[DAGCombine] Add TODOs for some combines that should support non-uniform vectors

We tend to only test for scalar/scalar consts when really we could support non-uniform vectors using ISD::matchUnaryPredicate/matchBinaryPredicate etc.

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

5 years ago[X86] LowerAVXExtend - handle ANY_EXTEND_VECTOR_INREG lowering as well.
Simon Pilgrim [Thu, 20 Jun 2019 11:31:54 +0000 (11:31 +0000)]
[X86] LowerAVXExtend - handle ANY_EXTEND_VECTOR_INREG lowering as well.

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

5 years ago[DAGCombine] Reduce scope of ShAmtVal variable. NFCI.
Simon Pilgrim [Thu, 20 Jun 2019 10:56:37 +0000 (10:56 +0000)]
[DAGCombine] Reduce scope of ShAmtVal variable. NFCI.

Fixes cppcheck warning.

Use the more capable getAPIntVal() instead of getZExtValue() as well since I'm here.

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

5 years ago[llvm-nm] Generalize ELF symbol types 'N' and 'n'
Fangrui Song [Thu, 20 Jun 2019 10:15:11 +0000 (10:15 +0000)]
[llvm-nm] Generalize ELF symbol types 'N' and 'n'

Reviewed By: grimar, jhenderson

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

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

5 years ago[NFC] Update documentation for AtomicCmpXchgInst
Serge Guelton [Thu, 20 Jun 2019 09:37:52 +0000 (09:37 +0000)]
[NFC] Update documentation for AtomicCmpXchgInst

Fix bz#42325

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

5 years agoTargetParserTest.ARMExtensionFeatures run out of memory on 32-bit (PR42316)
Sjoerd Meijer [Thu, 20 Jun 2019 09:33:11 +0000 (09:33 +0000)]
TargetParserTest.ARMExtensionFeatures run out of memory on 32-bit (PR42316)

Nothing of these tests made much sense. Loops were iterating too much, and I
also don't think it was actually testing anything. I think we simply want to
check that AEK_SOME_EXT returns "+some_ext".

I've given the AArch64 tests the same treatment as they very similarly didn't
made any sense either.

This fixes PR42316.

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

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

5 years ago[MIPS GlobalISel] Select integer to floating point conversions
Petar Avramovic [Thu, 20 Jun 2019 09:05:02 +0000 (09:05 +0000)]
[MIPS GlobalISel] Select integer to floating point conversions

Select G_SITOFP and G_UITOFP for MIPS32.

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

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

5 years ago[MIPS GlobalISel] Select floating point to integer conversions
Petar Avramovic [Thu, 20 Jun 2019 08:52:53 +0000 (08:52 +0000)]
[MIPS GlobalISel] Select floating point to integer conversions

Select G_FPTOSI and G_FPTOUI for MIPS32.

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

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

5 years ago[X86] Add test cases showing missed opportunities to use the C flag from the BLSI...
Craig Topper [Thu, 20 Jun 2019 06:45:01 +0000 (06:45 +0000)]
[X86] Add test cases showing missed opportunities to use the C flag from the BLSI instruction to avoid a TEST instruction

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

5 years ago[X86] Remove memory instructions form isUseDefConvertible.
Craig Topper [Thu, 20 Jun 2019 04:58:40 +0000 (04:58 +0000)]
[X86] Remove memory instructions form isUseDefConvertible.

The caller of this is looking for comparisons of the input
to these instructions with 0. But the memory instructions
input is an addess not a value input in a register.

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

5 years ago[X86] Add v64i8/v32i16 to several places in X86CallingConv.td where they seemed obvio...
Craig Topper [Thu, 20 Jun 2019 04:29:00 +0000 (04:29 +0000)]
[X86] Add v64i8/v32i16 to several places in X86CallingConv.td where they seemed obviously missing.

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

5 years agoAMDGPU: Don't clobber VCC in MUBUF addr64 emulation
Matt Arsenault [Thu, 20 Jun 2019 00:51:28 +0000 (00:51 +0000)]
AMDGPU: Don't clobber VCC in MUBUF addr64 emulation

Introducing VCC defs during SIFixSGPRCopies is generally
problematic. Avoid it by starting with the VOP3 form with the general
condition register. This is the easiest to fix instance, but doesn't
solve any specific problems I'm looking at.

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

5 years ago[llvm-objdump] Switch between ARM/Thumb based on mapping symbols.
Eli Friedman [Thu, 20 Jun 2019 00:29:40 +0000 (00:29 +0000)]
[llvm-objdump] Switch between ARM/Thumb based on mapping symbols.

The ARMDisassembler changes allow changing between ARM and Thumb mode
based on the MCSubtargetInfo, rather than the Target, which simplifies
the other changes a bit.

I'm not really happy with adding more target-specific logic to
tools/llvm-objdump/, but there isn't any easy way around it: the logic
in question specifically applies to disassembling an object file, and
that code simply isn't located in lib/Target, at least at the moment.

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

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

5 years agoAMDGPU: Consolidate some getGeneration checks
Matt Arsenault [Wed, 19 Jun 2019 23:54:58 +0000 (23:54 +0000)]
AMDGPU: Consolidate some getGeneration checks

This is incomplete, and ideally these would all be removed, but it's
better to localize them to the subtarget first with comments about
what they're for.

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

5 years ago[FileCheck] Stop qualifying expressions as numeric
Thomas Preud'homme [Wed, 19 Jun 2019 23:47:24 +0000 (23:47 +0000)]
[FileCheck] Stop qualifying expressions as numeric

Summary:
Stop referring to "numeric expression", using simply the term
"expression" instead. Likewise for numeric operation since operations
are only used in numeric expressions.

Reviewers: jhenderson, jdenny, probinson, arichardson

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

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

5 years agoFileCheck: Return parse error w/ Error & Expected
Thomas Preud'homme [Wed, 19 Jun 2019 23:47:10 +0000 (23:47 +0000)]
FileCheck: Return parse error w/ Error & Expected

Summary:
Make use of Error and Expected to bubble up diagnostics and force
checking of errors in the callers.

Reviewers: jhenderson, jdenny, probinson, arichardson

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

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

5 years agoAMDGPU: Undo sub x, c canonicalization for v2i16
Matt Arsenault [Wed, 19 Jun 2019 23:37:43 +0000 (23:37 +0000)]
AMDGPU: Undo sub x, c canonicalization for v2i16

Should avoid regression from D62341

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

5 years agoAMDGPU: Add baseline test for vector sub x, c canonicalization
Matt Arsenault [Wed, 19 Jun 2019 22:37:08 +0000 (22:37 +0000)]
AMDGPU: Add baseline test for vector sub x, c canonicalization

This will catch regressions from D62341, and show improvements from a
future patch to fix them.

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

5 years ago[DAGCombine] Use ConstantSDNode::getAPIntValue() instead of getZExtValue().
Simon Pilgrim [Wed, 19 Jun 2019 22:14:24 +0000 (22:14 +0000)]
[DAGCombine] Use ConstantSDNode::getAPIntValue() instead of getZExtValue().

Use getAPIntValue() in a few more places. Most of the time getZExtValue() is fine, but occasionally there's fuzzed code or someone decides to create i65536 or something.....

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

5 years ago[mips] Mark the `lwupc` instruction as MIPS64 R6 only
Simon Atanasyan [Wed, 19 Jun 2019 22:08:06 +0000 (22:08 +0000)]
[mips] Mark the `lwupc` instruction as MIPS64 R6 only

The "The MIPS64 Instruction Set Reference Manual" [1] states that
the `lwupc` is MIPS64 Release 6 only. It should not be supported
for 32-bit CPUs.

[1] https://s3-eu-west-1.amazonaws.com/downloads-mips/documents/MD00087-2B-MIPS64BIS-AFP-6.06.pdf

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

5 years ago[mips] Add (GPR|PTR)_64 predicates to PseudoReturn64 and PseudoIndirectHazardBranch64
Simon Atanasyan [Wed, 19 Jun 2019 22:07:46 +0000 (22:07 +0000)]
[mips] Add (GPR|PTR)_64 predicates to PseudoReturn64 and PseudoIndirectHazardBranch64

This patch is one of a series of patches. The goal is to make P5600
scheduler model complete and turn on the `CompleteModel` flag.

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

5 years ago[Util] Add a helper script for converting -print-before-all output into a file based...
Philip Reames [Wed, 19 Jun 2019 22:05:47 +0000 (22:05 +0000)]
[Util] Add a helper script for converting -print-before-all output into a file based equivelent

Simple little utility which takes a opt logfile generated with "opt -print-before-all -print-module-scope -o /dev/null <args> 2&>1", and splits into a series of individual "chunk-X.ll" files. The intended purpose is to help automate one step in failure reduction.

The imagined workflow is:

    New crasher bug reported against clang or other frontend
    Frontend run with -emit-llvm equivalent and manually confirmed that opt -O2 <emit.ll> crashes
    Run this splitter script
    Manually map pass name to invocation command (next on the to automate list)
    Run bugpoint on last chunk file + manual command

I chose to dump every chunk rather than only the last since miscompile debugging frequently requires either manual step by step reduction, or cross feeding IR into different compiler versions. Not an immediate target, but there may be applications.

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

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

5 years agoLFTR for multiple exit loops
Philip Reames [Wed, 19 Jun 2019 21:58:25 +0000 (21:58 +0000)]
LFTR for multiple exit loops

Teach IndVarSimply's LinearFunctionTestReplace transform to handle multiple exit loops. LFTR does two key things 1) it rewrites (all) exit tests in terms of a common IV potentially eliminating one in the process and 2) it moves any offset/indexing/f(i) style logic out of the loop.

This turns out to actually be pretty easy to implement. SCEV already has all the information we need to know what the backedge taken count is for each individual exit. (We use that when computing the BE taken count for the loop as a whole.) We basically just need to iterate through the exiting blocks and apply the existing logic with the exit specific BE taken count. (The previously landed NFC makes this super obvious.)

I chose to go ahead and apply this to all loop exits instead of only latch exits as originally proposed. After reviewing other passes, the only case I could find where LFTR form was harmful was LoopPredication. I've fixed the latch case, and guards aren't LFTRed anyways. We'll have some more work to do on the way towards widenable_conditions, but that's easily deferred.

I do want to note that I added one bit after the review.  When running tests, I saw a new failure (no idea why didn't see previously) which pointed out LFTR can rewrite a constant condition back to a loop varying one.  This was theoretically possible with a single exit, but the zero case covered it in practice.  With multiple exits, we saw this happening in practice for the eliminate-comparison.ll test case because we'd compute a ExitCount for one of the exits which was guaranteed to never actually be reached.  Since LFTR ran after simplifyAndExtend, we'd immediately turn around and undo the simplication work we'd just done.  The solution seemed obvious, so I didn't bother with another round of review.

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

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

5 years ago[Tests] Autogen a test so that future changes are understandable
Philip Reames [Wed, 19 Jun 2019 21:39:07 +0000 (21:39 +0000)]
[Tests] Autogen a test so that future changes are understandable

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

5 years ago[MemorySSA] Cleanup trivial phis.
Alina Sbirlea [Wed, 19 Jun 2019 21:33:09 +0000 (21:33 +0000)]
[MemorySSA] Cleanup trivial phis.

Summary:
This is unfortunately needed for correctness, if we are to extend the tolerance of the update API to the way simple loop unswitch is doing cloning.

In simple loop unswitch (as opposed to loop unswitch), not all blocks are cloned. This can create unreachable cloned blocks (no predecessor), which are later cleaned up.

In MemorySSA, the  APIs for supporting these kind of updates (clone + update exit blocks), make certain assumption on the integrity of the CFG. When cloning, if something was not cloned, it's values in MemorySSA default to LiveOnEntry. When updating exit blocks, it is safe to assume that we can first insert phis in the blocks merging two clones, then add additional phis in the IDF of the blocks that received phis. This no longer holds true if one of the clones being merged comes from an unreachable block. We'd conservatively need to add all phis before filling in their incoming definitions. In practice this restriction can be relaxed if we clean up trivial phis after the first round of insertion.

Reviewers: george.burgess.iv

Subscribers: jlebar, Prazek, llvm-commits

Tags: #llvm

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

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

5 years ago[MemorySSA] Use GraphDiff info when computing IDF.
Alina Sbirlea [Wed, 19 Jun 2019 21:17:31 +0000 (21:17 +0000)]
[MemorySSA] Use GraphDiff info when computing IDF.

Summary:
When computing IDF for insert updates, ensure we use the snapshot CFG offered by GraphDiff.
Caught by D63389.

Reviewers: kuhar, george.burgess.iv

Subscribers: jlebar, Prazek, llvm-commits, Szelethus

Tags: #llvm

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

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

5 years ago[LFTR] Stylistic cleanup as suggested in last review comment of D62939 [NFC]
Philip Reames [Wed, 19 Jun 2019 20:45:57 +0000 (20:45 +0000)]
[LFTR] Stylistic cleanup as suggested in last review comment of D62939 [NFC]

(Resumbit of r363292 which was reverted along w/an earlier patch)

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

5 years agoAMDGPU: Fix folding immediate into readfirstlane through reg_sequence
Matt Arsenault [Wed, 19 Jun 2019 20:44:15 +0000 (20:44 +0000)]
AMDGPU: Fix folding immediate into readfirstlane through reg_sequence

The def instruction for the vreg may not match, because it may be
folding through a reg_sequence. The assert was overly conservative and
not necessary. It's not actually important if DefMI really defined the
register, because the fold that will be done cares about the def of
the value that will be folded.

For some reason copies aren't making it through the reg_sequence,
although they should.

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

5 years ago[LFTR] Rename variable to minimize confusion [NFC]
Philip Reames [Wed, 19 Jun 2019 20:41:28 +0000 (20:41 +0000)]
[LFTR] Rename variable to minimize confusion [NFC]

(Recommit of r363293 which was reverted when a dependent patch was.)

As pointed out by Nikita in D62625, BackedgeTakenCount is generally used to refer to the backedge taken count of the loop. A conditional backedge taken count - one which only applies if a particular exit is taken - is called a ExitCount in SCEV code, so be consistent here.

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

5 years agohwasan: Shrink outlined checks by 1 instruction.
Peter Collingbourne [Wed, 19 Jun 2019 20:40:03 +0000 (20:40 +0000)]
hwasan: Shrink outlined checks by 1 instruction.

Turns out that we can save an instruction by folding the right shift into
the compare.

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

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

5 years agoReapply "AMDGPU: Add ds_gws_init / ds_gws_barrier intrinsics"
Matt Arsenault [Wed, 19 Jun 2019 19:55:27 +0000 (19:55 +0000)]
Reapply "AMDGPU: Add ds_gws_init / ds_gws_barrier intrinsics"

This reapplies r363678, using the correct chain for the CopyToReg for
v0. glueCopyToM0 counterintuitively changes the operands of the
original node.

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

5 years ago[llvm-readobj] Match GNU output for DT_RPATH and DT_RUNPATH when dumping dynamic...
Yuanfang Chen [Wed, 19 Jun 2019 19:31:07 +0000 (19:31 +0000)]
[llvm-readobj] Match GNU output for DT_RPATH and DT_RUNPATH when dumping dynamic symbol table.

Reviewers: jhenderson, grimar, MaskRay, rupprecht, espindola

Subscribers: emaste, nemanjai, arichardson, kbarton, llvm-commits

Tags: #llvm

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

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

5 years ago[SCEV] Revise a method description to match actual behavior [NFC]
Philip Reames [Wed, 19 Jun 2019 19:23:19 +0000 (19:23 +0000)]
[SCEV] Revise a method description to match actual behavior [NFC]

Reword the ScalarEvolution::getExitCount comment in the same terminology as used by getBackedgeTakenCount since they're equivelent for single exit loops.  Also, strengthen the comment to indicate exiting on the exact iteration specified is guaranteed.  Several transforms implicitly rely on this; and the actual implementation checks for it (via dominating latch checks).  So, spell out the guarantee in the comment.

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

5 years agogn build: Merge r363757.
Peter Collingbourne [Wed, 19 Jun 2019 19:11:23 +0000 (19:11 +0000)]
gn build: Merge r363757.

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

5 years agogn build: Merge r363848.
Peter Collingbourne [Wed, 19 Jun 2019 19:11:14 +0000 (19:11 +0000)]
gn build: Merge r363848.

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

5 years agogn build: Merge r363846.
Peter Collingbourne [Wed, 19 Jun 2019 19:11:05 +0000 (19:11 +0000)]
gn build: Merge r363846.

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

5 years agogn build: Merge r363794.
Peter Collingbourne [Wed, 19 Jun 2019 19:10:56 +0000 (19:10 +0000)]
gn build: Merge r363794.

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

5 years agogn build: Merge r363680.
Peter Collingbourne [Wed, 19 Jun 2019 19:10:47 +0000 (19:10 +0000)]
gn build: Merge r363680.

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

5 years agogn build: Merge r363712.
Peter Collingbourne [Wed, 19 Jun 2019 19:10:38 +0000 (19:10 +0000)]
gn build: Merge r363712.

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

5 years ago[llvm-objdump] Remove unnecessary indentation when dumping ELF data.
Yuanfang Chen [Wed, 19 Jun 2019 18:44:29 +0000 (18:44 +0000)]
[llvm-objdump] Remove unnecessary indentation when dumping ELF data.

Reviewers: MaskRay, jhenderson, rupprecht

Subscribers: llvm-commits

Tags: #llvm

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

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

5 years ago[TargetLowering] SimplifyDemandedBits - add ANY_EXTEND_VECTOR_INREG support
Simon Pilgrim [Wed, 19 Jun 2019 18:34:58 +0000 (18:34 +0000)]
[TargetLowering] SimplifyDemandedBits - add ANY_EXTEND_VECTOR_INREG support

Move 'lowest' demanded elt -> bitcast fold out of ZERO_EXTEND_VECTOR_INREG into ANY_EXTEND_VECTOR_INREG case.

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

5 years agoFix GlobalISel MachineVerifier tests. NFC.
Volkan Keles [Wed, 19 Jun 2019 18:15:45 +0000 (18:15 +0000)]
Fix GlobalISel MachineVerifier tests. NFC.

These test were failing when building llvm with
`-DLLVM_DEFAULT_TARGET_TRIPLE=''`. Add `-march` to the
run line to fix the issue.

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

5 years ago[x86] avoid vector load narrowing with extracted store uses (PR42305)
Sanjay Patel [Wed, 19 Jun 2019 18:13:47 +0000 (18:13 +0000)]
[x86] avoid vector load narrowing with extracted store uses (PR42305)

This is an exception to the rule that we should prefer xmm ops to ymm ops.
As shown in PR42305:
https://bugs.llvm.org/show_bug.cgi?id=42305
...the store folding opportunity with vextractf128 may result in better
perf by reducing the instruction count.

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

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

5 years ago[x86] add test for unaligned 32-byte load/store splitting; NFC
Sanjay Patel [Wed, 19 Jun 2019 18:06:59 +0000 (18:06 +0000)]
[x86] add test for unaligned 32-byte load/store splitting; NFC

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

5 years ago[test] Fix TargetParserTest runtime.
Jordan Rupprecht [Wed, 19 Jun 2019 18:03:36 +0000 (18:03 +0000)]
[test] Fix TargetParserTest runtime.

r363780 fixes extreme memory growth by using a new std::vector every loop iteration, but causes runtime to go up (and occasionally timeout in certain situations) because of constructor cost every loop iteration. Fix this by moving the constructor back out, but clearing contents in the loop.

Also apply this to the AArch64 features test case, which seems to use the same pattern.

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

5 years ago[TargetLowering] SimplifyDemandedBits ZERO_EXTEND_VECTOR_INREG -> ANY_EXTEND_VECTOR_INREG
Simon Pilgrim [Wed, 19 Jun 2019 18:00:24 +0000 (18:00 +0000)]
[TargetLowering] SimplifyDemandedBits ZERO_EXTEND_VECTOR_INREG -> ANY_EXTEND_VECTOR_INREG

Simplify ZERO_EXTEND_VECTOR_INREG if the extended bits are not required.

Matches what we already do for ZERO_EXTEND.

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

5 years ago[X86][SSE] combineToExtendVectorInReg - add ANY_EXTEND support TODO. NFCI.
Simon Pilgrim [Wed, 19 Jun 2019 17:42:37 +0000 (17:42 +0000)]
[X86][SSE] combineToExtendVectorInReg - add ANY_EXTEND support TODO. NFCI.

So I don't forget - there's a load of yak shaving to do first.

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

5 years ago[InstCombine] Fold icmp eq/ne (and %x, signbit), 0 -> %x s>=/s< 0 earlier
Huihui Zhang [Wed, 19 Jun 2019 17:31:39 +0000 (17:31 +0000)]
[InstCombine] Fold  icmp eq/ne (and %x, signbit), 0 -> %x s>=/s< 0  earlier

Summary:
To generate simplified IR, make sure fold
```
  (X & signbit) ==/!= 0) -> X s>=/s< 0;
```
is scheduled before fold
```
  ((X << Y) & C) == 0 -> (X & (C >> Y)) == 0.
```

https://rise4fun.com/Alive/fbdh

Reviewers: lebedev.ri, efriedma, spatel, craig.topper

Reviewed By: lebedev.ri

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

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

5 years ago[InstSimplify] add a phi test with 1 incoming value; NFC
Sanjay Patel [Wed, 19 Jun 2019 17:23:29 +0000 (17:23 +0000)]
[InstSimplify] add a phi test with 1 incoming value; NFC

D63489 proposes to change this behavior, but there's no
direct -instsimplify test to verify that the transform exists.

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

5 years ago[X86][SSE] Combine shuffles to ANY_EXTEND/ANY_EXTEND_VECTOR_INREG.
Simon Pilgrim [Wed, 19 Jun 2019 17:21:15 +0000 (17:21 +0000)]
[X86][SSE] Combine shuffles to ANY_EXTEND/ANY_EXTEND_VECTOR_INREG.

We already do this for ZERO_EXTEND/ZERO_EXTEND_VECTOR_INREG - this just extends the pattern matcher to recognize cases where we don't need the zeros in the extension.

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