132350 Commits

Author SHA1 Message Date
David L Kreitzer
b672687bed Fix for PR27750. Correctly handle the case where the fallthrough block and
target block are the same in getFallThroughMBB.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269760 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 12:47:46 +00:00
Benjamin Kramer
e5e3c201fd [InstCombine] Don't crash when trying to take an element of a ConstantExpr.
Fixes PR27786.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269757 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 12:08:55 +00:00
Derek Schuff
b63ec0f596 [WebAssembly] Remove our copy of PrologEpilogInserter
It's no longer needed after r269750

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269756 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 11:18:35 +00:00
Zoran Jovanovic
9027d962e1 [mips][microMIPS] Implement BEQZC and BNEZC instructions
Differential Revision: http://reviews.llvm.org/D15417


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269755 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 11:10:15 +00:00
Simon Dardis
e7441472ae [mips] Compact branch policy control for MIPSR6
This patch adds the commandline option -mips-compact-branches={never,optimal,always),
which controls how LLVM generates compact branches for MIPS targets. By
default, the compact branch policy is 'optimal' where LLVM will (hopefully)
pick the optimal branch for any situation. The 'never' policy will disable
the generation of compact branches and 'always' will generate compact branches
wherever possible.

Reviewers: dsanders

Differential Review: http://reviews.llvm.org/D20167


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269753 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 10:21:43 +00:00
Zlatko Buljan
6bb068f15c [mips][microMIPS][DSP] Implement BALIGN, BITREV, BPOSGE32, CMP*, CMPGDU*, CMPGU* and CMPU* instructions
Differential Revision: http://reviews.llvm.org/D16182


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269752 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 09:32:58 +00:00
Derek Schuff
4bfd3e29b1 Factor PrologEpilogInserter around spilling, frame finalization, and scavenging
PrologEpilogInserter has these 3 phases, which are related, but not
all of them are needed by all targets. This patch reorganizes PEI's
varous functions around those phases for more clear separation. It also
introduces a new TargetMachine hook, usesPhysRegsForPEI, which is true
for non-virtual targets. When it is true, all the phases operate as
before, and PEI requires the AllVRegsAllocated property on
MachineFunctions. Otherwise, CSR spilling and scavenging are skipped and
only prolog/epilog insertion/frame finalization is done.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269750 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 08:49:59 +00:00
Dan Gohman
c1fd522352 [WebAssembly] Improve the precision of memory and side effect dependence tracking.
MachineInstr::isSafeToMove is more conservative than is needed here;
use a more explicit check, and incorporate knowledge of some
WebAssembly-specific opcodes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269736 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 04:05:31 +00:00
Adrian Prantl
94a19b6888 Debug Info: Don't emit a DW_AT_data_member_location for DWARF bitfields.
The DWARF spec states that a member entry may have either a
DW_AT_data_member_location or a DW_AT_data_bit_offset, but not both.

This fixes a bug found in PR 27758.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269731 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 02:37:53 +00:00
Sanjay Patel
7b8e568480 try to avoid unused variable warning in release build; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269729 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 01:12:31 +00:00
Sanjay Patel
91b5ad4eb5 [InstCombine] check vector elements before trying to transform LE/GE vector icmp (PR27756)
Fix a bug introduced with rL269426 :
[InstCombine] canonicalize* LE/GE vector integer comparisons to LT/GT (PR26701, PR26819)

We were assuming that a ConstantDataVector / ConstantVector / ConstantAggregateZero operand of
an ICMP was composed of ConstantInt elements, but it might have ConstantExpr or UndefValue 
elements. Handle those appropriately.

Also, refactor this function to join the scalar and vector paths and eliminate the switches.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269728 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 00:57:57 +00:00
David Blaikie
4945c5367f llvm-dwp: Provide error handling for invalid string field forms
This diagnostic could be improved by adding the name of the input file
containing the invalid data and/or some information about how to
identify the specific offending attribute/tag in the input. But that's
not an immediate priority as these corner cases of invalid input
shouldn't come up too often.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269727 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 00:07:10 +00:00
Easwaran Raman
177be49d36 Remove .hot and .unlikely prefixes from function section names.
This code currently relies on static methods in ProfileSummary to determine whether a function is hot or unlikley. I am refactoring the ProfileSummary code and these methods will be removed. As discussed offline, the right way to re-introduce this is to add a pass to annotate functions with unlikely/hot hints and use the hints to determine the prefix here.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269726 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-16 23:59:04 +00:00
Jan Vesely
350e40ffb2 AMDGPU/R600: Use correct number of vector elements when lowering private loads
Reviewer: tstellardAMD, arsenm

Subscribers: arsenm, kzhuravl, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269725 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-16 23:56:32 +00:00
David Blaikie
dd6e786ff7 llvm-dwp: Add error handling for invalid (non-CU) top level tag in debug_info.dwo
The diagnostic could be improved a bit to include information about
which input file had the mistake (& which unit (counted, since the name
of the unit won't be accessible) within the input).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269723 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-16 23:26:29 +00:00
Michael Kuperstein
e7eda98078 Remove extra semicolon to fix warning. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269722 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-16 23:09:32 +00:00
Mehdi Amini
7b24ae662c Avoid temporary vector for sorting in BitcodeWriter
As suggested by Duncan, fixup for r269634 and r269635

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269715 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-16 22:47:15 +00:00
Adrian Prantl
043346c62d Debug info: Don't emit a DW_AT_byte_size when emitting a DWARF4 bit field.
The DWARF spec clearly states that a bit field member should have either a
DW_AT_byte_size or a DW_AT_bit_size, but not both.
Also the DW_AT_byte_size is redundant with the size of the type of the member.

This fixes a bug found in PR 27758.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269714 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-16 22:45:10 +00:00
Matt Arsenault
abc9f47dfe AMDGPU: Add some private element size tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269712 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-16 22:17:27 +00:00
Richard Smith
85bfb07553 Add a (size, value) constructor to TinyPtrVector.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269711 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-16 21:57:47 +00:00
Richard Smith
80bf9f5105 Add missing TinyPtrVector functionality: reverse iterators and conversion of
TinyPtrVector<T*> to ArrayRef<const T*>.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269710 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-16 21:45:58 +00:00
Matt Arsenault
7985e4be56 AMDGPU: Fix promote alloca pass creating huge arrays
This was assuming it could use all memory before, which is
a bad decision because it restricts occupancy.

By default, only try to use enough space that could reduce
occupancy to 7, an arbitrarily chosen limit.

Based on the exist LDS usage, try to round up to the limit
in the current tier instead of further hurting occupancy.
This isn't ideal, because it doesn't accurately know how much
space is going to be used for alignment padding.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269708 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-16 21:19:59 +00:00
Rafael Espindola
e26e7d308c Fail early on unknown appending linkage variables.
In practice only a few well known appending linkage variables work.

Currently if codegen sees an unknown appending linkage variable it will
just print it as a regular global. That is wrong as the symbol in the
produced object file has different semantics as the one provided by the
appending linkage.

This just errors early instead of producing a broken .o.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269706 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-16 21:14:24 +00:00
David Blaikie
02e7a2680b llvm-dwp: Add .test files missing from r269339
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269705 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-16 21:13:15 +00:00
Vedant Kumar
ce4aff93aa Revert "Retry^2 "[ProfileData] (llvm) Use Error in InstrProf and Coverage, NFC""
This reverts commit r269694. MSVC says:

error C2086: 'char llvm::ProfErrorInfoBase<enum llvm::instrprof_error>::ID' : redefinition

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269700 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-16 21:03:38 +00:00
Matt Arsenault
3b880e33a0 SelectionDAG: Select min/max when both are used
Allow two users of the condition if the other user
is also a min/max select. i.e.

%c = icmp slt i32 %x, %y
%min = select i1 %c, i32 %x, i32 %y
%max = select i1 %c, i32 %y, i32 %x

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269699 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-16 20:58:23 +00:00
Geoff Berry
7f7d4688d4 [AArch64] Fix bug in large stack spill slot handling (PR27717)
Summary:
Fix bug in MachO path where a frame index offset would not be reserved
for handling large frames when an extra non-used callee-save register
was saved.  In the case where the extra register is reserved or not a
GPR (e.g. %FP in the MachO case), this would lead to the register
scavenger later failing when called from PrologEpilogInserter.

Reviewers: t.p.northover

Subscribers: aemerson, rengolin, mcrosier, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269697 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-16 20:52:28 +00:00
Vedant Kumar
515ee3e025 Retry^2 "[ProfileData] (llvm) Use Error in InstrProf and Coverage, NFC"
Transition InstrProf and Coverage over to the stricter Error/Expected
interface.

Changes since the initial commit:
- Address undefined-var-template warning.
- Fix error message printing in llvm-profdata.
- Check errors in loadTestingFormat() + annotateAllFunctions().
- Defer error handling in InstrProfIterator to InstrProfReader.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269694 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-16 20:49:39 +00:00
David Blaikie
119b9304a9 llvm-dwp: Streamline duplicate DWO ID diagnostic handling
Actually use the error return path rather than printing the duplicate
information then a separate error. But also just tidy up/deduplicate
some of the code for generating the diagnostic text.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269692 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-16 20:42:27 +00:00
Xinliang David Li
addf109ca6 sync up common profile header /nfc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269690 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-16 20:34:39 +00:00
Bryan Chan
82733bd860 [SystemZ] Support LRVH and STRVH opcodes
Summary: On Linux, /usr/include/bits/byteswap-16.h defines __byteswap_16(x) as an inlined LRVH (Load Reversed Half-word) instruction. The SystemZ back-end did not support this opcode and the inlined assembly would cause a fatal error.

Reviewers: bryanpkc, uweigand

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269688 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-16 20:32:22 +00:00
Chad Rosier
94bb740359 Remove extra whitespace. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269685 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-16 20:03:02 +00:00
Mehdi Amini
bfed1d58c7 ThinLTO: sort inputs and schedule by decreasing size
This is a compile time optimization: keeping a large file to process
at the end hurts parallelism.
The heurisitic used right now is the input buffer size, however we
may want to consider the number of functions to import or the
different number of files to load for importing as well.

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269684 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-16 19:33:07 +00:00
Dan Gohman
594d70d5cc [WebAssembly] Mark COPY_LOCAL and TEE_LOCAL instructions has having no side effects.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269683 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-16 19:16:32 +00:00
Mehdi Amini
4f2e861e65 ThinLTO caching: reload cached file with mmap and drop heap-allocated memory buffer
This is reducing pressure on the OS memory system, and is NFC
when not using a cache.
I measure a 10x memory consumption reduction when linking opt
with full debug info.

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269682 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-16 19:11:59 +00:00
Dan Gohman
b57691df7a [WebAssembly] Use eqz to negate a branch conditions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269681 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-16 18:59:34 +00:00
Geoff Berry
4d2c6de03c [BasicAA] Update comments based on feedback from hfinkel. NFCI.
Original change Hal's comments were based on:
http://reviews.llvm.org/D19730

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269678 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-16 18:51:54 +00:00
Dan Gohman
b5e78617f3 [WebAssembly] Add a few optimization ideas to README.txt.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269677 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-16 18:51:03 +00:00
Michael Kuperstein
ee1280d412 [X86] Remove transformVSELECTtoBlendVECTOR_SHUFFLE
The new X86 shuffle lowering can do just fine without transforming vselects
into vector_shuffles. It looks like the only thing this code does right now
is cause trouble - in particular, it can lead to combine/legalization infinite
loops.

Note that it's not completely NFC, since some of the shuffle masks get inverted,
which may cause slight differences further down the line. We may want to find
a way to invert those masks, but that's orthogonal to this commit.

This fixes the hang in PR27689.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269676 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-16 18:27:00 +00:00
Krzysztof Parzyszek
f6ed63a0fc [Hexagon] Make getCallerSavedRegs specific to a register class
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269674 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-16 18:02:28 +00:00
Matthew Simpson
12427adbc9 [LAA] Rename forwarding conflict detection option (NFC)
This patch renames the option enabling the store-to-load forwarding conflict
detection optimization. This change was requested in the review of D20241.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269668 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-16 17:00:56 +00:00
Adam Nemet
095bb7d545 [LAA] Comment couldPreventStoreLoadForward. NFC
Also s/Cycles/Iters/ in NumCyclesForStoreLoadThroughMemory to make it
clear that this is not about clock cycles but loop cycles/iterations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269667 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-16 16:57:47 +00:00
Adam Nemet
24331f2d7f [LAA] clang-format the function couldPreventStoreLoadForward. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269666 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-16 16:57:42 +00:00
Krzysztof Parzyszek
ec3abaa727 [Hexagon] Simplify HexagonInstrInfo::isPredicable
Remove all the checks for constant extenders from isPredicable. The users
of it should be the ones checking cost/profitability.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269664 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-16 16:56:10 +00:00
Xinliang David Li
61ce277483 [PM] Port indirect call promotion pass to new pass manager
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269660 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-16 16:31:07 +00:00
Matthew Simpson
20ebcfc5d1 [LV] Ensure safe VF for loops with interleaved accesses
The selection of the vectorization factor currently doesn't consider
interleaved accesses. The vectorization factor is based on the maximum safe
dependence distance computed by LAA. However, for loops with interleaved
groups, we should instead base the vectorization factor on the maximum safe
dependence distance divided by the maximum interleave factor of all the
interleaved groups. Interleaved accesses not in a group will be scalarized.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269659 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-16 15:08:20 +00:00
Renato Golin
3b0d377ef8 [llc] New diagnostic handler
Without a diagnostic handler installed, llc's behaviour is to exit on the first
error that it encounters. This is very different from the behaviour of clang
and other front ends, which try to gather as many errors as possible before
exiting.

This commit adds a diagnostic handler to llc, allowing it to find and report
more than one error. The old behaviour is preserved under a flag (-exit-on-error).

Some of the tests fail with the new diagnostic handler, so they have to use the
new flag in order to run under the previous behaviour. Some of these are known
bugs, others need further investigation. Ideally, we should fix the tests and
remove the flag at some point in the future.

Reapplied after fixing the LLDB build that was broken due to the new
DiagnosticSeverity in LLVMContext.h, and fixed an UB in the new change.

Patch by Diana Picus.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269655 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-16 14:28:02 +00:00
Matthew Simpson
5c1f23686d [LAA] Add option to disable conflict detection (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269654 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-16 14:14:49 +00:00
Chad Rosier
a31dc8ea0e Use proper capitalization and punctuation per coding standards. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269652 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-16 12:55:01 +00:00
Simon Pilgrim
b2f8226df3 Fixed unused variable warning
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269650 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-16 11:48:54 +00:00