145430 Commits

Author SHA1 Message Date
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
Artem Belevich
b1a24afa7a [NVPTX] Unify vectorization of load/stores of aggregate arguments and return values.
Original code only used vector loads/stores for explicit vector arguments.
It could also do more loads/stores than necessary (e.g v5f32 would
touch 8 f32 values). Aggregate types were loaded one element at a time,
even the vectors contained within.

This change attempts to generalize (and simplify) parameter space
loads/stores so that vector loads/stores can be used more broadly.
Functionality of the patch has been verified by compiling thrust
test suite and manually checking the differences between PTX
generated by llvm with and without the patch.

General algorithm:
* ComputePTXValueVTs() flattens input/output argument into a flat list
  of scalars to load/store and returns their types and offsets.
* VectorizePTXValueVTs() uses that data to create vectorization plan
  which returns an array of flags marking boundaries of vectorized
  load/stores. Scalars are represented as 1-element vectors.
* Code that generates loads/stores implements a simple state machine
  that constructs a vector according to the plan.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295784 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-21 22:56:05 +00:00
Matt Arsenault
36229b4631 AMDGPU: Formatting fixes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295783 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-21 22:50:41 +00:00
Matt Arsenault
8f5956381c DAG: Check if extract_vector_elt is legal or custom
Avoids test regressions in future AMDGPU commits when
more vector types are custom lowered.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295782 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-21 22:47:27 +00:00
Evandro Menezes
450fce7072 [AArch64, X86] Add statistics for the MacroFusion pass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295777 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-21 22:16:13 +00:00
Evandro Menezes
6a905f67f6 [AArch64, X86] Guard against both instrs being wild cards
If both instrs are wild cards, the result can be a crash.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295776 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-21 22:16:11 +00:00
Evandro Menezes
bcd633da12 [AArch64] Add test case for fusion of literal generation
Add test case from https://reviews.llvm.org/D28698 that was somehow lost in
transit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295775 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-21 22:16:09 +00:00
Evandro Menezes
d9de925b22 [AArch64] Add test case for fusion of AES crypto operations
Add test case from https://reviews.llvm.org/D28491 that was somehow lost in
transit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295774 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-21 22:16:06 +00:00
Eugene Zelenko
c688c0bb51 [CodeGen] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295773 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-21 22:07:52 +00:00
Zachary Turner
0f341e41e5 Try to fix the buildbot on OSX.
Since I'm only seeing failures on OSX, and it's saying
permission denied, I'm suspecting this is due to the addition
of the MAP_RESILIENT_CODESIGN and/or MAP_RESILIENT_MEDIA flags.
Speculatively trying to remove those to get the bots working.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295770 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-21 21:31:28 +00:00
Zachary Turner
83fbeaf3ba Try to fix Android build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295769 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-21 21:13:10 +00:00
Zachary Turner
167b16d8fb [Support] Add a function to check if a file resides locally.
Differential Revision: https://reviews.llvm.org/D30010

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295768 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-21 20:55:47 +00:00
Xin Tong
97a57b3013 Make default value for disable-licm-promotion in licm explicit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295767 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-21 20:53:48 +00:00
Rafael Espindola
13f0c80b28 Don't modify archive members unless really needed.
For whatever reason ld64 requires that member headers (not the member
themselves) should be aligned. The only way to do that is to edit the
previous member so that it ends at an aligned boundary.

Since modifying data put in an archive is an undesirable property,
llvm-ar should only do it when it is absolutely necessary.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295765 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-21 20:40:54 +00:00
Evgeniy Stepanov
2c0dd61dd0 Fix PR31896.
Address of an alias of a global with offset is incorrectly lowered as an address of the global (i.e. ignoring offset).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295762 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-21 20:17:34 +00:00
Zachary Turner
f7ae539291 Try to fix line endings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295759 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-21 19:52:57 +00:00
Sanjay Patel
2d562fe758 [InstCombine] canonicalize non-obivous forms of integer min/max
This is part of trying to clean up our handling of min/max patterns in IR.
By converting these to canonical form, we're more likely to recognize them
because there are various places in InstCombine that don't use 
matchSelectPattern or m_SMax and friends.

The backend fixups referenced in the now deleted TODO comment were added with:
https://reviews.llvm.org/rL291392
https://reviews.llvm.org/rL289738

If there's any codegen fallout from this change, we should be able to address
it in DAGCombiner or target-specific lowering. 


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295758 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-21 19:33:53 +00:00
Matt Arsenault
8a7ccd7129 AMDGPU: Remove dead declarations in tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295757 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-21 19:31:33 +00:00