Commit Graph

132567 Commits

Author SHA1 Message Date
Reid Kleckner
8cc1c5e65b [codeview] Use comdats for debug info describing comdat functions
Summary:
This allows the linker to discard unused symbol information for comdat
functions that were discarded during the link. Before this change,
searching for the name of an inline function in the debugger would
return multiple results, one per symbol subsection in the object file.
After this change, there is only one result, the result for the function
chosen by the linker.

Reviewers: zturner, majnemer

Subscribers: aaboud, amccarth, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270792 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-25 23:16:12 +00:00
Manman Ren
b9f73597f6 Objective-C Class Properties: Autoupgrade "Class Properties" module flag.
When we have "Image Info Version" module flag but don't have "Class Properties"
module flag, set "Class Properties" module flag to 0, so we can correctly emit
errors when one module has the flag set and another module does not.

rdar://26469641


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270791 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-25 23:14:48 +00:00
Justin Lebar
d92afbd909 [NVPTX] Don't (incorrectly) say that the NVVMReflect pass preserves all analyses.
Reviewers: tra

Subscribers: jholewinski, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270790 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-25 23:12:38 +00:00
Justin Lebar
2969718630 [CUDA] Add section to docs about controlling fp optimizations.
Reviewers: rnk

Subscribers: llvm-commits, tra

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270789 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-25 23:11:31 +00:00
Eric Christopher
28abc1acf3 Remove unused header.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270788 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-25 22:56:58 +00:00
Lang Hames
f4f40d85e6 [Kaleidoscope][BuildingAJIT] Delete trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270787 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-25 22:48:43 +00:00
Petr Hosek
140cbbb5d9 [MC] Support symbolic expressions in assembly directives
This matches the behavior of GNU assembler which supports symbolic
expressions in absolute expressions used in assembly directives.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270786 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-25 22:47:51 +00:00
Rafael Espindola
ec726e98e1 Don't repeat name in comment and git-clang-format.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270785 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-25 22:44:06 +00:00
Adrian Prantl
aa8d763129 Work around an MSVC compiler issue in r270776.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270783 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-25 22:37:29 +00:00
Lang Hames
e48344195f [Kaleidoscope][BuildingAJIT] Fix code-block indents.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270782 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-25 22:33:25 +00:00
Davide Italiano
088a773bb8 [LazyValueInfo] Simplify return after else. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270779 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-25 22:29:34 +00:00
Lang Hames
ba9118ae86 [Kaleidoscope][BuildingAJIT] Add a description of the KaleidoscopeJIT addModule
method to Chapter1 of the BuildingAJIT tutorial.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270778 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-25 22:27:25 +00:00
Michael Kuperstein
92631b8db7 [BasicAA] Improve precision of alloca vs. inbounds GEP alias queries
If a we have (a) a GEP and (b) a pointer based on an alloca, and the
beginning of the object the GEP points would have a negative offset with
repsect to the alloca, then the GEP can not alias pointer (b).

For example, consider code like:

struct { int f0, int f1, ...} foo;
...
foo alloca;
foo *random = bar(alloca);
int *f0 = &alloca.f0
int *f1 = &random->f1;

Which is lowered, approximately, to:
%alloca = alloca %struct.foo
%random = call %struct.foo* @random(%struct.foo* %alloca)
%f0 = getelementptr inbounds %struct, %struct.foo* %alloca, i32 0, i32 0
%f1 = getelementptr inbounds %struct, %struct.foo* %random, i32 0, i32 1

Assume %f1 and %f0 alias. Then %f1 would point into the object allocated
by %alloca. Since the %f1 GEP is inbounds, that means %random must also
point into the same object. But since %f0 points to the beginning of %alloca,
the highest %f1 can be is (%alloca + 3). This means %random can not be higher
than (%alloca - 1), and so is not inbounds, a contradiction.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270777 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-25 22:23:08 +00:00
Adrian Prantl
82629e7ee8 PR26055: Speed up LiveDebugValues by replacing lists with bitvectors.
This patch modifies the LiveDebugValues pass to use more efficient set
data structures as outlined in PR26055. Both VarLocSet and VarLocList are
now SparseBitVectors which allows us to perform much faster bitvector
arithmetic on them.

The speedup can be in the order of minutes especially on ASANified code.

The change is not NFC in the assembler output because the inserted
DBG_VALUEs are now sorted by variable and location.

Many thanks to Daniel Berlin for helping design the improved algorithm and
reviewing the patch.

https://llvm.org/bugs/show_bug.cgi?id=26055
http://reviews.llvm.org/D20178
rdar://problem/24091200

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270776 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-25 22:21:12 +00:00
Chad Rosier
1056b5bd8f [MBB] Early exit to reduce indentation, per coding guidelines. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270773 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-25 21:53:46 +00:00
Hal Finkel
d86e7af14a Look for a loop's starting location in the llvm.loop metadata
Getting accurate locations for loops is important, because those locations are
used by the frontend to generate optimization remarks. Currently, optimization
remarks for loops often appear on the wrong line, often the first line of the
loop body instead of the loop itself. This is confusing because that line might
itself be another loop, or might be somewhere else completely if the body was
inlined function call. This happens because of the way we find the loop's
starting location. First, we look for a preheader, and if we find one, and its
terminator has a debug location, then we use that. Otherwise, we look for a
location on an instruction in the loop header.

The fallback heuristic is not bad, but will almost always find the beginning of
the body, and not the loop statement itself. The preheader location search
often fails because there's often not a preheader, and even when there is a
preheader, depending on how it was formed, it sometimes carries the location of
some preceeding code.

I don't see any good theoretical way to fix this problem. On the other hand,
this seems like a straightforward solution: Put the debug location in the
loop's llvm.loop metadata. A companion Clang patch will cause Clang to insert
llvm.loop metadata with appropriate locations when generating debugging
information. With these changes, our loop remarks have much more accurate
locations.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270771 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-25 21:42:37 +00:00
Rafael Espindola
65aab132bb Sort includes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270769 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-25 21:37:29 +00:00
Adrian Prantl
b28eca74ff Port the strip-invalid-debuginfo logic to the legacy verifier pass, too.
Since r268966 the modern Verifier pass defaults to stripping invalid debug info
in nonasserts builds.  This patch ports this behavior back to the legacy
Verifier pass as well.  The primary motivation is that the clang frontend
accepts bitcode files as input but is still using the legacy pass pipeline.

Background: The problem I'm trying to solve with this sequence of patches is
that historically we've done a really bad job at verifying debug info. We want
to be able to make the verifier stricter without having to worry about breaking
bitcode compatibility with existing producers. For example, we don't necessarily
want IR produced by an older version of clang to be rejected by an LTO link just
because of malformed debug info, and rather provide an option to strip it. Note
that merely outdated (but well-formed) debug info would continue to be
auto-upgraded in this scenario.

http://reviews.llvm.org/D20629
<rdar://problem/26448800>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270768 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-25 21:33:20 +00:00
Simon Pilgrim
b9dfbbc939 [X86][SSE41] Removed pblendw intrinsics tests - they are auto-upgraded
Equivalent tests included in sse41-intrinsics-x86-upgrade.ll - the i8/i32 immediate diff doesn't matter anymore

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270767 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-25 21:27:58 +00:00
Peter Collingbourne
03ef7f1eec Move whole-program virtual call optimization pass after function attribute inference in LTO pipeline.
As a result of D18634 we no longer infer certain attributes on linkonce_odr
functions at compile time, and may only infer them at LTO time. The readnone
attribute in particular is required for virtual constant propagation (part
of whole-program virtual call optimization) to work correctly.

This change moves the whole-program virtual call optimization pass after
the function attribute inference passes, and enables the attribute inference
passes at opt level 1, so that virtual constant propagation has a chance to
work correctly for linkonce_odr functions.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270765 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-25 21:26:14 +00:00
Simon Pilgrim
e4a60f4f50 [X86][SSE41] Regenerated intrinsics tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270764 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-25 21:21:51 +00:00
Ahmed Bougacha
242270d704 [TLI] Also cover Linux 64 libfunc (stat64, ...) prototype checking.
My script missed those in r270750.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270763 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-25 21:16:33 +00:00
Simon Pilgrim
05bd592af9 [X86][SSE41] Removed blendpd/blendps intrinsics tests - they are auto-upgraded
Equivalent tests included in sse41-intrinsics-x86-upgrade.ll

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270761 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-25 21:06:36 +00:00
Sanjay Patel
49208300cd fix typo; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270760 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-25 21:03:31 +00:00
Mehdi Amini
055a0c9555 ValueMaterializer: rename materializeDeclFor() to materialize()
It may materialize a declaration, or a definition. The name could
be misleading. This is following a merge of materializeInitFor()
into materializeDeclFor().

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270759 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-25 21:03:21 +00:00
Mehdi Amini
f29dafd655 ValueMaterializer: fuse materializeDeclFor and materializeInitFor (NFC)
They were originally separated to handle the co-recursion between
the ValueMapper and the ValueMaterializer. This recursion does not
exist anymore: the ValueMapper now uses a Worklist and the
ValueMaterializer is scheduling job on the Worklist.

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

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270758 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-25 21:01:51 +00:00
Mehdi Amini
f31f603963 IRLinker: fix double scheduling of mapping a global value because of an alias
This test was hitting an assertion in the value mapper because
the IRLinker was trying to map two times @A while materializing
the initializer for @C.

Fix http://llvm.org/PR27850

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270757 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-25 21:00:44 +00:00
Simon Pilgrim
07cea65abb [X86][AVX2] Regenerate avx2 vector shift tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270756 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-25 21:00:40 +00:00
Mike Aizatsky
215450cd0e [libfuzzer] replacing unittest for truncate_units with functional test.
Differential Revision: http://reviews.llvm.org/D20641

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270755 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-25 21:00:17 +00:00
Simon Pilgrim
586141811f Simplify std::all_of/any_of predicates by using llvm::all_of/any_of. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270753 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-25 20:41:11 +00:00
Zachary Turner
213d3d3c81 [codeview] Move StreamInterface and StreamReader to libcodeview.
We have need to reuse this functionality, including making
additional generic stream types that are smarter about how and
when they copy memory versus referencing the original memory.
So all of these structures belong in the common library
rather than being pdb specific.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270751 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-25 20:37:03 +00:00
Ahmed Bougacha
c863f71a62 [TLI] Fix NumParams==0 prototype checking typo.
There was a typo in r267758. It caused invalid accesses when
given something like "void @free(...)", as NumParams == 0, and
we then try to look at the 0th parameter.

Turns out, most of these were untested; add both attribute
and missing-prototype checks for all libc libfuncs.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270750 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-25 20:22:45 +00:00
Simon Pilgrim
aff0925b32 Simplify std::all_of predicate (to one line) by using llvm::all_of. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270749 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-25 20:17:39 +00:00
Simon Pilgrim
dd13df0ea8 Simplify std::all_of predicate (to one line) by using llvm::all_of. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270747 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-25 20:13:39 +00:00
Rafael Espindola
6edb5180dd Fix shouldAssumeDSOLocal for private linkage.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270746 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-25 19:55:16 +00:00
Kostya Serebryany
7dd7cd10c8 [libFuzzer] document the proposed FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270744 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-25 18:41:53 +00:00
Reid Kleckner
6dc628ff61 [IR] Copy comdats in GlobalObject::copyAttributesFrom
This is probably correct for all uses except cross-module IR linking,
where we need to move the comdat from the source module to the
destination module.

Fixes PR27870.

Reviewers: majnemer

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270743 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-25 18:36:22 +00:00
Zachary Turner
f50e8cdfbd [llvm-pdbdump] Dump raw stream contents as binary block.
Dumping it as ASCII makes it fairly useless.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270742 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-25 18:32:07 +00:00
Matt Arsenault
2b7ac01da2 TableGen: Use StringRef instead of std::string
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270741 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-25 18:07:40 +00:00
Matt Arsenault
2997ae6e3e AMDGPU: Fix v2i64/v2f64 bitcasts
These operations tend to get promoted away to v4i32 so
this doesn't happen often.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270740 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-25 18:07:36 +00:00
Matt Arsenault
211d1cd5a3 AMDGPU: Fix missing br_cc i1 test coverage
Also un xfail a test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270739 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-25 17:58:27 +00:00
Chad Rosier
a922e4bd0a [SelectionDAG] Add smarts for BSWAP in computeKnownBits.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270738 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-25 17:52:38 +00:00
Matt Arsenault
53d233a178 AMDGPU: Make vectorization defeating test changes
Simplifies test updates in the future.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270736 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-25 17:42:39 +00:00
Davide Italiano
92cd490ebb [PM] CorrelatedValuePropagation: pass state to function. NFCI.
While here, convert the logic of the pass to use static function(s).
This is in preparation for porting this pass to the new PM.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270734 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-25 17:39:54 +00:00
Matt Arsenault
068cdecac2 AMDGPU: Fix inconsistent lowering of select of vectors
f32 vectors would use a sequence of BFI instructions instead
of unrolled cmp + select. This was better in the case of a VALU
select with SGPR inputs, but we don't have a way of dealing with that
in the DAG.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270731 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-25 17:34:58 +00:00
Sanjay Patel
cab076f44c [x86] avoid code explosion from LoopVectorizer for gather loop (PR27826)
By making pointer extraction from a vector more expensive in the cost model,
we avoid the vectorization of a loop that is very likely to be memory-bound:
https://llvm.org/bugs/show_bug.cgi?id=27826

There are still bugs related to this, so we may need a more general solution
to avoid vectorizing obviously memory-bound loops when we don't have HW gather
support.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270729 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-25 17:27:54 +00:00
Xinliang David Li
c863690403 Use new triple API to check if comdat is supported
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270727 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-25 17:17:51 +00:00
Xinliang David Li
c36e61dacd Add a new helper API in triple /NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270726 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-25 17:11:31 +00:00
Chris Bieneman
4877ca745f [obj2yaml] [yaml2obj] MachO support for rebase opcodes
This is the first bit of support for MachO __LINKEDIT segment data.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270724 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-25 17:09:07 +00:00
Chris Bieneman
fdd7755743 [CMake] LINK_LIBS need to be public for Darwin dylib targets
This should actually address PR27855. This results in adding references to the system libs inside generated dylibs so that they get correctly pulled in when linking against the dylib.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270723 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-25 17:08:43 +00:00