Commit Graph

147382 Commits

Author SHA1 Message Date
Craig Topper
61e26210b1 [InstSimplify] Use Instruction::BinaryOps instead of unsigned for a few function operands to remove some casts. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299745 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-07 05:57:51 +00:00
Daniel Berlin
f634bfbb16 AliasAnalysis: Be less conservative about volatile than atomic.
Summary:
getModRefInfo is meant to answer the question "what impact does this
instruction have on a given memory location" (not even another
instruction).

Long debate on this on IRC comes to the conclusion the answer should be "nothing special".

That is, a noalias volatile store does not affect a memory location
just by being volatile.  Note: DSE and GVN and memdep currently
believe this, because memdep just goes behind AA's back after it says
"modref" right now.

see line 635 of memdep. Prior to this patch we would get modref there, then check aliasing,
and if it said noalias, we would continue.

getModRefInfo *already* has this same AA check, it just wasn't being used because volatile was
lumped in with ordering.

(I am separately testing whether this code in memdep is now dead except for the invariant load case)

Reviewers: jyknight, chandlerc

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D31726

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299741 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-07 01:28:36 +00:00
Craig Topper
1096080a5d [InstCombine] Add more commuted patterns to support folding ((~A & B) | A) -> (A | B).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299737 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-07 00:29:47 +00:00
Derek Schuff
ca5c29bce6 [WebAssembly] Fix -Wcovered-switch-default warning
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299736 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-06 23:52:01 +00:00
Zachary Turner
b470610091 Allow specification of what kinds of class members to dump.
Previously when dumping class definitions, there were only
two modes - on or off.  But it's useful to sometimes get a
little more fine-grained.  For example, you might only want
to see the record layout (for example to look for extraneous
padding).  This patch adds a third mode, layout mode, which
does exactly that.  Only this-relative data members are
displayed in this mode.

Differential Revision: https://reviews.llvm.org/D31794

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299733 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-06 23:43:39 +00:00
Zachary Turner
dbbede1ea2 [llvm-pdbdump] Allow pretty to only dump specific types of types.
Previously we just had the -types option, which would dump all
classes, typedefs, and enums.  But this produces a lot of output
if you only want to view classes, for example.  This patch breaks
this down into 3 additional options, -classes, -enums, and
-typedefs, and keeps the -types option around which implies all
3 more specific options.

Differential Revision: https://reviews.llvm.org/D31791

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299732 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-06 23:43:12 +00:00
Konstantin Zhuravlyov
4d40c97796 AMDGPU/GFX9: Fix shared and private aperture queries
Differential Revision: https://reviews.llvm.org/D31786


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299727 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-06 23:02:33 +00:00
Eric Christopher
d78c0c1930 Remove the default subtarget from the Power port. It's unnecessary and harmful if used.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299726 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-06 23:01:30 +00:00
Craig Topper
42c1cc1993 [InstCombine] Add a few cases for OR we fail to optimize due to missing commuted patterns checks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299725 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-06 23:00:22 +00:00
Yi Kong
619d61b042 Revert "Revert "[ARM] Add Kryo to available targets""
This reverts commit dc9458d5a7.

Added missing case for PreISelOperandLatencyAdjustment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299724 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-06 22:47:47 +00:00
Eli Friedman
f25acacbe6 Turn on -addr-sink-using-gep by default.
The new codepath has been in the tree for years, and there isn't any
reason to use two codepaths here.

Differential Revision: https://reviews.llvm.org/D30596



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299723 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-06 22:42:18 +00:00
Michael Kuperstein
bf82f16ca4 [X86] Revert r299387 due to AVX legalization infinite loop.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299720 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-06 22:33:25 +00:00
Craig Topper
f8a82f0200 [InstCombine] Remove testing assert I accidentally left in r299710.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299715 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-06 21:29:43 +00:00
Zachary Turner
40df19a140 iwyu fixes for lldbCore.
This adjusts header file includes for headers and source files
in Core.  In doing so, one dependency cycle is eliminated
because all the includes from Core to that project were dead
includes anyway.  In places where some files in other projects
were only compiling due to a transitive include from another
header, fixups have been made so that those files also include
the header they need.  Tested on Windows and Linux, and plan
to address failures on OSX and FreeBSD after watching the
bots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299714 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-06 21:28:29 +00:00
Matt Arsenault
c82755f01b AMDGPU: Diagnose illegal SGPR to VGPR copies
This is possible in ways that are not compiler bugs,
so stop asserting on them.

This emits an extra error when emitting objects when it
can't encode the new pseudo, but I'm not sure that matters.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299712 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-06 21:09:53 +00:00
Craig Topper
3c04b9a3cf [InstCombine] When checking to see if we can turn subtracts of 2^n - 1 into xor, we only need to call computeKnownBits on the RHS not the whole subtract. While there use isMask instead of isPowerOf2(C+1)
Calling computeKnownBits on the RHS should allows us to recurse one step further. isMask is equivalent to the isPowerOf2(C+1) except in the case where C is all ones. But that was already handled earlier by creating a not which is an Xor with all ones. So this should be fine.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299710 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-06 21:06:03 +00:00
Matt Arsenault
34d5677726 AMDGPU: Replace fp16SrcZerosHighBits with a whitelist
FCOPYSIGN is lowered to bit operations which don't clear the high
bits.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299708 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-06 20:58:30 +00:00
Rong Xu
bdbfd7487e [PGO] Preserve GlobalsAA in pgo-memop-opt pass.
Preserve GlobalsAA analysis in memory intrinsic calls optimization based on
profiled size.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299707 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-06 20:56:00 +00:00
Keno Fischer
1f6fa0f45a [llvm-extract] Add option for recursive extraction
Summary:
Particularly, with --delete, this can be very useful for testing
new optimizations on some hotspots, without having to run it on the whole
application. E.g. as such:
```
llvm-extract app.bc --recursive --rfunc .*hotspot.* > hotspot.bc
llvm-extract app.bc --recursive --delete --rfunc .*hotspot.* > residual.bc
llc -filetype=obj residual.bc > residual.o
llc -filetype=obj hotspot.bc > hotspot.o
cc -o app residual.o hotspot.o
```

Reviewed By: davide
Differential Revision: https://reviews.llvm.org/D31722

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299706 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-06 20:51:40 +00:00
Craig Topper
ff802834d5 [InstCombine] Remove redundant combine from visitAnd
This combine is fully handled by SimplifyDemandedInstructionBits as of r299658 where I fixed this code to ensure the Add/Sub had only a single user. Otherwise it would fire and create additional instructions. That fix resulted in an improvement to code generated for tsan which is why I committed it before deleting.

Differential Revision: https://reviews.llvm.org/D31543



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299704 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-06 20:41:48 +00:00
Davide Italiano
519b967c7e [BFIterator] Remove an assertion that doesn't hold. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299703 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-06 20:32:10 +00:00
Mehdi Amini
8701bbc75d Revert "Turn some C-style vararg into variadic templates"
This reverts commit r299699, the examples needs to be updated.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299702 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-06 20:23:57 +00:00
Huihui Zhang
e184e1f870 [SelectionDAG] [ARM CodeGen] Fix chain information of LowerMUL
In LowerMUL, the chain information is not preserved for the new
created Load SDNode.

For example, if a Store alias with one of the operand of Mul.
The Load for that operand need to be scheduled before the Store.
The dependence is recorded in the chain of Store, in TokenFactor.
However, when lowering MUL, the SDNodes for the new Loads for
VMULL are not updated in the TokenFactor for the Store. Thus the
chain is not preserved for the lowered VMULL.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299701 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-06 20:22:51 +00:00
Mehdi Amini
753bd2a772 Turn some C-style vararg into variadic templates
Module::getOrInsertFunction is using C-style vararg instead of
variadic templates.

From a user prospective, it forces the use of an annoying nullptr
to mark the end of the vararg, and there's not type checking on the
arguments. The variadic template is an obvious solution to both
issues.

Patch by: Serge Guelton <serge.guelton@telecom-bretagne.eu>

Differential Revision: https://reviews.llvm.org/D31070

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299699 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-06 20:09:31 +00:00
Evgeniy Stepanov
7bfedca6fc [asan] Fix dead stripping of globals on Linux.
Use a combination of !associated, comdat, @llvm.compiler.used and
custom sections to allow dead stripping of globals and their asan
metadata. Sometimes.

Currently this works on LLD, which supports SHF_LINK_ORDER with
sh_link pointing to the associated section.

This also works on BFD, which seems to treat comdats as
all-or-nothing with respect to linker GC. There is a weird quirk
where the "first" global in each link is never GC-ed because of the
section symbols.

At this moment it does not work on Gold (as in the globals are never
stripped).

This is a re-land of r298158 rebased on D31358. This time,
asan.module_ctor is put in a comdat as well to avoid quadratic
behavior in Gold.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299697 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-06 19:55:17 +00:00
Evgeniy Stepanov
9d134816b4 [asan] Put ctor/dtor in comdat.
When possible, put ASan ctor/dtor in comdat.

The only reason not to is global registration, which can be
TU-specific. This is not the case when there are no instrumented
globals. This is also limited to ELF targets, because MachO does
not have comdat, and COFF linkers may GC comdat constructors.

The benefit of this is a lot less __asan_init() calls: one per DSO
instead of one per TU. It's also necessary for the upcoming
gc-sections-for-globals change on Linux, where multiple references to
section start symbols trigger quadratic behaviour in gold linker.

This is a rebase of r298756.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299696 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-06 19:55:13 +00:00
Evgeniy Stepanov
fcc345974f [asan] Delay creation of asan ctor.
Create the constructor in the module pass.
This in needed for the GC-friendly globals change, where the constructor can be
put in a comdat  in some cases, but we don't know about that in the function
pass.

This is a rebase of r298731 which was reverted due to a false alarm.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299695 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-06 19:55:09 +00:00
Peter Collingbourne
593fb7ed17 Bitcode: Do not create FNENTRYs for aliases of functions.
There doesn't seem to be any point in doing this.

Differential Revision: https://reviews.llvm.org/D31691

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299694 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-06 19:39:24 +00:00
Keno Fischer
93e3e80c72 [StripDeadDebugInfo] Drop dead CUs entirely
Summary:
Prior to this while it would delete the dead DIGlobalVariables, it would
leave dead DICompileUnits and everything referenced therefrom. For a bit
bitcode file with thousands of compile units those dead nodes easily
outnumbered the real ones. Clean that up.

Reviewed By: aprantl
Differential Revision: https://reviews.llvm.org/D31720

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299692 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-06 19:26:22 +00:00
Yaxun Liu
e4f931e960 [AMDGPU] Temporarily change constant address space from 4 to 2
Our final address space mapping is to let constant address space to be 4 to match nvptx.
However for now we will make it 2 to avoid unnecessary work in FE/BE/devlib
about intrinsics returning constant pointers.

Differential Revision: https://reviews.llvm.org/D31770


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299690 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-06 19:17:32 +00:00
Yi Kong
dc9458d5a7 Revert "[ARM] Add Kryo to available targets"
This reverts commit 942d6e6f58.

Build breakage.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299689 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-06 19:16:14 +00:00
Nirav Dave
d4d2ab353e [SDAG] Fix visitAND optimization to deal with vector extract case again.
Summary:
Fix case elided by rL298920.

Fixes PR32545.

Reviewers: eli.friedman, RKSimon

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D31759

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299688 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-06 19:05:41 +00:00
Craig Topper
f8e400cffa [InstSimplify] Remove unreachable default from SimplifyBinOp.
We have dedicated handlers for every opcode so nothing can get here anymore. The switch doesn't get detected as fully covered because Opcode is an unsigned. Casting to Instruction::BinaryOps still doesn't detect it because BinaryOpsEnd is in the enum and 1 past the last opcode.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299687 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-06 18:59:08 +00:00
Daniel Berlin
3d88b146f6 NewGVN: Rename some functions for consistency
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299685 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-06 18:52:58 +00:00
Daniel Berlin
934731460a NewGVN: Fixup some small issues
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299684 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-06 18:52:55 +00:00
Daniel Berlin
8648b7dd7a NewGVN: Fix a small formatting issue in performSymbolicLoadEvaluation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299683 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-06 18:52:53 +00:00
Daniel Berlin
a96ab41df7 NewGVN: This patch makes memory congruence work for all types of
memorydefs, not just stores.  Along the way, we audit and fixup issues
about how we were tracking memory leaders, and improve the verifier
to notice more memory congruency issues.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299682 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-06 18:52:50 +00:00
Yi Kong
942d6e6f58 [ARM] Add Kryo to available targets
Summary:
Host CPU detection now supports Kryo, so we need to recognize it in ARM
target.

Reviewers: mcrosier, t.p.northover, rengolin, echristo, srhines

Reviewed By: t.p.northover, echristo

Subscribers: aemerson

Differential Revision: https://reviews.llvm.org/D31775

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299674 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-06 18:10:08 +00:00
Matt Arsenault
0719006e7e AMDGPU: Stop using CCAssignToRegWithShadow
This does not do what it is attempting to use it for
and requires working around in LowerFormalArguments.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299667 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-06 17:37:27 +00:00
Craig Topper
864291860e [InstSimplify] Teach SimplifyMulInst to recognize vectors of i1 as And. Not just scalar i1.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299665 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-06 17:33:37 +00:00
Krzysztof Parzyszek
6cf90d3647 [Hexagon] Change the vector scaling for vector offsets
Keep full offset value on MI-level instructions, but have it scaled down
in the MC-level instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299664 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-06 17:28:21 +00:00
Davide Italiano
0caf385833 [ADT] Add a generic breadth-first-search graph iterator.
This will be used in LCSSA to speed up the canonicalization.

Differential Revision:  https://reviews.llvm.org/D31694

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299660 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-06 17:03:04 +00:00
Stanislav Mekhanoshin
3b10e5fb8d [AMDGPU] Eliminate barrier if workgroup size is not greater than wavefront size
If a workgroup size is known to be not greater than wavefront size
the s_barrier instruction is not needed since all threads are guarantied
to come to the same point at the same time.

Differential Revision: https://reviews.llvm.org/D31731

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299659 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-06 16:48:30 +00:00
Craig Topper
ba2269c0f0 [InstCombine] Fix a case where we weren't checking that an instruction had a single use resulting in extra instructions being created.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299658 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-06 16:42:46 +00:00
Sam Kolton
3481b0868e [AMDGPU] Resubmit SDWA peephole: enable by default
Reviewers: vpykhtin, rampitec, arsenm

Subscribers: qcolombet, kzhuravl, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye

Differential Revision: https://reviews.llvm.org/D31671

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299654 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-06 15:03:28 +00:00
Jonas Paulsson
ff14b9ebc7 [SelectionDAG] NFC patch removing a redundant check.
Since the BUILD_VECTOR has already been checked by
isBuildVectorOfConstantSDNodes() in SelectionDAG::getNode() for a
SIGN_EXTEND_INREG, it can be assumed that Op is always either undef or a
ConstantSDNode, and Ops.size() will always equal VT.getVectorNumElements().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299647 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-06 13:00:37 +00:00
Simon Pilgrim
ed65bfc6c9 [X86][MMX] Test showing failure to create MMX non-temporal store
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299640 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-06 10:32:30 +00:00
Daniel Sanders
f167493b19 [globalisel][tablegen] Move <Target>InstructionSelector declarations to anonymous namespaces
Summary: This resolves the issue of tablegen-erated includes in the headers for non-GlobalISel builds in a simpler way than before.

Reviewers: qcolombet, ab

Reviewed By: ab

Subscribers: igorb, ab, mgorny, dberris, rovka, llvm-commits, kristof.beyls

Differential Revision: https://reviews.llvm.org/D30998



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299637 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-06 09:49:34 +00:00
David Green
3b23ff5204 [ARM] Remove a dead ADD during the creation of TBBs
During the optimisation of jump tables in the constant island pass,
an extra ADD could be left over, now dead but not removed.

Differential Revision: https://reviews.llvm.org/D31389



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299634 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-06 08:32:47 +00:00
Craig Topper
3c3df0d82a [InstSimplify] Add test cases for mixing add/sub i1 with xor of i1. Seems we can simplify in one direction but not the other.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299627 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-06 05:48:06 +00:00