1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 19:42:54 +02:00
Commit Graph

131871 Commits

Author SHA1 Message Date
Davide Italiano
51308d7c2b [LCSSA] Use llvm::any_of instead of std::size_of.
The API is simpler. Suggested by David Blaikie!

llvm-svn: 269800
2016-05-17 19:01:02 +00:00
Reid Kleckner
be9dd41d28 [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

llvm-svn: 269798
2016-05-17 18:43:22 +00:00
Sanjay Patel
2d43600215 [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.

llvm-svn: 269797
2016-05-17 18:38:55 +00:00
Rafael Espindola
adbbf127ad Delete unused defaults.
llvm-svn: 269795
2016-05-17 18:11:58 +00:00
Rafael Espindola
1c9250e647 Don't repeat name in comment.
llvm-svn: 269792
2016-05-17 17:57:49 +00:00
Sanjoy Das
6c603c44d6 [Guards] Add branch metadata when lowering
Guards are expected to basically never fail.  Reflect this in the branch
probabilities in their lowered form.

llvm-svn: 269791
2016-05-17 17:51:19 +00:00
Sanjoy Das
92221742de [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).

llvm-svn: 269790
2016-05-17 17:51:14 +00:00
Chris Bieneman
8ea85f87a5 Revert "[obj2yaml] [yaml2obj] Support for MachO load command structures"
This reverts commit r269782 because it broke bots with -fpermissive.

llvm-svn: 269785
2016-05-17 17:13:50 +00:00
Kevin Enderby
9024f597c5 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.

llvm-svn: 269784
2016-05-17 17:10:12 +00:00
Eugene Zelenko
2045d7b3aa 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

llvm-svn: 269783
2016-05-17 17:04:23 +00:00
Chris Bieneman
62cf49e4fb [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.

llvm-svn: 269782
2016-05-17 17:03:28 +00:00
Reid Kleckner
1e664f585c [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.

llvm-svn: 269778
2016-05-17 16:20:35 +00:00
Teresa Johnson
24cd493363 [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.

llvm-svn: 269777
2016-05-17 16:06:16 +00:00
Rafael Espindola
3a373d5446 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.

llvm-svn: 269776
2016-05-17 16:01:32 +00:00
Teresa Johnson
95ad7eab26 [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

llvm-svn: 269775
2016-05-17 15:26:13 +00:00
Teresa Johnson
8a51792cf4 [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

llvm-svn: 269771
2016-05-17 14:45:30 +00:00
Simon Pilgrim
9e2a539638 [CostModel][X86] Tidied up checks
llvm-svn: 269770
2016-05-17 14:43:41 +00:00
Davide Italiano
1703342f7d [PM/LCSSA] Fix dependency list. Some passes are preserved, not required.
llvm-svn: 269768
2016-05-17 14:32:12 +00:00
Davide Italiano
ad69e31eb4 [LCSSA] Use any_of() to simplify the code. NFCI.
llvm-svn: 269767
2016-05-17 14:24:41 +00:00
Rafael Espindola
6af348a0a8 Add a test showing how hidden stubs are handled on ppc.
llvm-svn: 269766
2016-05-17 14:24:33 +00:00
Igor Laevsky
a4c8f60ff3 [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

llvm-svn: 269764
2016-05-17 13:54:10 +00:00
Renato Golin
5e4f70ea56 [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.

llvm-svn: 269761
2016-05-17 13:05:28 +00:00
David L Kreitzer
874333eb48 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

llvm-svn: 269760
2016-05-17 12:47:46 +00:00
Benjamin Kramer
36892682d9 [InstCombine] Don't crash when trying to take an element of a ConstantExpr.
Fixes PR27786.

llvm-svn: 269757
2016-05-17 12:08:55 +00:00
Derek Schuff
a9b7d0355e [WebAssembly] Remove our copy of PrologEpilogInserter
It's no longer needed after r269750

llvm-svn: 269756
2016-05-17 11:18:35 +00:00
Zoran Jovanovic
c3850b81b8 [mips][microMIPS] Implement BEQZC and BNEZC instructions
Differential Revision: http://reviews.llvm.org/D15417

llvm-svn: 269755
2016-05-17 11:10:15 +00:00
Simon Dardis
a99b8023bb [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

llvm-svn: 269753
2016-05-17 10:21:43 +00:00
Zlatko Buljan
0fef23e430 [mips][microMIPS][DSP] Implement BALIGN, BITREV, BPOSGE32, CMP*, CMPGDU*, CMPGU* and CMPU* instructions
Differential Revision: http://reviews.llvm.org/D16182

llvm-svn: 269752
2016-05-17 09:32:58 +00:00
Derek Schuff
6435e10dbd 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

llvm-svn: 269750
2016-05-17 08:49:59 +00:00
Dan Gohman
78374076c0 [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.

llvm-svn: 269736
2016-05-17 04:05:31 +00:00
Adrian Prantl
562624c39d 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.

llvm-svn: 269731
2016-05-17 02:37:53 +00:00
Sanjay Patel
fdf7fd7ebc try to avoid unused variable warning in release build; NFCI
llvm-svn: 269729
2016-05-17 01:12:31 +00:00
Sanjay Patel
59f49118ec [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

llvm-svn: 269728
2016-05-17 00:57:57 +00:00
David Blaikie
b2196ac249 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.

llvm-svn: 269727
2016-05-17 00:07:10 +00:00
Easwaran Raman
08f026523a 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.

llvm-svn: 269726
2016-05-16 23:59:04 +00:00
Jan Vesely
628b422d21 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

llvm-svn: 269725
2016-05-16 23:56:32 +00:00
David Blaikie
db05b7f61e 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).

llvm-svn: 269723
2016-05-16 23:26:29 +00:00
Michael Kuperstein
a338cd2790 Remove extra semicolon to fix warning. NFC.
llvm-svn: 269722
2016-05-16 23:09:32 +00:00
Mehdi Amini
1e19cc4c55 Avoid temporary vector for sorting in BitcodeWriter
As suggested by Duncan, fixup for r269634 and r269635

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 269715
2016-05-16 22:47:15 +00:00
Adrian Prantl
d29a7a3b9a 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.

llvm-svn: 269714
2016-05-16 22:45:10 +00:00
Matt Arsenault
c075f84ba8 AMDGPU: Add some private element size tests
llvm-svn: 269712
2016-05-16 22:17:27 +00:00
Richard Smith
43a8b67421 Add a (size, value) constructor to TinyPtrVector.
llvm-svn: 269711
2016-05-16 21:57:47 +00:00
Richard Smith
b47dd66659 Add missing TinyPtrVector functionality: reverse iterators and conversion of
TinyPtrVector<T*> to ArrayRef<const T*>.

llvm-svn: 269710
2016-05-16 21:45:58 +00:00
Matt Arsenault
774adca4ab 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.

llvm-svn: 269708
2016-05-16 21:19:59 +00:00
Rafael Espindola
668416cf2a 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.

llvm-svn: 269706
2016-05-16 21:14:24 +00:00
David Blaikie
eba94ee768 llvm-dwp: Add .test files missing from r269339
llvm-svn: 269705
2016-05-16 21:13:15 +00:00
Vedant Kumar
e233548c19 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

llvm-svn: 269700
2016-05-16 21:03:38 +00:00
Matt Arsenault
9204a680e2 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

llvm-svn: 269699
2016-05-16 20:58:23 +00:00
Geoff Berry
7dd4166698 [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

llvm-svn: 269697
2016-05-16 20:52:28 +00:00
Vedant Kumar
511487a013 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

llvm-svn: 269694
2016-05-16 20:49:39 +00:00