38418 Commits

Author SHA1 Message Date
Craig Topper
f2a1f86928 [X86] Make the FMA3 instruction names consistent between VEX and EVEX encoded versions.
This places the 132/213/231 form number in front of the SS/SD/PS/PD. Move the Y for 256-bit versions to be after the PS/PD. Change the AVX512 scalar forms to include a Z in the their name. This new format should be consistent with the general naming of instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276559 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-24 08:26:38 +00:00
Elena Demikhovsky
ba55955caa [Loop Vectorizer] Handling loops FP induction variables.
Allowed loop vectorization with secondary FP IVs. Like this:
float *A;
float x = init;
for (int i=0; i < N; ++i) {
  A[i] = x;
  x -= fp_inc;
}

The auto-vectorization is possible when the induction binary operator is "fast" or the function has "unsafe" attribute.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276554 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-24 07:24:54 +00:00
Simon Pilgrim
9c7a6d9f59 [X86][SSE] Added float widened broadcast tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276535 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-23 21:24:02 +00:00
Simon Pilgrim
ada7d323cd [X86][SSE] Added more widened broadcast tests
Added more vXi16 and vXi8 tests

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276534 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-23 21:15:31 +00:00
Simon Pilgrim
55a640e4b7 [X86][SSE] Added tests where we should be trying to widen a load+splat into a broadcast
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276527 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-23 16:19:17 +00:00
Simon Pilgrim
a0a5960eef [X86][SSE] Regenerated uitofp <2 x i32> -> <2 x float> conversion tests
Demonstrate difference in codegen discussed on PR14760

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276526 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-23 15:55:42 +00:00
Sanjay Patel
6928c3c35e [InstCombine] allow icmp (bit-manipulation-intrinsic(), C) folds for vectors
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276523 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-23 13:06:49 +00:00
Craig Topper
6381dfd7ee [AVX512] Implement commuting support for EVEX encoded FMA3 instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276521 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-23 07:16:56 +00:00
Xinliang David Li
52e0b0d91b [Profile] Use explicit flag to enable IR PGO
Patch by Jake VanAdrighem

Differential Revision: http://reviews.llvm.org/D22607




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276516 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-23 04:28:52 +00:00
Sanjoy Das
fa29211988 [SCEV] Make isImpliedCondOperandsViaRanges smarter
This change lets us prove things like

  "{X,+,10} s< 5000" implies "{X+7,+,10} does not sign overflow"

It does this by replacing replacing getConstantDifference by
computeConstantDifference (which is smarter) in
isImpliedCondOperandsViaRanges.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276505 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-23 00:54:36 +00:00
Sanjay Patel
c9b262bfbd auto-generate checks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276501 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-23 00:09:54 +00:00
Tom Stellard
a6b9e20623 Revert "[AMDGPU] Emit read-only data to .rodata for hsa"
This reverts commit r276298.

Data stored in .rodata can have a negative offset from .text, but we
don't support negative values in relocations yet.

This caused a regression in one of the amp conformance tests:
5_Data_Cont/5_2_a_v/5_2_3_m/Assignment/Test.02.01

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276498 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-22 23:46:40 +00:00
Adam Nemet
5781107c29 [LoopDataPrefetch] Include hotness of region in opt remark
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276488 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-22 22:53:17 +00:00
Sanjay Patel
6176c36ce3 add tests for icmp vector folds
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276482 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-22 22:19:52 +00:00
Tim Northover
3921674c30 GlobalISel: allow multiple types on MachineInstrs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276481 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-22 22:13:36 +00:00
Vitaly Buka
ecefac9053 Unpoison stack before resume instruction
Summary:
Clang inserts cleanup code before resume similar way as before return instruction.
This makes asan poison local variables causing false use-after-scope reports.

__asan_handle_no_return does not help here as it was executed before
llvm.lifetime.end inserted into resume block.

To avoid false report we need to unpoison stack for resume same way as for return.

PR27453

Reviewers: kcc, eugenis

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276480 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-22 22:04:38 +00:00
Alina Sbirlea
9909951848 Add flag to PassManagerBuilder to disable GVN Hoist Pass.
Summary:
Adding a flag to diable GVN Hoisting by default.
Note: The GVN Hoist Pass causes some Halide tests to hang. Halide will disable the pass while investigating.

Reviewers: llvm-commits, chandlerc, spop, dberlin

Subscribers: mehdi_amini

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276479 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-22 22:02:19 +00:00
Michael Kuperstein
e5b8fbc43a [SLPVectorizer] Vectorize reverse-order loads in horizontal reductions
When vectorizing a tree rooted at a store bundle, we currently try to sort the
stores before building the tree, so that the stores can be vectorized. For other
trees, the order of the root bundle - which determines the order of all other
bundles - is arbitrary. That is bad, since if a leaf bundle of consecutive loads
happens to appear in the wrong order, we will not vectorize it.

This is partially mitigated when the root is a binary operator, by trying to
build a "reversed" tree when that's considered profitable. This patch extends the
workaround we have for binops to trees rooted in a horizontal reduction.

This fixes PR28474.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276477 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-22 21:28:48 +00:00
Sanjay Patel
7416201c31 add tests for icmp vector folds
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276476 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-22 21:28:20 +00:00
Sanjay Patel
2215e9b5b0 add tests for icmp vector folds
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276475 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-22 21:13:08 +00:00
Sanjay Patel
b5911c2fd8 add tests for icmp vector folds
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276472 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-22 21:02:33 +00:00
Vedant Kumar
d12f3729fd [llvm-cov] Don't copy stylesheets into index files
Just link in the stylesheet from the toplevel dir of the report.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276468 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-22 20:49:23 +00:00
Sanjay Patel
e61393a939 update to use FileCheck and auto-generate checks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276466 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-22 20:39:07 +00:00
Sanjay Patel
86728a0d70 add tests for icmp vector folds
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276464 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-22 20:11:08 +00:00
Tim Northover
ea26cb1f48 GlobalISel: implement legalization pass, with just one transformation.
This adds the actual MachineLegalizeHelper to do the work and a trivial pass
wrapper that legalizes all instructions in a MachineFunction. Currently the
only transformation supported is splitting up a vector G_ADD into one acting on
smaller vectors.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276461 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-22 20:03:43 +00:00
Teresa Johnson
13bed9484c [ThinLTO/gold] Remove thin archive part of new test due to bot failures
I am getting a bot failure from the thin archive part of this test:

From
http://bb.pgr.jp/builders/cmake-llvm-x86_64-linux/builds/40468/steps/test_llvm/logs/LLVM%20%3A%3A%20tools__gold__X86__thinlto_emit_linked_objects.ll:

Command Output (stderr):
--
/home/bb/cmake-llvm-x86_64-linux/build/./bin/llvm-ar: creating
/home/bb/cmake-llvm-x86_64-linux/build/test/tools/gold/X86/Output/thinlto_emit_linked_objects.ll.tmp2.a
/usr/bin/ld.gold: internal error in add_writer, at
../../gold/token.h:124

--

This appears to be an issue with an older version of gold. The test case
passes for me locally when I use the gold v1.12 I was testing with, but
when I tried the gold installed on my system which is v1.11 I get the
same error.

Remove the thin archive version of the test, since there isn't a way to
predicate it on gold version.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276453 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-22 18:32:30 +00:00
Jun Bum Lim
0618303382 Recommit - [DSE]Enhance shorthening MemIntrinsic based on OverlapIntervals
Recommiting r275571 after fixing crash reported in PR28270.
Now we erase elements of IOL in deleteDeadInstruction().

Original Summary:
This change use the overlap interval map built from partial overwrite tracking to perform shortening MemIntrinsics.
Add test cases which was missing opportunities before.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276452 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-22 18:27:24 +00:00
Sanjay Patel
f9e61b69a6 add tests for vector bit manipulation intrinsics
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276451 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-22 18:22:25 +00:00
Teresa Johnson
9493a84086 [ThinLTO/gold] Support for getting list of included objects from gold
Summary:
In the distributed backend case, the ThinLink step and the final native
object link are separate processes. This can be problematic when archive
libraries are involved in the link (e.g. via --start-lib/--end-lib
pairs). The linker only includes objects from libraries when
there is a strong reference to them, and depending on the intervening
ThinLTO backend processes' importing/inlining, the strong references
may appear different in the two link steps. See D22356 and D22467
for two scenarios where this causes issues.

To ensure that the final link includes the same objects, this patch
adds support for an "=filename" form of the thinlto-index-only plugin
option, in which case objects gold included in the link are emitted to
the given filename. This should be used as input to the final link (e.g.
via the @filename option to gold), instead of listing all the objects
within --start-lib/--end-lib pairs again.

Note that the support for the gold callback that identifies included
objects was added in gold version 1.12.

Reviewers: davidxl, mehdi_amini

Subscribers: llvm-commits, mehdi_amini

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276450 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-22 18:20:22 +00:00
Wei Mi
a6c7a032fe [PM] Port BreakCriticalEdges to the new PM.
Differential Revision: https://reviews.llvm.org/D22688


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276449 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-22 18:04:25 +00:00
Anna Thomas
80ee170cb3 Invariant start/end intrinsics overloaded for address space
Summary:
The llvm.invariant.start and llvm.invariant.end intrinsics currently
support specifying invariant memory objects only in the default address
space.

With this change, these intrinsics are overloaded for any adddress space
for memory objects
and we can use these llvm invariant intrinsics in non-default address
spaces.

Example: llvm.invariant.start.p1i8(i64 4, i8 addrspace(1)* %ptr)

This overloaded intrinsic is needed for representing final or invariant
memory in managed languages.

Reviewers: apilipenko, reames

Subscribers: llvm-commits

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276447 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-22 17:49:40 +00:00
Matt Arsenault
c5a5706d17 AMDGPU: Remove redundant test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276439 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-22 17:01:36 +00:00
Matt Arsenault
9da217ee1e AMDGPU: Fix groupstaticsize for large LDS
The size can exceed s_movk_i32's limit, and we don't
want to use it this early since it inhibits optimizations.

This should probably be merged to the release branch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276438 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-22 17:01:33 +00:00
Matt Arsenault
30f0e3e4be AMDGPU: Add HSA dispatch id intrinsic
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276437 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-22 17:01:30 +00:00
Matt Arsenault
7488ab3114 AMDGPU: Fix i1 fp_to_int
R600's i1 fp_to_uint selected but was incorrect according to
what instcombine constant folds to.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276435 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-22 17:01:21 +00:00
Tim Northover
04e7d3ce19 GlobalISel: implement alloca instruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276433 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-22 16:59:52 +00:00
Simon Pilgrim
85f2423a35 [SelectionDAG] Optimization of BITREVERSE legalization for power-of-2 integer scalar/vector types
An extension of D19978, this patch replaces the default BITREVERSE evaluation of individual bit masks+shifts with block mask+shifts when we have integer elements of power-of-2 bits in size.

After calling BSWAP to reverse the order of the constituent bytes (which typically follows a similar approach), every neighbouring 4-bits, 2-bits and finally 1-bit pairs are masked off and swapped over with shifts.

In doing so we can significantly reduce the number of operations required.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276432 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-22 16:46:25 +00:00
Krzysztof Parzyszek
262370bdcc [Hexagon] Use loop data prefetch on Hexagon
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276422 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-22 14:22:43 +00:00
Simon Pilgrim
370589a158 [X86][AVX] Added support for lowering to VBROADCASTF128/VBROADCASTI128 (reapplied)
As reported on PR26235, we don't currently make use of the VBROADCASTF128/VBROADCASTI128 instructions (or the AVX512 equivalents) to load+splat a 128-bit vector to both lanes of a 256-bit vector.

This patch enables lowering from subvector insertion/concatenation patterns and auto-upgrades the llvm.x86.avx.vbroadcastf128.pd.256 / llvm.x86.avx.vbroadcastf128.ps.256 intrinsics to match.

We could possibly investigate using VBROADCASTF128/VBROADCASTI128 to load repeated constants as well (similar to how we already do for scalar broadcasts).

Reapplied with fix for PR28657 - removed intrinsic definitions (clang companion patch to be be submitted shortly).

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276416 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-22 13:58:44 +00:00
Ahmed Bougacha
e01551dfca [FastISel] Ignore @llvm.assume.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276410 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-22 12:54:53 +00:00
Ying Yi
d6931b112a [llvm-cov] - Add the coverage of lines in the summary report.
The llvm-cov ‘report' command displays a summary of the coverage of a binary file.
The summary report currently only includes covered regions and covered functions.
This patch adds the coverage of lines in the summary report.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276409 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-22 12:46:13 +00:00
Benjamin Kramer
3d6f5139ec [llvm-profdata] Bring back reading profile data from STDIN.
This feature was lost in r276197.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276407 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-22 12:39:55 +00:00
Benjamin Kramer
964a86a1f7 Revert "[X86][AVX] Added support for lowering to VBROADCASTF128/VBROADCASTI128"
It caused PR28657.

This reverts commit r276281.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276405 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-22 11:03:10 +00:00
Ying Yi
9b5c51d077 [llvm-cov] - Improve llvm-cov error message
Summary:

When giving the following command:
% llvm-cov report -instr-profile=default.profraw

llvm-cov will give the following error message:

>llvm-cov report: Not enough positional command line arguments specified!
>Must specify at least 1 positional arguments: See: orbis-llvm-cov report -help

This patch changes the error message from  '1 positional arguments'
to '1 positional argument'.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276404 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-22 10:52:21 +00:00
Hrvoje Varga
389773fbfb [mips][microMIPS] Implement SLT, SLTI, SLTIU, SLTU microMIPS32r6 instructions
Differential Revision: https://reviews.llvm.org/D19906


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276397 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-22 07:18:33 +00:00
Craig Topper
22cd3ed2a2 [AVX512] Add ExeDomain to vector extend and truncate instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276394 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-22 05:46:44 +00:00
Craig Topper
f876acdcd8 [AVX512] Add initial support for the Execution Domain fixing pass to change some EVEX instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276393 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-22 05:00:52 +00:00
Craig Topper
55cd727608 [AVX512] Add load folding for some AVX512VL logic and arithmetic instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276391 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-22 05:00:39 +00:00
Craig Topper
71a0540303 [AVX512] Update X86InstrInfo::foldMemoryOperandCustom to handle the EVEX encoded instructions too.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276390 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-22 05:00:35 +00:00
David Majnemer
14834723b0 Don't remove side effecting instructions due to ConstantFoldInstruction
Just because we can constant fold the result of an instruction does not
imply that we can delete the instruction.  It may have side effects.

This fixes PR28655.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276389 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-22 04:54:44 +00:00