Commit Graph

117519 Commits

Author SHA1 Message Date
Elena Demikhovsky
86425451e5 AVX-512: Enabled SSE intrinsics on AVX-512.
Predicate UseAVX depricates pattern selection on AVX-512.
This predicate is necessary for DAG selection to select EVEX form.
But mapping SSE intrinsics to AVX-512 instructions is not ready yet.
So I replaced UseAVX with HasAVX for intrinsics patterns.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237903 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-21 14:01:32 +00:00
Renato Golin
b6ea67e027 Make Triple::parseARMArch use ARMTargetParser
Simplifying Triple::parseARMArch, leaving all the parsing to ARMTargetParser.

This commit also adds AArch64 detection to ARMTargetParser canonicalization,
and a two RedHat arch names (v{6,7}hl, meaning hard-float / little-endian).

Adding enough unit tests to cover the basics. Clang checks fine.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237902 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-21 13:52:20 +00:00
Igor Laevsky
897d9bccdc [RewriteStatepointsForGC] Fix debug assertion during derivable pointer rematerialization
Correct assertion would be that there is no other uses from chain we are currently cloning. It is ok to have other uses of values not from this chain.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237899 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-21 13:02:14 +00:00
Artur Pilipenko
5ac9604df7 Fix memory-dereferenceable.ll test
One of the testcases introduced by D9365 had incorrect !dereferenceable metadata on load. It must fail but it doesn't due to incorrect order of CHECK/CHECK-NOT commands in test. Fixed both.

Reviewed By: sanjoy

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237897 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-21 12:51:38 +00:00
Artur Pilipenko
946d5f5631 Test commit. Fix typo in MemDerefPrinter.cpp comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237893 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-21 11:57:38 +00:00
Renato Golin
a9a920d652 Remove unnecessary FIXME comment
It has been fixed by commit r237797.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237890 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-21 10:47:56 +00:00
Simon Pilgrim
41c749a31f Fixed unused variable warning in non-assert builds from rL237885
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237889 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-21 10:22:10 +00:00
Simon Pilgrim
87d1836793 [X86][SSE] Improve support for 128-bit vector sign extension
This patch improves support for sign extension of the lower lanes of vectors of integers by making use of the SSE41 pmovsx* sign extension instructions where possible, and optimizing the sign extension by shifts on pre-SSE41 targets (avoiding the use of i64 arithmetic shifts which require scalarization).

It converts SIGN_EXTEND nodes to SIGN_EXTEND_VECTOR_INREG where necessary, that more closely matches the pmovsx* instruction than the default approach of using SIGN_EXTEND_INREG which splits the operation (into an ANY_EXTEND lowered to a shuffle followed by shifts) making instruction matching difficult during lowering. Necessary support for SIGN_EXTEND_VECTOR_INREG has been added to the DAGCombiner.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237885 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-21 10:05:03 +00:00
Toma Tabacu
cebe8f8b05 [mips] [IAS] Add 2 missing CHECK directives for fixups in mips-expansions.s.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237884 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-21 10:04:39 +00:00
Hal Finkel
80bb2d981d [TableGen] Resolve complex def names inside multiclasses
We had not been trying hard enough to resolve def names inside multiclasses
that had complex concatenations, etc. Now we'll try harder.

Patch by Amaury Sechet!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237877 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-21 04:32:56 +00:00
Duncan P. N. Exon Smith
583dac827c AsmPrinter: Compute absolute label difference directly
Create a low-overhead path for `EmitLabelDifference()` that emits a
emits an absolute number when (1) the output is an object stream and (2)
the two symbols are in the same data fragment.

This drops memory usage on Mach-O from 975 MB down to 919 MB (5.8%).
The only call is when `!doesDwarfUseRelocationsAcrossSections()` --
i.e., on Mach-O -- since otherwise an absolute offset from the start of
the section needs a relocation.  (`EmitLabelDifference()` is cheaper on
ELF anyway, since it creates 1 fewer temp symbol, and it gets called far
less often.  It's not clear to me if this is even a bottleneck there.)

(I'm looking at `llc` memory usage on `verify-uselistorder.lto.opt.bc`;
see r236629 for details.)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237876 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-21 02:41:23 +00:00
Duncan P. N. Exon Smith
1d4f2ba509 MC: Initialize MCSymbolData::Offset directly
Try to fix miscompile after r237873.  Looks like this union
initialization isn't legal (or at least not supported).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237875 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-21 01:59:58 +00:00
Ahmed Bougacha
8eca988b00 [MemCpyOpt] Do move the memset, but look at its dest's dependencies.
In effect a partial revert of r237858, which was a dumb shortcut.
Looking at the dependencies of the destination should be the proper
fix: if the new memset would depend on anything other than itself,
the transformation isn't correct.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237874 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-21 01:43:39 +00:00
Duncan P. N. Exon Smith
4652459f64 MC: Simplify MCSymbolData initialization and remove MCSymbol pointer
Finally remove the `MCSymbolData::Symbol` pointer.  It was still being
used to track whether `MCSymbolData` had been initialized, but this is
better tracked by the bitfield in `MCSymbol`.

The only caller of `MCSymbolData::initialize()` was `MCAssembler`, which
(other than `Symbol`) passed in all-0 values.  Replace all that
indirection with a default constructor.

The main point is a cleanup (and there's more cleanup to do), but there
are also some small memory savings.  I measured ~989 MB down to ~975 MB,
cutting a little over 1% off the top of `llc`.

(I'm looking at `llc` memory usage on `verify-uselistorder.lto.opt.bc`;
see r236629 for details.)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237873 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-21 01:33:03 +00:00
Swaroop Sridhar
0141c66026 Document the CoreCLR GC Strategy
Add notead about the CoreCLR GC Strategy to the 
Garbage Collection document.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237869 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-21 00:50:10 +00:00
Duncan P. N. Exon Smith
549a742ba4 MC: Make MCSymbolData::Symbol private
Make the back-pointer from `MCSymbolData` to `MCSymbol` private,
preparing to remove the back pointer entirely.  I've already updated all
the users, although for now it's still used to indicate whether
`MCSymbol::Data` has been initialized.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237868 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-21 00:49:09 +00:00
Duncan P. N. Exon Smith
aa87ff8440 MC: Remove last use of MCSymbolData::getSymbol(), NFC
Remove the last use of `MCSymbolData::getSymbol()`.  There's some
*really* hairy stuff going on in `MachObjectWriter::WriteNList()` that I
want to come back to.  In particular, it updates `Symbol` to point at
its aliasee (if any), but leaves `Data` behind, and it's not clear
whether everything makes sense there.

For now I've left the logic unchanged by adding `OrigSymbol` and moving
the FIXME from r237750 up a bit higher.  I've filed PR23598 to track
looking into this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237867 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-21 00:39:24 +00:00
Ahmed Bougacha
d591505d9f [MemCpyOpt] Pass Instruction to IRBuilder, no need for NextNode. NFC.
We're erasing the instructions anyway.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237861 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-21 00:08:35 +00:00
David Blaikie
47ee653cdc [opaque pointer type] Pass explicit pointee type in another case of GEP constant folding
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237860 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-21 00:06:38 +00:00
Andrew Kaylor
f12338a6b7 Fix build error
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237859 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-20 23:58:44 +00:00
Ahmed Bougacha
6d1485e974 [MemCpyOpt] Don't move the memset when optimizing memset+memcpy.
Fixes PR23599, another miscompile introduced by r235232: when there is
another dependency on the destination of the created memset (i.e., the
part of the original destination that the memcpy doesn't depend on)
between the memcpy and the original memset, we would insert the created
memset after the memcpy, and thus after the other dependency.

Instead, insert the created memset right after the old one.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237858 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-20 23:55:16 +00:00
Andrew Kaylor
008a1efecf Fix build warning
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237855 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-20 23:28:03 +00:00
Andrew Kaylor
d0f4ffa472 [WinEH] C++ EH state numbering fixes
Differential Revision: http://reviews.llvm.org/D9787



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237854 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-20 23:22:24 +00:00
Reid Kleckner
7681f6a1b0 [WinEH] Store pointers to the LSDA in the exception registration object
We aren't yet emitting the LSDA yet, so this will still fail to
assemble.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237852 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-20 23:08:04 +00:00
Pete Cooper
05b0f7dc93 Don't generate comments in the DebugLocStream unless required. NFC.
The ByteStreamer here wasn't taking account of whether the asm streamer was text based and verbose.  Only with that combination should we emit comments.

This change makes sure that we only actually convert a Twine to a string using Twine::str() if we need the comment.  This saves about 10000 small allocations on a test case involving the verify-use_list-order bitcode going through llc with debug info.

Note, this is NFC as the comments would ultimately never be emitted unless required.

Reviewed by Duncan Exon Smith and David Blaikie.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237851 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-20 22:51:27 +00:00
Pete Cooper
d4483d4512 Revert "Add bool to DebugLocDwarfExpression to control emitting comments."
This reverts commit 0037b6bcbc874aa1b93d7ce3ad8dba3753ee2d9d (r237827).

David Blaikie suggested some alternatives to this which are better.  Reverting to apply a better solution later.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237849 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-20 22:37:48 +00:00
Hans Wennborg
fa13c712af Revert r237828 "[X86] Remove unused node after morphing it from shr to and."
This caused assertions during DAG combine: PR23601.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237843 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-20 22:31:55 +00:00
Nick Kledzik
0dd9a6767c [doc] Update Lexicon with C++ unwinder acronyms
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237840 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-20 22:04:06 +00:00
David Blaikie
14a714f727 [opaque pointer type] Pass explicit type to Load instruction creation in AutoUpgrade
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237838 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-20 21:46:30 +00:00
Davide Italiano
e677c7bd22 [Target/ARM] Only enable OptimizeBarrierPass at -O1 and above.
Ideally this is going to be and LLVM IR pass (shared, among others
with AArch64), but for the time being just enable it if consumers
ask us for optimization and not unconditionally.

Discussed with Tim Northover on IRC.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237837 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-20 21:40:38 +00:00
Kostya Serebryany
b753a30d3b [lib/Fuzzer] more docs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237836 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-20 21:03:03 +00:00
Alex Lorenz
3f1b2bdf5d AsmParser: Require a terminating null character when creating memory buffer.
This commit modifies the memory buffer creation in the AsmParser library so 
that it requires a terminating null character. The LLLexer in the AsmParser
library checks for EOF only when it sees a null character, thus it would
be best to require it when creating a memory buffer so that the memory
buffer constructor can verify that a terminating null character is indeed
present.

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

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237833 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-20 20:41:27 +00:00
David Blaikie
e86ba4b571 [opaque pointer type] LoadInst: assert that the explicit type matches the implicit one
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237830 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-20 20:22:31 +00:00
Duncan P. N. Exon Smith
cfa5342444 MC: Remove most remaining uses of MCSymbolData::getSymbol(), NFC
Remove most remaining calls to `MCSymbolData::getSymbol()`, instead
using the already available `MCSymbol` directly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237829 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-20 20:18:16 +00:00
Benjamin Kramer
644f1ff184 [X86] Remove unused node after morphing it from shr to and.
In some cases it won't get cleaned up properly leading to crashes
downstream. PR23353.

Based on a patch by Davide Italiano.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237828 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-20 20:10:26 +00:00
Pete Cooper
c212d49d75 Add bool to DebugLocDwarfExpression to control emitting comments.
DebugLocDwarfExpression::EmitOp was creating temporary strings by concatenating Twine's.

When emitting to object files, these comments are thrown away.

This commit adds a boolean to the constructor of the DwarfExpression to control whether it will actually emit
any comments.  This prevents it from even generating the temporary comments which would have been thrown away anyway.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237827 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-20 19:50:03 +00:00
Duncan P. N. Exon Smith
96273f6cbe MC: Stop using MCSymbolData::getSymbol() in WinCOFF, NFC
Move APIs over from `MCSymbolData` to `MCSymbol`.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237826 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-20 19:34:08 +00:00
Pete Cooper
bed96c8d97 Use a SmallString buffer instead of a std::string for debug info path lookup. NFC.
This code appends the filename to the directory then looks that up in a StringMap.  We should be using the existing Twine::toStringRef method instead of Twine::str() as most times we'll succeed in the lookup.

Its possible that we should also consider allowing StringMap to lookup a key using a Twine in addition to a StringRef but that would complicate the code with little known benefit above and beyond this change.

This saves 170k temporary allocations when running llc on the verify_use_list_order bitcode with debug info for x86.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237823 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-20 19:12:14 +00:00
Matthias Braun
fa3d0dc026 DAGCombiner: Continue combining if FoldConstantArithmetic() fails.
DAG.FoldConstantArithmetic() can fail even though both operands are
Constants if OpaqueConstants are involved. Continue trying other combine
possibilities in tis case.

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

Somewhat related to PR21801 / rdar://19211454

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237822 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-20 18:54:02 +00:00
James Molloy
d594ba0815 Reapply r237539 with a fix for the Chromium build.
Make sure if we're truncating a constant that would then be sign extended
that the sign extension of the truncated constant is the same as the
original constant.

> Canonicalize min/max expressions correctly.
>
> This patch introduces a canonical form for min/max idioms where one operand
> is extended or truncated. This often happens when the other operand is a
> constant. For example:
>
> %1 = icmp slt i32 %a, i32 0
> %2 = sext i32 %a to i64
> %3 = select i1 %1, i64 %2, i64 0
>
> Would now be canonicalized into:
>
> %1 = icmp slt i32 %a, i32 0
> %2 = select i1 %1, i32 %a, i32 0
> %3 = sext i32 %2 to i64
>
> This builds upon a patch posted by David Majenemer
> (https://www.marc.info/?l=llvm-commits&m=143008038714141&w=2). That pass
> passively stopped instcombine from ruining canonical patterns. This
> patch additionally actively makes instcombine canonicalize too.
>
> Canonicalization of expressions involving a change in type from int->fp
> or fp->int are not yet implemented.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237821 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-20 18:41:25 +00:00
Matthias Braun
ee15f86421 ARM: Fix comment and make it slightly more readable
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237820 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-20 18:40:06 +00:00
Duncan P. N. Exon Smith
80b2cb6d4d MC: Use MCSymbol in LocalCommon, NFC
Switch from MCSymbolData to MCSymbol in LocalCommon.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237816 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-20 18:25:40 +00:00
Pawel Bylica
12f6308247 Fix icmp lowering
Summary:
During icmp lowering it can happen that a constant value can be larger than expected (see the code around the change).
APInt::getMinSignedBits() must be checked again as the shift before can change the constant sign to positive.
I'm not sure it is the best fix possible though.

Test Plan: Regression test included.

Reviewers: resistor, chandlerc, spatel, hfinkel

Reviewed By: hfinkel

Subscribers: hfinkel, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237812 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-20 17:21:09 +00:00
Pete Cooper
9584e07a9c Change Function::getIntrinsicID() to return an Intrinsic::ID. NFC.
Now that Intrinsic::ID is a typed enum, we can forward declare it and so return it from this method.

This updates all users which were either using an unsigned to store it, or had a now unnecessary cast.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237810 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-20 17:16:39 +00:00
Alexey Samsonov
1563a4a416 Temporary delete the test while we're investigating crashes in LLVMObject it causes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237809 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-20 17:01:06 +00:00
Duncan P. N. Exon Smith
91a675f972 MC: Add MCSymbolData back to MCAssembler dump
r237490 accidentally dropped MCSymbolData from the MCAssembler dump.
Add it back underneath the MCSymbol dump.  Remove the MCSymbol dump from
MCSymbolData, since this would cause an infinite co-recursion, and
besides, that back pointer is going away.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237807 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-20 16:34:36 +00:00
Duncan P. N. Exon Smith
20cf3f41e7 MC: Update MCAssembler to use MCSymbol, NFC
Use `MCSymbol` over `MCSymbolData` where both are needed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237803 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-20 16:02:11 +00:00
Benjamin Kramer
10054fb7b0 [YAML] Make Node's destructor non-virtual.
Nodes aren't supposed to be destroyed polymorphically. Also make all subclasses
final to avoid non-virtual dtor warnings.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237801 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-20 15:38:29 +00:00
Duncan P. N. Exon Smith
c8d166a437 MC: Use MCSymbol in MachObjectWriter, NFC
Replace uses of `MCSymbolData` with `MCSymbol` where both are needed, so
we can remove the backpointer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237799 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-20 15:16:14 +00:00
Duncan P. N. Exon Smith
f5bdf04f09 MC: Use MCSymbol in MCObjectWriter::isWeak(), NFC
Continue to prefer `MCSymbol` when we need both.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237798 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-20 15:10:03 +00:00