OSDN Git Service

android-x86/external-llvm.git
8 years agofix documentation comments; NFC
Sanjay Patel [Mon, 4 Apr 2016 18:25:06 +0000 (18:25 +0000)]
fix documentation comments; NFC

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

8 years ago[DependenceAnalysis] Check if result of getConstantPart is null
Brendon Cahoon [Mon, 4 Apr 2016 18:13:18 +0000 (18:13 +0000)]
[DependenceAnalysis] Check if result of getConstantPart is null

A seg-fault occurs due to a reference of a null pointer, which is
the value returned by getConstantPart. This function returns
null if the constant part is not found. The code that calls this
function needs to check for the null return value.

Differential Revision: http://reviews.llvm.org/D18718

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

8 years agoReplace MachineRegisterInfo::isSSA() with a MachineFunctionProperty
Derek Schuff [Mon, 4 Apr 2016 18:03:29 +0000 (18:03 +0000)]
Replace MachineRegisterInfo::isSSA() with a MachineFunctionProperty

Use the MachineFunctionProperty mechanism to indicate whether a MachineFunction
is in SSA form instead of a custom method on MachineRegisterInfo. NFC

Differential Revision: http://reviews.llvm.org/D18574

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

8 years agoRevert r265309 and r265312 because they caused some errors I need to investigate.
Wei Mi [Mon, 4 Apr 2016 17:45:03 +0000 (17:45 +0000)]
Revert r265309 and r265312 because they caused some errors I need to investigate.

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

8 years agoDocument standard substitutions defined by lit.
Paul Robinson [Mon, 4 Apr 2016 17:14:45 +0000 (17:14 +0000)]
Document standard substitutions defined by lit.

Patch by Guilherme Bufolo!

Differential Revision: http://reviews.llvm.org/D18752

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

8 years agoAdd MachineFunctionProperty checks for AllVRegsAllocated for target passes
Derek Schuff [Mon, 4 Apr 2016 17:09:25 +0000 (17:09 +0000)]
Add MachineFunctionProperty checks for AllVRegsAllocated for target passes

Summary:
This adds the same checks that were added in r264593 to all
target-specific passes that run after register allocation.

Reviewers: qcolombet

Subscribers: jyknight, dsanders, llvm-commits

Differential Revision: http://reviews.llvm.org/D18525

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

8 years agoFix unused var warning caused by r265309.
Wei Mi [Mon, 4 Apr 2016 17:03:58 +0000 (17:03 +0000)]
Fix unused var warning caused by r265309.

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

8 years agoReplace analyzeSiblingValues with new algorithm to fix its compile
Wei Mi [Mon, 4 Apr 2016 16:42:40 +0000 (16:42 +0000)]
Replace analyzeSiblingValues with new algorithm to fix its compile
time issue. The patch is to solve PR17409 and its duplicates.

analyzeSiblingValues is a N x N complexity algorithm where N is
the number of siblings generated by reg splitting. Although it
causes siginificant compile time issue when N is large, it is also
important for performance since it removes redundent spills and
enables rematerialization.

To solve the compile time issue, the patch removes analyzeSiblingValues
and replaces it with lower cost alternatives containing two parts. The
first part creates a new spill hoisting method in postOptimization of
register allocation. It does spill hoisting at once after all the spills
are generated instead of inside every instance of selectOrSplit. The
second part queries the define expr of the original register for
rematerializaiton and keep it always available during register allocation
even if it is already dead. It deletes those dead instructions only in
postOptimization. With the two parts in the patch, it can remove
analyzeSiblingValues without sacrificing performance.

Differential Revision: http://reviews.llvm.org/D15302

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

8 years ago[mips] Range check simm32 and fold MIPS16's imm32 into simm32.
Daniel Sanders [Mon, 4 Apr 2016 15:32:49 +0000 (15:32 +0000)]
[mips] Range check simm32 and fold MIPS16's imm32 into simm32.

Summary:
At this point we should be able to enable IAS by default for O32 without
breaking check-all, or recursion.

Reviewers: vkalintiris

Subscribers: dsanders, llvm-commits

Differential Revision: http://reviews.llvm.org/D18439

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

8 years ago[SystemZ] Add compare-and-branch instructions to MC
Ulrich Weigand [Mon, 4 Apr 2016 14:26:43 +0000 (14:26 +0000)]
[SystemZ] Add compare-and-branch instructions to MC

This adds MC support for fused compare + indirect branch instructions,
ie. CRB, CGRB, CLRB, CLGRB, CIB, CGIB, CLIB, CLGIB. They aren't actually
generated yet -- this is preparation for their use for conditional
returns in the next iteration of D17339.

Author: koriakin
Differential Revision: http://reviews.llvm.org/D18742

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

8 years ago[SystemZ] Support ATOMIC_FENCE
Ulrich Weigand [Mon, 4 Apr 2016 12:45:44 +0000 (12:45 +0000)]
[SystemZ] Support ATOMIC_FENCE

A cross-thread sequentially consistent fence should be lowered into
z/Architecture's BCR serialization instruction, instead of causing a
fatal error in the back-end.

Author: bryanpkc
Differential Revision: http://reviews.llvm.org/D18644

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

8 years ago[SystemZ] Support llvm.frameaddress/llvm.returnaddress intrinsics
Ulrich Weigand [Mon, 4 Apr 2016 12:44:55 +0000 (12:44 +0000)]
[SystemZ] Support llvm.frameaddress/llvm.returnaddress intrinsics

Enable the SystemZ back-end to lower FRAMEADDR and RETURNADDR, which
previously would cause the back-end to crash.  Currently, only a
frame count of zero is supported.

Author: bryanpkc
Differential Revision: http://reviews.llvm.org/D18514

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

8 years agoFixup r265277 [-Wdocumentation]
NAKAMURA Takumi [Mon, 4 Apr 2016 11:54:48 +0000 (11:54 +0000)]
Fixup r265277 [-Wdocumentation]

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

8 years agoAVX-512: Truncating store for i1 vectors
Elena Demikhovsky [Mon, 4 Apr 2016 07:17:47 +0000 (07:17 +0000)]
AVX-512: Truncating store for i1 vectors
Implemented truncstore for KNL and skylake-avx512.
Covered vectors from v2i1 to v64i1. We save the value in bits (not in bytes) - v32i1 is saved in 4 bytes.

Differential Revision: http://reviews.llvm.org/D18740

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

8 years agoValueMapper: Remove old FIXMEs; almost NFC
Duncan P. N. Exon Smith [Mon, 4 Apr 2016 04:59:56 +0000 (04:59 +0000)]
ValueMapper: Remove old FIXMEs; almost NFC

Remove a few old FIXMEs from the original commit of the Metadata/Value
split in r223802.  These are commented out assertions to the effect that
calls between mapValue and mapMetadata never return nullptr.

(The only behaviour change is that Mapper::mapSimpleMetadata memoizes
the nullptr return.)

When I originally rewrote the mapping code, I thought we could be
stricter in the new metadata hierarchy and never return nullptr when
RF_NullMapMissingGlobalValues was off.  It's still not entirely clear to
me why these assertions failed (a few months ago, I had a theory that I
forgot to write down, but that's helping no one).

Understood or not, I no longer see how these commented-out assertions
would be useful.  I'm relegating them to the annals of source control
before making significant changes to ValueMapper.cpp.

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

8 years ago[DebugInfo] Fix tests in Assembler/
Davide Italiano [Mon, 4 Apr 2016 02:11:34 +0000 (02:11 +0000)]
[DebugInfo] Fix tests in Assembler/

Each DISubprogram with isDefinition : true must
belong to a compile unit.

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

8 years agoIR: Lazily create ReplaceableMetadataImpl on MDNode
Duncan P. N. Exon Smith [Sun, 3 Apr 2016 21:23:52 +0000 (21:23 +0000)]
IR: Lazily create ReplaceableMetadataImpl on MDNode

RAUW support on MDNode usually requires an extra allocation for
ReplaceableMetadataImpl.  This is only strictly necessary if there are
tracking references to the MDNode.  Make the construction of
ReplaceableMetadataImpl lazy, so that we don't get allocations if we
don't need them.

Since MDNode::isResolved now checks MDNode::isTemporary and
MDNode::NumUnresolved instead of whether a ReplaceableMetadataImpl is
allocated, the internal changes are intrusive (at various internal
checkpoints, isResolved now has a different answer).

However, there should be no real functionality change here; just
slightly lazier allocation behaviour.  The external semantics should be
identical.

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

8 years agoIR: Make MDNode::Context private, NFC
Duncan P. N. Exon Smith [Sun, 3 Apr 2016 21:10:00 +0000 (21:10 +0000)]
IR: Make MDNode::Context private, NFC

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

8 years agoVarious style fix in Core.h/Core.cpp . NFC
Amaury Sechet [Sun, 3 Apr 2016 21:06:04 +0000 (21:06 +0000)]
Various style fix in Core.h/Core.cpp . NFC

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

8 years agoValueMapper: Disallow metadata mapping recursion through mapValue
Duncan P. N. Exon Smith [Sun, 3 Apr 2016 20:54:51 +0000 (20:54 +0000)]
ValueMapper: Disallow metadata mapping recursion through mapValue

This adds an assertion to maintain the property from r265273.  When
Mapper::mapSimpleMetadata calls Mapper::mapValue, it should not find its
way back to mapMetadataImpl.  This guarantees that mapSimpleMetadata is
not involved in any recursion.

Since Mapper::mapValue calls out to arbitrary materializers, we need to
save a bit on the ValueMap to make this assertion effective.

There should be no functionality change here.  This co-recursion should
already have been impossible.

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

8 years agoWork around MSVC failure from r265273
Duncan P. N. Exon Smith [Sun, 3 Apr 2016 20:42:21 +0000 (20:42 +0000)]
Work around MSVC failure from r265273

http://lab.llvm.org:8011/builders/sanitizer-windows/builds/19726

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

8 years ago[X86] Removed duplicate code.
Simon Pilgrim [Sun, 3 Apr 2016 20:40:35 +0000 (20:40 +0000)]
[X86] Removed duplicate code.

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

8 years agoValueMapper: Avoid recursion in mapSimplifiedMetadata, NFC
Duncan P. N. Exon Smith [Sun, 3 Apr 2016 20:17:45 +0000 (20:17 +0000)]
ValueMapper: Avoid recursion in mapSimplifiedMetadata, NFC

The main change is to delay materializing GlobalValue initializers from
Mapper::mapValue until Mapper::~Mapper.  This effectively removes all
recursion from mapSimplifiedMetadata, as promised in r265270.
mapSimplifiedMetadata calls mapValue for ConstantAsMetadata nodes to
find the mapped constant, and now it shouldn't be possible for mapValue
to indirectly re-invoke mapMetadata.  I'll add an assertion to that
effect in a follow-up (separated so that the assertion can easily be
reverted independently, if it comes to that).

This a step toward a broader goal: converting Mapper::mapMetadataImpl
from a recursive to an iterative algorithm.

When a BlockAddress points at a BasicBlock inside an unmaterialized
function body, we need to delay it until the function body is
materialized in Mapper::~Mapper.  This commit creates a temporary
BasicBlock and returns a new BlockAddress, then RAUWs the BasicBlock
once it is known.  This situation should be extremely rare since a
BlockAddress is usually used from within the function it's referencing
(and BlockAddress itself is rare).

There should be no observable functionality change.

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

8 years ago[CodeGenPrepare] Fix r265264 (again).
Peter Zotov [Sun, 3 Apr 2016 19:32:13 +0000 (19:32 +0000)]
[CodeGenPrepare] Fix r265264 (again).

Don't require TLI for SinkCmpExpression, like it wasn't before
r265264.

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

8 years agoValueMapper: Split out mapSimpleMetadata, NFC
Duncan P. N. Exon Smith [Sun, 3 Apr 2016 19:31:01 +0000 (19:31 +0000)]
ValueMapper: Split out mapSimpleMetadata, NFC

Split out a helper for mapping metadata without operands.  This is any
metadata that is not an MDNode, and any MDNode where the answer is known
without looking at operands.

Through some weird twists, this function is co-recursive:

    mapSimpleMetadata
    => MapValue
    => materializeInitFor
    => linkFunctionBody
    => RemapInstructions
    => MapMetadata
    => mapSimpleMetadata

I plan to break the recursion in a follow-up.

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

8 years agoValueMapper: Introduce Mapper helper class, NFC
Duncan P. N. Exon Smith [Sun, 3 Apr 2016 19:06:24 +0000 (19:06 +0000)]
ValueMapper: Introduce Mapper helper class, NFC

Remove a bunch of boilerplate from ValueMapper.cpp by using a new
file-local class called Mapper.

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

8 years ago[X86][SSE] Refreshed MOVMSK sign bit tests
Simon Pilgrim [Sun, 3 Apr 2016 18:59:42 +0000 (18:59 +0000)]
[X86][SSE] Refreshed MOVMSK sign bit tests

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

8 years ago[X86][SSE] Support for MOVMSK signbit extraction instructions
Simon Pilgrim [Sun, 3 Apr 2016 18:22:03 +0000 (18:22 +0000)]
[X86][SSE] Support for MOVMSK signbit extraction instructions

Add support for lowering with the MOVMSK instruction to extract vector element signbits to a GPR.

This is an early step towards more optimal handling of vector comparison results.

Differential Revision: http://reviews.llvm.org/D18741

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

8 years ago[CodeGenPrepare] Fix r265264.
Peter Zotov [Sun, 3 Apr 2016 17:11:53 +0000 (17:11 +0000)]
[CodeGenPrepare] Fix r265264.

The case where there was no TargetLowering was not handled,
leading to null pointer dereferences.

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

8 years ago[CodeGenPrepare] Avoid sinking soft-FP comparisons
Peter Zotov [Sun, 3 Apr 2016 16:36:17 +0000 (16:36 +0000)]
[CodeGenPrepare] Avoid sinking soft-FP comparisons

Sinking comparisons in CGP can undo the job of hoisting them done
earlier by LICM, and soft-FP makes this an expensive mistake.

A common pattern that produces floating point comparisons uniform
over a loop is an explicit check for division by zero. If the divisor
is hoisted out of the loop, the comparison can also be, but hoisting
the function that unwinds is never legal, since it may cause side
effects in the loop body prior to the unwinding to not be executed.

Differential Revision: http://reviews.llvm.org/D18744

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

8 years ago[X86] Tidied up X86ISD instruction nodes. NFCI.
Simon Pilgrim [Sun, 3 Apr 2016 14:14:32 +0000 (14:14 +0000)]
[X86] Tidied up X86ISD instruction nodes. NFCI.

Tidied up comments, stripped trailing whitespace, split apart nodes that aren't related.

No change in ordering although there is definitely some scope for it.

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

8 years agoMark some FP intrinsics as safe to speculatively execute
Peter Zotov [Sun, 3 Apr 2016 12:30:46 +0000 (12:30 +0000)]
Mark some FP intrinsics as safe to speculatively execute

Floating point intrinsics in LLVM are generally not speculatively
executed, since most of them are defined to behave the same as libm
functions, which set errno.

However, the only error that can happen  when executing ceil, floor,
nearbyint, rint and round libm functions per POSIX.1-2001 is -ERANGE,
and that requires the maximum value of the exponent to be smaller
than  the number of mantissa bits, which is not the case with any of
the floating point types supported by LLVM.

The trunc and copysign functions never set errno per per POSIX.1-2001.

Differential Revision: http://reviews.llvm.org/D18643

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

8 years agoAVX-512: Load and Extended Load for i1 vectors
Elena Demikhovsky [Sun, 3 Apr 2016 08:41:12 +0000 (08:41 +0000)]
AVX-512: Load and Extended Load for i1 vectors

Implemented load+{sign|zero}_extend for i1 vectors
Fixed failures in i1 vector load.
Covered loading of v2i1, v4i1, v8i1, v16i1, v32i1, v64i1 vectors for KNL and SKX.

Differential Revision: http://reviews.llvm.org/D18737

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

8 years ago[SimplifyLibCalls] Garbage collect dead code.
Davide Italiano [Sun, 3 Apr 2016 01:46:52 +0000 (01:46 +0000)]
[SimplifyLibCalls] Garbage collect dead code.

We already skip optimizations if the return value
of printf() is used, so CI->use_empty() is always
true.

Differential Revision:  http://reviews.llvm.org/D18656

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

8 years ago[lanai] Fix for LanaiDelaySlotFiller and LanaiMCInstLower.cpp
Jacques Pienaar [Sun, 3 Apr 2016 00:49:27 +0000 (00:49 +0000)]
[lanai] Fix for LanaiDelaySlotFiller and LanaiMCInstLower.cpp

Summary:
* Fix to stop delay slot filler from inserting SP modifying instructions in the newly expanded call/return instructions.
* In LowerSymbol the outermost type was not LanaiMCExpr if there was a binary expression
* Remove printExpr in LanaiInstPrinter

Subscribers: joker.eph, llvm-commits

Differential Revision: http://reviews.llvm.org/D18734

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

8 years ago[mips][microMIPS] Revert commits r264245 and r264248.
Zoran Jovanovic [Sat, 2 Apr 2016 23:06:13 +0000 (23:06 +0000)]
[mips][microMIPS] Revert commits r264245 and r264248.
Commit r264245 was the reason for failing tests in LLVM test suite.
Commit r264248 depends on the first one.

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

8 years ago[X86][SSE] Added 1024-bit vector comparison tests
Simon Pilgrim [Sat, 2 Apr 2016 21:33:09 +0000 (21:33 +0000)]
[X86][SSE] Added 1024-bit vector comparison tests

More examples of PR22603, poor vector splitting for AVX512F targets as well as missing uses of PACKSS/MOVMSK

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

8 years ago[X86][AVX512] Added AVX512 comparison tests
Simon Pilgrim [Sat, 2 Apr 2016 21:24:42 +0000 (21:24 +0000)]
[X86][AVX512] Added AVX512 comparison tests

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

8 years agoAArch64: support .cpu directive
Saleem Abdulrasool [Sat, 2 Apr 2016 19:29:52 +0000 (19:29 +0000)]
AArch64: support .cpu directive

Add support for the AArch64 .cpu directive.  This is a slightly involved
directive since the parameter is actually a variable encoded string.  The
general structure is:

  <cpu>[[+-]<feature>]*

We now map some of the supported string names for features for internal
representation of feature flags.  If we encounter one which we do not support,
bail out as we cannot validate the assembly any longer.

Resolves PR27010.

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

8 years agoLinker: Split mapUnneededSubprograms into two; almost NFC
Duncan P. N. Exon Smith [Sat, 2 Apr 2016 17:54:01 +0000 (17:54 +0000)]
Linker: Split mapUnneededSubprograms into two; almost NFC

Split the loop through compile units in mapUnneededSubprograms in two.
First, visit imported entities to ensure that we've visited all need
subprograms.  Second, visit subprograms, and drop the ones we don't
need.

Hypothetically this protects against a subprogram from one compile unit
being referenced from an imported entity in a different compile unit.  I
don't think that's valid IR (a debug info expert could confirm), but I
think the refactor makes the code more clear.

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

8 years agoRemove redundant assertion after cast, NFC
Duncan P. N. Exon Smith [Sat, 2 Apr 2016 17:41:52 +0000 (17:41 +0000)]
Remove redundant assertion after cast, NFC

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

8 years agoLinker: Avoid unnecessary work when moving named metadata
Duncan P. N. Exon Smith [Sat, 2 Apr 2016 17:39:31 +0000 (17:39 +0000)]
Linker: Avoid unnecessary work when moving named metadata

IRLinker::mapUnneededSubprograms has to be sure that any "needed"
subprograms get linked in.  Rather than traversing through imported
entities using llvm::getSubprogram, call MapMetadata.  The latter
memoizes the result in the ValueMap (sharing work with
IRLinker::linkNamedMDNodes proper), and makes the local SmallPtrSet
redundant.

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

8 years agoRename FunctionIndex into GlobalValueIndex to reflect the recent changes (NFC)
Mehdi Amini [Sat, 2 Apr 2016 17:29:47 +0000 (17:29 +0000)]
Rename FunctionIndex into GlobalValueIndex to reflect the recent changes (NFC)

The index used to contain only Function, but now contains GlobalValue
in general.

From: Mehdi Amini <mehdi.amini@apple.com>

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

8 years agoLinker: Remove IRMover::isMetadataUnneeded indirection; almost NFC
Duncan P. N. Exon Smith [Sat, 2 Apr 2016 17:12:00 +0000 (17:12 +0000)]
Linker: Remove IRMover::isMetadataUnneeded indirection; almost NFC

Instead of checking live during MapMetadata whether a subprogram is
needed, seed the ValueMap with `nullptr` up-front.

There is a small hypothetical functionality change.  Previously, calling
MapMetadataOp on a node whose "scope:" chain led to an unneeded
subprogram would return nullptr.  However, if that were ever called,
then the subprogram would be needed; a situation that the IRMover is
supposed to avoid a priori!

Besides cleaning up the code a little, this restores a nice property:
MapMetadataOp returns the same as MapMetadata.

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

8 years agoValueMapper: Add support for seeding metadata with nullptr
Duncan P. N. Exon Smith [Sat, 2 Apr 2016 17:04:38 +0000 (17:04 +0000)]
ValueMapper: Add support for seeding metadata with nullptr

Support seeding a ValueMap with nullptr for Metadata entries, a
situation I didn't consider in the Metadata/Value split.

I added a ValueMapper::getMappedMD accessor that returns an
Optional<Metadata*> with the mapped (possibly null) metadata.  IRMover
needs to use this to avoid modifying the map when it's checking for
unneeded subprograms.  I updated a call from bugpoint since I find the
new code clearer.

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

8 years agoDocument end of anonymous namespaces, NFC
Duncan P. N. Exon Smith [Sat, 2 Apr 2016 16:45:51 +0000 (16:45 +0000)]
Document end of anonymous namespaces, NFC

Prevent clang-format from deleting the preceding newline.

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

8 years agoBitcode: Try to emit metadata in function blocks
Duncan P. N. Exon Smith [Sat, 2 Apr 2016 15:22:57 +0000 (15:22 +0000)]
Bitcode: Try to emit metadata in function blocks

Whenever metadata is only referenced by a single function, emit the
metadata just in that function block.  This should improve lazy-loading
by reducing the amount of metadata in the global block.

For now, this should catch all DILocations, and anything else that
happens to be referenced only by a single function.

It's also a first step toward a couple of possible future directions
(which this commit does *not* implement):

 1. Some debug info metadata is only referenced from compile units and
    individual functions.  If we can drop the link from the compile
    unit, this optimization will get more powerful.

 2. Any uniqued metadata that isn't referenced globally can in theory be
    emitted in every function block that references it (trading off
    bitcode size and full-parse time vs. lazy-load time).

Note: this assumes the new BitcodeReader error checking from r265223.
The metadata stored in function blocks gets purged after parsing each
function, which means unresolved forward references will get lost.
Since all the global metadata should have already been resolved by the
time we get to the function metadata blocks we just need to check for
that case.  (If for some reason we need to handle bitcode that fails the
checks in r265223, the fix is to store about-to-be-dropped unresolved
nodes in MetadataList::shrinkTo until they can be handled succesfully by
a future call to MetadataList::tryToResolveCycles.)

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

8 years agoFix doxygen comments from r265224, NFC
Duncan P. N. Exon Smith [Sat, 2 Apr 2016 15:16:56 +0000 (15:16 +0000)]
Fix doxygen comments from r265224, NFC

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

8 years agoBitcodeWriter: Further unify function metadata, NFC
Duncan P. N. Exon Smith [Sat, 2 Apr 2016 15:09:42 +0000 (15:09 +0000)]
BitcodeWriter: Further unify function metadata, NFC

Further unify the handling of function-local metadata with global
metadata, by exposing the same interface in ValueEnumerator.  Both
contexts use the same accessors:

  - getMDStrings(): get the strings for this block.
  - getNonMDStrings(): get the non-strings for this block.

A future commit will start adding strings to the function-block.

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

8 years agoBitcodeReader: Check for unresolved function metadata
Duncan P. N. Exon Smith [Sat, 2 Apr 2016 14:55:01 +0000 (14:55 +0000)]
BitcodeReader: Check for unresolved function metadata

A follow-up commit will start using function metadata blocks more
heavily.  This commit adds some error checking to confirm that metadata
is fully resolved before (and after) materializing each function.

This is valid even when reading very old bitcode from before the
metadata/value split.  The global metadata block always came before the
function blocks.  However, in case somehow this causes a regression
(i.e., an old LLVM did produce such bitcode after all) I'm committing
separately.

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

8 years ago[X86][AVX] Added vector float truncation (double2float) tests
Simon Pilgrim [Sat, 2 Apr 2016 14:09:17 +0000 (14:09 +0000)]
[X86][AVX] Added vector float truncation (double2float) tests

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

8 years agoReverts r265219.
Mehdi Amini [Sat, 2 Apr 2016 05:35:03 +0000 (05:35 +0000)]
Reverts r265219.

Unintentionally commited... time to call the day off!

From: Mehdi Amini <mehdi.amini@apple.com>

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

8 years agoFix "warning: variabl 'XX’ set but not used" in release build (variable used in asser...
Mehdi Amini [Sat, 2 Apr 2016 05:34:19 +0000 (05:34 +0000)]
Fix "warning: variabl 'XX’ set but not used" in release build (variable used in assertion, NFC)

From: Mehdi Amini <mehdi.amini@apple.com>

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

8 years agowip
Mehdi Amini [Sat, 2 Apr 2016 05:34:14 +0000 (05:34 +0000)]
wip

From: Mehdi Amini <mehdi.amini@apple.com>

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

8 years agoconstify GlobalValue::getGUID() and GlobalValue::getGlobalIdentifier() (NFC)
Mehdi Amini [Sat, 2 Apr 2016 05:25:27 +0000 (05:25 +0000)]
constify GlobalValue::getGUID() and GlobalValue::getGlobalIdentifier() (NFC)

From: Mehdi Amini <mehdi.amini@apple.com>

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

8 years agoRevert "ThinLTO: add module caching handling."
Mehdi Amini [Sat, 2 Apr 2016 05:08:18 +0000 (05:08 +0000)]
Revert "ThinLTO: add module caching handling."

This reverts commit r265214, unintentionally commited.

From: Mehdi Amini <mehdi.amini@apple.com>

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

8 years agoCreate a typedef GlobalValue::GUID for uint64_t and RAUW (NFC)
Mehdi Amini [Sat, 2 Apr 2016 05:07:53 +0000 (05:07 +0000)]
Create a typedef GlobalValue::GUID for uint64_t and RAUW  (NFC)

Summary: This should make the code more readable, especially all the map declarations.

Reviewers: tejohnson

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D18721

From: Mehdi Amini <mehdi.amini@apple.com>

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

8 years agoThinLTO: add module caching handling.
Mehdi Amini [Sat, 2 Apr 2016 05:07:08 +0000 (05:07 +0000)]
ThinLTO: add module caching handling.

Reviewers: tejohnson

Subscribers: llvm-commits, joker.eph

Differential Revision: http://reviews.llvm.org/D18494

From: Mehdi Amini <mehdi.amini@apple.com>

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

8 years ago80 lines column after renaming "shouldDiscardValueNames" (NFC)
Mehdi Amini [Sat, 2 Apr 2016 03:59:58 +0000 (03:59 +0000)]
80 lines column after renaming "shouldDiscardValueNames" (NFC)

From: Mehdi Amini <mehdi.amini@apple.com>

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

8 years agoRename Context::discardValueNames() to shouldDiscardValueNames() (NFC)
Mehdi Amini [Sat, 2 Apr 2016 03:46:17 +0000 (03:46 +0000)]
Rename Context::discardValueNames() to shouldDiscardValueNames() (NFC)

Suggested by Sean Silva.

From: Mehdi Amini <mehdi.amini@apple.com>

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

8 years agoAdd Cache Pruning support
Mehdi Amini [Sat, 2 Apr 2016 03:28:26 +0000 (03:28 +0000)]
Add Cache Pruning support

Incremental LTO will usea cache to store object files.
This patch handles the pruning part of the cache, exposing
a few knobs:

- Pruning interval: the implementation keeps a "timestamp" file in the
  directory and will scan it only after a given interval since the
  last modification of the timestamp file. This is for performance
  purpose, we don't want to scan continuously the folder.
- Entry expiration: this is the time after which a file that hasn't
  been used is remove from the cache.
- Maximum size: expressed in percentage of the available disk space,
  it helps to avoid that we blow up the disk space.

http://reviews.llvm.org/D18422

From: Mehdi Amini <mehdi.amini@apple.com>

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

8 years agoFix -Wpedantic warning about extra semi-colon
Hans Wennborg [Sat, 2 Apr 2016 01:03:41 +0000 (01:03 +0000)]
Fix -Wpedantic warning about extra semi-colon

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

8 years ago[PGO] Use a helper function to find all indirect call-sites
Rong Xu [Fri, 1 Apr 2016 23:16:44 +0000 (23:16 +0000)]
[PGO] Use a helper function to find all indirect call-sites

Use a helper function to find all the direct-calls-sites in a function.
Also split the code into a separated file as this will be use by
indirect-call-promotion transformation.

Differential Revision: http://reviews.llvm.org/D18704

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

8 years agoAArch64: avoid clobbering SP for dead MOVimm pseudos.
Tim Northover [Fri, 1 Apr 2016 23:14:52 +0000 (23:14 +0000)]
AArch64: avoid clobbering SP for dead MOVimm pseudos.

We were producing ORR, which actually defines a GPR32sp rather than a GPR32.

Should fix PR23209.

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

8 years agoMake DIASession work if msdia*.dll isn't registered.
Nico Weber [Fri, 1 Apr 2016 22:21:51 +0000 (22:21 +0000)]
Make DIASession work if msdia*.dll isn't registered.

This fixes various symbolization test failures for me when I build with a
hermetic VS2015 without having run the 2015 installer.

http://reviews.llvm.org/D18707

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

8 years agoAdd missing emissionKind flags to the DICompileUnits of several old testcases.
Adrian Prantl [Fri, 1 Apr 2016 22:18:43 +0000 (22:18 +0000)]
Add missing emissionKind flags to the DICompileUnits of several old testcases.

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

8 years agoThinLTO: special handling for LinkOnce functions
Mehdi Amini [Fri, 1 Apr 2016 21:53:50 +0000 (21:53 +0000)]
ThinLTO: special handling for LinkOnce functions

These function can be dropped by the compiler if they are no longer
referenced in the current module. However there is a change that
another module is still referencing them because of the import.

Multiple solutions can be used:

- Always import LinkOnce when a caller is imported. This ensure that
  every module with a call to a LinkOnce has the definition and will
  be able to emit it if it emits the call.
- Turn the LinkOnce into Weak, so that it is always emitted.
- Turn all LinkOnce into available_externally and come back after all
  modules are codegen'ed to emit only one copy of the linkonce, when
  there is still a reference to it.

This patch implement the second option, with am optimization that
only *one* module will turn the LinkOnce into Weak, while the others
will turn it into available_externally, so that there is exactly one
copy emitted for the whole compilation.

http://reviews.llvm.org/D18346

From: Mehdi Amini <mehdi.amini@apple.com>

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

8 years agoSwift Calling Convention: add swifterror attribute.
Manman Ren [Fri, 1 Apr 2016 21:41:15 +0000 (21:41 +0000)]
Swift Calling Convention: add swifterror attribute.

A ``swifterror`` attribute can be applied to a function parameter or an
AllocaInst.

This commit does not include any target-specific change. The target-specific
optimization will come as a follow-up patch.

Differential Revision: http://reviews.llvm.org/D18092

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

8 years ago[X86][SSE] Regenerated vector float tests - fabs / floor(etc.) / fneg / float2double
Simon Pilgrim [Fri, 1 Apr 2016 21:30:48 +0000 (21:30 +0000)]
[X86][SSE] Regenerated vector float tests - fabs / floor(etc.) / fneg / float2double

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

8 years ago[X86][SSE] Vector i64 load tests
Simon Pilgrim [Fri, 1 Apr 2016 21:06:17 +0000 (21:06 +0000)]
[X86][SSE] Vector i64 load tests

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

8 years ago[X86][SSE] Regenerated comparison mask and float immediate tests
Simon Pilgrim [Fri, 1 Apr 2016 21:00:00 +0000 (21:00 +0000)]
[X86][SSE] Regenerated comparison mask and float immediate tests

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

8 years ago[X86][SSE] Regenerated the vec_extract tests.
Simon Pilgrim [Fri, 1 Apr 2016 20:55:19 +0000 (20:55 +0000)]
[X86][SSE] Regenerated the vec_extract tests.

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

8 years agoUpdate owners to reflect recent changes
David Blaikie [Fri, 1 Apr 2016 20:40:49 +0000 (20:40 +0000)]
Update owners to reflect recent changes

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

8 years agoFix buildbot lldb-amd64-ninja-netbsd7 failure
Rong Xu [Fri, 1 Apr 2016 20:15:04 +0000 (20:15 +0000)]
Fix buildbot lldb-amd64-ninja-netbsd7 failure

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

8 years ago[X86][SSE] Regenerated the vec_insert tests.
Simon Pilgrim [Fri, 1 Apr 2016 19:42:23 +0000 (19:42 +0000)]
[X86][SSE] Regenerated the vec_insert tests.

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

8 years agoRemove useless check for ThreadModel==Single in ARMISelLowering. NFC.
James Y Knight [Fri, 1 Apr 2016 19:33:19 +0000 (19:33 +0000)]
Remove useless check for ThreadModel==Single in ARMISelLowering. NFC.

ThreadModel::Single is already handled already by ARMPassConfig adding
LowerAtomicPass to the pass list, which lowers all atomics to non-atomic
ops and deletes fences.

So by the time we get to ISel, there's no atomic fences left, so they
don't need special handling.

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

8 years agoLowerBitSets: Move declarations to separate namespace.
Peter Collingbourne [Fri, 1 Apr 2016 18:46:50 +0000 (18:46 +0000)]
LowerBitSets: Move declarations to separate namespace.

Should fix modules build.

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

8 years ago[libfuzzer] adding license headers to cpp files
Mike Aizatsky [Fri, 1 Apr 2016 18:38:58 +0000 (18:38 +0000)]
[libfuzzer] adding license headers to cpp files

Differential Revision: http://reviews.llvm.org/D18705

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

8 years ago[X86][SSE] Regenerated vec_partial tests.
Simon Pilgrim [Fri, 1 Apr 2016 18:30:29 +0000 (18:30 +0000)]
[X86][SSE] Regenerated vec_partial tests.

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

8 years ago[x86] add an SSE2 + fast-unaligned accesses run for memset nonzero tests
Sanjay Patel [Fri, 1 Apr 2016 18:29:25 +0000 (18:29 +0000)]
[x86] add an SSE2 + fast-unaligned accesses run for memset nonzero tests

Was there really no other way to splat a byte in SSE2?
    punpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
    pshuflw {{.*#+}} xmm0 = xmm0[0,0,0,0,4,5,6,7]
    pshufd {{.*#+}} xmm0 = xmm0[0,0,1,1]

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

8 years ago[X86][SSE] Regenerated vec_logical tests.
Simon Pilgrim [Fri, 1 Apr 2016 18:28:23 +0000 (18:28 +0000)]
[X86][SSE] Regenerated vec_logical tests.

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

8 years agoAMDGPU: Implement {BUFFER,FLAT}_ATOMIC_CMPSWAP{,_X2}
Tom Stellard [Fri, 1 Apr 2016 18:27:37 +0000 (18:27 +0000)]
AMDGPU: Implement {BUFFER,FLAT}_ATOMIC_CMPSWAP{,_X2}

Summary:
Implement BUFFER_ATOMIC_CMPSWAP{,_X2} instructions on all GCN targets, and FLAT_ATOMIC_CMPSWAP{,_X2} on CI+.

32-bit instruction variants tested manually on Kabini and Bonaire. Tests and parts of code provided by Jan Veselý.

Patch by: Vedran Miletić

Reviewers: arsenm, tstellarAMD, nhaehnle

Subscribers: jvesely, scchan, kanarayan, arsenm

Differential Revision: http://reviews.llvm.org/D17280

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

8 years ago[X86][SSE] Regenerated vector sdiv to shifts tests
Simon Pilgrim [Fri, 1 Apr 2016 18:18:40 +0000 (18:18 +0000)]
[X86][SSE] Regenerated vector sdiv to shifts tests

Added SSE + AVX1 tests as well as AVX2

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

8 years ago[sancov] save entry block from pruning (it is always full dominator)
Mike Aizatsky [Fri, 1 Apr 2016 18:13:19 +0000 (18:13 +0000)]
[sancov] save entry block from pruning (it is always full dominator)

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

8 years ago[x86] add an SSE1 run for these tests
Sanjay Patel [Fri, 1 Apr 2016 18:11:30 +0000 (18:11 +0000)]
[x86] add an SSE1 run for these tests

Note however that this is identical to the existing SSE2 run.
What we really want is yet another run for an SSE2 machine that
also has fast unaligned 16-byte accesses.

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

8 years ago[X86][SSE] Regenerated vec_setcc tests.
Simon Pilgrim [Fri, 1 Apr 2016 17:55:02 +0000 (17:55 +0000)]
[X86][SSE] Regenerated vec_setcc tests.

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

8 years ago[X86][SSE] Regenerated the vec_set tests.
Simon Pilgrim [Fri, 1 Apr 2016 17:40:25 +0000 (17:40 +0000)]
[X86][SSE] Regenerated the vec_set tests.

Replaced lots of dodgy greps with actual codegen

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

8 years ago[x86] avoid intermediate splat for non-zero memsets (PR27100)
Sanjay Patel [Fri, 1 Apr 2016 17:36:45 +0000 (17:36 +0000)]
[x86] avoid intermediate splat for non-zero memsets (PR27100)

Follow-up to http://reviews.llvm.org/D18566 and http://reviews.llvm.org/D18676 -
where we noticed that an intermediate splat was being generated for memsets of
non-zero chars.

That was because we told getMemsetStores() to use a 32-bit vector element type,
and it happily obliged by producing that constant using an integer multiply.

The 16-byte test that was added in D18566 is now equivalent for AVX1 and AVX2
(no splats, just a vector load), but we have PR27141 to track that splat difference.

Note that the SSE1 path is not changed in this patch. That can be a follow-up.
This patch should resolve PR27100.

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

8 years ago[AArch64] Fix a typo. NFC.
Chad Rosier [Fri, 1 Apr 2016 17:34:38 +0000 (17:34 +0000)]
[AArch64] Fix a typo. NFC.

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

8 years ago[InstCombine] Don't sink an instr after a catchswitch
David Majnemer [Fri, 1 Apr 2016 17:28:17 +0000 (17:28 +0000)]
[InstCombine] Don't sink an instr after a catchswitch

A catchswitch is a terminator, instructions cannot be inserted after it.

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

8 years ago[SLPVectorizer] Don't insert an extractelement before a catchswitch
David Majnemer [Fri, 1 Apr 2016 17:28:15 +0000 (17:28 +0000)]
[SLPVectorizer] Don't insert an extractelement before a catchswitch

A catchswitch cannot be preceded by another instruction in the same
basic block (other than a PHI node).

Instead, insert the extract element right after the materialization of
the vectorized value.  This isn't optimal but is a reasonable compromise
given the constraints of WinEH.

This fixes PR27163.

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

8 years ago[PGO] Refactor PGOFuncName meta data code to be used in clang
Rong Xu [Fri, 1 Apr 2016 16:43:30 +0000 (16:43 +0000)]
[PGO] Refactor PGOFuncName meta data code to be used in clang

Refactor the code that gets and creates PGOFuncName meta data so that it can be
used in clang's value profile annotation.

Differential Revision: http://reviews.llvm.org/D18623

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

8 years ago[x86] avoid intermediate splat for non-zero memsets (PR27100)
Sanjay Patel [Fri, 1 Apr 2016 16:27:14 +0000 (16:27 +0000)]
[x86] avoid intermediate splat for non-zero memsets (PR27100)

Follow-up to D18566 - where we noticed that an intermediate splat was being
generated for memsets of non-zero chars.

That was because we told getMemsetStores() to use a 32-bit vector element type,
and it happily obliged by producing that constant using an integer multiply.

The tests that were added in the last patch are now equivalent for AVX1 and AVX2
(no splats, just a vector load), but we have PR27141 to track that splat difference.
In the new tests, the splat via shuffling looks ok to me, but there might be some
room for improvement depending on uarch there.

Note that the SSE1/2 paths are not changed in this patch. That can be a follow-up.
This patch should resolve PR27100.

Differential Revision: http://reviews.llvm.org/D18676

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

8 years ago[ADT] Make StringMap's tombstone aligned.
Benjamin Kramer [Fri, 1 Apr 2016 15:51:51 +0000 (15:51 +0000)]
[ADT] Make StringMap's tombstone aligned.

This avoids undefined behavior when casting pointers to it. Also make
sure that we don't cast to a derived StringMapEntry before checking for
tombstone, as that may have different alignment requirements.

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

8 years ago[PGOProfile] Rename a test to make it more reusable, NFC
Vedant Kumar [Fri, 1 Apr 2016 15:45:33 +0000 (15:45 +0000)]
[PGOProfile] Rename a test to make it more reusable, NFC

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

8 years ago[AMDGPU] fix MADAK/MADMK instructions operand namings to match encoding fields.
Valery Pykhtin [Fri, 1 Apr 2016 13:13:12 +0000 (13:13 +0000)]
[AMDGPU] fix MADAK/MADMK instructions operand namings to match encoding fields.

$vsrc1 -> $src1, $k -> $imm

Differential Revision: http://reviews.llvm.org/D18659

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

8 years ago[x86] Remove redundant call to setTargetDAGCombine for BUILD_VECTOR node type.
Andrea Di Biagio [Fri, 1 Apr 2016 12:25:44 +0000 (12:25 +0000)]
[x86] Remove redundant call to setTargetDAGCombine for BUILD_VECTOR node type.

Since revision 235394, we no longer perform target specific combines on
build_vector nodes. No functional change intended.

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

8 years ago[X86][AVX512] Regenerated intrinsics tests
Simon Pilgrim [Fri, 1 Apr 2016 11:57:51 +0000 (11:57 +0000)]
[X86][AVX512] Regenerated intrinsics tests

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

8 years ago[MIPS][LLVM-MC] Fix JR encoding for MIPSR6 ISA
Sagar Thakur [Fri, 1 Apr 2016 11:55:33 +0000 (11:55 +0000)]
[MIPS][LLVM-MC] Fix JR encoding for MIPSR6 ISA

Summary: The assembler was picking the wrong JR variant because the pre-R6 one was still enabled at R6.

Author: nitesh.jain
Reviewers: vkalintiris, dsanders
Subscribers: dsanders, llvm-commits, mohit.bhakkad, sagar, bhushan, jaydeep
Differential: D18387

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

8 years ago[ThinLTO] Fix uninitialized flags.
Benjamin Kramer [Fri, 1 Apr 2016 11:49:59 +0000 (11:49 +0000)]
[ThinLTO] Fix uninitialized flags.

Found by msan. Patch by Adrian Kuegel!

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