132350 Commits

Author SHA1 Message Date
David Blaikie
34ab13fd25 llvm-dwp: Move error handling code closer to use
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269864 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 23:37:44 +00:00
Dan Gohman
51510adcfa [WebAssembly] Rename $discard to $drop in the assembly output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269862 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 23:19:03 +00:00
Rui Ueyama
dce33b5457 pdbdump: Print out more strcutures.
I don't yet fully understand the meaning of these data strcutures,
but at least it seems that their sizes and types are correct.
With this change, we can read publics streams till end.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269861 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 23:07:48 +00:00
Paul Robinson
329de212c7 [DwarfDebug] Make tuning predicates private, should be used only in ctor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269859 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 22:53:20 +00:00
Peter Collingbourne
e6b948e54d docs: Update and clean up BitCodeFormat.rst.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269857 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 22:30:58 +00:00
Dan Gohman
b9fa981c8a [WebAssembly] Model the stack evaluation order more precisely.
We currently don't represent get_local and set_local explicitly; they
are just implied by virtual register use and def. This avoids a lot of
clutter, but it does complicate stackifying: get_locals read their
operands at their position in the stack evaluation order, rather than
at their parent instruction. This patch adds code to walk the stack to
determine the precise ordering, when needed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269854 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 22:24:18 +00:00
Rafael Espindola
c27d8b42ef Delete deprecated function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269853 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 22:07:45 +00:00
David Blaikie
7fdce00ff3 llvm-dwp: Add error handling for multiple type sections in a dwp file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269851 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 22:00:57 +00:00
Chris Bieneman
d640f9183d Fixing a test case that I broke by fixing r269846
This should fix the bots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269850 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 21:55:45 +00:00
Lang Hames
47ad42e0ee [Object] Move isNotObjectErrorInvalidFileType out of header.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269848 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 21:38:53 +00:00
Justin Bogner
9c81a3f598 [PM] Port DSE to the new pass manager
Patch by JakeVanAdrighem. Thanks!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269847 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 21:38:13 +00:00
Chris Bieneman
20b603a8a3 [obj2yaml][yaml2obj] Fixing dyld_info_command mappings
Apparently I mucked up the mappings here, which was causing some binary differences in round tripping.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269846 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 21:33:59 +00:00
Chris Bieneman
b04144c7d6 [obj2yaml] [yaml2obj] Support MachO section and section_64 structs
This patch adds round trip support for MachO section structs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269845 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 21:31:02 +00:00
Lang Hames
79f152aca1 Remove unnecessary header include.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269844 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 21:15:50 +00:00
Dan Gohman
e5abbb2bf0 [WebAssembly] Don't stackify calls past stack pointer modifications.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269843 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 21:14:26 +00:00
Adrian Prantl
888bd0bf87 Debug Info: Introduce a DwarfDebug::UseDWARF2Bitfields flag
instead of having DwarfUnit query the debugger tuning options.

Follow-up commmit to r269827.
Thanks to Paul Robinson for pointing this out!

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