Aaron Ballman [Wed, 20 May 2015 14:53:50 +0000 (14:53 +0000)]
Silencing a -Wsign-compare warning; NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237794
91177308-0d34-0410-b5e6-
96231b3b80d8
Elena Demikhovsky [Wed, 20 May 2015 14:32:03 +0000 (14:32 +0000)]
AVX-512: fixed algorithm of building vectors of i1 elements
fixed extract-insert i1 element,
load i1, zextload i1 should be with "and $1, %reg" to prevent loading garbage.
added a bunch of new tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237793
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Wed, 20 May 2015 14:18:59 +0000 (14:18 +0000)]
Revert r237789 - [mips] The naming convention for private labels is ABI dependant.
It works, but I've noticed that I missed several callers of createMCAsmInfo()
and many don't have a TargetMachine to provide.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237792
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Wed, 20 May 2015 13:19:19 +0000 (13:19 +0000)]
[mips] Fix ehframe-indirect.ll test.
Summary:
-check-prefix replaces the default CHECK prefix rather than adding to it and
must be explicitly re-added.
Also added the N32 cases.
Reviewers: petarj
Reviewed By: petarj
Subscribers: tberghammer, llvm-commits
Differential Revision: http://reviews.llvm.org/D9668
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237790
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Wed, 20 May 2015 13:16:42 +0000 (13:16 +0000)]
[mips] The naming convention for private labels is ABI dependant.
Summary:
For N32/N64, private labels begin with '.L' but for O32 they begin with '$'.
MCAsmInfo now has an initializer function which can be used to provide information from the TargetMachine to control the assembly syntax.
Reviewers: vkalintiris
Reviewed By: vkalintiris
Subscribers: jfb, sandeep, llvm-commits, rafael
Differential Revision: http://reviews.llvm.org/D9821
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237789
91177308-0d34-0410-b5e6-
96231b3b80d8
Igor Laevsky [Wed, 20 May 2015 11:37:25 +0000 (11:37 +0000)]
[StatepointLowering] Support of the gc.relocates for invoke statepoints.
This change implements support for lowering of the gc.relocates tied to the invoke statepoint.
This is acomplished by storing frame indices of the lowered values in "StatepointRelocatedValues" map inside FunctionLoweringInfo instead of storing them in per-basic block structure StatepointLowering.
After this change StatepointLowering is used only during "LowerStatepoint" call and it is not necessary to store it as a field in SelectionDAGBuilder anymore.
Differential Revision: http://reviews.llvm.org/D7798
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237786
91177308-0d34-0410-b5e6-
96231b3b80d8
Toma Tabacu [Wed, 20 May 2015 08:54:45 +0000 (08:54 +0000)]
[mips] [IAS] Factor out .set nomacro warning. NFC.
Reviewers: dsanders
Reviewed By: dsanders
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D9772
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237780
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Wed, 20 May 2015 05:40:13 +0000 (05:40 +0000)]
[TableGen] Make some variable names consistent with their type names and just generally consistent across all of the overloads.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237775
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Wed, 20 May 2015 05:40:09 +0000 (05:40 +0000)]
[TableGen] Fix a memory leak.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237774
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Wed, 20 May 2015 05:40:06 +0000 (05:40 +0000)]
[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
David Majnemer [Wed, 20 May 2015 04:45:26 +0000 (04:45 +0000)]
[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
Duncan P. N. Exon Smith [Wed, 20 May 2015 04:39:01 +0000 (04:39 +0000)]
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
Peter Collingbourne [Wed, 20 May 2015 02:44:14 +0000 (02:44 +0000)]
Support: Introduce LLVM_FALLTHROUGH macro.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237766
91177308-0d34-0410-b5e6-
96231b3b80d8
Swaroop Sridhar [Wed, 20 May 2015 01:07:23 +0000 (01:07 +0000)]
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
Alexei Starovoitov [Wed, 20 May 2015 00:20:26 +0000 (00:20 +0000)]
[bpf] fix build
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237751
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Wed, 20 May 2015 00:02:39 +0000 (00:02 +0000)]
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
Duncan P. N. Exon Smith [Tue, 19 May 2015 23:53:20 +0000 (23:53 +0000)]
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
Philip Reames [Tue, 19 May 2015 23:40:11 +0000 (23:40 +0000)]
[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
Reid Kleckner [Tue, 19 May 2015 23:28:23 +0000 (23:28 +0000)]
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
Hans Wennborg [Tue, 19 May 2015 23:06:30 +0000 (23:06 +0000)]
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
Philip Reames [Tue, 19 May 2015 22:26:33 +0000 (22:26 +0000)]
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
Kostya Serebryany [Tue, 19 May 2015 22:12:57 +0000 (22:12 +0000)]
[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
Akira Hatanaka [Tue, 19 May 2015 21:59:11 +0000 (21:59 +0000)]
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
Alexey Samsonov [Tue, 19 May 2015 21:54:32 +0000 (21:54 +0000)]
[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
David Blaikie [Tue, 19 May 2015 21:47:12 +0000 (21:47 +0000)]
[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
Alex Lorenz [Tue, 19 May 2015 21:41:28 +0000 (21:41 +0000)]
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
David Blaikie [Tue, 19 May 2015 21:31:18 +0000 (21:31 +0000)]
[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
Matthias Braun [Tue, 19 May 2015 21:22:20 +0000 (21:22 +0000)]
MachineInstr: Remove unused parameter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237726
91177308-0d34-0410-b5e6-
96231b3b80d8
Jingyue Wu [Tue, 19 May 2015 20:52:45 +0000 (20:52 +0000)]
[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
Alex Lorenz [Tue, 19 May 2015 20:51:48 +0000 (20:51 +0000)]
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
Pete Cooper [Tue, 19 May 2015 20:50:14 +0000 (20:50 +0000)]
Remove unnecessary cast. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237722
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexey Samsonov [Tue, 19 May 2015 20:29:28 +0000 (20:29 +0000)]
[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
Sanjoy Das [Tue, 19 May 2015 20:10:19 +0000 (20:10 +0000)]
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
Sanjay Patel [Tue, 19 May 2015 20:10:16 +0000 (20:10 +0000)]
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
Pete Cooper [Tue, 19 May 2015 19:20:02 +0000 (19:20 +0000)]
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
Sanjay Patel [Tue, 19 May 2015 19:10:57 +0000 (19:10 +0000)]
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
Alex Lorenz [Tue, 19 May 2015 18:45:41 +0000 (18:45 +0000)]
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
Sanjay Patel [Tue, 19 May 2015 18:24:33 +0000 (18:24 +0000)]
use range-based for-loop
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237711
91177308-0d34-0410-b5e6-
96231b3b80d8
Pete Cooper [Tue, 19 May 2015 18:18:49 +0000 (18:18 +0000)]
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
Filipe Cabecinhas [Tue, 19 May 2015 18:18:10 +0000 (18:18 +0000)]
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
Alex Lorenz [Tue, 19 May 2015 18:17:39 +0000 (18:17 +0000)]
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
Pete Cooper [Tue, 19 May 2015 17:59:09 +0000 (17:59 +0000)]
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
Matthias Braun [Tue, 19 May 2015 17:52:32 +0000 (17:52 +0000)]
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
Sanjay Patel [Tue, 19 May 2015 17:49:14 +0000 (17:49 +0000)]
use range-based for loop
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237705
91177308-0d34-0410-b5e6-
96231b3b80d8
Igor Laevsky [Tue, 19 May 2015 16:29:43 +0000 (16:29 +0000)]
[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
Wei Mi [Tue, 19 May 2015 16:09:11 +0000 (16:09 +0000)]
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
Igor Laevsky [Tue, 19 May 2015 15:59:05 +0000 (15:59 +0000)]
[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
Zoran Jovanovic [Tue, 19 May 2015 14:12:55 +0000 (14:12 +0000)]
[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
Zoran Jovanovic [Tue, 19 May 2015 13:32:31 +0000 (13:32 +0000)]
[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
Yaron Keren [Tue, 19 May 2015 13:32:19 +0000 (13:32 +0000)]
Rangify for loop in Cleanup(), NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237695
91177308-0d34-0410-b5e6-
96231b3b80d8
Yaron Keren [Tue, 19 May 2015 13:31:25 +0000 (13:31 +0000)]
Prevent Cleanup() from running more than once.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237694
91177308-0d34-0410-b5e6-
96231b3b80d8
Yaron Keren [Tue, 19 May 2015 12:59:23 +0000 (12:59 +0000)]
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
Daniel Sanders [Tue, 19 May 2015 12:24:52 +0000 (12:24 +0000)]
[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
Yaron Keren [Tue, 19 May 2015 11:46:27 +0000 (11:46 +0000)]
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
Zoran Jovanovic [Tue, 19 May 2015 11:21:37 +0000 (11:21 +0000)]
[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
Yaron Keren [Tue, 19 May 2015 11:18:10 +0000 (11:18 +0000)]
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
Michael Kuperstein [Tue, 19 May 2015 11:06:56 +0000 (11:06 +0000)]
[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
Pawel Bylica [Tue, 19 May 2015 10:51:24 +0000 (10:51 +0000)]
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
Pawel Bylica [Tue, 19 May 2015 10:35:32 +0000 (10:35 +0000)]
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
Artyom Skrobov [Tue, 19 May 2015 10:21:12 +0000 (10:21 +0000)]
Fix documentation for Set-Like Containers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237677
91177308-0d34-0410-b5e6-
96231b3b80d8
Pawel Bylica [Tue, 19 May 2015 08:44:15 +0000 (08:44 +0000)]
Fix getSwappedBytes for double.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237673
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Tue, 19 May 2015 06:50:19 +0000 (06:50 +0000)]
BrainF.cpp: Update CreateCall() according to r237624.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237669
91177308-0d34-0410-b5e6-
96231b3b80d8
Tobias Grosser [Tue, 19 May 2015 06:25:19 +0000 (06:25 +0000)]
Drop unnecessary ';' after namespace
The ';' was introduced in 237642. With it in place, we get a large number of
warnings in -pedantic mode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237667
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Tue, 19 May 2015 01:40:21 +0000 (01:40 +0000)]
SelectionDAG: Cleanup and simplify FoldConstantArithmetic
This cleans up the FoldConstantArithmetic code by factoring out the case
of two ConstantSDNodes into an own function. This avoids unnecessary
complexity for many callers who already have ConstantSDNode arguments.
This also avoids an intermeidate SmallVector datastructure and a loop
over that datastructure.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237651
91177308-0d34-0410-b5e6-
96231b3b80d8
Filipe Cabecinhas [Tue, 19 May 2015 01:21:06 +0000 (01:21 +0000)]
[BitcodeReader] Error out if we read an invalid function argument type
Bug found with AFL fuzz.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237650
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Tue, 19 May 2015 01:06:07 +0000 (01:06 +0000)]
[lib/Fuzzer] more efficient reload logic; also don't spam git too much
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237649
91177308-0d34-0410-b5e6-
96231b3b80d8
Filipe Cabecinhas [Tue, 19 May 2015 00:34:17 +0000 (00:34 +0000)]
[BitcodeReader] It's a malformed block if CodeLenWidth is too big
Bug found with AFL fuzz.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237646
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Tue, 19 May 2015 00:25:21 +0000 (00:25 +0000)]
DAGCombiner: Factor common pattern into isOneConstant() function. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237645
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Tue, 19 May 2015 00:25:20 +0000 (00:25 +0000)]
DAGCombiner: Factor common pattern into isAllOnesConstant() function. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237644
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Tue, 19 May 2015 00:25:17 +0000 (00:25 +0000)]
DAGCombiner: Use isNullConstant() where possible
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237643
91177308-0d34-0410-b5e6-
96231b3b80d8
Pete Cooper [Tue, 19 May 2015 00:24:26 +0000 (00:24 +0000)]
Store intrinsic ID by value in Function instead of a string lookup. NFC.
On 64-bit targets, Function has 4-bytes of padding in its struct layout.
This uses the space for the intrinsic ID. It is set and recalculated whenever the function name is set. This is similar to the current behavior which clears the function from the intrinsic ID cache when its renamed.
The intrinsic cache itself is removed as the only purpose was to speedup calls to getIntrinsicID() which now just reading the new field in the struct.
Reviewed by Duncan. http://reviews.llvm.org/D9836
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237642
91177308-0d34-0410-b5e6-
96231b3b80d8
Pete Cooper [Tue, 19 May 2015 00:02:25 +0000 (00:02 +0000)]
Move Function::lookupIntrinsicID to a static method. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237641
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Mon, 18 May 2015 23:35:09 +0000 (23:35 +0000)]
Re-land r237175: [X86] Always return the sret parameter in eax/rax ...
This reverts commit r237210.
Also fix X86/complex-fca.ll to match the code that we used to generate
on win32 and now generate everwhere to conform to SysV.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237639
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Mon, 18 May 2015 23:18:13 +0000 (23:18 +0000)]
Revert accidental change in r237633
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237635
91177308-0d34-0410-b5e6-
96231b3b80d8
Jozef Kolek [Mon, 18 May 2015 23:12:10 +0000 (23:12 +0000)]
[mips][microMIPSr6] Implement LSA instruction
This patch implements LSA instruction using mapping.
Differential Revision: http://reviews.llvm.org/D8919
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237634
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Mon, 18 May 2015 23:07:27 +0000 (23:07 +0000)]
DAGCombiner: Factor common pattern into isNullConstant() function. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237633
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Mon, 18 May 2015 22:40:13 +0000 (22:40 +0000)]
Revert "[opaque pointer type] Provide a convenience for IRBuilder::CreateCall that accepts a Function without needing to take an explicit callee Type"
Creates ambiguity in Clang callers. Reverting while I figure it out.
This reverts commit r237627.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237629
91177308-0d34-0410-b5e6-
96231b3b80d8
Filipe Cabecinhas [Mon, 18 May 2015 22:27:11 +0000 (22:27 +0000)]
[BitcodeReader] Make sure the type of the inserted value matches the type of the aggregate at those indices
Bug found with AFL-fuzz.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237628
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Mon, 18 May 2015 22:25:14 +0000 (22:25 +0000)]
[opaque pointer type] Provide a convenience for IRBuilder::CreateCall that accepts a Function without needing to take an explicit callee Type
The common case is a direct call, so don't make all those users have to
explicitly pass the result of llvm::Function::getFunctionType.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237627
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Mon, 18 May 2015 22:13:54 +0000 (22:13 +0000)]
Simplify IRBuilder::CreateCall* by using ArrayRef+initializer_list/braced init only
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237624
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Mon, 18 May 2015 22:12:43 +0000 (22:12 +0000)]
80-col fixup.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237623
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Mon, 18 May 2015 22:12:41 +0000 (22:12 +0000)]
Fix grammar in comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237622
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Mon, 18 May 2015 22:07:20 +0000 (22:07 +0000)]
AArch64: work around ld64 bug more aggressively.
ld64 currently mishandles internal pointer relocations (i.e.
ARM64_RELOC_UNSIGNED referred to by section & offset rather than symbol). The
existing __cfstring clause was an early discovery and workaround for this, but
the problem is wider and we should avoid such relocations wherever possible for
now.
This code should be reverted to allowing internal relocations as soon as
possible.
PR23437.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237621
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Mon, 18 May 2015 21:49:02 +0000 (21:49 +0000)]
Fix some odd whitespace and formatting errors while making
changes in ConstantsContext.h.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237620
91177308-0d34-0410-b5e6-
96231b3b80d8
Filipe Cabecinhas [Mon, 18 May 2015 21:48:55 +0000 (21:48 +0000)]
Extract the load/store type verification to a separate function.
Summary:
Added isLoadableOrStorableType to PointerType.
We were doing some checks in some places, occasionally assert()ing instead
of telling the caller. With this patch, I'm putting all type checking in
the same place for load/store type instructions, and verifying the same
thing every time.
I also added a check for load/store of a function type.
Applied extracted check to Load, Store, and Cmpxcg.
I don't have exhaustive tests for all of these, but all Error() calls in
TypeCheckLoadStoreInst are being tested (in invalid.test).
Reviewers: dblaikie, rafael
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D9785
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237619
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Mon, 18 May 2015 21:34:20 +0000 (21:34 +0000)]
[lib/Fuzzer] when -sync_command=<CMD> is given, periodically execute 'CMD CORPUS' to synchronize with other processes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237617
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Mon, 18 May 2015 21:11:27 +0000 (21:11 +0000)]
[YAML] Plug a memory leak
The destructor of BlockScalarNode is never called. Store the contained
string in BumpPtrAllocated memory instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237614
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Mon, 18 May 2015 20:27:55 +0000 (20:27 +0000)]
MachineInstr: Change return value of getOpcode() to unsigned.
This was previously returning int. However there are no negative opcode
numbers and more importantly this was needlessly different from
MCInstrDesc::getOpcode() (which even is the value returned here) and
SDValue::getOpcode()/SDNode::getOpcode().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237611
91177308-0d34-0410-b5e6-
96231b3b80d8
Chen Li [Mon, 18 May 2015 19:50:14 +0000 (19:50 +0000)]
[Verifier] Assert gc_relocate always return a pointer type
Summary: Add an assertion in verifier.cpp to make sure gc_relocate relocate a gc pointer, and its return type has the same address space with the relocated pointer.
Reviewers: reames, AndyAyers, sanjoy, pgavlin
Reviewed By: pgavlin
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D9695
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237605
91177308-0d34-0410-b5e6-
96231b3b80d8
Chen Li [Mon, 18 May 2015 19:02:25 +0000 (19:02 +0000)]
[PlaceSafepoints] Assertion on that gc_result can not have preceding phis should only apply to invoke statepoint
Summary: When PlaceSafepoints pass replaces old return result with gc_result from statepoint, it asserts that gc_result can not have preceding phis in its parent block. This is only true on invoke statepoint, which terminates the block and puts its result at the beginning of the normal successor block. Call statepoint does not terminate the block and thus its result is in the same block with it. There should be no restriction on whether there are phis or not.
Reviewers: reames, igor-laevsky
Reviewed By: igor-laevsky
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D9803
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237597
91177308-0d34-0410-b5e6-
96231b3b80d8
Jim Grosbach [Mon, 18 May 2015 18:43:23 +0000 (18:43 +0000)]
MC: clang-format MCContext. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237595
91177308-0d34-0410-b5e6-
96231b3b80d8
Jim Grosbach [Mon, 18 May 2015 18:43:14 +0000 (18:43 +0000)]
MC: Clean up method names in MCContext.
The naming was a mish-mash of old and new style. Update to be consistent
with the new. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237594
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Mon, 18 May 2015 18:07:00 +0000 (18:07 +0000)]
Exploit dereferenceable_or_null attribute in LICM pass
Summary:
Allow hoisting of loads from values marked with dereferenceable_or_null
attribute. For values marked with the attribute perform
context-sensitive analysis to determine whether it's known-non-null or
not.
Patch by Artur Pilipenko!
Reviewers: hfinkel, sanjoy, reames
Reviewed By: reames
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D9253
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237593
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Mon, 18 May 2015 17:10:40 +0000 (17:10 +0000)]
ARM: allow jump tables to be placed as constant islands.
Previously, they were forced to immediately follow the actual branch
instruction. This was usually OK (the LEAs actually accessing them got emitted
nearby, and weren't usually separated much afterwards). Unfortunately, a
sufficiently nasty phi elimination dumps many instructions right before the
basic block terminator, and this can increase the range too much.
This patch frees them up to be placed as usual by the constant islands pass,
and consequently has to slightly modify the form of TBB/TBH tables to refer to
a PC-relative label at the final jump. The other jump table formats were
already position-independent.
rdar://
20813304
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237590
91177308-0d34-0410-b5e6-
96231b3b80d8
Jingyue Wu [Mon, 18 May 2015 17:03:25 +0000 (17:03 +0000)]
[ScalarEvolution] refactor: extract interface getGEPExpr
Summary:
This allows other passes (such as SLSR) to compute the SCEV expression for an
imaginary GEP.
Test Plan: no regression
Reviewers: atrick, sanjoy
Reviewed By: sanjoy
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D9786
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237589
91177308-0d34-0410-b5e6-
96231b3b80d8
Hans Wennborg [Mon, 18 May 2015 16:54:17 +0000 (16:54 +0000)]
Fix llvm::BumpPtrAllocatorImpl::Reset()
BumpPtrAllocator's Reset wouldn't clear CustomSizedSlabs if Slabs.size() == 0.
Patch by Kal <
b17c0de@gmail.com>!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237588
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Mon, 18 May 2015 16:49:34 +0000 (16:49 +0000)]
indvars cruft: don't replace phi nodes for no reason.
Don't replace a phi with an identical phi. This was done long ago to
"preserve" IVUsers analysis. The code has already called
SE->forgetValue(PN) so I see no purpose in creating a new value for
the phi.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237587
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Mon, 18 May 2015 16:49:31 +0000 (16:49 +0000)]
SimplifyIV comments and dead argument cleanup.
Remove crufty comments. IVUsers hasn't been used here for a long time.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237586
91177308-0d34-0410-b5e6-
96231b3b80d8
James Y Knight [Mon, 18 May 2015 16:43:33 +0000 (16:43 +0000)]
Sparc: support the "set" synthetic instruction.
This pseudo-instruction expands into 'sethi' and 'or' instructions,
or, just one of them, if the other isn't necessary for a given value.
Differential Revision: http://reviews.llvm.org/D9089
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237585
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Mon, 18 May 2015 16:42:10 +0000 (16:42 +0000)]
Preserve the order of READ_REGISTER and WRITE_REGISTER
At the present time, we don't have a way to represent general dependency
relationships, so everything is represented using memory dependency. In order
to preserve the data dependency of a READ_REGISTER on WRITE_REGISTER, we need
to model WRITE_REGISTER as writing (which we had been doing) and model
READ_REGISTER as reading (which we had not been doing). Fix this, and also the
way that the chain operands were generated at the SDAG level.
Patch by Nicholas Paul Johnson, thanks! Test case by me.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237584
91177308-0d34-0410-b5e6-
96231b3b80d8