Commit Graph

145647 Commits

Author SHA1 Message Date
Zachary Turner
a6cf40b584 [Support] Re-add the special OSX flags on mmap.
The problem appears to be that these flags can only be used
when mapping a file for read-only, not for readwrite.  So
we do that here.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295880 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 21:24:06 +00:00
Krzysztof Parzyszek
7af390a681 [Hexagon] Add intrinsics for masked vector stores
Patch by Harsha Jagasia.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295879 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 21:23:09 +00:00
Matt Arsenault
c1d17d5f71 AMDGPU: Don't look at chain users when adjusting writemask
Fixes not adjusting using new intrinsics with chains.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295878 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 21:16:41 +00:00
Matt Arsenault
138d429065 AMDGPU: Always allocate emergency stack slot at offset 0
This allows us to ensure that 0 is never a valid pointer
to a user object, and ensures that the offset is always legal
without needing a register to access it. This comes at the cost
of usable offsets and wasted stack space.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295877 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 21:05:25 +00:00
Derek Schuff
ca81270fb4 [WebAssembly] Update llvm-readobj tests for switch to version 0x1
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295875 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 21:01:17 +00:00
Matt Arsenault
1b020b3be5 AMDGPU: Change exp with compr bit printing
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295873 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 20:37:12 +00:00
Wei Ding
9b1c9472f5 Revert "AMDGPU : Update TrapCode based on Trap Handler ABI."
This reverts commit r295867.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295871 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 20:29:22 +00:00
Dan Gohman
093a7eb7bd [WebAssembly] Update llvm-objdump tests for the new wasm version number.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295869 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 20:24:16 +00:00
Alexey Bataev
d6db829b03 [SLP] Fix for PR32036: Vectorized horizontal reduction returning wrong result
Summary:
If the same value is used several times as an extra value, SLP
vectorizer takes it into account only once instead of actual number of
using.
For example:
```
int val = 1;
for (int y = 0; y < 8; y++) {
  for (int x = 0; x < 8; x++) {
    val = val + input[y * 8 + x] + 3;
  }
}
```
We have 2 extra rguments: `1` - initial value of horizontal reduction
and `3`, which is added 8*8 times to the reduction. Before the patch we
added `1` to the reduction value and added once `3`, though it must be
added 64 times.

Reviewers: mkuper, mzolotukhin

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295868 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 20:06:40 +00:00
Wei Ding
d70493f450 AMDGPU : Update TrapCode based on Trap Handler ABI.
Differential Revision: http://reviews.llvm.org/D30232

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295867 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 20:05:06 +00:00
Rafael Espindola
2504ec9f08 Move llvm_unreachable out of switch.
This should make gcc happy and still produce a clang warning if we add
another value to the enum.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295865 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 19:42:14 +00:00
Matthias Braun
a0ae75470a Bring back 2>&1 redirection for this test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295864 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 19:16:33 +00:00
Geoff Berry
6b494b30f2 [AArch64] Extend AArch64RedundantCopyElimination to do simple copy propagation.
Summary:
Extend AArch64RedundantCopyElimination to catch cases where the register
that is known to be zero is COPY'd in the predecessor block.  Before
this change, this pass would catch cases like:

      CBZW %W0, <BB#1>
  BB#1:
      %W0 = COPY %WZR // removed

After this change, cases like the one below are also caught:

      %W0 = COPY %W1
      CBZW %W1, <BB#1>
  BB#1:
      %W0 = COPY %WZR // removed

This change results in a 4% increase in static copies removed by this
pass when compiling the llvm test-suite.  It also fixes regressions
caused by doing post-RA copy propagation (a separate change to be put up
for review shortly).

Reviewers: junbuml, mcrosier, t.p.northover, qcolombet, MatzeB

Subscribers: aemerson, rengolin, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295863 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 19:10:45 +00:00
Matthew Simpson
ef6eb7f42c [LV] Add scalar floating-point induction test (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295862 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 19:09:38 +00:00
Davide Italiano
33b82ff8c4 [ModuleSummaryAnalysis] Don't crash when referencing unnamed globals.
Instead, just be conservative as these are unfrequent enough. Thanks
to Peter Collingbourne for the discussion about this on IRC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295861 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 18:53:38 +00:00
Dan Gohman
6d5b578789 [WebAssembly] Implement the wasm binary container header.
Also, update the version number to 0x1, which is what engines are now
expecting.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295860 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 18:50:20 +00:00
Matthias Braun
3f55d742b2 MIRTests: Remove unnecessary 2>&1 redirection
llc mir output goes to stdout nowadays, so the 2>&1 is not necessary
anymore for most tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295859 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 18:47:41 +00:00
Karl-Johan Karlsson
29fec22c97 [LoopVectorize] Added address space check when analysing interleaved accesses
Prevent memory objects of different address spaces to be part of
the same load/store groups when analysing interleaved accesses.

This is fixing pr31900.

Reviewers: HaoLiu, mssimpso, mkuper

Reviewed By: mssimpso, mkuper

Subscribers: llvm-commits, efriedma, mzolotukhin

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

This reverts r295042 (re-applies r295038) with an additional fix for the
buildbot problem.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295858 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 18:37:36 +00:00
Dan Gohman
2be1878c67 [WebAssembly] Define a table of function signatures for runtime library calls.
LLVM CodeGen emits references to external symbols that are never declared in
LLVM IR level, so they have no declared signature. However, WebAssembly requires
all functions be declared with signatures. This patch adds a table for providing
signatures for known runtime libcalls that will be used in subsequent patches to
emit declarations for such functions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295857 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 18:34:16 +00:00
Krzysztof Parzyszek
e2af082e44 [RDF] Skip undef uses when calculating kill flags
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295856 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 18:29:16 +00:00
Krzysztof Parzyszek
c5ffa24bc1 [RDF] Only access block live-ins when tracking liveness
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295855 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 18:27:36 +00:00
Michal Gorny
39b10e911b [Support] Provide linux/magic.h fallback for older kernels
The function for distinguishing local and remote files added in r295768
unconditionally uses linux/magic.h header to provide necessary
filesystem magic numbers. However, in kernel headers predating 2.6.18
the magic numbers are spread throughout multiple include files.
Furthermore, LLVM did not require kernel headers being installed so far.

To increase the portability across different versions of Linux kernel
and different Linux systems, add CMake header checks for linux/magic.h
and -- if it is missing -- the linux/nfs_fs.h and linux/smb.h headers
which contained the numbers previously.

Furthermore, since the numbers are static and the feature does not seem
critical enough to make LLVM require kernel headers at all, add fallback
constants for the case when none of the necessary headers is available.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295854 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 18:09:15 +00:00
Alexey Bataev
437bff4b03 [SLP] Test with extra argument used several times.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295853 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 17:47:28 +00:00
Dehao Chen
94ebcf7e5e Fix an obvious bug in SampleProfileReaderGCC.
Summary: The CallTargetProfile should be added to FProfile to be consistent with other profile readers.

Reviewers: dnovillo, davidxl

Reviewed By: davidxl

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295852 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 17:27:21 +00:00
Dan Gohman
61ce026358 [WebAssembly] Configure codegen to legalize f16 values.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295850 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 16:28:00 +00:00
Bill Seurer
6ef315bddb [DAGCombiner] revert r295336
r295336 causes a bootstrapped clang to fail for many compilations on
powerpc BE.  See 
http://lab.llvm.org:8011/builders/clang-ppc64be-linux-multistage/builds/2315
for example.

Reverting as per the developer's request.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295849 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 16:27:33 +00:00
Simon Pilgrim
458f2a48cd [X86][SSE] getTargetConstantBitsFromNode - insert constant bits directly into masks.
Minor optimization, don't create temporary mask APInts that are just going to be OR'd into the accumulate masks - insert directly instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295848 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 15:38:13 +00:00
Simon Pilgrim
5eef3502f8 [X86][SSE] Use APInt::getBitsSet() instead of APInt::getLowBitsSet().shl() separately. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295845 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 15:04:55 +00:00
Simon Dardis
fd07c4c7b5 [Support] XFAIL is_local for mips
is_local can't pass on some our buildbots as some of our buildbots use network
shares for building and testing LLVM.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295840 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 14:34:45 +00:00
Dmitry Preobrazhensky
c7a2269d72 * [AMDGPU][mc][tests] Updated coverage/smoke tests for gfx7 and gfx8; minor test corrections.
NB: several old tests have been corrected because they violated constant bus limitations

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295834 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 13:59:39 +00:00
Simon Pilgrim
d10ce4865f Fix -Wunused-but-set-variable warning by removing unused 'aggregateIsPacked' checking
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295830 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 13:37:31 +00:00
Benjamin Kramer
8218b76114 [GlobalISel] Fix compiler warnings and make assert assert something.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295827 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 12:59:47 +00:00
Alexey Bataev
2a5165d7dc [SLP] Remove unused initial value from the variable, NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295826 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 12:57:58 +00:00
Igor Breger
8ae3570fa8 [X86][GlobalISel] Initial implementation , select G_ADD gpr, gpr
Summary: Initial implementation for X86InstructionSelector. Handle selection COPY and G_ADD/G_SUB gpr, gpr .

Reviewers: qcolombet, rovka, zvi, ab

Reviewed By: rovka

Subscribers: mgorny, dberris, kristof.beyls, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295824 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 12:25:09 +00:00
Simon Pilgrim
0766c65e73 [X86] Regenerate CSE test with codegen instead of just the instruction count
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295819 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 10:12:46 +00:00
Roger Ferrer Ibanez
296acceca1 [ARM] Fix constant islands pass.
The pass tries to fix a spill of LR that turns out to be unnecessary.
So it removes the tPOP but forgets to remove tPUSH.
This causes the stack be misaligned upon returning the function.

Thus, remove the tPUSH as well in this case.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295816 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 09:06:21 +00:00
Benjamin Kramer
5edec6931c Write to a temporary file in test instead of random file in the test directory.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295815 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 09:02:27 +00:00
Ayman Musa
7f45e918f8 [X86] Fix memory operands definition for some instructions.
Change integer memory operands to FP memory operands to some FP instructions.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295813 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 08:06:29 +00:00
Justin Bogner
3d433ea2e3 OptDiag: Add const to some interfaces that don't modify anything. NFC
This needed a const_cast for the dominator tree recalculation in
OptimizationRemarkEmitter, but we do that all over the place already
and it's safe.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295812 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 07:38:17 +00:00
Javed Absar
6badf185b6 [ARM] Classification Improvements to ARM Sched-Models. NFCI.
This patch adds missing sched classes for Thumb2 instructions.
This has been missing so far, and as a consequence, machine
scheduler models for individual sub-targets have tended to
be larger than they needed to be. These patches should help
write schedulers better and faster in the future
for ARM sub-targets.

Reviewer: Diana Picus
Differential Revision: https://reviews.llvm.org/D29953



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295811 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 07:22:57 +00:00
Craig Topper
544076881b [AVX-512] Allow legacy scalar min/max intrinsics to select EVEX instructions when available
This patch introduces new X86ISD::FMAXS and X86ISD::FMINS opcodes. The legacy intrinsics now lower to this node. As do the AVX-512 masked intrinsics when the rounding mode is CUR_DIRECTION.

I've merged a copy of the tablegen multiclass avx512_fp_scalar into avx512_fp_scalar_sae. avx512_fp_scalar still needs to support CUR_DIRECTION appearing as a rounding mode for X86ISD::FADD_ROUND and others.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295810 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 06:54:18 +00:00
Sanjoy Das
7e76879901 [ValueTracking] Make poison propagation more aggressive
Summary:
Motivation: fix PR31181 without regression (the actual fix is still in
progress).  However, the actual content of PR31181 is not relevant
here.

This change makes poison propagation more aggressive in the following
cases:

 1. poision * Val == poison, for any Val.  In particular, this changes
    existing intentional and documented behavior in these two cases:
     a. Val is 0
     b. Val is 2^k * N
 2. poison << Val == poison, for any Val
 3. getelementptr is poison if any input is poison

I think all of these are justified (and are axiomatically true in the
new poison / undef model):

1a: we need poison * 0 to be poison to allow transforms like these:

  A * (B + C) ==> A * B + A * C

If poison * 0 were 0 then the above transform could not be allowed
since e.g. we could have A = poison, B = 1, C = -1, making the LHS

  poison * (1 + -1) = poison * 0 = 0

and the RHS

  poison * 1 + poison * -1 = poison + poison = poison

1b: we need e.g. poison * 4 to be poison since we want to allow

  A * 4 ==> A + A + A + A

If poison * 4 were a value with all of their bits poison except the
last four; then we'd not be able to do this transform since then if A
were poison the LHS would only be "partially" poison while the RHS
would be "full" poison.

2: Same reasoning as (1b), we'd like have the following kinds
transforms be legal:

  A << 1 ==> A + A

Reviewers: majnemer, efriedma

Subscribers: mcrosier, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295809 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 06:52:32 +00:00
Sean Silva
0b39c0f14b Use const-ref in range-loop for to avoid copying pairs of std::string
No reason to create temporaries.

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

Patch by sergio.martins!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295807 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 06:34:04 +00:00
Dan Gohman
d660a5d68c [WebAssembly] Add skeleton MC support for the Wasm container format
This just adds the basic skeleton for supporting a new object file format.
All of the actual encoding will be implemented in followup patches.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295803 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 01:23:18 +00:00
Rui Ueyama
9a736108d4 Fix -Wcovered-switch-default.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295799 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 01:01:45 +00:00
Matt Arsenault
7d65faa5cc AMDGPU: Add cvt.pkrtz intrinsic
Convert llvm.SI.packf16 test uses

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295797 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 00:27:34 +00:00
Michael Kuperstein
2b21febc6b [LoopUnroll] Enable PGO-based loop peeling by default.
This enables peeling of loops with low dynamic iteration count by default,
when profile information is available.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295796 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 00:27:34 +00:00
Matt Arsenault
7d9379397a AMDGPU: Remove some uses of llvm.SI.export in tests
Merge some of the old, smaller tests into more complete versions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295792 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 00:02:21 +00:00
Matt Arsenault
6de2a82753 AMDGPU: Remove llvm.AMDGPU.clamp intrinsic
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295789 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-21 23:46:04 +00:00
Matt Arsenault
aac82e218f AMDGPU: Redefine clamp node as clamp 0.0-1.0
Change implementation to use max instead of add.
min/max/med3 do not flush denormals regardless of the mode,
so it is OK to use it whether or not they are enabled.

Also allow using clamp with f16, and use knowledge
of dx10_clamp.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295788 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-21 23:35:48 +00:00