1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 20:12:56 +02:00
Commit Graph

139808 Commits

Author SHA1 Message Date
Simon Pilgrim
41c6a1165b [X86][SSE] Add support for (V)PMOVSX* constant folding
We already have (V)PMOVZX* combining support, this is the beginning of handling (V)PMOVSX* similarly - other combines in combineVSZext can be generalized in future patches.

This unearthed an interesting bug in that we were generating illegal build vectors on 32-bit targets - it was proving difficult to create a test for it from PMOVZX, but it fired immediately with PMOVSX. I've created a more general form of the existing getConstVector to handle these cases - ideally this should be handled in non-target-specific code but I couldn't find an equivalent.

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

llvm-svn: 285072
2016-10-25 14:29:25 +00:00
Sanjay Patel
802f621594 [InstCombine] fix checks for previous commit (r285069)
Accidentally put in the hoped-for checks ahead of the transform!

llvm-svn: 285070
2016-10-25 13:30:19 +00:00
Sanjay Patel
24a71b8bd7 [InstCombine] add tests for bitcast interference with min/max (PR28001)
llvm-svn: 285069
2016-10-25 13:27:56 +00:00
Rafael Espindola
ba3f65d754 fix warning
llvm-svn: 285064
2016-10-25 12:28:26 +00:00
Zvi Rackover
d92eb1132c [DAGCombine] Preserve shuffles when one of the vector operands is constant
Summary:
Do *not* perform combines such as:

    vector_shuffle<4,1,2,3>(build_vector(Ud, C0, C1 C2), scalar_to_vector(X))
    ->
    build_vector(X, C0, C1, C2)

Keeping the shuffle allows lowering the constant build_vector to a materialized
constant vector (such as a vector-load from the constant-pool or some other idiom).

Reviewers: delena, igorb, spatel, mkuper, andreadb, RKSimon

Subscribers: llvm-commits

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

llvm-svn: 285063
2016-10-25 12:14:19 +00:00
Rafael Espindola
f8f8e59cdd Make the LTO comdat api more symbol table friendly.
In an IR symbol table I would expect the comdats to be represented as:

- A table of strings, one for each comdat name.
- Each symbol has an optional index into that table.

The natural api for accessing that would be

InputFile:
ArrayRef<StringRef> getComdatTable() const;

Symbol:
int getComdatIndex() const;

This patch implements an API as close to that as possible.  The
implementation on top of the current IRObjectFile is a bit hackish,
but should map just fine over a symbol table and is very convenient to
use.

llvm-svn: 285061
2016-10-25 12:02:03 +00:00
Benjamin Kramer
058cf40c31 Fix an unused warning in WebAssemblyInstPrinter with NDEBUG.
Patch by Sam McCall!

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

llvm-svn: 285055
2016-10-25 09:08:50 +00:00
Craig Topper
929845dd01 [AVX-512] Add support for creating SIGN_EXTEND_VECTOR_INREG and ZERO_EXTEND_VECTOR_INREG for 512-bit vectors to support vpmovzxbq and vpmovsxbq.
Summary: The one tricky thing about this is that the sign/zero_extend_inreg uses v64i8 as an input type which isn't legal without BWI support. Though the vpmovsxbq and vpmovzxbq instructions themselves don't require BWI. To support this we need to add custom lowering for ZERO_EXTEND_VECTOR_INREG with v64i8 input. This can mostly reuse the existing sign extend code with a couple checks for sign extend vs zero extend added.

Reviewers: delena, RKSimon

Subscribers: llvm-commits

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

llvm-svn: 285053
2016-10-25 04:00:29 +00:00
Peter Collingbourne
d1ba1989b1 GlobalDCE: Restore a statement accidentally removed in r285048.
llvm-svn: 285052
2016-10-25 02:57:27 +00:00
Matthias Braun
456a8212fd MachineInstrBundle: Pass iterators to getBundle(Start|End); NFC
This is a function to go backwards in a block to find the first
instruction in a bundle, so iterator is a more natural choice for
parameter/return rather than a reference to a MachineInstruction.

llvm-svn: 285051
2016-10-25 02:55:17 +00:00
Peter Collingbourne
667b6a8f41 IR: Deduplicate getParent() functions on derived classes of GlobalValue into the base class. NFCI.
llvm-svn: 285050
2016-10-25 02:54:08 +00:00
Kostya Serebryany
1f6ecd860a [libFuzzer] simplify the code for use_cmp, also use the position hint when available, add a test
llvm-svn: 285049
2016-10-25 02:04:43 +00:00
Peter Collingbourne
3901ce9527 GlobalDCE: Deduplicate code. NFCI.
llvm-svn: 285048
2016-10-25 01:58:26 +00:00
Sanjay Patel
73022fbc15 [InstCombine] auto-generate checks
llvm-svn: 285046
2016-10-25 00:44:02 +00:00
Sanjay Patel
c4fe292ebd [InstCombine] auto-generate checks
llvm-svn: 285045
2016-10-25 00:41:00 +00:00
Dan Gohman
6a5c3acce4 [WebAssembly] Reorder load/store operands to match binary encoding.
The p2align operand of a load/store is encoded before the offset
operand; reorder the MachineInstr operands accordingly.

llvm-svn: 285044
2016-10-25 00:17:11 +00:00
Vedant Kumar
c3211a4807 [llvm-cov] Do not print out the filename of the object file
When we load coverage data from multiple objects, we don't have a way to
attribute a source object to a function record. Printing out the object
filename next to the source filename is already not very useful: soon,
it'll actually become misleading. Stop printing out the filename now.

llvm-svn: 285043
2016-10-25 00:08:33 +00:00
Dan Gohman
4d43f941c8 [WebAssembly] Implement more WebAssembly binary encoding.
This changes locals from being declared by the emitLocal hook in
WebAssemblyTargetStreamer, rather than with an instruction. After exploring
the infastructure in LLVM more, this seems to make more sense since
declaring locals doesn't use an encoded opcode.

This also adds more 0xd opcodes, type encodings, and miscellaneous
binary encoding bits.

llvm-svn: 285040
2016-10-24 23:27:49 +00:00
Matthias Braun
9688a1523c CodeGen/Passes: Pass MachineFunction as functor arg; NFC
Passing a MachineFunction as argument is more natural and avoids an
unnecessary round-trip through the logic determining the correct
Subtarget because MachineFunction already has a reference anyway.

llvm-svn: 285039
2016-10-24 23:23:02 +00:00
Sanjay Patel
f7b399052c [InstCombine] regenerate some checks
llvm-svn: 285036
2016-10-24 22:50:26 +00:00
Justin Bogner
d6b5f38a66 cmake: Rename installhdrs to install-llvm-headers and fix the dependencies
The installhdrs target was inconsistently named and would behave
differently depending on whether or not you ran a build first. This
renames it to install-llvm-headers to match other target names and
adds a dependency on intrinsics_gen so that it will always install the
same set of things.

llvm-svn: 285035
2016-10-24 21:58:58 +00:00
Eli Friedman
245e1a53f5 Fix regression from my recent GlobalsAA fix.
There are two fixes here: one, AnalyzeUsesOfPointer can't return
false until it has checked all the uses of the pointer. Two, if a
global uses another global, we have to assume the address of the
first global escapes.

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

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

llvm-svn: 285034
2016-10-24 21:47:44 +00:00
Simon Pilgrim
cbbeba0ed1 [SelectionDAG] Update ComputeNumSignBits SRA/SHL handlers to accept scalar or vector splats
Use isConstOrConstSplat helper.

Also use APInt instead of getZExtValue directly to avoid out of range issues.

llvm-svn: 285033
2016-10-24 21:47:19 +00:00
Justin Bogner
1773e2c387 cmake: Make /usr/share/cmake installable with LLVM_DISTRIBUTION_COMPONENTS
Add a cmake-exports install component and appropriate targets for
LLVM_DISTRIBUTION_COMPONENTS to work with.

llvm-svn: 285030
2016-10-24 21:40:15 +00:00
Matthias Braun
7fbfea2c1c Use MachineInstr::mop_iterator instead of MIOperands; NFC
(Const)?MIOperands is equivalent to the C++ style
MachineInstr::mop_iterator. Use the latter for consistency except for a
few callers of MIOperands::analyzePhysReg().

llvm-svn: 285029
2016-10-24 21:36:43 +00:00
Kevin Enderby
569d19c0b3 nother additional error check for an invalid Mach-O file
when contained in a Mach-O universal file and the
cputypes in both headers don’t match.

llvm-svn: 285026
2016-10-24 21:15:11 +00:00
Simon Pilgrim
c121e15065 Use SDValue::getConstantOperandVal() helper. NFCI.
llvm-svn: 285025
2016-10-24 20:56:52 +00:00
Vedant Kumar
b244542028 [pbqp] unique_ptr-ify (Vector|Matrix)::Data, NFC.
Suggested by David Blaikie.

llvm-svn: 285024
2016-10-24 20:51:46 +00:00
Vedant Kumar
5f4dcfdba8 [pbqp] Delete some dead code, NFC.
I took the opportunity to replace some copy|move constructors|assignment
operators with default implementations.

As a follow-up, I plan on threading unique_ptr<T []> through a few areas
per David Blaikie's advice.

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

llvm-svn: 285018
2016-10-24 20:35:35 +00:00
Dan Gohman
84936ca9c3 [WebAssembly] Fix a broken URL.
llvm-svn: 285017
2016-10-24 20:35:17 +00:00
Dan Gohman
c9b2af84a2 [WebAssembly] Define the end opcode value.
CFGStackify differentiates between END_LOOP and END_BLOCK, but wasm
itself doesn't. For now, just use the same opcode for both.

llvm-svn: 285016
2016-10-24 20:32:04 +00:00
Dan Gohman
af7dc16568 [WebAssembly] Update opcode values according to recent spec changes.
This corresponds to the "0xd" opcode renumbering.

llvm-svn: 285014
2016-10-24 20:21:49 +00:00
Dan Gohman
a62715a542 [WebAssembly] Add an option to make get_local/set_local explicit.
This patch adds a pass, controlled by an option and off by default for
now, for making implicit get_local/set_local explicit. This simplifies
emitting wasm with MC.

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

llvm-svn: 285009
2016-10-24 19:49:43 +00:00
Davide Italiano
4459b43829 Merge two if conditions into one. NFCI.
llvm-svn: 285008
2016-10-24 19:41:47 +00:00
Peter Collingbourne
543d51e147 Target: Change various section classifiers in TargetLoweringObjectFile to take a GlobalObject.
These functions are about classifying a global which will actually be
emitted, so it does not make sense for them to take a GlobalValue which may
for example be an alias.

Change the Mach-O object writer and the Hexagon, Lanai and MIPS backends to
look through aliases before using TargetLoweringObjectFile interfaces. These
are functional changes but all appear to be bug fixes.

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

llvm-svn: 285006
2016-10-24 19:23:39 +00:00
Sanjay Patel
8f2c88ca19 [x86] add tests for {-1,0,1} select of constants
llvm-svn: 285005
2016-10-24 19:13:29 +00:00
Mandeep Singh Grang
54f45ece9e [llvm] Remove redundant --check-prefix=CHECK from tests
Reviewers: MatzeB, mcrosier, rengolin

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

llvm-svn: 285003
2016-10-24 18:57:55 +00:00
Peter Collingbourne
6186b99992 CodeGen: Do not add a global's address space to the folding set profile.
It is already part of the type (which is part of the global, which is already
being added), so there's no need to do it.

llvm-svn: 285002
2016-10-24 18:56:09 +00:00
Adrian Prantl
1f1c90553c add-discriminators: Fix handling of lexical scopes.
This fixes a bug in the handling of lexical scopes, when more than one
scope is defined on the same line or functions are inlined into call
sites that are on the same line as the function definition. This
situation can easily happen in macro expansions.

The problem is solved by introducing a SmallDenseMap<DIScope *,
DILexicalBlockFile *, 1> that keeps track of all the different lexical
scopes that share a line/file location.

Fixes PR30681.

llvm-svn: 284998
2016-10-24 18:23:51 +00:00
Benjamin Kramer
fbf33beea8 Clarify that MSVC is not the issue here anymore.
llvm-svn: 284997
2016-10-24 18:11:05 +00:00
Krzysztof Parzyszek
91934888c9 Revert r284972 and remove other defaulted copy/move constructors/=
David Blaikie pointed out that we get them for free without having to
write anything.

llvm-svn: 284996
2016-10-24 17:40:46 +00:00
Ehsan Amiri
e2a6f26a8d [PPC] Generate positive FP zero using xor insn instead of loading from constant area
https://reviews.llvm.org/D23614

Currently we load +0.0 from constant area. That can change to be generated using
XOR instruction.

llvm-svn: 284995
2016-10-24 17:31:09 +00:00
Hans Wennborg
e16eedac3b ReleaseNotes: mention new compiler requirements
llvm-svn: 284994
2016-10-24 17:29:52 +00:00
Eli Friedman
b17f521ba9 Revert r284580+r284917. ("Synthesize TBB/TBH instructions")
The optimization has correctness issues, so reverting for now to fix tests
on thumb1 targets.

llvm-svn: 284993
2016-10-24 17:20:50 +00:00
Simon Pilgrim
205eb3ed63 Removed FIXME from include ordering comment
Nothing to fix, it's just the way it has to be.

llvm-svn: 284991
2016-10-24 17:15:05 +00:00
Rong Xu
05df291ce6 Check the number of Args in LibCallsShrinkWrap.
Some library fucntions can have no argument.

llvm-svn: 284989
2016-10-24 16:50:12 +00:00
Evandro Menezes
6efb1b6691 [AArch64] Optionally use the Newton series for reciprocal estimation
Add support for estimating the square root or its reciprocal and division or
reciprocal using the combiner generic Newton series.

Differential revision: https://reviews.llvm.org/D25291

llvm-svn: 284986
2016-10-24 16:14:58 +00:00
Justin Lebar
c7b51dd8b5 [ADT] static_assert that SmallDenseMap is instantiated with a power-of-two number of inline buckets.
Summary:
If you try to instantiate it with a non-power-of-two buckets, DenseMap
will assert at runtime (!) if we ever outgrow our inline storage.

I believe using a constexpr function inside of a static_assert is safe
now that we've unsupported MSVC 2013 and GCC < 4.8.

Reviewers: bkramer, qcolombet, escha

Subscribers: llvm-commits

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

llvm-svn: 284985
2016-10-24 16:06:53 +00:00
Geoff Berry
4cf33cb292 [EarlyCSE] Optimize MemoryPhis and reduce memory clobber queries w/ MemorySSA
Summary:
When using MemorySSA, re-optimize MemoryPhis when removing a store since
this may create MemoryPhis with all identical arguments.

Also, when using MemorySSA to check if two MemoryUses are reading from
the same version of the heap, use the defining access instead of calling
getClobberingAccess, since the latter can currently result in many more
AA calls.  Once the MemorySSA use optimization tracking changes are
done, we can remove this limitation, which should result in more loads
being CSE'd.

Reviewers: dberlin

Subscribers: mcrosier, llvm-commits

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

llvm-svn: 284984
2016-10-24 15:54:00 +00:00
Ehsan Amiri
851e2f985f [PPC] Better codegen for AND, ANY_EXT, SRL sequence
https://reviews.llvm.org/D24924

This improves the code generated for a sequence of AND, ANY_EXT, SRL instructions. This is a targetted fix for this special pattern. The pattern is generated by target independet dag combiner and so a more general fix may not be necessary. If we come across other similar cases, some ideas for handling it are discussed on the code review.

llvm-svn: 284983
2016-10-24 15:46:58 +00:00