Commit Graph

138597 Commits

Author SHA1 Message Date
Valery Pykhtin
5d11fd54b0 [AMDGPU] Refactor VOP1 and VOP2 instruction TD definitions
Differential revision: https://reviews.llvm.org/D24738

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282234 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23 09:08:07 +00:00
Craig Topper
c2a5d16d1e [AVX-512] Split X86ISD::VFPROUND and X86ISD::VFPEXT into separate opcodes for each type constraint.
This revealed that scalar intrinsics could create nodes with a rounding mode of FROUND_CUR_DIRECTION, but the patterns didn't check for it. It just worked because isel doesn't check operand count and we had a pattern without the rounding mode argument at all.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282231 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23 06:24:43 +00:00
Craig Topper
27e9902850 [AVX-512] Add separate ISD opcodes for each form of CVT instructions. Don't reuse non-X86 ISD opcodes with extra X86 specific arguments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282230 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23 06:24:39 +00:00
Craig Topper
cfb1f68fd0 [AVX-512] Use different ISD opcodes for some of the scalar intrinsic lowering. Isel is not very robust against using the same ISD opcode with different number of operands so its better to separate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282229 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23 06:24:35 +00:00
Kostya Serebryany
fd1fd77cb1 [libFuzzer] be more precise about what we reset in TracePC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282225 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23 02:18:59 +00:00
Kostya Serebryany
07016d4bd5 [libFuzzer] fix merging with trace-pc-guard
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282224 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23 01:58:51 +00:00
Tom Stellard
bf101a6e08 AMDGPU/SI: Include implicit arguments in kernarg_segment_byte_size
Reviewers: arsenm

Subscribers: arsenm, kzhuravl, wdng, nhaehnle, yaxunl, llvm-commits, tony-tye

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282223 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23 01:33:26 +00:00
Kostya Serebryany
73508a3cb1 [libFuzzer] simplify the TracePC logic
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282222 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23 01:20:07 +00:00
Quentin Colombet
a750e553b1 [RegisterBankInfo] Mark the dump methods with LLVM_DUMP_METHOD.
NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282221 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23 00:59:12 +00:00
Quentin Colombet
7bb963ee9d [AArch64][RegisterBankInfo] Sanity check TableGen'ed like inputs.
Make sure the entries written to mimic the behavior of TableGen are
sane.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282220 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23 00:59:07 +00:00
Kostya Serebryany
5a965a68f3 [libFuzzer] move value profiling logic into TracePC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282219 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23 00:46:18 +00:00
Tom Stellard
67446361c2 Triple: Add opencl environment type
Summary:
For AMDGPU, we have been using the operating system component of the triple
for specifying the low-level runtime that is being used.  The rationale for
this is that the host operating system (e.g. Linux) is irrelevant for GPU code,
since its execution enviroment will be mostly controled by the low-level runtime
being used to execute the code.

In most cases, higher level languages have their own runtime which is
implemented on top of the low-level runtime.  The kernel ABIs of each
language mostly depend on the low-level runtime, but there may be some
slight differences between languages.  OpenCL for example, may append
additional arguments to the kernel in order to pass values like global
offsets or buffers for printf.  OpenMP, HCC, or other languages may want
to add their own values which differ from OpenCL.

The reason for adding a new opencl environment type is to make it possible for the backend
to distinguish between the ABIs of the higher-level languages and handle them correctly.
It seems cleaner to use the enviroment component for this rather than creating a new
OS type for every combination of low-level runtime / high-level language.

Reviewers: Anastasia, chandlerc

Subscribers: whchung, pekka.jaaskelainen, wdng, yaxunl, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282218 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23 00:42:56 +00:00
Petr Hosek
bdbe64e031 [MC] Support skip and count for .incbin directive
These optional arguments are supported by GNU assembler.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282217 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23 00:41:06 +00:00
Kostya Serebryany
28f017d845 [libFuzzer] change ValueBitMap to remember the number of bits in it
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282216 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23 00:22:46 +00:00
Quentin Colombet
5255015bf5 [AArch64][RegisterBankInfo] Switch to TableGen'ed like PartialMapping.
Statically instanciate the most common PartialMappings. This should
be closer to what the code would look like when TableGen support is
added for GlobalISel. As a side effect, this should improve compile
time.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282215 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23 00:14:36 +00:00
Quentin Colombet
04905d75e7 [RegisterBankInfo] Check that the mapping covers the interesting bits.
In the verify method of the ValueMapping class we used to check that the
mapping exactly matches the bits of the input value. This is problematic
for statically allocated mappings because we would need a different
mapping for each different size of the value that maps on one
instruction. For instance, with such scheme, we would need a different
mapping for a value of size 1, 5, 23 whereas they all end up on a 32-bit
wide instruction.

Therefore, change the verifier to check that the meaningful bits are
covered by the mapping instead of matching them.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282214 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23 00:14:34 +00:00
Quentin Colombet
45c56aeee1 [RegisterBankInfo] Use array instead of SmallVector for BreakDown.
This is another step toward TableGen'ed like structures. The BreakDown of
the mapping of the value will be statically computed by TableGen, thus
we only have to point to the right entry in the table instead of
dynamically allocate the mapping for each instruction.

We still support the dynamic allocation through a factory of
PartialMapping to ease the bring-up of the targets while the TableGen
backend is not available.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282213 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23 00:14:30 +00:00
Kostya Serebryany
43896df9dd [libFuzzer] simplify the crash minimizer; split MaxLen into two: MaxInputLen and MaxMutationLen, allow MaxMutationLen to be less than MaxInputLen
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282211 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-22 23:16:36 +00:00
Sanjay Patel
38d30e5d19 [InstCombine] fold X urem C -> X < C ? X : X - C when C is big (PR28672)
We already have the udiv variant of this transform, so I think this is ok for 
InstCombine too even though there is an increase in IR instructions. As the 
tests and TODO comments show, the transform can lead to follow-on combines.

This should fix: https://llvm.org/bugs/show_bug.cgi?id=28672

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282209 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-22 22:36:26 +00:00
Davide Italiano
f35fea1de5 [AsmParser] Remove unused partial template specialization.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282206 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-22 22:02:59 +00:00
Vedant Kumar
c2ac1a71c3 [utils] Teach the code coverage prep script about --restrict
Add two options to the code coverage artifact prep script:

  * --use-existing-profdata: Use an existing indexed profile instead of
    merging the same profiles again.
  * --restrict: Restrict the coverage reporting to the given list of
    source directories.

With this in place, we can teach the coverage bot how to prepare
separate reports for each of the llvm tools.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282204 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-22 21:49:49 +00:00
Vedant Kumar
ae0e243fb0 [llvm-cov] Document some fields in a class (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282203 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-22 21:49:47 +00:00
Vedant Kumar
ef76be0d1e [llvm-cov] Add the ability to specify directories of input source files
We've supported restricting coverage reports to a set of files for a
long time. Add support for being able to restrict by entire directories.

I suppose this supersedes D20803.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282202 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-22 21:49:43 +00:00
Matthias Braun
a86d297ba3 MachineScheduler: Slightly simplify release node
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282201 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-22 21:39:56 +00:00
Matthias Braun
c3e16a5807 MachineScheduler: Remove ineffective heuristic; NFC
Currently all nodes get added to the NextSU list when they are released,
so any candidate must be in that list, making the heuristic ineffective.
Remove it for now, we can add it back later in a working fashion if
necessary.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282200 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-22 21:39:52 +00:00
Hans Wennborg
579bab4252 Revert r282168 "GVN-hoist: fix store past load dependence analysis (PR30216)"
and also the dependent r282175 "GVN-hoist: do not dereference null pointers"

It's causing compiler crashes building Harfbuzz (PR30499).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282199 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-22 21:20:53 +00:00
Krzysztof Parzyszek
319d69e0f2 [RDF] Add initial support for lane masks in the DFG
Use lane masks for calculating covering and aliasing of register
references.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282194 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-22 21:01:24 +00:00
Krzysztof Parzyszek
a9c167e82e [Hexagon] Remove USR_OVF from CtrRegs register class
USR_OVF is a subregister of USR, which is a member of CtrRegs. Having both
a register and its proper subregister in the same register class has bad
consequences for lane mask calculation: based solely on the lane mask info,
USR_OVF would not appear to be a subregister of USR.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282192 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-22 20:59:41 +00:00
Krzysztof Parzyszek
b505adc10e [RDF] Print the function name for calls in dumps
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282191 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-22 20:58:19 +00:00
Krzysztof Parzyszek
6baa853c4c [RDF] Use uint32_t for register numbers instead of unsigned
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282190 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-22 20:56:39 +00:00
Arnold Schwaighofer
d1714b5989 i386 does not support optimized swifterror handling
rdar://28432565

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282186 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-22 20:06:25 +00:00
Hans Wennborg
ba9e1e6b25 Win64: Don't emit unwind info for "leaf" functions (PR30337)
According to MSDN (see the PR), functions which don't touch any callee-saved
registers (including %rsp) don't need any unwind info.

This patch makes LLVM not emit unwind info for such functions, to save
binary size.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282185 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-22 19:50:05 +00:00
Zachary Turner
0966627657 Fix build breakage due to typo in cast.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282183 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-22 19:21:32 +00:00
Nemanja Ivanovic
f2f9e2bcc5 [PowerPC] Sign extend sub-word values for atomic comparisons
Atomic comparison instructions use the sub-word load instruction on
Power8 and up but the value is not sign extended prior to the signed word
compare instruction. This patch adds that sign extension.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282182 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-22 19:06:38 +00:00
Nirav Dave
489cfe73c2 [DAG] Fix incorrect alignment of ext load.
Correctly use alignment size from loaded size not output value size.

Reviewers: jyknight, tstellarAMD, arsenm

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282177 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-22 17:28:43 +00:00
Sebastian Pop
7924acd64f GVN-hoist: do not dereference null pointers
there may be basic blocks without memory accesses, in which case the
list of accesses is a null pointer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282175 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-22 17:22:58 +00:00
Krzysztof Parzyszek
7b83fe6d98 [PPC] Set SP after loading data from stack frame, if no red zone is present
Follow-up to r280705: Make sure that the SP is only restored after all data
is loaded from the stack frame, if there is no red zone.

This completes the fix for https://llvm.org/bugs/show_bug.cgi?id=26519.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282174 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-22 17:22:43 +00:00
Zachary Turner
20bb0322fd Speculative fix for build failures due to consumeInteger.
A recent patch added support for consumeInteger() and made
getAsInteger delegate to this function.  A few buildbots are
failing as a result with an assertion failure.  On a hunch,
I tested what happens if I call getAsInteger() on an empty
string, and sure enough it crashes the same way that the
buildbots are crashing.

I confirmed that getAsInteger() on an empty string did not
crash before my patch, so I suspect this to be the cause.

I also added a unit test for the empty string.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282170 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-22 15:55:05 +00:00
Sebastian Pop
3e55f3d023 GVN-hoist: fix store past load dependence analysis (PR30216)
To hoist stores past loads, we used to search for potential
conflicting loads on the hoisting path by following a MemorySSA
def-def link from the store to be hoisted to the previous
defining memory access, and from there we followed the def-use
chains to all the uses that occur on the hoisting path. The
problem is that the def-def link may point to a store that does
not alias with the store to be hoisted, and so the loads that are
walked may not alias with the store to be hoisted, and even as in
the testcase of PR30216, the loads that may alias with the store
to be hoisted are not visited.

The current patch visits all loads on the path from the store to
be hoisted to the hoisting position and uses the alias analysis
to ask whether the store may alias the load. I was not able to
use the MemorySSA functionality to ask for whether load and
store are clobbered: I'm not sure which function to call, so I
used a call to AA->isNoAlias().

Store past store is still working as before using a MemorySSA
query: I added an extra test to pr30216.ll to make sure store
past store does not regress.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282168 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-22 15:33:51 +00:00
Sebastian Pop
3132c38344 GVN-hoist: fix typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282165 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-22 15:08:09 +00:00
Zachary Turner
fb27f55135 [Support] Add StringRef::consumeInteger.
StringRef::getInteger() exists and treats the entire string as
an integer of the specified radix, failing if any invalid characters
are encountered or the number overflows.

Sometimes you might have something like "123456foo" and you want
to get the number 123456 and leave the string "foo" remaining.
This is similar to what would be possible by using the standard
runtime library functions strtoul et al and specifying an end
pointer.

This patch adds consumeInteger(), which does exactly that.  It
consumes as much as possible until an invalid character is found,
and modifies the StringRef in place so that upon return only
the portion of the StringRef after the number remains.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282164 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-22 15:05:19 +00:00
Etienne Bergeron
3abbc4d854 [compiler-rt] fix typo in option description [NFC]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282163 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-22 14:57:24 +00:00
Sebastian Pop
69580509c8 GVN-hoist: move hoist testcase to GVNHoist dir
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282161 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-22 14:45:46 +00:00
Sebastian Pop
afaf6ad3a7 GVN-hoist: only hoist relevant scalar instructions
Without this patch, GVN-hoist would think that a branch instruction is a scalar instruction
and would try to value number it. The patch filters out all such kind of irrelevant instructions.

A bit frustrating is that there is no easy way to discard all those very infrequent instructions,
a bit like isa<TerminatorInst> that stands for a large family of instructions. I'm thinking that
checking for those very infrequent other instructions would cost us more in compilation time
than just letting those instructions getting numbered, so I'm still thinking that a simpler check:

  if (isa<TerminatorInst>(I))
    return false;

is better than listing all the other less frequent instructions.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282160 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-22 14:45:40 +00:00
Keith Walker
523c933b4c Reapplying r281895 (and follow-up r281964) after fixing pr30468.
The additional fix is:

When adding debug information to a lowered phi node in mem2reg
check that we have a valid insertion point after the phi for adding
the debug information.

This change addresses the issue in pr30468 where a lowered phi was
added before a catchswitch and no debug information should be added
after the phi in this case.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282155 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-22 14:13:25 +00:00
Tim Northover
c63e7f7506 GlobalISel: handle stack-based parameters on AArch64.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282153 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-22 13:49:25 +00:00
Anna Thomas
4bbf4cb69b [RS4GC] Remat in presence of phi and use live value
Summary:

Reviewers:

Subscribers:

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282150 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-22 13:13:06 +00:00
Artem Tamazov
c228fe8466 [AMDGPU][mc] Add support for absolute expressions in DPP modifiers.
Also added range checking for DPP attributes.
Assembler tests added as well.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282145 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-22 11:47:21 +00:00
Nemanja Ivanovic
11508f0614 [PowerPC] Remove LE patterns matching generic stores/loads to VSX permuting ops
This patch corresponds to:
https://reviews.llvm.org/D21409

The LXVD2X, LXVW4X, STXVD2X and STXVW4X instructions permute the two doublewords
in the vector register when in little-endian mode. Custom code ensures that the
necessary swaps are inserted for these. This patch simply removes the possibilty
that a load/store node will match one of these instructions in the SDAG as that
would not insert the necessary swaps.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282144 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-22 10:32:03 +00:00
Nemanja Ivanovic
a941fe247e [Power9] Add exploitation of non-permuting memory ops
This patch corresponds to review:
https://reviews.llvm.org/D19825

The new lxvx/stxvx instructions do not require the swaps to line the elements
up correctly. In order to select them over the lxvd2x/lxvw4x instructions which
require swaps, the patterns for the old instruction have a predicate that
ensures they won't be selected on Power9 and newer CPUs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282143 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-22 09:52:19 +00:00