OSDN Git Service
Lang Hames [Wed, 25 May 2016 23:25:23 +0000 (23:25 +0000)]
[Kaleidoscope][BuildingAJIT] Add code for the 2nd chapter of the BuildingAJIT
tutorial.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270794
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Wed, 25 May 2016 23:16:12 +0000 (23:16 +0000)]
[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
Manman Ren [Wed, 25 May 2016 23:14:48 +0000 (23:14 +0000)]
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
Justin Lebar [Wed, 25 May 2016 23:12:38 +0000 (23:12 +0000)]
[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
Justin Lebar [Wed, 25 May 2016 23:11:31 +0000 (23:11 +0000)]
[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
Eric Christopher [Wed, 25 May 2016 22:56:58 +0000 (22:56 +0000)]
Remove unused header.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270788
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Wed, 25 May 2016 22:48:43 +0000 (22:48 +0000)]
[Kaleidoscope][BuildingAJIT] Delete trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270787
91177308-0d34-0410-b5e6-
96231b3b80d8
Petr Hosek [Wed, 25 May 2016 22:47:51 +0000 (22:47 +0000)]
[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
Rafael Espindola [Wed, 25 May 2016 22:44:06 +0000 (22:44 +0000)]
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
Adrian Prantl [Wed, 25 May 2016 22:37:29 +0000 (22:37 +0000)]
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
Lang Hames [Wed, 25 May 2016 22:33:25 +0000 (22:33 +0000)]
[Kaleidoscope][BuildingAJIT] Fix code-block indents.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270782
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Wed, 25 May 2016 22:29:34 +0000 (22:29 +0000)]
[LazyValueInfo] Simplify `return after else`. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270779
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Wed, 25 May 2016 22:27:25 +0000 (22:27 +0000)]
[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
Michael Kuperstein [Wed, 25 May 2016 22:23:08 +0000 (22:23 +0000)]
[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
Adrian Prantl [Wed, 25 May 2016 22:21:12 +0000 (22:21 +0000)]
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
Chad Rosier [Wed, 25 May 2016 21:53:46 +0000 (21:53 +0000)]
[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
Hal Finkel [Wed, 25 May 2016 21:42:37 +0000 (21:42 +0000)]
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
Rafael Espindola [Wed, 25 May 2016 21:37:29 +0000 (21:37 +0000)]
Sort includes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270769
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Wed, 25 May 2016 21:33:20 +0000 (21:33 +0000)]
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
Simon Pilgrim [Wed, 25 May 2016 21:27:58 +0000 (21:27 +0000)]
[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
Peter Collingbourne [Wed, 25 May 2016 21:26:14 +0000 (21:26 +0000)]
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
Simon Pilgrim [Wed, 25 May 2016 21:21:51 +0000 (21:21 +0000)]
[X86][SSE41] Regenerated intrinsics tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270764
91177308-0d34-0410-b5e6-
96231b3b80d8
Ahmed Bougacha [Wed, 25 May 2016 21:16:33 +0000 (21:16 +0000)]
[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
Simon Pilgrim [Wed, 25 May 2016 21:06:36 +0000 (21:06 +0000)]
[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
Sanjay Patel [Wed, 25 May 2016 21:03:31 +0000 (21:03 +0000)]
fix typo; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270760
91177308-0d34-0410-b5e6-
96231b3b80d8
Mehdi Amini [Wed, 25 May 2016 21:03:21 +0000 (21:03 +0000)]
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
Mehdi Amini [Wed, 25 May 2016 21:01:51 +0000 (21:01 +0000)]
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
Mehdi Amini [Wed, 25 May 2016 21:00:44 +0000 (21:00 +0000)]
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
Simon Pilgrim [Wed, 25 May 2016 21:00:40 +0000 (21:00 +0000)]
[X86][AVX2] Regenerate avx2 vector shift tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270756
91177308-0d34-0410-b5e6-
96231b3b80d8
Mike Aizatsky [Wed, 25 May 2016 21:00:17 +0000 (21:00 +0000)]
[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
Simon Pilgrim [Wed, 25 May 2016 20:41:11 +0000 (20:41 +0000)]
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
Zachary Turner [Wed, 25 May 2016 20:37:03 +0000 (20:37 +0000)]
[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
Ahmed Bougacha [Wed, 25 May 2016 20:22:45 +0000 (20:22 +0000)]
[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
Simon Pilgrim [Wed, 25 May 2016 20:17:39 +0000 (20:17 +0000)]
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
Simon Pilgrim [Wed, 25 May 2016 20:13:39 +0000 (20:13 +0000)]
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
Rafael Espindola [Wed, 25 May 2016 19:55:16 +0000 (19:55 +0000)]
Fix shouldAssumeDSOLocal for private linkage.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270746
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Wed, 25 May 2016 18:41:53 +0000 (18:41 +0000)]
[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
Reid Kleckner [Wed, 25 May 2016 18:36:22 +0000 (18:36 +0000)]
[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
Zachary Turner [Wed, 25 May 2016 18:32:07 +0000 (18:32 +0000)]
[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
Matt Arsenault [Wed, 25 May 2016 18:07:40 +0000 (18:07 +0000)]
TableGen: Use StringRef instead of std::string
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270741
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Wed, 25 May 2016 18:07:36 +0000 (18:07 +0000)]
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
Matt Arsenault [Wed, 25 May 2016 17:58:27 +0000 (17:58 +0000)]
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
Chad Rosier [Wed, 25 May 2016 17:52:38 +0000 (17:52 +0000)]
[SelectionDAG] Add smarts for BSWAP in computeKnownBits.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270738
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Wed, 25 May 2016 17:42:39 +0000 (17:42 +0000)]
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
Davide Italiano [Wed, 25 May 2016 17:39:54 +0000 (17:39 +0000)]
[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
Matt Arsenault [Wed, 25 May 2016 17:34:58 +0000 (17:34 +0000)]
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
Sanjay Patel [Wed, 25 May 2016 17:27:54 +0000 (17:27 +0000)]
[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
Xinliang David Li [Wed, 25 May 2016 17:17:51 +0000 (17:17 +0000)]
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
Xinliang David Li [Wed, 25 May 2016 17:11:31 +0000 (17:11 +0000)]
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
Chris Bieneman [Wed, 25 May 2016 17:09:07 +0000 (17:09 +0000)]
[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
Chris Bieneman [Wed, 25 May 2016 17:08:43 +0000 (17:08 +0000)]
[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
Tim Shen [Wed, 25 May 2016 17:01:09 +0000 (17:01 +0000)]
Move and add comments to the top for tailcall-string-rvo.ll
Differential Revision: http://reviews.llvm.org/D20311
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270722
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Wed, 25 May 2016 16:50:22 +0000 (16:50 +0000)]
[SDAG] Add a fallback multiplication expansion
LegalizeIntegerTypes does not have a way to expand multiplications for large
integer types (i.e. larger than twice the native bit width). There's no
standard runtime call to use in that case, and so we'd just assert.
Unfortunately, as it turns out, it is possible to hit this case from
standard-ish C code in rare cases. A particular case a user ran into yesterday
involved an __int128 induction variable and a loop with a quadratic (not
linear) recurrence which triggered some backend logic using SCEVExpander. In
this case, the BinomialCoefficient code in SCEV generates some i129 variables,
which get widened to i256. At a high level, this is not actually good (i.e. the
underlying optimization, PPCLoopPreIncPrep, should not be transforming the loop
in question for performance reasons), but regardless, the backend shouldn't
crash because of cost-modeling issues in the optimizer.
This is a straightforward implementation of the multiplication expansion, based
on the algorithm in Hacker's Delight. I validated it against the code for the
mul256b function from http://locklessinc.com/articles/256bit_arithmetic/ using
random inputs. There should be no functional change for previously-working code
(the new expansion code only replaces an assert).
Fixes PR19797.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270720
91177308-0d34-0410-b5e6-
96231b3b80d8
Teresa Johnson [Wed, 25 May 2016 16:45:08 +0000 (16:45 +0000)]
[ThinLTO] Fix test check prefix so that intended prefix tested
There aren't any checks with prefix PROMOTE, should be PROMOTE_MOD1
which wasn't being tested (but works as expected).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270719
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Wed, 25 May 2016 16:39:47 +0000 (16:39 +0000)]
[x86, AVX] allow explicit calls to VZERO* to modify state in VZeroUpperInserter pass (PR27823)
As noted in the review, there are still problems, so this doesn't the bug completely.
Differential Revision: http://reviews.llvm.org/D20529
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270718
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Wed, 25 May 2016 16:23:59 +0000 (16:23 +0000)]
[RuntimeDyld] Call the SymbolResolver::findSymbolInLogicalDylib method when
searching for external symbols, and fall back to the SymbolResolver::findSymbol
method if the former returns null.
This makes RuntimeDyld behave more like a static linker: Symbol definitions
from within the current module's "logical dylib" will be preferred to
external definitions. We can build on this behavior in the future to properly
support weak symbol handling.
Custom symbol resolvers that override the findSymbolInLogicalDylib method may
notice changes due to this patch. Clients who have not overridden this method
should generally be unaffected, however users of the OrcMCJITReplacement class
may notice changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270716
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Wed, 25 May 2016 16:22:14 +0000 (16:22 +0000)]
Clarify that we match BSwap in InstCombine and BitReverse in CGP. NFC.
Also, rename recognizeBitReverseOrBSwapIdiom to recognizeBSwapOrBitReverseIdiom,
so the ordering of the MatchBSwaps and MatchBitReversals arguments are
consistent with the function name.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270715
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Wed, 25 May 2016 15:30:08 +0000 (15:30 +0000)]
[X86][AVX] Sync with clang/test/CodeGen/avx2-builtins.c
Only tests for the gather intrinsic are still to be added
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270710
91177308-0d34-0410-b5e6-
96231b3b80d8
Teresa Johnson [Wed, 25 May 2016 14:03:11 +0000 (14:03 +0000)]
[ThinLTO] Refactor ODR resolution and internalization (NFC)
Move the now index-based ODR resolution and internalization routines out
of ThinLTOCodeGenerator.cpp and into either LTO.cpp (index-based
analysis) or FunctionImport.cpp (index-driven optimizations).
This is to enable usage by other linkers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270698
91177308-0d34-0410-b5e6-
96231b3b80d8
Oleg Ranevskyy [Wed, 25 May 2016 13:01:33 +0000 (13:01 +0000)]
[SCEV] No-wrap flags are not propagated when folding "{S,+,X}+T ==> {S+T,+,X}"
Summary:
**Description**
This makes `WidenIV::widenIVUse` (IndVarSimplify.cpp) fail to widen narrow IV uses in some cases. The latter affects IndVarSimplify which may not eliminate narrow IV's when there actually exists such a possibility, thereby producing ineffective code.
When `WidenIV::widenIVUse` gets a NarrowUse such as `{(-2 + %inc.lcssa),+,1}<nsw><%for.body3>`, it first tries to get a wide recurrence for it via the `getWideRecurrence` call.
`getWideRecurrence` returns recurrence like this: `{(sext i32 (-2 + %inc.lcssa) to i64),+,1}<nsw><%for.body3>`.
Then a wide use operation is generated by `cloneIVUser`. The generated wide use is evaluated to `{(-2 + (sext i32 %inc.lcssa to i64))<nsw>,+,1}<nsw><%for.body3>`, which is different from the `getWideRecurrence` result. `cloneIVUser` sees the difference and returns nullptr.
This patch also fixes the broken LLVM tests by adding missing <nsw> entries introduced by the correction.
**Minimal reproducer:**
```
int foo(int a, int b, int c);
int baz();
void bar()
{
int arr[20];
int i = 0;
for (i = 0; i < 4; ++i)
arr[i] = baz();
for (; i < 20; ++i)
arr[i] = foo(arr[i - 4], arr[i - 3], arr[i - 2]);
}
```
**Clang command line:**
```
clang++ -mllvm -debug -S -emit-llvm -O3 --target=aarch64-linux-elf test.cpp -o test.ir
```
**Expected result:**
The ` -mllvm -debug` log shows that all the IV's for the second `for` loop have been eliminated.
Reviewers: sanjoy
Subscribers: atrick, asl, aemerson, mzolotukhin, llvm-commits
Differential Revision: http://reviews.llvm.org/D20058
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270695
91177308-0d34-0410-b5e6-
96231b3b80d8
Renato Golin [Wed, 25 May 2016 12:02:33 +0000 (12:02 +0000)]
[AArch64] Adding a TargetParser for AArch64
There's already a ARMTargetParser,now adding a similar one for aarch64.
so we can use it to do ARCH/CPU/FPU parsing in clang and llvm, instead of
string comparison.
Patch by Jojo Ma.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270687
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Wed, 25 May 2016 10:56:23 +0000 (10:56 +0000)]
[X86][AVX2] Added more fast-isel tests to match clang/test/CodeGen/avx2-builtins.c
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270685
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Wed, 25 May 2016 10:15:06 +0000 (10:15 +0000)]
[X86][AVX2] Begun adding fast-isel tests to match clang/test/CodeGen/avx2-builtins.c
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270683
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Wed, 25 May 2016 09:42:29 +0000 (09:42 +0000)]
[X86][SSE2] Use storeu intrinsics for _mm_storeu_pd/_mm_storeu_pd tests
Also fixed name of _mm_store1_pd test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270681
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Wed, 25 May 2016 09:28:06 +0000 (09:28 +0000)]
[X86][SSE] Use storeu intrinsics for _mm_storeu_ps test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270680
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Wed, 25 May 2016 08:59:18 +0000 (08:59 +0000)]
[X86][SSE] Replace (V)CVTDQ2PD(Y) and (V)CVTPS2PD(Y) lossless conversion intrinsics with generic IR
Followup to D20528 clang patch, this removes the (V)CVTDQ2PD(Y) and (V)CVTPS2PD(Y) llvm intrinsics and auto-upgrades to sitofp/fpext instead.
Differential Revision: http://reviews.llvm.org/D20568
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270678
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Wed, 25 May 2016 06:56:32 +0000 (06:56 +0000)]
[X86] Remove the llvm.x86.sse2.storel.dq intrinsic. It hasn't been used in a long time.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270677
91177308-0d34-0410-b5e6-
96231b3b80d8
Gerolf Hoflehner [Wed, 25 May 2016 06:23:45 +0000 (06:23 +0000)]
[Support] Reapply cleanup r270643
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270674
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Wed, 25 May 2016 05:53:04 +0000 (05:53 +0000)]
[FunctionAttrs] Volatile loads should disable readonly
A volatile load has side effects beyond what callers expect readonly to
signify. For example, it is not safe to reorder two function calls
which each perform a volatile load to the same memory location.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270671
91177308-0d34-0410-b5e6-
96231b3b80d8
Gerolf Hoflehner [Wed, 25 May 2016 05:51:05 +0000 (05:51 +0000)]
[Support] revert previous commit r270643
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270670
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Wed, 25 May 2016 05:49:48 +0000 (05:49 +0000)]
[llvm-pdbdump] Decipher the remaining PDB streams.
We know at least know the meaning of every stream of the
PDB file. Yay!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270669
91177308-0d34-0410-b5e6-
96231b3b80d8
Saleem Abdulrasool [Wed, 25 May 2016 05:45:02 +0000 (05:45 +0000)]
Revert "llvm-objdump: support dumping AUX records for weak externals"
Revert it until we can figure out the endianness issue.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270667
91177308-0d34-0410-b5e6-
96231b3b80d8
Saleem Abdulrasool [Wed, 25 May 2016 05:23:02 +0000 (05:23 +0000)]
Object: ensure that structures are fully defined
Ensure that the unused fields are explicitly stated when defining the types.
Add some compile time assertions about the size requirements for the structure
types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270663
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Wed, 25 May 2016 04:35:22 +0000 (04:35 +0000)]
[llvm-pdbdump] Dump the IPI stream and all records.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270661
91177308-0d34-0410-b5e6-
96231b3b80d8
Rui Ueyama [Wed, 25 May 2016 04:07:17 +0000 (04:07 +0000)]
pdbdump: fix bug in name hash table.
name_ids() did not return all IDs but only the first NameCount items.
The number of non-zero entries in IDs vector is NameCount, but it
does not mean that all non-zero entries are at the beginning of IDs
vector.
Differential Revision: http://reviews.llvm.org/D20611
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270656
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Wed, 25 May 2016 03:53:16 +0000 (03:53 +0000)]
[llvm-pdbdump] Stream 0 isn't actually the MSF superblock.
Oddly enough, I realized we don't actually know what stream
0 is (if anything).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270655
91177308-0d34-0410-b5e6-
96231b3b80d8
Saleem Abdulrasool [Wed, 25 May 2016 03:48:07 +0000 (03:48 +0000)]
test: use a binary file instead
Generate the obj rather than use yaml2obj. Hopefully, this fixes the PPC64 test
failures.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270654
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Wed, 25 May 2016 03:43:17 +0000 (03:43 +0000)]
[llvm-pdbdump] Dump stream summary list.
Try to figure out what each stream is, and dump its name.
This gives us a better picture of what streams we still don't
understand.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270653
91177308-0d34-0410-b5e6-
96231b3b80d8
Saleem Abdulrasool [Wed, 25 May 2016 01:59:36 +0000 (01:59 +0000)]
Support: remove outdated comment
This information is in the latest version of the specification.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270649
91177308-0d34-0410-b5e6-
96231b3b80d8
Saleem Abdulrasool [Wed, 25 May 2016 01:59:32 +0000 (01:59 +0000)]
llvm-objdump: support dumping AUX records for weak externals
This is a support COFF feature. Ensure that we can display the weak externals
auxiliary symbol. It contains useful information (such as the default binding
and how to resolve the symbol).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270648
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Wed, 25 May 2016 01:57:04 +0000 (01:57 +0000)]
[PM] Port BDCE to the new pass manager.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270647
91177308-0d34-0410-b5e6-
96231b3b80d8
Nirav Dave [Wed, 25 May 2016 01:45:42 +0000 (01:45 +0000)]
Soften assertion in AMDGPU emitPrologue.
[AMDGPU] emitPrologue looks for an unused unallocated SGPR that is not
the scratch descriptor. Continue search if unused register found fails
other requirements.
Reviewers: arsenm, tstellarAMD, nhaehnle
Subscribers: arsenm, llvm-commits, kzhuravl
Differential Revision: http://reviews.llvm.org/D20526
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270646
91177308-0d34-0410-b5e6-
96231b3b80d8
Eugene Zelenko [Wed, 25 May 2016 01:18:36 +0000 (01:18 +0000)]
Fix some Include What You Use warnings in examples; other minor fixes.
Differential revision: http://reviews.llvm.org/D20607
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270645
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Wed, 25 May 2016 01:18:00 +0000 (01:18 +0000)]
ScheduleDAGInstrs: Fix memory corruption
We have to modify V2SU before inserting new elements into the
CurrentVRegDefs set because that may move V2SU in memory invalidating
the reference.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270644
91177308-0d34-0410-b5e6-
96231b3b80d8
Gerolf Hoflehner [Wed, 25 May 2016 00:54:39 +0000 (00:54 +0000)]
[Support] Cleanup of an ancient Darwin work-around in Signals.inc (PR26174)
Patch by Jeremy Huddleston Sequoia
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270643
91177308-0d34-0410-b5e6-
96231b3b80d8
Derek Bruening [Wed, 25 May 2016 00:17:24 +0000 (00:17 +0000)]
[esan|wset] EfficiencySanitizer working set tool fastpath
Summary:
Adds fastpath instrumentation for esan's working set tool. The
instrumentation for an intra-cache-line load or store consists of an
inlined write to shadow memory bits for the corresponding cache line.
Adds a basic test for this instrumentation.
Reviewers: aizatsky
Subscribers: vitalybuka, zhaoqin, kcc, eugenis, llvm-commits
Differential Revision: http://reviews.llvm.org/D20483
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270640
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Wed, 25 May 2016 00:15:36 +0000 (00:15 +0000)]
[libFuzzer] print stats if we crash on empty input
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270639
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Wed, 25 May 2016 00:14:12 +0000 (00:14 +0000)]
Revert r270569 (teach llvm-mc to generate compressed debug sections in zlib
style). It appears that current ELF linkers are not ready for this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270638
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Wed, 25 May 2016 00:12:48 +0000 (00:12 +0000)]
[codeview] Add support for new types and symbols.
This patch adds support for:
S_EXPORT
LF_BITFIELD
With this patch, I have run through a couple of gigabytes of PDB
files and cannot find a type or symbol that we do not understand.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270637
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Wed, 25 May 2016 00:12:40 +0000 (00:12 +0000)]
[codeview] Add support for S_EXPORT symbol.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270636
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Tue, 24 May 2016 23:47:41 +0000 (23:47 +0000)]
[WebAssembly] Put __stack_pointer in the offset field of loads and stores.
Instead of this:
i32.const $push10=, __stack_pointer
i32.load $push11=, 0($pop10)
Emit this:
i32.const $push10=, 0
i32.load $push11=, __stack_pointer($pop10)
It's not currently clear which is better, though there's a chance the second
form may be better at overall compression. We can revisit this when we have
more data; for now it makes sense to make PEI consistent with isel.
Differential Revision: http://reviews.llvm.org/D20411
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270635
91177308-0d34-0410-b5e6-
96231b3b80d8
Mike Aizatsky [Tue, 24 May 2016 23:14:29 +0000 (23:14 +0000)]
[libfuzzer] Trying random unit prefixes during corpus load.
Differential Revision: http://reviews.llvm.org/D20301
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270632
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Zolotukhin [Tue, 24 May 2016 23:00:05 +0000 (23:00 +0000)]
Re-enable "[LoopUnroll] Enable advanced unrolling analysis by default" one more time.
This reverts commit r270577.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270630
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Zolotukhin [Tue, 24 May 2016 22:59:58 +0000 (22:59 +0000)]
[LoopUnrollAnalyzer] Fix a crash in UnrolledInstAnalyzer::visitCastInst.
This fixes PR27847. Now for real.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270629
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Tue, 24 May 2016 22:58:46 +0000 (22:58 +0000)]
[codeview] Add support for new type records.
This adds support for parsing and dumping the following
symbol types:
S_LPROCREF
S_ENVBLOCK
S_COMPILE2
S_REGISTER
S_COFFGROUP
S_SECTION
S_THUNK32
S_TRAMPOLINE
As of this patch, the test PDB files no longer have any unknown
symbol types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270628
91177308-0d34-0410-b5e6-
96231b3b80d8
Derek Bruening [Tue, 24 May 2016 22:48:24 +0000 (22:48 +0000)]
[esan] Add calls from the ctor/dtor to the runtime library
Summary:
Adds createEsanInitToolGV for creating a tool-specific variable passed
to the runtime library.
Adds dtor "esan.module_dtor" and inserts calls from the dtor to
"__esan_exit" in the runtime library.
Updates the EfficiencySanitizer test.
Patch by Qin Zhao.
Reviewers: aizatsky
Subscribers: bruening, kcc, vitalybuka, eugenis, llvm-commits
Differential Revision: http://reviews.llvm.org/D20488
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270627
91177308-0d34-0410-b5e6-
96231b3b80d8
Mike Aizatsky [Tue, 24 May 2016 22:25:46 +0000 (22:25 +0000)]
[libfuzzer][doc] documenting running libfuzzer tests.
Differential Revision: http://reviews.llvm.org/D20594
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270626
91177308-0d34-0410-b5e6-
96231b3b80d8
Haicheng Wu [Tue, 24 May 2016 22:16:14 +0000 (22:16 +0000)]
[MBP] Factor out the optimizations on branch conditions and unanalyzable branches. NFCI.
The benefits of this patch are
-- We call AnalyzeBranch() to optimize unanalyzable branches, but the result of
AnalyzeBranch() is not used. Now the result is useful.
-- Before the layout of all the MBBs is set, the result of AnalyzeBranch() is
not correct and needs to be fixed before using it to optimize the branch
conditions. Now this optimization is called after the layout, the code used
to fix the result of AnalyzeBranch() is not needed.
-- The branch condition of the last block is not optimized before. Now it is
optimized.
Differential Revision: http://reviews.llvm.org/D20177
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270623
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Tue, 24 May 2016 22:15:54 +0000 (22:15 +0000)]
There's no reason to use _ to name variables different just for construction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270622
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Tue, 24 May 2016 21:54:01 +0000 (21:54 +0000)]
LiveIntervalAnalysis: Fix handleMove() re-using the wrong value number
This fixes http://llvm.org/PR27856
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270619
91177308-0d34-0410-b5e6-
96231b3b80d8