132134 Commits

Author SHA1 Message Date
Xinliang David Li
3c661ab452 minor cleanup /NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269839 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 21:06:16 +00:00
Hans Wennborg
fc99ce0062 Revert r269828 "X86: Avoid using _chkstk when lowering WIN_ALLOCA instructions"
Seems to have broken the Windows ASan bot. Reverting while investigating.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269833 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 20:38:56 +00:00
Zachary Turner
cbc09f709e [codeview] Macroify definition of bitwise operators for flags enums.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269832 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 20:21:01 +00:00
Sanjay Patel
e448e72356 [InstCombine] add another test for wrong icmp constant (PR27792)
It doesn't matter if the comparison is unsigned; the inc/dec is always signed.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269831 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 20:20:40 +00:00
Dan Gohman
f9336ec145 [WebAssembly] Stackify induction variable increment instructions.
This handles instructions where the defined register is also used, as in
"x = x + 1".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269830 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 20:19:47 +00:00
Xinliang David Li
5bf7d993fc Simple refactoring /NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269829 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 20:19:03 +00:00
Hans Wennborg
547f114e33 X86: Avoid using _chkstk when lowering WIN_ALLOCA instructions
This patch moves the expansion of WIN_ALLOCA pseudo-instructions
into a separate pass that walks the CFG and lowers the instructions
based on a conservative estimate of the offset between the stack
pointer and the lowest accessed stack address.

The goal is to reduce binary size and run-time costs by removing
calls to _chkstk. While it doesn't fix all the code quality problems
with inalloca calls, it's an incremental improvement for PR27076.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269828 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 20:13:29 +00:00
Adrian Prantl
c8f8f9cc84 Debug Info: Don't emit bitfields in the DWARF4 format when tuning for GDB.
As discovered in PR27758, GDB does not fully support the DWARF 4 format.
This patch ensures we always emit bitfields in the DWARF 2 when tuning for GDB.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269827 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 20:12:08 +00:00
Renato Golin
cd41a78559 Fix an assert in SelectionDAGBuilder when processing inline asm
When processing inline asm that contains errors, make sure we can recover
gracefully by creating an UNDEF SDValue for the inline asm statement before
returning from SelectionDAGBuilder::visitInlineAsm. This is necessary for
consumers that don't exit on the first error that is emitted (e.g. clang)
and that would assert later on.

Fixes PR24071.

Patch by Diana Picus.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269811 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 19:52:01 +00:00
Chris Bieneman
0865cea8c3 Reapply r269782 "[obj2yaml] [yaml2obj] Support for MachO load command structures""
This adds support for all the MachO *_command structures. The load_command payloads still are not represented, but that will come next.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269808 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 19:44:06 +00:00
David Blaikie
293233a048 llvm-dwp: Simplify duplicate DWO ID error handling
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269805 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 19:40:28 +00:00
Sanjay Patel
bd9d3e007e [InstCombine] add test for wrong icmp constant (PR27792)
The code fix for this was checked in at r269797.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269803 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 19:25:55 +00:00
Davide Italiano
809c94de33 [LCSSA] Use llvm::any_of instead of std::size_of.
The API is simpler. Suggested by David Blaikie!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269800 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 19:01:02 +00:00
Reid Kleckner
4e35fa54a6 [ThinLTO] Use semicolon to separate path prefix replacement
Summary:
Colons can appear in Windows paths after drive letters. Both colon and
semicolon are valid characters in filenames, but neither are very
common. Semicolon seems just as good, and makes the test pass on
Windows.

Reviewers: tejohnson

Subscribers: joker.eph, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269798 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 18:43:22 +00:00
Sanjay Patel
0353bb1421 [InstCombine] fix constant to be signed for signed comparisons
This bug was introduced in r269728 and is the likely cause of many stage 2 ubsan bot failures.
I'll add a test in a follow-up commit assuming this fixes things properly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269797 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 18:38:55 +00:00
Rafael Espindola
8ae1501586 Delete unused defaults.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269795 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 18:11:58 +00:00
Rafael Espindola
09ba7ecff8 Don't repeat name in comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269792 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 17:57:49 +00:00
Sanjoy Das
b4edd72f76 [Guards] Add branch metadata when lowering
Guards are expected to basically never fail.  Reflect this in the branch
probabilities in their lowered form.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269791 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 17:51:19 +00:00
Sanjoy Das
2848e3cd95 [SCEV] Be more aggressive in proving NUW
... for AddRec's in loops for which SCEV is unable to compute a max
tripcount.  This is the NUW variant of r269211 and fixes PR27691.

(Note: PR27691 is not a correct or stability bug, it was created to
track a pending task).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269790 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 17:51:14 +00:00
Chris Bieneman
923a9ba5c6 Revert "[obj2yaml] [yaml2obj] Support for MachO load command structures"
This reverts commit r269782 because it broke bots with -fpermissive.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269785 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 17:13:50 +00:00
Kevin Enderby
77be094e2f Change llvm-objdump, llvm-nm and llvm-size when reporting an object file error
when the object is in an archive to use something like libx.a(foo.o) as part of
the error message.

Also changed llvm-objdump and llvm-size to be like llvm-nm and ignore non-object
files in archives and not produce any error message.

To do this Archive::Child::getAsBinary() was changed from ErrorOr<...> to
Expected<...> then that was threaded up to its users.

Converting this interface to Expected<> from ErrorOr<> does involve
touching a number of places. To contain the changes for now the use of
errorToErrorCode() is still used in one place yet to be fully converted.

Again there some were bugs in the existing code that did not deal with the
old ErrorOr<> return values.  So now with Expected<> since they must be
checked and the error handled, I added a TODO and a comments for those.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269784 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 17:10:12 +00:00
Eugene Zelenko
d307f96d68 Fix Clang-tidy modernize-use-bool-literals in generated Target code; other minor fixes; other minor fixes.
Make generated code more readable.

Fix some Include What You Use warnings.

Differential revision: http://reviews.llvm.org/D20317


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269783 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 17:04:23 +00:00
Chris Bieneman
4a038a7aac [obj2yaml] [yaml2obj] Support for MachO load command structures
This adds support for all the MachO *_command structures. The load_command payloads still are not represented, but that will come next.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269782 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 17:03:28 +00:00
Reid Kleckner
87749e8b5d [codeview] Test serialization of all known type records
This just checks that we emit all type records once, and then after
merging the type stream with no other type streams, we still emit every
kind of type record.

We could test the dumper output more closely, but that would make the
test very brittle. Currently we're just getting coverage.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269778 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 16:20:35 +00:00
Teresa Johnson
8a4e293fd0 [ThinLTO] Force disable test on Windows via REQUIRES shell
The "XFAIL: win32" was not enough to get the test to XFAIL on the bot:
http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/5478

For now, use "REQUIRES: shell" to suppress test on Windows while we
investigate.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269777 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 16:06:16 +00:00
Rafael Espindola
6a70b9b746 Simplify handling of hidden stub.
Since r207518 they are printed exactly like non-hidden stubs on x86 and
since r207517 on ARM.

This means we can use a single set for all stubs in those platforms.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269776 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 16:01:32 +00:00
Teresa Johnson
825210fe7e [ThinLTO] XFAIL path manipulation test on Windows
This test is creating and checking paths using '/'. XFAIL it on Windows
to unbreak bot:
http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/5478

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269775 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 15:26:13 +00:00
Teresa Johnson
a486381660 [ThinLTO] Option to control path of distributed backend files
Summary:
Add support to control where files for a distributed backend (the
individual index files and optional imports files) are created.

This is invoked with a new thinlto-prefix-replace option in the gold
plugin and llvm-lto. If specified, expects a string of the form
"oldprefix:newprefix", and instead of generating these files in the
same directory path as the corresponding bitcode file, will use a path
formed by replacing the bitcode file's path prefix matching oldprefix
with newprefix.

Also add a new replace_path_prefix helper to Path.h in libSupport.

Depends on D19636.

Reviewers: joker.eph

Subscribers: llvm-commits, joker.eph

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269771 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 14:45:30 +00:00
Simon Pilgrim
7537c45fbd [CostModel][X86] Tidied up checks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269770 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 14:43:41 +00:00
Davide Italiano
9ae1fd1674 [PM/LCSSA] Fix dependency list. Some passes are preserved, not required.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269768 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 14:32:12 +00:00
Davide Italiano
86cadc5625 [LCSSA] Use any_of() to simplify the code. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269767 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 14:24:41 +00:00
Rafael Espindola
0d4db7017f Add a test showing how hidden stubs are handled on ppc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269766 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 14:24:33 +00:00
Igor Laevsky
af3b6beef3 [RewriteStatepointsForGC] Remove obsolete assertion
This is assertion is no longer necessary since we never record
constants in the live set anyway. (They are never recorded in 
the initial live set, and constant bases are removed near line 2119)

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269764 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 13:54:10 +00:00
Renato Golin
41326d5ab1 [ARM] ARM mov InstAlias for MOVW lacks HasV6T2
The movw instruction is only available in ARM state for V6T2 and above.
The MOVi16 instruction has requirement HasV6T2 but the InstAlias
for mov rd, imm where the operand is imm0_65535_expr:$imm does not.

This means that movw can incorrectly be used in ARMv4 and ARMv5 by
writing mov rd, 0x1234. The simple fix is to the requirement HasV6T2
to the InstAlias. Tests added to not-armv4.s.

Patch by Peter Smith.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269761 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 13:05:28 +00:00
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