Commit Graph

117708 Commits

Author SHA1 Message Date
Craig Topper
64f9e5908b [TableGen] Don't override convertValue for some of the Init types when it does the same thing as the base class implementation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237773 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-20 05:40:06 +00:00
David Majnemer
349f0b12a4 [X86] Implement the local-exec TLS model for Windows targets
We know that _tls_index is zero for local-exec TLS variables because
they are always defined in the executable.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237772 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-20 04:45:26 +00:00
Duncan P. N. Exon Smith
37e9aba0db MC: Use MCSymbol in most of ELFObjectWriter, NFC
Stop using MCSymbolData where we also need MCSymbol.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237770 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-20 04:39:01 +00:00
Peter Collingbourne
ed5afe4277 Support: Introduce LLVM_FALLTHROUGH macro.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237766 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-20 02:44:14 +00:00
Swaroop Sridhar
95d08bce87 Add a GCStrategy for CoreCLR
This change adds a new GC strategy for supporting the CoreCLR runtime.

This strategy is currently identical to Statepoint-example GC, 
but is necessary for several upcoming changes specific to CoreCLR, such as:

1. Base-pointers not explicitly reported for interior pointers
2. Different format for stack-map encoding
3. Location of Safe-point polls: polls are only needed before loop-back edges and before tail-calls (not needed at function-entry)
4. Runtime specific handshake between calls to managed/unmanaged functions.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237753 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-20 01:07:23 +00:00
Alexei Starovoitov
a6f501cb97 [bpf] fix build
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237751 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-20 00:20:26 +00:00
Duncan P. N. Exon Smith
891fd53a90 MC: Take MCSymbol in MachObjectWriter::getSymbolAddress(), NFC
Pass through an `MCSymbol` instead of an `MCSymbolData` so we can get
rid of the back pointer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237750 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-20 00:02:39 +00:00
Duncan P. N. Exon Smith
e1fce8692d MC: Use MCSymbol in MCAsmLayout::getSymbolOffset(), NFC
Continue to canonicalize on MCSymbol instead of MCSymbolData when both
are needed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237749 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-19 23:53:20 +00:00
Philip Reames
a5703bc52e [PlaceSafepoints] Stop special casing some intrinsics
We were special casing a handful of intrinsics as not needing a safepoint before them.  After running into another valid case - memset - I took a closer look and realized that almost no intrinsics need to have a safepoint poll before them.  Restructure the code to make that apparent so that we stop hitting these bugs.  The only intrinsics which need a safepoint poll before them are ones which can run arbitrary code.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237744 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-19 23:40:11 +00:00
Reid Kleckner
4bc9d4ea26 Try to fix the build with MSVC 2015 by disabling sized deallocation
I can't actually test this properly because uninstalling MSVC 2015 CTP 6
and reinstalling the 2015 RC takes hours. I can only verify that this
doesn't mess up MSVC 2013 and 2015 CTP 6 builds, which is what I've
done.

Should fix PR23513.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237743 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-19 23:28:23 +00:00
Hans Wennborg
c0f6113287 Revert r237539: "Reapply r237520 with another fix for infinite looping"
This caused PR23583.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237739 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-19 23:06:30 +00:00
Philip Reames
486f97bf19 Remove a stale comment
The todo was implemented a while ago; I just forgot to remove the comment.  



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237736 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-19 22:26:33 +00:00
Kostya Serebryany
556425f9a9 [lib/Fuzzer] change the meaning of -timeout flag: now timeout is applied to every unit of work separately
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237735 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-19 22:12:57 +00:00
Akira Hatanaka
4345121f7d Add a comment line that was accidentally dropped in r236671.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237734 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-19 21:59:11 +00:00
Alexey Samsonov
05f725eb67 [DWARF parser] Make DWARF parser more robust against missing compile/type units.
DWARF standard claims that each compilation/type unit header in
.debug_info/.debug_types section must be followed by corresponding
compile/type unit DIE, possibly with its children. Two situations
are possible:

 * compile/type unit DIE is missing because DWARF producer failed to
   emit it.
 * DWARF parser failed to parse unit DIE correctly, for instance if it
   contains some unsupported attributes (see r237721, for instance).

In either of these cases, the library, and the tools that use it
(llvm-dwarfdump, llvm-symbolizer) should not crash. Insert appropriate
checks to protect against this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237733 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-19 21:54:32 +00:00
David Blaikie
b9b3fb261e [opaque pointer type] Provide a convenience function for creating direct CallInsts to Functions in IRBuilder
Might need a similar convenience in CallInst's ctor too, but we'll
see/will add it when it becomes useful.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237731 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-19 21:47:12 +00:00
Alex Lorenz
e5a723675b Revert r237708 (MIR serialization) - incremental buildbots became unstable.
The incremental buildbots entered a pass-fail cycle where during the fail
cycle one of the tests from this commit fails for an unknown reason. I
have reverted this commit and will investigate the cause of this problem.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237730 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-19 21:41:28 +00:00
David Blaikie
94a1bbfebc [opaque pointer type] Provide the ability to pass an explicit type when creating a CallInst through IRBuilder
A use for this will be added to Clang shortly. I haven't hit the
specific cases I want to cleanup in LLVM just yet.

A utility that avoids the need for this in direct calls to
llvm::Functions will be added too - since in that case the type can be
retrieved from the llvm::Function directly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237728 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-19 21:31:18 +00:00
Matthias Braun
dfc41dbcda MachineInstr: Remove unused parameter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237726 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-19 21:22:20 +00:00
Jingyue Wu
31d2ee7360 [Speculation] NFC: more header comments
explaining how it differs from SpeculativeExecuteBB in SimplifyCFG.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237724 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-19 20:52:45 +00:00
Alex Lorenz
65266361a1 Fix MIR testcase committed in r237708 - remove target triple.
Remove the target specific triple and datalayout from the 
llvm IR in the MIR testcase file.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237723 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-19 20:51:48 +00:00
Pete Cooper
64b0d53256 Remove unnecessary cast. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237722 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-19 20:50:14 +00:00
Alexey Samsonov
4ca606f22f [DWARF parser] Add basic support for DWZ DWARF multifile extensions.
This change implements basic support for DWARF alternate sections
proposal: http://www.dwarfstd.org/ShowIssue.php?issue=120604.1&type=open

LLVM tools now understand new forms: DW_FORM_GNU_ref_alt and
DW_FORM_GNU_strp_alt, which are used as references to .debug_info and
.debug_str sections respectively, stored in a separate file, and
possibly shared between different executables / shared objects.

llvm-dwarfdump and llvm-symbolizer don't yet know how to access this
alternate debug file (usually pointed by .gnu_debugaltlink section),
but they can at lease properly parse and dump regular files, which
refer to it.

This change should fix crashes of llvm-dwarfdump and llvm-symbolizer on
files produced by running "dwz" tool. Such files are already installed
on some modern Linux distributions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237721 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-19 20:29:28 +00:00
Sanjoy Das
4d88c3ebad Dereferenceable, dereferenceable_or_null metadata for loads
Summary:
Introduce dereferenceable, dereferenceable_or_null metadata for loads
with the same semantic as corresponding attributes.

This patch depends on http://reviews.llvm.org/D9253

Patch by Artur Pilipenko!

Reviewers: hfinkel, sanjoy, reames

Reviewed By: sanjoy, reames

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237720 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-19 20:10:19 +00:00
Sanjay Patel
041ab65fcd use 'auto *' for pointers; clearer usage, no deep copying
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237719 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-19 20:10:16 +00:00
Pete Cooper
4c8545c815 Remove unused MCExpr.h include from MCELF.h. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237717 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-19 19:20:02 +00:00
Sanjay Patel
0f9fcd22b3 tidy up
1. remove duplicate local variable
2. add local variable with name to match comment
3. remove useless comment



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237715 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-19 19:10:57 +00:00
Alex Lorenz
4c34f96cd6 Fix llc path in MIR testcases committed in r237708.
I've committed testcases with local llc path by mistake.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237712 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-19 18:45:41 +00:00
Sanjay Patel
f75a247286 use range-based for-loop
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237711 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-19 18:24:33 +00:00
Pete Cooper
61386a4fe3 Remove unused MCRelocationInfo.h include from MCDisassembler.h. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237710 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-19 18:18:49 +00:00
Filipe Cabecinhas
27ca64f3d3 Change a reachable unreachable to a fatal error.
Summary:
Also tagged a FIXME comment, and added information about why it breaks.

Bug found using AFL fuzz.

Reviewers: rafael, craig.topper

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237709 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-19 18:18:10 +00:00
Alex Lorenz
328f462f3c MIR Serialization: print and parse LLVM IR using MIR format.
This commit is the initial commit for the MIR serialization project.
It creates a new library under CodeGen called 'MIR'. This new
library adds a new machine function pass that prints out the LLVM IR 
using the MIR format. This pass is then added as a last pass when a 
'stop-after' option is used in llc. The new library adds the initial 
functionality for parsing of MIR files as well. This commit also 
extends the llc tool so that it can recognize and parse MIR input files.

Reviewers: Duncan P. N. Exon Smith, Matthias Braun, Philip Reames

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237708 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-19 18:17:39 +00:00
Pete Cooper
98fe1d290c Remove unused MachineLocation.h include from MCAsmInfo.h. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237707 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-19 17:59:09 +00:00
Matthias Braun
f7ad33bd8a RegisterCoalescer: Improve a comment.
Explain the relation of the example to the variables in the code,
explain what bad behaviour the code avoids in this case.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237706 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-19 17:52:32 +00:00
Sanjay Patel
038aeda7cf use range-based for loop
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237705 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-19 17:49:14 +00:00
Igor Laevsky
92948b04c3 [RewriteStatepointsForGC] Fix up naming in "relocationViaAlloca" and run it through clang-format.
Differential Revision: http://reviews.llvm.org/D9774



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237703 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-19 16:29:43 +00:00
Wei Mi
51891f2364 Remove the InstructionSimplifierPass immediately after InstructionCombiningPass.
InstructionCombiningPass was added after LoopUnrollPass in r237395. Because
InstructionCombiningPass is strictly more powerful than InstructionSimplifierPass,
remove the unnecessary InstructionSimplifierPass.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237702 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-19 16:09:11 +00:00
Igor Laevsky
42737039d5 [RewriteStatepointsForGC] For some values (like gep's and bitcasts) it's cheaper to clone them after statepoint than to emit proper relocates for them. This change implements this logic. There is alredy similar optimization in CodeGenPrepare, but doing so during RewriteStatepointsForGC allows to capture more opprtunities such as relocates in loops and longer instruction chains.
Differential Revision: http://reviews.llvm.org/D9774



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237701 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-19 15:59:05 +00:00
Zoran Jovanovic
70d1005bbd [mips][microMIPSr6] Implement NOR, OR, ORI, XOR and XORI instructions
Differential Revision: http://reviews.llvm.org/D8800


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237697 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-19 14:12:55 +00:00
Zoran Jovanovic
94ddfe5e09 [mips][microMIPSr6] Implement AND and ANDI instructions
Differential Revision: http://reviews.llvm.org/D8772


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237696 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-19 13:32:31 +00:00
Yaron Keren
f1ed587ebf Rangify for loop in Cleanup(), NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237695 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-19 13:32:19 +00:00
Yaron Keren
add5ea661a Prevent Cleanup() from running more than once.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237694 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-19 13:31:25 +00:00
Yaron Keren
7141b3d6f3 Use cat and not type Under MSYS, same as Cygwin.
type means something else under the MSYS shell.

Patch by Tzafrir Poupko!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237692 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-19 12:59:23 +00:00
Daniel Sanders
dfce63b1ba [mips] Correct and improve special-case shuffle instructions.
Summary:
The documentation writes vectors highest-index first whereas LLVM-IR writes
them lowest-index first. As a result, instructions defined in terms of
left_half() and right_half() had the halves reversed.

In addition to correcting them, they have been improved to allow shuffles
that use the same operand twice or in reverse order. For example, ilvev
used to accept masks of the form:
  <0, n, 2, n+2, 4, n+4, ...>
but now accepts:
  <0, 0, 2, 2, 4, 4, ...>
  <n, n, n+2, n+2, n+4, n+4, ...>
  <0, n, 2, n+2, 4, n+4, ...>
  <n, 0, n+2, 2, n+4, 4, ...>

One further improvement is that splati.[bhwd] is now the preferred instruction
for splat-like operations. The other special shuffles are no longer used
for splats. This lead to the discovery that <0, 0, ...> would not cause
splati.[hwd] to be selected and this has also been fixed.

This fixes the enc-3des test from the test-suite on Mips64r6 with MSA.

Reviewers: vkalintiris

Reviewed By: vkalintiris

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237689 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-19 12:24:52 +00:00
Yaron Keren
07cfd922f0 As r237678 was reverted, this is no longer needed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237687 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-19 11:46:27 +00:00
Zoran Jovanovic
7004ac8b5a [mips][microMIPSr6] Implement DIV, DIVU, MOD and MODU instructions
Differential Revision: http://reviews.llvm.org/D8769


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237685 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-19 11:21:37 +00:00
Yaron Keren
a44933e6d0 Fix Visual C++ errors C2784, C2780, C2782 after r237678.
It does not like std::min(unsigned, uint32_t).



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237683 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-19 11:18:10 +00:00
Michael Kuperstein
5440f2198d [X86] ABI change for x86-32: pass 3 vector arguments in-register instead of 4, except on Darwin.
This changes the ABI used on 32-bit x86 for passing vector arguments. 
Historically, clang passes the first 4 vector arguments in-register, and additional vector arguments on the stack, regardless of platform. That is different from the behavior of gcc, icc, and msvc, all of which pass only the first 3 arguments in-register.
The 3-register convention is documented, unofficially, in Agner's calling convention guide, and, officially, in the recently released version 1.0 of the i386 psABI.

Darwin is kept as is because the OS X ABI Function Call Guide explicitly documents the current (4-register) behavior.

This fixes PR21510

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237682 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-19 11:06:56 +00:00
Pawel Bylica
ef3ec7c783 Revert "Avoid size_t -> unsigned conversion in MathExtras.h header. NFC".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237680 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-19 10:51:24 +00:00
Pawel Bylica
8fae893373 Avoid size_t -> unsigned conversion in MathExtras.h header. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237678 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-19 10:35:32 +00:00