134382 Commits

Author SHA1 Message Date
Kevin Enderby
054620884a Change all but the last ErrorOr<...> use for MachOUniversalBinary to Expected<...> to
allow a good error message to be produced.

I added the one test case that the object file tools could produce an error
message.  The other two errors can’t be triggered if the input file is passed
through sys::fs::identify_magic().  But the malformedError("bad magic number")
does get triggered by the logic in llvm-dsymutil when dealing with a normal
Mach-O file.  The other "File too small ..." error would take a logic error
currently to produce and is not tested for.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273946 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-27 21:39:39 +00:00
Rafael Espindola
aac123825e Convert a few more comparisons to isPositionIndependent(). NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273945 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-27 21:33:08 +00:00
Rafael Espindola
edc588dfd7 Delete the IsStatic predicate.
In all its uses it was equivalent to IsNotPIC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273943 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-27 21:09:14 +00:00
Matt Arsenault
d35aece639 AMDGPU: Implement per-function subtargets
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273940 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-27 20:48:03 +00:00
Davide Italiano
1e5e32b74d [llvm-ar] Ignore -plugin option.
binutils ar uses -plugin to specify the LTO plugin, but LLVM doesn't
need this as it doesn't use a plugin for LTO. Accepting (and ignoring)
the option allows interoperability with existing build systems and
make downstream consumers life much easier.

No objections from Rafael on this change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273938 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-27 20:38:39 +00:00
Matt Arsenault
dca409d5ad AMDGPU: Move subtarget feature checks into passes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273937 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-27 20:32:13 +00:00
Sanjay Patel
87796a3096 add tests for PR28153
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273936 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-27 20:28:59 +00:00
Justin Holewinski
76e2771df0 Only emit extension for zeroext/signext arguments if type is < 32 bits
Reviewers: jingyue, jlebar

Subscribers: jholewinski

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273922 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-27 20:22:22 +00:00
Rafael Espindola
bc84e94c11 Teach shouldAssumeDSOLocal about tls.
Fixes a fixme about handling other visibilities.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273921 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-27 20:19:14 +00:00
Elena Demikhovsky
beb8cd956d Fixed crash of SLP Vectorizer on KNL
The bug is connected to vector GEPs.
https://llvm.org/bugs/show_bug.cgi?id=28313



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273919 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-27 20:07:00 +00:00
Chris Bieneman
7dd3b5594f [yaml2obj] Missed updating a few test cases in r273915
This should fix the broken bots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273918 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-27 20:02:49 +00:00
Matt Arsenault
5123c149e7 AMDGPU: Fix verifier errors with undef vector indices
Also fix pointlessly adding exec to liveins.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273916 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-27 19:57:44 +00:00
Chris Bieneman
9cf90e65d1 [yaml2obj] Remove --format option in favor of YAML tags
Summary:
Our YAML library's handling of tags isn't perfect, but it is good enough to get rid of the need for the --format argument to yaml2obj. This patch does exactly that.

Instead of requiring --format, it infers the format based on the tags found in the object file. The supported tags are:

!ELF
!COFF
!mach-o
!fat-mach-o

I have a corresponding patch that is quite large that fixes up all the in-tree test cases.

Reviewers: rafael, Bigcheese, compnerd, silvas

Subscribers: compnerd, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273915 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-27 19:53:53 +00:00
Matt Arsenault
1d88d3b08d Verifier: Reject non-float !fpmath
Code already assumes this is float. getFPAccuracy()
crashes on any other type.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273912 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-27 19:43:15 +00:00
Matt Arsenault
bd288e1778 DAGCombiner: Don't narrow volatile vector loads + extract
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273909 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-27 19:31:04 +00:00
Rafael Espindola
c01c8ebe61 Use isPositionIndependent(). NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273907 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-27 19:15:08 +00:00
Sanjay Patel
85a9211eaf [InstCombine] refactor sdiv by APInt transforms (NFC)
There's at least one more fold to do here:
https://llvm.org/bugs/show_bug.cgi?id=28153


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273904 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-27 18:38:40 +00:00
Rafael Espindola
4d570622b2 Use isPositionIndependent(). NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273903 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-27 18:37:44 +00:00
George Burgess IV
ecb9fc51e3 [CFLAA] Use unsigned numbers for bit-shifts.
This uses `1U` instead of `1ULL` because StratifiedAttrs is a 32-bit
bitset.

Thanks to Hans-Bernhard Broker for bringing this up.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273902 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-27 18:35:00 +00:00
Daniel Berlin
9577f286d4 Factor out buildMemorySSA from getWalker.
NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273901 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-27 18:22:27 +00:00
Rafael Espindola
8c57f91d70 Refactor duplicated condition.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273900 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-27 18:09:22 +00:00
Elena Demikhovsky
89fca4c1b1 X86 Lowering - Fixed a crash in ICMP scalar instruction
Fixed a bug in EmitTest() function in combining shl + icmp.

https://llvm.org/bugs/show_bug.cgi?id=28119



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273899 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-27 18:07:16 +00:00
Sanjay Patel
d96514bcfe [InstCombine] use m_APInt for div --> ashr fold
The APInt matcher works with splat vectors, so we get this fold for vectors too.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273897 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-27 17:25:57 +00:00
Rafael Espindola
0c5a6a8955 Use isPositionIndependent(). NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273896 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-27 17:21:46 +00:00
Artur Pilipenko
be0da39a48 Revert -r273892 "Support arbitrary addrspace pointers in masked load/store intrinsics" since some of the clang tests don't expect to see the updated signatures.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273895 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-27 16:54:33 +00:00
Easwaran Raman
78b1ab747b [PM] Port PartialInlining to the new PM
Differential revision: http://reviews.llvm.org/D21699



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273894 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-27 16:50:18 +00:00
Artur Pilipenko
9227558e8e Support arbitrary addrspace pointers in masked load/store intrinsics
This is a resubmittion of 263158 change after fixing the existing problem with intrinsics mangling (see LTO and intrinsics mangling llvm-dev thread for details).

This patch fixes the problem which occurs when loop-vectorize tries to use @llvm.masked.load/store intrinsic for a non-default addrspace pointer. It fails with "Calling a function with a bad signature!" assertion in CallInst constructor because it tries to pass a non-default addrspace pointer to the pointer argument which has default addrspace.

The fix is to add pointer type as another overloaded type to @llvm.masked.load/store intrinsics.

Reviewed By: reames

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273892 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-27 16:29:26 +00:00
Simon Pilgrim
17c3914be2 [X86][SSE] Added extra broadcast tests to cover PR28327
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273891 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-27 16:15:37 +00:00
Kuba Brecka
b41eaf7778 [asan] fix false dynamic-stack-buffer-overflow report with constantly-sized dynamic allocas, LLVM part
See the bug report at https://github.com/google/sanitizers/issues/691. When a dynamic alloca has a constant size, ASan instrumentation will treat it as a regular dynamic alloca (insert calls to poison and unpoison), but the backend will turn it into a regular stack variable. The poisoning/unpoisoning is then broken. This patch will treat such allocas as static.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273888 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-27 15:57:08 +00:00
Zhan Jun Liau
ff74d2352e [SystemZ] Avoid generating 2 XOR instructions for (and (xor x, -1), y)
Summary:
Created a pattern to match 64-bit mode (and (xor x, -1), y)
to a shorter sequence of instructions.

Before the change, the canonical form is translated to:
        xihf    %r3, 4294967295
        xilf    %r3, 4294967295
        ngr     %r2, %r3

After the change, the canonical form is translated to:
        ngr     %r3, %r2
        xgr     %r2, %r3

Reviewers: zhanjunl, uweigand

Subscribers: llvm-commits

Author: assem

Committing on behalf of Assem.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273887 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-27 15:55:30 +00:00
Krzysztof Parzyszek
339dc3dc8f [Hexagon] Equally-sized vectors are equivalent in ISel (except vNi1)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273885 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-27 15:08:22 +00:00
Simon Dardis
4cc8cc2f69 [mips] Add instruction itineraries for LSA, DLSA
Reviewers: vkalintiris, dsanders

Differential Review: http://reviews.llvm.org/D21679


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273883 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-27 14:55:07 +00:00
Renato Golin
4a90581b5a [ARM] Fix Thumb text sections' flags under COFF/Windows
The main issue here is that the "thumb" flag wasn't set for some of these
sections, making MSVC's link.exe fails to correctly relocate code
against the symbols inside these sections. link.exe could fail for
instance with the "fixup is not aligned for target 'XX'" error. If
linking doesn't fail, the relocation process goes wrong in the end and
invalid code is generated by the linker.

This patch adds Thumb/ARM information so that the right flags are set
on COFF/Windows.

Patch by Adrien Guinet.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273880 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-27 14:42:20 +00:00
Nico Weber
ebad00c746 Revert 273848, it caused PR28329
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273879 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-27 14:36:46 +00:00
Chris Dewhurst
56b08a5b8c Last line of file missing on previous check-in.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273878 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-27 14:35:07 +00:00
Rafael Espindola
665d49773d Move isPositionIndependent up to AsmPrinter.
Use it in ppc too.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273877 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-27 14:19:45 +00:00
Chris Dewhurst
97f87458e4 [Sparc] Formatting and commenting changes per review.
Differential Review: http://reviews.llvm.org/rL273108

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273876 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-27 14:19:19 +00:00
Rafael Espindola
47347b8315 Use the isPositionIndependent predicate. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273875 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-27 14:05:43 +00:00
Simon Pilgrim
9040edc5de Removed duplicate assertions note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273874 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-27 13:06:18 +00:00
Diana Picus
e50b5c5180 [ARM] Use member initializers in ARMSubtarget. NFCI
Same as r273556, but with C++11 member initializers.

Change suggested by Matthias Braun (see http://reviews.llvm.org/D21432).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273873 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-27 13:06:10 +00:00
Simon Pilgrim
b0c59abcd3 Fix "not all control paths return a value" warning on MSVC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273872 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-27 12:58:10 +00:00
Rafael Espindola
7a6104fd55 Simplify getLabelAccessInfo.
It now takes a IsPIC flag instead of computing and returning it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273871 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-27 12:56:02 +00:00
Rafael Espindola
3334c59094 Use the isPositionIndependent predicate. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273870 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-27 12:48:21 +00:00
Rafael Espindola
706f4ac5f6 Add an explanation on how mips is special in here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273868 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-27 12:33:33 +00:00
Benjamin Kramer
8430ca2f8f [IRBuilder] Drop unused CreateInvoke overloads.
The arrayref overload is more flexible with virtually the same
interface. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273867 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-27 12:25:26 +00:00
Benjamin Kramer
8f7d823142 [msan] Tighten up type in StoreList. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273866 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-27 12:25:23 +00:00
Elena Demikhovsky
98cea819c1 Removed extra test from the prev commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273865 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-27 11:40:49 +00:00
Elena Demikhovsky
1abadbff39 Fixed consecutive memory access detection in Loop Vectorizer.
It did not handle correctly cases without GEP.

The following loop wasn't vectorized:

for (int i=0; i<len; i++)

  *to++ = *from++;

I use getPtrStride() to find Stride for memory access and return 0 is the Stride is not 1 or -1.

Re-commit rL273257 - revision: http://reviews.llvm.org/D20789



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273864 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-27 11:19:23 +00:00
NAKAMURA Takumi
c4cd97e86f SIMachineFunctionInfo.cpp: Appease msc18 to use std::array.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273860 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-27 10:26:43 +00:00
NAKAMURA Takumi
9a3b139888 Reformat.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273859 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-27 10:26:36 +00:00