OSDN Git Service

android-x86/external-llvm.git
8 years agoFix non-determinism in order of LLVM attributes
Reid Kleckner [Mon, 4 Apr 2016 23:06:05 +0000 (23:06 +0000)]
Fix non-determinism in order of LLVM attributes

We were using array_pod_sort on an array of type 'Attribute', which
wraps a pointer to AttributeImpl. For the most part this didn't matter
because the printing code prints enum attributes in a defined order, but
integer attributes such as 'align' and 'dereferenceable' were not
ordered.

Furthermore, AttributeImpl::operator< was broken for integer attributes.
An integer attribute is a kind and an integer value, and both pieces
need to be compared.

By fixing the comparison operator, we can go back to std::sort, and
things look good now.  This should fix clang arm-swiftcall.c test
failures on Windows.

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

8 years agouse range loop; NFCI
Sanjay Patel [Mon, 4 Apr 2016 23:05:06 +0000 (23:05 +0000)]
use range loop; NFCI

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

8 years agofix typos; NFC
Sanjay Patel [Mon, 4 Apr 2016 22:45:56 +0000 (22:45 +0000)]
fix typos; NFC

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

8 years agoStyle update in Core.h/Core.cpp . NFC
Amaury Sechet [Mon, 4 Apr 2016 22:00:25 +0000 (22:00 +0000)]
Style update in Core.h/Core.cpp . NFC

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

8 years agoRevert "CodeGen: Remove dead code in TailDuplicate"
Justin Bogner [Mon, 4 Apr 2016 21:41:54 +0000 (21:41 +0000)]
Revert "CodeGen: Remove dead code in TailDuplicate"

It seems this is reachable after all. It hit on 7zip-benchmark in lnt
on ppc64:

  http://lab.llvm.org:8011/builders/clang-ppc64be-linux-lnt/builds/2317

This reverts r265347.

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

8 years agoMachineScheduler: Ignore COPYs with undef/dead op in CopyConstrain mutation.
Matthias Braun [Mon, 4 Apr 2016 21:23:46 +0000 (21:23 +0000)]
MachineScheduler: Ignore COPYs with undef/dead op in CopyConstrain mutation.

There is no problem with the code today, but the fix will avoid a crash
in test/CodeGen/AMDGPU/subreg-coalescer-undef-use.ll once the
DetectDeadLanes pass is added.

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

8 years agotest: Always treat .mir files as tests even outside of CodeGen/MIR
Matthias Braun [Mon, 4 Apr 2016 21:23:44 +0000 (21:23 +0000)]
test: Always treat .mir files as tests even outside of CodeGen/MIR

We missed a handful of .mir tests that existed outside the
test/CodeGen/MIR directory.

Also fix the three powerpc .mir tests that nobody noticed were broken.

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

8 years agoClean up calls to WriteBitcodeToFile (NFC)
Teresa Johnson [Mon, 4 Apr 2016 21:19:31 +0000 (21:19 +0000)]
Clean up calls to WriteBitcodeToFile (NFC)

Remove a default parameter value being passed unnecessarily, which
also reduces the changes required when this parameter is changed in
D18763.

Document the remaining non-default bool value passed for another
parameter.

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

8 years agoCodeGen: Remove dead code in TailDuplicate
Justin Bogner [Mon, 4 Apr 2016 21:11:40 +0000 (21:11 +0000)]
CodeGen: Remove dead code in TailDuplicate

I noticed that this isn't covered by our existing tests and spent some
time trying to come up with an example it actually hits. I tried hand
rolling something based on the explanation in the comment, but couldn't
get anything that didn't abort tail duplication earlier for one reason
or another.

Then, I tried cranking tail-dup-size cranked up so this would fire
more and ran a bootstrap of clang and the nightly test suite - those
don't hit this either.

This reverts r132816 and replaces it with an assert.

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

8 years agoclang-format llvm-as.cpp (NFC)
Teresa Johnson [Mon, 4 Apr 2016 21:06:17 +0000 (21:06 +0000)]
clang-format llvm-as.cpp (NFC)

This reduces unrelated changes in other patches (such as D18763) when
changes to this file are clang formatted.

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

8 years agoRe-commit r265039 "[X86] Merge adjacent stack adjustments in eliminateCallFramePseudo...
Hans Wennborg [Mon, 4 Apr 2016 21:02:46 +0000 (21:02 +0000)]
Re-commit r265039 "[X86] Merge adjacent stack adjustments in eliminateCallFramePseudoInstr (PR27140)"

The original commit miscompiled things on 32-bit Windows, e.g. a Clang
boostrap. It turns out that mergeSPUpdates() was a bit too generous in
what it interpreted as a stack adjustment, causing the following code:

        addl    $12, %esp
        leal    -4(%ebp), %esp

To be "optimized" into simply:

        addl    $8, %esp

This commit tightens up mergeSPUpdates() and includes a new test
(test14 in movtopush.ll) for this situation.

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

8 years agoEnable unroll for constant bound loops when TripCount is not modulo of unroll factor...
Zia Ansari [Mon, 4 Apr 2016 19:24:46 +0000 (19:24 +0000)]
Enable unroll for constant bound loops when TripCount is not modulo of unroll factor, reducing it to maximum power-of-2 that satisfies threshold limit.

Commit for Evgeny Stupachenko (evstupac@gmail.com)

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

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

8 years agoFix bot errors from r265327, exact GUID which depends on path
Teresa Johnson [Mon, 4 Apr 2016 19:11:00 +0000 (19:11 +0000)]
Fix bot errors from r265327, exact GUID which depends on path

E.g. http://bb.pgr.jp/builders/ninja-x64-msvc-RA-centos6/builds/21919

The source file path name will affect exact GUID, don't try to match
exact value.

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

8 years agoBeef up some dllexport tests.
Sean Silva [Mon, 4 Apr 2016 19:10:55 +0000 (19:10 +0000)]
Beef up some dllexport tests.

Adds some dllexport tests to verify that:
  - Variables in bss are exported appropriately
  - Non-dllexport symbols aliased to dllexport symbols are not exported
  - Symbols declared as dllexport but are not defined are not exported

We plan to enable dllimport/dllexport support for the PS4, and these
additional tests are for points we noticed in our internal testing.

Patch by Warren Ristow!

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

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

8 years agoRevert r263460: [SpillPlacement] Fix a quadratic behavior in spill placement.
Chandler Carruth [Mon, 4 Apr 2016 18:57:50 +0000 (18:57 +0000)]
Revert r263460: [SpillPlacement] Fix a quadratic behavior in spill placement.

That commit looks wonderful and awesome. Sadly, it greatly exacerbates
PR17409 and effectively regresses build time for a lot of (very large)
code when compiled with ASan or MSan.

We thought this could be fixed forward by landing D15302 which at last
fixes that PR, but some issues were discovered and it looks like that
got reverted, so reverting this as well temporarily. As soon as the fix
for PR17409 lands and sticks, we should re-land this patch as it won't
trigger more significant test cases hitting that bug.

Many thanks to Quentin and Wei here as they're doing all the awesome
hard work!!!

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

8 years ago[PGO] Avoid instrumenting direct callee's at value sites.
Betul Buyukkurt [Mon, 4 Apr 2016 18:56:36 +0000 (18:56 +0000)]
[PGO] Avoid instrumenting direct callee's at value sites.

Direct callees' that are cast to other function prototypes,
show up in the Call/Invoke instructions as ConstantExpr's.
Currently llvm::CallSite's getCalledFunction() fails
to return the callees in such expressions as direct calls.
Value profiling should avoid instrumenting such cases. Mostly NFC.

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

8 years agoARM, AArch64, X86: Check preserved registers for tail calls.
Matthias Braun [Mon, 4 Apr 2016 18:56:13 +0000 (18:56 +0000)]
ARM, AArch64, X86: Check preserved registers for tail calls.

We can only perform a tail call to a callee that preserves all the
registers that the caller needs to preserve.

This situation happens with calling conventions like preserver_mostcc or
cxx_fast_tls. It was explicitely handled for fast_tls and failing for
preserve_most. This patch generalizes the check to any calling
convention.

Related to rdar://24207743

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

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

8 years ago[ThinLTO] Add option to dump value name to GUID mapping
Teresa Johnson [Mon, 4 Apr 2016 18:52:58 +0000 (18:52 +0000)]
[ThinLTO] Add option to dump value name to GUID mapping

Summary:
Useful for debugging since we lose this correlation after the permodule
summary/VST is read and until we later materialize source modules in the
function importer.

Reviewers: joker.eph

Subscribers: llvm-commits, joker.eph

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

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

8 years ago[ThinLTO] Augment FunctionImport dump with value name to GUID map
Teresa Johnson [Mon, 4 Apr 2016 18:52:23 +0000 (18:52 +0000)]
[ThinLTO] Augment FunctionImport dump with value name to GUID map

Summary:
To aid in debugging, dump out the correlation between value names and
GUID for each source module when it is materialized. This will make it
easier to comprehend the earlier summary-based function importing debug
trace which only has access to and prints the GUIDs.

Reviewers: joker.eph

Subscribers: llvm-commits, joker.eph

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

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

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