Commit Graph

138410 Commits

Author SHA1 Message Date
Xinliang David Li
760a2d0c51 Fix built bot failure
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281859 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-18 18:52:08 +00:00
Xinliang David Li
ab430229ee [Profile] Implement select instruction instrumentation in IR PGO
Differential Revision: http://reviews.llvm.org/D23727


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281858 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-18 18:34:07 +00:00
Elena Demikhovsky
305b3f3b5a [Loop Vectorizer] Consecutive memory access - fixed and simplified
Amended consecutive memory access detection in Loop Vectorizer.
Load/Store were not handled properly without preceding GEP instruction.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281853 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-18 13:56:08 +00:00
Simon Pilgrim
428ba8ee90 [X86][SSE] Improve recognition of uitofp conversions that can be performed as sitofp
With D24253 we can now use SelectionDAG::SignBitIsZero with vector operations.

This patch uses SelectionDAG::SignBitIsZero to recognise that a zero sign bit means that we can use a sitofp instead of a uitofp (which is not directly support on pre-AVX512 hardware).

While AVX512 does provide support for uitofp, the conversion to sitofp should not cause any regressions.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281852 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-18 12:45:23 +00:00
Elena Demikhovsky
868c6d1643 [Loop vectorizer] Simplified GEP cloning. NFC.
Simplified GEP cloning in vectorizeMemoryInstruction().
Added an assertion that checks consecutive GEP, which should have only one loop-variant operand.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281851 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-18 09:22:54 +00:00
Wei Mi
f54e133dd2 Change the order of the splitted store from high - low to low - high.
It is a trivial change which could make the testcase easier to be reused
for the store splitting in CodeGenPrepare.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281846 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-18 06:10:32 +00:00
Kostya Serebryany
2bed90363f [libFuzzer] use 'if guard' instead of 'if guard >= 0' with trace-pc; change the guard type to intptr_t; use separate array for 8-bit counters
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281845 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-18 04:52:23 +00:00
Davide Italiano
4b868ad9b9 [llvm-objump] Simplify the code. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281844 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-18 04:39:15 +00:00
Davide Italiano
a64fbcff2d [lib/LTO] Try harder to reduce code duplication. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281843 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-17 22:32:42 +00:00
Simon Pilgrim
52c60cece6 [X86][SSE] Added vector udiv combine tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281842 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-17 22:02:23 +00:00
Simon Pilgrim
063b3271dc [X86][SSE] Added vector fcopysign combine tests
Also demonstrating the poor lowering of fcopysign...


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281841 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-17 21:31:34 +00:00
Teresa Johnson
b6d6773710 [ThinLTO] Ensure anonymous globals renamed even at -O0
Summary:
This fixes an issue when files are compiled with -flto=thin
at default -O0. We need to rename anonymous globals before attempting
to write the module summary because all values need names for
the summary. This was happening at -O1 and above, but not before
the early exit when constructing the pipeline for -O0.

Also add an internal -prepare-for-thinlto option to enable this
to be tested via opt.

Fixes PR30419.

Reviewers: mehdi_amini

Subscribers: probinson, llvm-commits, mehdi_amini

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281840 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-17 20:40:16 +00:00
Simon Pilgrim
1982c8eed7 [X86][SSE] Added vector mul combine tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281839 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-17 20:06:16 +00:00
Simon Pilgrim
cbaa900ad9 [X86][SSE] Improve target shuffle mask extraction
Add ability to extract vXi64 'vzext_movl' masks on 32-bit targets

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281834 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-17 18:50:54 +00:00
Simon Pilgrim
83d088fe4b [X86][AVX] Test target shuffle combining on 32 and 64-bit targets
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281833 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-17 18:42:41 +00:00
Simon Pilgrim
db0c416394 [X86][AVX2] Add target shuffle constant folding tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281830 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-17 17:42:15 +00:00
Simon Pilgrim
679cf9558a [X86][AVX] Add target shuffle constant folding tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281829 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-17 17:41:14 +00:00
Simon Pilgrim
aa105ad95d [X86][XOP] Add target shuffle constant folding tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281828 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-17 17:40:40 +00:00
Simon Pilgrim
05c5270a67 [X86][SSSE3] Add target shuffle constant folding tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281827 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-17 17:40:08 +00:00
Ron Lieberman
973dd0ece5 [Hexagon] segv while processing SUnit with nullNodePtr
Added BoundaryNode check to isBestZeroLatency function.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281825 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-17 16:21:09 +00:00
Matt Arsenault
de82da5521 AMDGPU: Fix broken FrameIndex handling
We were trying to avoid using a FrameIndex operand in non-pointer
operands in a convoluted way, and would break because of
using TargetFrameIndex. The TargetFrameIndex should only be used
in the case where it makes sense to fold it as part of the addressing
mode, otherwise it requires materialization like a normal constant.
This wasn't working reliably and failed in the added testcase, hitting
the assert when processing the frame index.

The TargetFrameIndex was coming from trying to produce an AssertZext
limiting the maximum stack size. I'm not sure this was correct to begin
with, because it is apparently possible to have a single workitem
dispatch that requires all 4G of private memory.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281824 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-17 16:09:55 +00:00
Matt Arsenault
28d052241c AMDGPU: Rename spill operands to match real instruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281823 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-17 15:52:37 +00:00
Matt Arsenault
077ab85e5a AMDGPU: Push bitcasts through build_vector
This reduces the number of copies and reg_sequences
when using fp constant vectors. This significantly
reduces the code size in local-stack-alloc-bug.ll

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281822 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-17 15:44:16 +00:00
Kostya Serebryany
338f974b6e [libFuzzer] properly reset the guards when reseting the coverage. Also try to fix check-fuzzer on the bot
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281814 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-17 06:01:55 +00:00
Mehdi Amini
d1e3c5aaec Don't create a SymbolTable in Function when the LLVMContext discards value names (NFC)
The ValueSymbolTable is used to detect name conflict and rename
instructions automatically. This is not needed when the value
names are automatically discarded by the LLVMContext.
No functional change intended, just saving a little bit of memory.

This is a recommit of r281806 after fixing the accessor to return
a pointer instead of a reference and updating all the call-sites.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281813 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-17 06:00:02 +00:00
Mehdi Amini
f3f34d6443 [MIR Parser] Fix Build!
Last-second refactoring before push was bad idea...

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281812 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-17 05:41:02 +00:00
Mehdi Amini
5f16c76bd0 MIR Parser: issue an error when the Context discard value names.
This is in line with the LLParser behavior

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281811 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-17 05:33:58 +00:00
Kostya Serebryany
b9cc2c457f [libFuzzer] change trace-pc to use 8-byte guards
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281810 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-17 05:04:47 +00:00
Kostya Serebryany
16197d80b6 [sanitizer-coverage] change trace-pc to use 8-byte guards
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281809 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-17 05:03:05 +00:00
Mehdi Amini
977635df54 Revert "Don't create a SymbolTable in Function when the LLVMContext discards value names (NFC)"
This reverts commit r281806. It introduces undefined behavior as an
API is returning a reference to the Symtab

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281808 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-17 04:36:46 +00:00
Mehdi Amini
e3e722b910 Don't create a SymbolTable in Function when the LLVMContext discards value names (NFC)
The ValueSymbolTable is used to detect name conflict and rename
instructions automatically. This is not needed when the value
names are automatically discarded by the LLVMContext.
No functional change intended, just saving a little bit of memory.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281806 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-17 03:39:01 +00:00
Matt Arsenault
982faf27a3 AMDGPU: Use i64 scalar compare instructions
VI added eq/ne for i64, so use them.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281800 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-17 02:02:19 +00:00
Tom Stellard
019f4de043 AMDGPU/SI: Fix kernel argument ABI for HSA
Summary: i8, i16, and f16 values are not extended to 32-bit in the HSA kernel ABI.

Reviewers: arsenm

Subscribers: arsenm, kzhuravl, wdng, nhaehnle, llvm-commits, yaxunl

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281789 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-16 22:20:24 +00:00
Chris Bieneman
78279ce05d [CMake] Support symlinks with the same name as the binary
This supports creating symlinks to tools in different directories than
the tool is built to. This is useful for the LLDB framework build which
I’m sending patches for shortly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281788 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-16 22:19:19 +00:00
Sanjay Patel
16150b3947 [InstCombine] canonicalize vector select with constant vector condition to shuffle
As discussed on llvm-dev ( http://lists.llvm.org/pipermail/llvm-dev/2016-August/104210.html ): 
turn a vector select with constant condition operand into a shuffle as a canonicalization step.
Shuffles may be easier to reason about in conjunction with other shuffles and insert/extract.

Possible known (minor?) regressions from this change are filed as:
https://llvm.org/bugs/show_bug.cgi?id=28530 
https://llvm.org/bugs/show_bug.cgi?id=28531 
https://llvm.org/bugs/show_bug.cgi?id=30371

If something terrible happens to perf after this commit, feel free to revert until a backend
fix is in place.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281787 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-16 22:16:18 +00:00
Matt Arsenault
8f824feb12 AMDGPU: Allow some control flow intrinsics to be CSEd
These clean up some unnecessary or instructions in
cases with complex loops.

In the original testcase I noticed this, the same
or with exec was repeated 5 or 6 times in a row. With
this only one is emitted or sometimes a copy.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281786 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-16 22:11:18 +00:00
Evgeniy Stepanov
df9dcaf1ee [safestack] Fix assertion failure in stack coloring.
This is a fix for PR30318.

Clang may generate IR where an alloca is already live when entering a
BB with lifetime.start. In this case, conservatively extend the
alloca lifetime all the way back to the block entry.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281784 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-16 22:04:10 +00:00
Quentin Colombet
005bfb8238 [RegAllocGreedy] Fix the list of NewVRegs for last chance recoloring.
When trying to recolor a register we may split live-ranges in the
process. When we create new live-ranges we will have to process them,
but when we move a register from Assign to Split, the allocation is not
changed until the whole recoloring session is successful.
Therefore, only push the live-ranges that changed from Assign to
Split when the recoloring is successful.

Same as the previous commit, I was not able to produce a test case that
reproduce the problem with in-tree targets.

Note: The bug has been here since the recoloring scheme has been added
back in r200883 (Feb 2014).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281783 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-16 22:00:50 +00:00
Quentin Colombet
12bac3e6a2 [RegAllocGreedy] Fix an assertion and condition when last chance recoloring is used.
When last chance recoloring is used, the list of NewVRegs may not be
empty when calling selectOrSplitImpl. Indeed, another coloring may have
taken place with splitting/spilling in the same recoloring session.

Relax an assertion to take this into account and adapt a condition to
act as if the NewVRegs were local to this selectOrSplitImpl instance.

Unfortunately I am unable to produce a test case for this, I was only
able to reproduce the conditions on an out-of-tree target.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281782 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-16 22:00:42 +00:00
Tom Stellard
77361ae206 AMDGPU: Refactor kernel argument lowering
Summary:
The main challenge in lowering kernel arguments for AMDGPU is determing the
memory type of the argument.  The generic calling convention code assumes
that only legal register types can be stored in memory, but this is not the
case for AMDGPU.

This consolidates all the logic AMDGPU uses for deducing memory types into a single
function.  This will make it much easier to support different ABIs in the future.

Reviewers: arsenm

Subscribers: arsenm, wdng, nhaehnle, llvm-commits, yaxunl

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281781 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-16 21:53:00 +00:00
Matt Arsenault
3a74bac021 AMDGPU: Use SOPK compare instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281780 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-16 21:41:16 +00:00
Tom Stellard
1961591989 AMDGPU/SI: Add support for triples with the mesa3d operating system
Summary:
mesa3d will use the same kernel calling convention as amdhsa, but it will
handle everything else like the default 'unknown' OS type.

Reviewers: arsenm

Subscribers: arsenm, llvm-commits, kzhuravl

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281779 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-16 21:34:26 +00:00
Sanjay Patel
59183b9175 [InstCombine] allow vector types for constant folding / computeKnownBits (PR24942)
computeKnownBits() already works for integer vectors, so allow vector types when calling that from InstCombine.

I don't think the change to use m_APInt in computeKnownBits is strictly necessary because we do check for 
ConstantVector later, but it's more efficient to handle the splat case without needing to loop on vector elements.

This should work with InstSimplify, but doesn't yet, so I made that a FIXME comment on the test for PR24942:
https://llvm.org/bugs/show_bug.cgi?id=24942

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281777 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-16 21:20:36 +00:00
Davide Italiano
463cfe4e60 [LTO] Add ability to parse AA pipelines.
This is supposed to be a drop in replacement for what lld
provides via --lto-newpm-aa-pipeline.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281774 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-16 21:03:21 +00:00
Derek Schuff
740da34c34 [WebAssembly] Fix function types of CFGStackify tests
Make the function's declared type match its (lack of) return type

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281773 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-16 20:58:31 +00:00
Simon Pilgrim
839ecc81ef [X86][SSE] Added vector sub combine tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281769 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-16 20:00:51 +00:00
Simon Pilgrim
b2c2d1f82a [X86][SSE] Added vector add combine tests
Some work great and others currently demonstrate the anti-vector bias prevalent in DAGCombiner

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281768 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-16 19:20:41 +00:00
Derek Schuff
7add7dd73a Install libLLVM if needed with LLVM_INSTALL_TOOLCHAIN_ONLY
Summary:
When LLVM_LINK_LLVM_DYLIB is set, the libLLVM shared
library needs to be installed in the toolchain.  Without
this chanage LLVM_INSTALL_TOOLCHAIN_ONLY combined with
LLVM_LINK_LLVM_DYLIB results in a broken install.

Patch by Sam Clegg

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281763 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-16 18:50:39 +00:00
Nirav Dave
db393b8e8f Defer asm errors to post-statement failure
Recommitting after fixing AsmParser initialization and X86 inline asm
error cleanup.

Allow errors to be deferred and emitted as part of clean up to simplify
and shorten Assembly parser code. This will allow error messages to be
emitted in helper functions and be modified by the caller which has
better context.

As part of this many minor cleanups to the Parser:

* Unify parser cleanup on error
* Add Workaround for incorrect return values in ParseDirective instances
* Tighten checks on error-signifying return values for parser functions
  and fix in-tree TargetParsers to be more consistent with the changes.
* Fix AArch64 test cases checking for spurious error messages that are
  now fixed.

These changes should be backwards compatible with current Target Parsers
so long as the error status are correctly returned in appropriate
functions.

Reviewers: rnk, majnemer

Subscribers: aemerson, jyknight, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281762 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-16 18:30:20 +00:00
Dehao Chen
47462143b2 Change extractProfMetadata and extractProfTotalWeight to const member function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281760 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-16 18:27:20 +00:00