OSDN Git Service

android-x86/external-llvm.git
7 years ago[RegisterBankInfo] Mark the dump methods with LLVM_DUMP_METHOD.
Quentin Colombet [Fri, 23 Sep 2016 00:59:12 +0000 (00:59 +0000)]
[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

7 years ago[AArch64][RegisterBankInfo] Sanity check TableGen'ed like inputs.
Quentin Colombet [Fri, 23 Sep 2016 00:59:07 +0000 (00:59 +0000)]
[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

7 years ago[libFuzzer] move value profiling logic into TracePC
Kostya Serebryany [Fri, 23 Sep 2016 00:46:18 +0000 (00:46 +0000)]
[libFuzzer] move value profiling logic into TracePC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282219 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoTriple: Add opencl environment type
Tom Stellard [Fri, 23 Sep 2016 00:42:56 +0000 (00:42 +0000)]
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

7 years ago[MC] Support skip and count for .incbin directive
Petr Hosek [Fri, 23 Sep 2016 00:41:06 +0000 (00:41 +0000)]
[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

7 years ago[libFuzzer] change ValueBitMap to remember the number of bits in it
Kostya Serebryany [Fri, 23 Sep 2016 00:22:46 +0000 (00:22 +0000)]
[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

7 years ago[AArch64][RegisterBankInfo] Switch to TableGen'ed like PartialMapping.
Quentin Colombet [Fri, 23 Sep 2016 00:14:36 +0000 (00:14 +0000)]
[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

7 years ago[RegisterBankInfo] Check that the mapping covers the interesting bits.
Quentin Colombet [Fri, 23 Sep 2016 00:14:34 +0000 (00:14 +0000)]
[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

7 years ago[RegisterBankInfo] Use array instead of SmallVector for BreakDown.
Quentin Colombet [Fri, 23 Sep 2016 00:14:30 +0000 (00:14 +0000)]
[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

7 years ago[libFuzzer] simplify the crash minimizer; split MaxLen into two: MaxInputLen and...
Kostya Serebryany [Thu, 22 Sep 2016 23:16:36 +0000 (23:16 +0000)]
[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

7 years ago[InstCombine] fold X urem C -> X < C ? X : X - C when C is big (PR28672)
Sanjay Patel [Thu, 22 Sep 2016 22:36:26 +0000 (22:36 +0000)]
[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

7 years ago[AsmParser] Remove unused partial template specialization.
Davide Italiano [Thu, 22 Sep 2016 22:02:59 +0000 (22:02 +0000)]
[AsmParser] Remove unused partial template specialization.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282206 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[utils] Teach the code coverage prep script about --restrict
Vedant Kumar [Thu, 22 Sep 2016 21:49:49 +0000 (21:49 +0000)]
[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

7 years ago[llvm-cov] Document some fields in a class (NFC)
Vedant Kumar [Thu, 22 Sep 2016 21:49:47 +0000 (21:49 +0000)]
[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

7 years ago[llvm-cov] Add the ability to specify directories of input source files
Vedant Kumar [Thu, 22 Sep 2016 21:49:43 +0000 (21:49 +0000)]
[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

7 years agoMachineScheduler: Slightly simplify release node
Matthias Braun [Thu, 22 Sep 2016 21:39:56 +0000 (21:39 +0000)]
MachineScheduler: Slightly simplify release node

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282201 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoMachineScheduler: Remove ineffective heuristic; NFC
Matthias Braun [Thu, 22 Sep 2016 21:39:52 +0000 (21:39 +0000)]
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

7 years agoRevert r282168 "GVN-hoist: fix store past load dependence analysis (PR30216)"
Hans Wennborg [Thu, 22 Sep 2016 21:20:53 +0000 (21:20 +0000)]
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

7 years ago[RDF] Add initial support for lane masks in the DFG
Krzysztof Parzyszek [Thu, 22 Sep 2016 21:01:24 +0000 (21:01 +0000)]
[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

7 years ago[Hexagon] Remove USR_OVF from CtrRegs register class
Krzysztof Parzyszek [Thu, 22 Sep 2016 20:59:41 +0000 (20:59 +0000)]
[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

7 years ago[RDF] Print the function name for calls in dumps
Krzysztof Parzyszek [Thu, 22 Sep 2016 20:58:19 +0000 (20:58 +0000)]
[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

7 years ago[RDF] Use uint32_t for register numbers instead of unsigned
Krzysztof Parzyszek [Thu, 22 Sep 2016 20:56:39 +0000 (20:56 +0000)]
[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

7 years agoi386 does not support optimized swifterror handling
Arnold Schwaighofer [Thu, 22 Sep 2016 20:06:25 +0000 (20:06 +0000)]
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

7 years agoWin64: Don't emit unwind info for "leaf" functions (PR30337)
Hans Wennborg [Thu, 22 Sep 2016 19:50:05 +0000 (19:50 +0000)]
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

7 years agoFix build breakage due to typo in cast.
Zachary Turner [Thu, 22 Sep 2016 19:21:32 +0000 (19:21 +0000)]
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

7 years ago[PowerPC] Sign extend sub-word values for atomic comparisons
Nemanja Ivanovic [Thu, 22 Sep 2016 19:06:38 +0000 (19:06 +0000)]
[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

7 years ago[DAG] Fix incorrect alignment of ext load.
Nirav Dave [Thu, 22 Sep 2016 17:28:43 +0000 (17:28 +0000)]
[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

7 years agoGVN-hoist: do not dereference null pointers
Sebastian Pop [Thu, 22 Sep 2016 17:22:58 +0000 (17:22 +0000)]
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

7 years ago[PPC] Set SP after loading data from stack frame, if no red zone is present
Krzysztof Parzyszek [Thu, 22 Sep 2016 17:22:43 +0000 (17:22 +0000)]
[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

7 years agoSpeculative fix for build failures due to consumeInteger.
Zachary Turner [Thu, 22 Sep 2016 15:55:05 +0000 (15:55 +0000)]
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

7 years agoGVN-hoist: fix store past load dependence analysis (PR30216)
Sebastian Pop [Thu, 22 Sep 2016 15:33:51 +0000 (15:33 +0000)]
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

7 years agoGVN-hoist: fix typo
Sebastian Pop [Thu, 22 Sep 2016 15:08:09 +0000 (15:08 +0000)]
GVN-hoist: fix typo

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282165 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Support] Add StringRef::consumeInteger.
Zachary Turner [Thu, 22 Sep 2016 15:05:19 +0000 (15:05 +0000)]
[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

7 years ago[compiler-rt] fix typo in option description [NFC]
Etienne Bergeron [Thu, 22 Sep 2016 14:57:24 +0000 (14:57 +0000)]
[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

7 years agoGVN-hoist: move hoist testcase to GVNHoist dir
Sebastian Pop [Thu, 22 Sep 2016 14:45:46 +0000 (14:45 +0000)]
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

7 years agoGVN-hoist: only hoist relevant scalar instructions
Sebastian Pop [Thu, 22 Sep 2016 14:45:40 +0000 (14:45 +0000)]
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

7 years agoReapplying r281895 (and follow-up r281964) after fixing pr30468.
Keith Walker [Thu, 22 Sep 2016 14:13:25 +0000 (14:13 +0000)]
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

7 years agoGlobalISel: handle stack-based parameters on AArch64.
Tim Northover [Thu, 22 Sep 2016 13:49:25 +0000 (13:49 +0000)]
GlobalISel: handle stack-based parameters on AArch64.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282153 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[RS4GC] Remat in presence of phi and use live value
Anna Thomas [Thu, 22 Sep 2016 13:13:06 +0000 (13:13 +0000)]
[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

7 years ago[AMDGPU][mc] Add support for absolute expressions in DPP modifiers.
Artem Tamazov [Thu, 22 Sep 2016 11:47:21 +0000 (11:47 +0000)]
[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

7 years ago[PowerPC] Remove LE patterns matching generic stores/loads to VSX permuting ops
Nemanja Ivanovic [Thu, 22 Sep 2016 10:32:03 +0000 (10:32 +0000)]
[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

7 years ago[Power9] Add exploitation of non-permuting memory ops
Nemanja Ivanovic [Thu, 22 Sep 2016 09:52:19 +0000 (09:52 +0000)]
[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

7 years ago[EfficiencySanitizer] Using '$' instead of '#' for struct counter name
Sagar Thakur [Thu, 22 Sep 2016 08:33:06 +0000 (08:33 +0000)]
[EfficiencySanitizer] Using '$' instead of '#' for struct counter name

For MIPS '#' is the start of comment line. Therefore we get assembler errors if # is used in the structure names.

Differential: D24334
Reviewed by: zhaoqin

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282141 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoFix revision 281960
Dorit Nuzman [Thu, 22 Sep 2016 07:56:23 +0000 (07:56 +0000)]
Fix revision 281960

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282139 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[AVX-512] Add support for commuting VPTERNLOG instructions.
Craig Topper [Thu, 22 Sep 2016 03:00:50 +0000 (03:00 +0000)]
[AVX-512] Add support for commuting VPTERNLOG instructions.

VPTERNLOG is a ternary instruction with an immediate specifying the logical operation to perform. For each bit position in the 3 source vectors the bit from each source is concatenated together and the resulting 3-bit value is used to select a bit in the immediate. This bit value is written to the result vector.

We can commute this by swapping operands and modifying the immediate. To modify the immediate we need to swap two pairs of bits. The pairs correspond to the locations in the immediate where the commuted operands bits have opposite values and the uncommuted operand has the same value. Bits 0 and 7 will never be swapped since the relevant bits from all sources are the same value.

This refactors and reuses parts of the FMA3 commuting code which is also a three operand instruction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282132 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[RegisterBankInfo] Move to statically allocated RegisterBank.
Quentin Colombet [Thu, 22 Sep 2016 02:10:37 +0000 (02:10 +0000)]
[RegisterBankInfo] Move to statically allocated RegisterBank.

This commit is basically the first step toward what will
RegisterBankInfo look when it gets TableGen'ed.

It introduces a XXXGenRegisterBankInfo.def file that is what TableGen
will issue at some point. Moreover, the RegBanks field in
RegisterBankInfo changed to reflect the static (compile time) aspect of
the information.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282131 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[RegisterBankInfo] Take advantage of the extra argument of SmallVector::resize.
Quentin Colombet [Thu, 22 Sep 2016 02:10:32 +0000 (02:10 +0000)]
[RegisterBankInfo] Take advantage of the extra argument of SmallVector::resize.

When initializing an instance of OperandsMapper, instead of using
SmallVector::resize followed by std::fill, use the function that
directly does that in SmallVector.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282130 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[libFuzzer] add 'features' to the corpus elements, allow mutations with Size > MaxSiz...
Kostya Serebryany [Thu, 22 Sep 2016 01:34:58 +0000 (01:34 +0000)]
[libFuzzer] add 'features' to the corpus elements, allow mutations with Size > MaxSize, fix sha1 in corpus stats; various refactorings

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282129 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[libFuzzer] one more test
Kostya Serebryany [Thu, 22 Sep 2016 00:57:29 +0000 (00:57 +0000)]
[libFuzzer] one more test

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282127 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[libFuzzer] add stats to the corpus; more refactoring
Kostya Serebryany [Wed, 21 Sep 2016 22:42:17 +0000 (22:42 +0000)]
[libFuzzer] add stats to the corpus; more refactoring

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282121 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago=delete the StringRef(nullptr_t) constructor.
Zachary Turner [Wed, 21 Sep 2016 22:29:36 +0000 (22:29 +0000)]
=delete the StringRef(nullptr_t) constructor.

It's a guaranteed crash if you construct a StringRef with
nullptr, so might as well delete the constructor that allows
it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282116 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[libFuzzer] more refactoring; don't compute sha1sum every time we mutate a unit from...
Kostya Serebryany [Wed, 21 Sep 2016 21:41:48 +0000 (21:41 +0000)]
[libFuzzer] more refactoring; don't compute sha1sum every time we mutate a unit from the corpus, use the stored one.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282115 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[libFuzzer] more refactoring
Kostya Serebryany [Wed, 21 Sep 2016 21:17:23 +0000 (21:17 +0000)]
[libFuzzer] more refactoring

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282113 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoNext set of additional error checks for invalid Mach-O files for bad LC_UUID
Kevin Enderby [Wed, 21 Sep 2016 20:03:09 +0000 (20:03 +0000)]
Next set of additional error checks for invalid Mach-O files for bad LC_UUID
load commands.  Added a missing check and made the check for more than
one like other other â€śmore than one” checks.  And of course added test cases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282104 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[LoopInterchange] Track all dependencies, not just anti dependencies.
Chad Rosier [Wed, 21 Sep 2016 19:16:47 +0000 (19:16 +0000)]
[LoopInterchange] Track all dependencies, not just anti dependencies.

Currently, we give up on loop interchange if we encounter a flow dependency
anywhere in the loop list. Worse yet, we don't even track output dependencies.

This patch updates the dependency matrix computation to track flow and output
dependencies in the same way we track anti dependencies.

This improves an internal workload by 2.2x.

Note the loop interchange pass is off by default and it can be enabled with
'-mllvm -enable-loopinterchange'

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282101 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[ThinLTO] Emit files for distributed builds for all modules
Teresa Johnson [Wed, 21 Sep 2016 19:12:05 +0000 (19:12 +0000)]
[ThinLTO] Emit files for distributed builds for all modules

With the new LTO API in r278338, we stopped emitting the individual
index files and imports files for some modules in the distributed backend
case (thinlto-index-only plugin option).

Specifically, this is when the linker decides not to include a module in the
link, because it was in an archive library and did not have a strong
reference to it. Not creating the expected output files makes the
distributed build system implementation more difficult, in terms of
checking for the expected outputs of the thin link, and scheduling the
backend jobs. To address this, the gold-plugin will write dummy empty
.thinlto.bc and .imports files for modules not included in the link
(which LTO never sees).

Augmented a gold v1.12+ test, since that version of gold has the handling
for notifying on modules not being included in the link.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282100 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[MIRParser] Delete dead code. NFCI.
Davide Italiano [Wed, 21 Sep 2016 18:26:08 +0000 (18:26 +0000)]
[MIRParser] Delete dead code. NFCI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282098 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agorevert 281908 because 281909 got reverted
Nico Weber [Wed, 21 Sep 2016 18:25:43 +0000 (18:25 +0000)]
revert 281908 because 281909 got reverted

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282097 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agofix typo in comment [NFC]
Etienne Bergeron [Wed, 21 Sep 2016 17:15:23 +0000 (17:15 +0000)]
fix typo in comment [NFC]

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282091 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoDisable tail calls if there is an swifterror argument
Arnold Schwaighofer [Wed, 21 Sep 2016 16:53:36 +0000 (16:53 +0000)]
Disable tail calls if there is an swifterror argument

ISel does not handle them correctly yet i.e we crash trying to emit tail call
code.

radar://28407842

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282088 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[LV] Don't emit unused scalars for uniform instructions
Matthew Simpson [Wed, 21 Sep 2016 16:50:24 +0000 (16:50 +0000)]
[LV] Don't emit unused scalars for uniform instructions

If we identify an instruction as uniform after vectorization, we know that we
should only use the value corresponding to the first vector lane of each unroll
iteration. However, when scalarizing such instructions, we still produce values
for the other vector lanes. This patch prevents us from generating the unused
scalars.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282087 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[AMDGPU][mc] Add support for ds_add_[rtn_]f32.
Artem Tamazov [Wed, 21 Sep 2016 16:35:44 +0000 (16:35 +0000)]
[AMDGPU][mc] Add support for ds_add_[rtn_]f32.

Lit tests added.
Resolves https://github.com/RadeonOpenCompute/hcc/issues/122.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282086 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoChange the basic block weight calculation algorithm to use max instead of voting.
Dehao Chen [Wed, 21 Sep 2016 16:26:51 +0000 (16:26 +0000)]
Change the basic block weight calculation algorithm to use max instead of voting.

Summary: Now that we have more precise debug info, we should change back to use maximum to get basic block weight.

Reviewers: dnovillo

Subscribers: andreadb, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282084 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[LV] Rename "Width" to "Lane" (NFC)
Matthew Simpson [Wed, 21 Sep 2016 16:09:23 +0000 (16:09 +0000)]
[LV] Rename "Width" to "Lane" (NFC)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282083 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[AVX512] Fix return types on int_x86_avx512_gatherXXX_di intrinsics
Cameron McInally [Wed, 21 Sep 2016 16:06:10 +0000 (16:06 +0000)]
[AVX512] Fix return types on int_x86_avx512_gatherXXX_di intrinsics

The return type should match the pass through vector type.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282081 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRevert r281895 "Add @llvm.dbg.value entries for the phi node created by -mem2reg"
Hans Wennborg [Wed, 21 Sep 2016 15:55:53 +0000 (15:55 +0000)]
Revert r281895 "Add @llvm.dbg.value entries for the phi node created by -mem2reg"

(And follow-up r281964.)

It caused PR30468.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282077 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRevert r281715, it caused PR30475
Nico Weber [Wed, 21 Sep 2016 15:33:24 +0000 (15:33 +0000)]
Revert r281715, it caused PR30475

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282076 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoDeadArgElim: Don't mark swifterror arguments as unused
Arnold Schwaighofer [Wed, 21 Sep 2016 15:29:08 +0000 (15:29 +0000)]
DeadArgElim: Don't mark swifterror arguments as unused

Replacing swifterror arguments with undef creates invalid IR.

rdar://28300490

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282075 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[LoopInterchange] Various cleanup. NFC.
Chad Rosier [Wed, 21 Sep 2016 13:28:41 +0000 (13:28 +0000)]
[LoopInterchange] Various cleanup. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282071 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoGlobalISel: produce correct code for signext/zeroext ABI flags.
Tim Northover [Wed, 21 Sep 2016 12:57:45 +0000 (12:57 +0000)]
GlobalISel: produce correct code for signext/zeroext ABI flags.

We still don't really have an equivalent of "AssertXExt" in DAG, so we don't
exploit the guarantees on the receiving side yet, but this should produce
conservatively correct code on iOS ABIs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282069 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoGlobalISel: pass Function to lowerFormalArguments directly (NFC).
Tim Northover [Wed, 21 Sep 2016 12:57:35 +0000 (12:57 +0000)]
GlobalISel: pass Function to lowerFormalArguments directly (NFC).

The only implementation that exists immediately looks it up anyway, and the
information is needed to handle various parameter attributes (stored on the
function itself).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282068 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[AMDGPU] Assembler: remove unused AMDGPUMCObjectWriter.
Sam Kolton [Wed, 21 Sep 2016 10:33:32 +0000 (10:33 +0000)]
[AMDGPU] Assembler: remove unused AMDGPUMCObjectWriter.

Summary: It is replaced by AMDGPUELFObjectWriter

Reviewers: tstellarAMD, vpykhtin, artem.tamazov

Subscribers: arsenm, kzhuravl, wdng, nhaehnle, yaxunl

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282065 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[mips] LLVM PR/30197 - Tail call incorrectly clobbers arguments for mips
Simon Dardis [Wed, 21 Sep 2016 09:43:40 +0000 (09:43 +0000)]
[mips] LLVM PR/30197 - Tail call incorrectly clobbers arguments for mips

The postRA scheduler performs alias analysis to determine if stores and loads
can moved past each other. When a function has more arguments than argument
registers for the calling convention used, excess arguments are spilled onto the
stack. LLVM by default assumes that argument slots are immutable, unless the
function contains a tail call. Without the knowledge of that a function contains
a tail call site, stores and loads to fixed stack slots may be re-ordered
causing the out-going arguments to clobber the incoming arguments before the
incoming arguments are supposed to be dead.

Reviewers: vkalintiris

Differential Review: https://reviews.llvm.org/D24077

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282063 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRevert "AArch64: Set shift bit of TLSLE HI12 add instruction"
Diana Picus [Wed, 21 Sep 2016 08:24:41 +0000 (08:24 +0000)]
Revert "AArch64: Set shift bit of TLSLE HI12 add instruction"

This reverts commit r282057 because it broke the buildbots - see e.g.
http://lab.llvm.org:8011/builders/clang-cmake-aarch64-42vma/builds/12063

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282058 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoAArch64: Set shift bit of TLSLE HI12 add instruction
Lei Liu [Wed, 21 Sep 2016 07:41:41 +0000 (07:41 +0000)]
AArch64: Set shift bit of TLSLE HI12 add instruction

Summary: AArch64 LLVM assembler emits add instruction without shift bit to calculate the higher 12-bit address of TLS variables in local exec model.  This generates wrong code sequence to access TLS variables with thread offset larger than 0x1000.

Reviewers: t.p.northover, peter.smith, rovka

Subscribers: salim.nasser, aemerson, llvm-commits, rengolin

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282057 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[AVX-512] Split the 3 different usages of the X86ISD::FSETCC opcode into 3 different...
Craig Topper [Wed, 21 Sep 2016 06:37:54 +0000 (06:37 +0000)]
[AVX-512] Split the 3 different usages of the X86ISD::FSETCC opcode into 3 different opcodes.

It turns out isel is really not robust against having different type profiles for the same opcode. It turns out that if you put an illegal rounding mode(i.e. not CUR_DIRECTION or NO_EXC) on a comiss intrinsic we would generate the FSETCC form with the rounding mode added, but then pattern match to an instruction with ROUND_CUR_DIRECTION.

We can probably get away with just one FSETCCM opcode that always contains the rounding mode and explicitly put ROUND_CUR_DIRECTION in the pattern, but I'll leave that for future work.

With this change the clang tests for the comiss intrinsics that used an incorrect rounding mode of 3 properly fail isel instead of silently doing the wrong thing. Those clang tests will be fixed in a follow up commit and I also plan to add rounding mode checking to clang.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282055 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agollvm/test/CodeGen/NVPTX/zero-cs.ll: Relax an expression to match in -Asserts.
NAKAMURA Takumi [Wed, 21 Sep 2016 04:43:11 +0000 (04:43 +0000)]
llvm/test/CodeGen/NVPTX/zero-cs.ll: Relax an expression to match in -Asserts.

  LLVM ERROR: Cannot select: 0x3607bf0: i32 = ExternalSymbol'__powidf2'

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282053 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[AVX-512] Don't add an additional rounding mode operand to the avx512 vcvtps2ph intri...
Craig Topper [Wed, 21 Sep 2016 03:58:44 +0000 (03:58 +0000)]
[AVX-512] Don't add an additional rounding mode operand to the avx512 vcvtps2ph intrinsic lowering.

There was no way to control its value so it was always FROUND_CURRENT making it unnecessary. The true rounding mode is encoded in the immediate operand of the instruction.

This also removes the pattern from the rb form of the instructions since there is no way to specify the FROUND_NO_EXC rounding mode it required.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282052 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[AVX-512] Simplify handling of INTR_TYPE_1OP_MASK_RM to remove support for the second...
Craig Topper [Wed, 21 Sep 2016 03:58:41 +0000 (03:58 +0000)]
[AVX-512] Simplify handling of INTR_TYPE_1OP_MASK_RM to remove support for the second opcode since its never used. This makes it consistent with INTR_TYPE_2OP_MASK_RM and INTR_TYPE_3OP_MASK_RM.

And even if it was used we were passing the same operands to both so it wouldn't make sense to have two opcodes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282051 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[libFuzzer] fix libc++ build
Kostya Serebryany [Wed, 21 Sep 2016 03:50:37 +0000 (03:50 +0000)]
[libFuzzer] fix libc++ build

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282050 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[LV] When reporting about a specific instruction without debug location use loop's
Adam Nemet [Wed, 21 Sep 2016 03:14:20 +0000 (03:14 +0000)]
[LV] When reporting about a specific instruction without debug location use loop's

This can occur for example if some optimization drops the debug location.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282048 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[libFuzzer] more refactoring; NFC
Kostya Serebryany [Wed, 21 Sep 2016 02:05:39 +0000 (02:05 +0000)]
[libFuzzer] more refactoring; NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282047 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[AVX-512] Don't lower avx512 vcvtps2ph/vcvtph2ps nodes to ISD::FP16_TO_FP/ISD::FP_TO_...
Craig Topper [Wed, 21 Sep 2016 02:05:22 +0000 (02:05 +0000)]
[AVX-512] Don't lower avx512 vcvtps2ph/vcvtph2ps nodes to ISD::FP16_TO_FP/ISD::FP_TO_FP16 with an extra x86 specific rounding mode operand. We should use a target specific ISD opcode.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282046 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[NVPTX] Check if callsite is defined when computing argument allignment
Jacques Pienaar [Wed, 21 Sep 2016 01:57:57 +0000 (01:57 +0000)]
[NVPTX] Check if callsite is defined when computing argument allignment

Summary: In getArgumentAlignment check if the ImmutableCallSite pointer CS is non-null before dereferencing. If CS is 0x0 fall back to the ABI type alignment else compute the alignment as before.

Reviewers: eliben, jpienaar

Subscribers: jlebar, vchuravy, cfe-commits, jholewinski

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282045 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[libFuzzer] refactoring: split the large header into many; NFC
Kostya Serebryany [Wed, 21 Sep 2016 01:50:50 +0000 (01:50 +0000)]
[libFuzzer] refactoring: split the large header into many; NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282044 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[libFuzzer] refactoring: move the Corpus into a separate class; delete two unused...
Kostya Serebryany [Wed, 21 Sep 2016 01:04:43 +0000 (01:04 +0000)]
[libFuzzer] refactoring: move the Corpus into a separate class; delete two unused experimental features

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282042 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRevert "TableGen: Switch from a std::map to a DenseMap in CodeGenSubRegIndex. NFC"
Justin Bogner [Wed, 21 Sep 2016 00:25:45 +0000 (00:25 +0000)]
Revert "TableGen: Switch from a std::map to a DenseMap in CodeGenSubRegIndex. NFC"

It turns out we iterate over this map a fair amount and the order
matters for clang to be deterministic. See:

  http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20160919/391315.html

This reverts r279875.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282040 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[InferAttributes] Don't access parameters that don't exist.
Michael Kuperstein [Tue, 20 Sep 2016 23:10:31 +0000 (23:10 +0000)]
[InferAttributes] Don't access parameters that don't exist.

Check for the correct number of parameters before querying their type.
This fixes PR30455.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282038 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[ThinLTO] Always emit a summary when compiling in ThinLTO mode
Teresa Johnson [Tue, 20 Sep 2016 23:07:17 +0000 (23:07 +0000)]
[ThinLTO] Always emit a summary when compiling in ThinLTO mode

Summary:
Emit an empty summary section, instead of no summary section, when
there are no global variables in the index. This ensures that LTO
will treat these files as ThinLTO inputs, instead of as regular
LTO inputs.

In addition to not being what the user likely intended when
compiling with -flto=thin, the current behavior is problematic for
distributed build systems that expect to get ThinLTO index and imports
files back for each input compiled with -flto=thin. Combining into
a single regular LTO module also reduces the backend parallelism.
And in the case where the index was suppressed due to uses in
inline assembly, combining into a single LTO module could provoke
renaming of duplicates that we were trying to prevent by suppressing
the index.

This change required a couple of fixes to handle the empty summary
section.

Reviewers: mehdi_amini

Subscribers: mehdi_amini, llvm-commits, pcc

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282037 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agocode cleanup -- commoning IR travsersals
Xinliang David Li [Tue, 20 Sep 2016 22:39:47 +0000 (22:39 +0000)]
code cleanup -- commoning IR travsersals

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282034 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRemove the default subtarget from the x86 port as it isn't necessary (or
Eric Christopher [Tue, 20 Sep 2016 22:19:33 +0000 (22:19 +0000)]
Remove the default subtarget from the x86 port as it isn't necessary (or
correct) anymore.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282031 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRevert "Remove extra argument used once on
Eric Christopher [Tue, 20 Sep 2016 22:03:28 +0000 (22:03 +0000)]
Revert "Remove extra argument used once on
TargetMachine::getNameWithPrefix and inline the result into the singular
caller." and "Remove more guts of TargetMachine::getNameWithPrefix and
migrate one check to the TLOF mach-o version." temporarily until I can
get the whole call migrated out of the TargetMachine as we could hit
places where TLOF isn't valid.

This reverts commits r281981 and r281983.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282028 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[RS4GC] Refactor code for Rematerializing in presence of phi. NFC
Anna Thomas [Tue, 20 Sep 2016 21:36:02 +0000 (21:36 +0000)]
[RS4GC] Refactor code for Rematerializing in presence of phi. NFC

Summary:
This is an NFC refactoring change as a precursor to the actual fix for rematerializing in
presence of phi.
https://reviews.llvm.org/D24399

Pasted from review:
findRematerializableChainToBasePointer changed to return the root of the
chain. instead of true or false.
move the PHI matching logic into the caller by inspecting the root return value.
This includes an assertion that the alternate root is in the liveset for the
call.

Tested with current RS4GC tests.

Reviewers: reames, sanjoy

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282023 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[CodeGen] stop short-circuiting the SSP code for sspstrong.
George Burgess IV [Tue, 20 Sep 2016 21:30:01 +0000 (21:30 +0000)]
[CodeGen] stop short-circuiting the SSP code for sspstrong.

This check caused us to skip adding layout information for calls to
alloca in sspreq/sspstrong mode. We check properly for sspstrong later
on (and add the correct layout info when doing so), so removing this
shouldn't hurt.

No test is included, since testing this using lit seems to require
checking for exact offsets in asm, which is something that the lit tests
for this avoid. If someone cares deeply, I'm happy to write a unittest
or something to cover this, but that feels like overkill.

Patch by Daniel Micay.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282022 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[llvm-cov] Demangle names for hidden instantiation views
Vedant Kumar [Tue, 20 Sep 2016 21:27:48 +0000 (21:27 +0000)]
[llvm-cov] Demangle names for hidden instantiation views

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282020 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Profile] dump ic value profile value/site-count histogram
Xinliang David Li [Tue, 20 Sep 2016 21:04:22 +0000 (21:04 +0000)]
[Profile] dump ic value profile value/site-count histogram

Differential Revision: http://reviews.google.com/D24783

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282017 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoMark ELF sections whose name start with .note as note
Petr Hosek [Tue, 20 Sep 2016 20:21:13 +0000 (20:21 +0000)]
Mark ELF sections whose name start with .note as note

Previously, such section would be marked as SHT_PROGBITS which
makes it impossible to use an initialized C variable declaration
to emit an (allocated) ELF note. The new behavior is also consistent
with ELF assembly parser.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282010 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Profile] Do not annotate select insts not covered in profile.
Xinliang David Li [Tue, 20 Sep 2016 20:20:01 +0000 (20:20 +0000)]
[Profile] Do not annotate select insts not covered in profile.

Fixed PR/30466

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282009 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoNext set of additional error checks for invalid Mach-O files for bad load commands
Kevin Enderby [Tue, 20 Sep 2016 20:14:14 +0000 (20:14 +0000)]
Next set of additional error checks for invalid Mach-O files for bad load commands
that use the Mach::dylib_command type for the load commands that are
currently used in the MachOObjectFile constructor.

This contains the missing checks for LC_ID_DYLIB, LC_ID_DYLIB, etc.
load commands and the fields for the Mach::dylib_command type.

Also checks that only an MH_DYLIB or MH_STUB_DYLIB has an
LC_ID_DYLIB load command (and others filetype don’t) and there
is not more than one of these load commands.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282008 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[x86] split up tests, regenerate checks
Sanjay Patel [Tue, 20 Sep 2016 19:31:30 +0000 (19:31 +0000)]
[x86] split up tests, regenerate checks

Note that we fail to eliminate 'or' with 0!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282005 91177308-0d34-0410-b5e6-96231b3b80d8