]> granicus.if.org Git - llvm/log
llvm
8 years ago[LoopInfo] Add helper methods to compute two useful orderings of the
Chandler Carruth [Fri, 20 Jan 2017 02:41:20 +0000 (02:41 +0000)]
[LoopInfo] Add helper methods to compute two useful orderings of the
loops in a function.

These are relatively confusing to talk about and compute correctly so it
seems really good to write down their implementation in one place. I've
replaced one place we needed this in the loop PM infrastructure and
I have another place in a pending patch that wants it.

We can't quite use this for the core loop PM walk because there we're
sometimes working on a sub-forest.

I'll add the expected unittests before committing this but wanted to
make sure folks were happy with these names / comments.

Credit goes to Richard Smith for the idea for naming the order where siblings
are in reverse program order but the tree traversal remains preorder.

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

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

8 years ago[test] Remove a unwanted match for `XFAIL:`.
Greg Parker [Fri, 20 Jan 2017 02:01:04 +0000 (02:01 +0000)]
[test] Remove a unwanted match for `XFAIL:`.

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

8 years ago[AArch64][GlobalISel] Widen scalar int->fp conversions.
Ahmed Bougacha [Fri, 20 Jan 2017 01:37:24 +0000 (01:37 +0000)]
[AArch64][GlobalISel] Widen scalar int->fp conversions.

It's incorrect to ignore the higher bits of the integer source.
Teach the legalizer how to widen it.

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

8 years ago[PM] Attempt to pacify windows bots.
Michael Kuperstein [Fri, 20 Jan 2017 00:47:32 +0000 (00:47 +0000)]
[PM] Attempt to pacify windows bots.

Another difference in type pretty-printing, this one windows-specific.

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

8 years ago[AMDGPU] Prevent spills before exec mask is restored
Stanislav Mekhanoshin [Fri, 20 Jan 2017 00:44:31 +0000 (00:44 +0000)]
[AMDGPU] Prevent spills before exec mask is restored

Inline spiller can decide to move a spill as early as possible in the basic block.
It will skip phis and label, but we also need to make sure it skips instructions
in the basic block prologue which restore exec mask.

Added isPositionLike callback in TargetInstrInfo to detect instructions which
shall be skipped in addition to common phis, labels etc.

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

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

8 years agoGlobalISel: Add a note about how we're being a bit loose with memory operands
Justin Bogner [Fri, 20 Jan 2017 00:30:17 +0000 (00:30 +0000)]
GlobalISel: Add a note about how we're being a bit loose with memory operands

The logic in r292461 is conservatively correct, but we should revisit
this later. Add a TODO so we don't forget.

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

8 years ago[AArch64][GlobalISel] Split FP conversion legalizer tests. NFC.
Ahmed Bougacha [Fri, 20 Jan 2017 00:30:09 +0000 (00:30 +0000)]
[AArch64][GlobalISel] Split FP conversion legalizer tests. NFC.

Big functions with large vreg # are quite unwieldy to update.

Change it to have one function per test (it does increase boilerplate,
but makes the core hopefully more readable and maintanable).

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

8 years ago[AArch64][GlobalISel] Split legalizer combine tests. NFC.
Ahmed Bougacha [Fri, 20 Jan 2017 00:30:06 +0000 (00:30 +0000)]
[AArch64][GlobalISel] Split legalizer combine tests. NFC.

Big functions with large vreg # are quite unwieldy to update.  This test
also relied on legal s8 operations which we're considering removing.

Change it to have one function per test (it does increase boilerplate,
but makes the core hopefully more readable and maintanable), and use
100% legal operations throughout.

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

8 years ago[MIRParser] Allow generic register specification on operand.
Ahmed Bougacha [Fri, 20 Jan 2017 00:29:59 +0000 (00:29 +0000)]
[MIRParser] Allow generic register specification on operand.

This completes r292321 by adding support for generic registers, e.g.:

  %2:_(s32) = G_ADD %0, %1

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

8 years ago[lit] Limit parallelism of sanitizer tests on Darwin [llvm part, take 2]
Kuba Mracek [Fri, 20 Jan 2017 00:24:32 +0000 (00:24 +0000)]
[lit] Limit parallelism of sanitizer tests on Darwin [llvm part, take 2]

Running lit tests and unit tests of ASan and TSan on macOS has very bad performance when running with a high number of threads. This is caused by xnu (the macOS kernel), which currently doesn't handle mapping and unmapping of sanitizer shadow regions (reserved VM which are several terabytes large) very well. The situation is so bad that increasing the number of threads actually makes the total testing time larger. The macOS buildbots are affected by this. Note that we can't easily limit the number of sanitizer testing threads without affecting the rest of the tests.

This patch adds a special "group" into lit, and limits the number of concurrently running tests in this group. This helps solve the contention problem, while still allowing other tests to run in full, that means running lit with -j8 will still with 8 threads, and parallelism is only limited in sanitizer tests.

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

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

8 years agoGlobalISel: Only set FailedISel on dropped dbg intrinsics when using fallback
Justin Bogner [Fri, 20 Jan 2017 00:24:30 +0000 (00:24 +0000)]
GlobalISel: Only set FailedISel on dropped dbg intrinsics when using fallback

It's easier to test the non-fallback path if we just drop these
intrinsics for now, like we did before we added the fallback path.
We'll obviously need to fix this properly, but the fixme for that is
already here.

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

8 years ago[AliasAnalysis] Fences do not modify constant memory location
Anna Thomas [Fri, 20 Jan 2017 00:21:33 +0000 (00:21 +0000)]
[AliasAnalysis] Fences do not modify constant memory location

Summary:
Fence instructions are currently marked as `ModRef` for all memory locations.

We can improve this for constant memory locations (such as constant globals),
since fence instructions cannot modify these locations.

This helps us to forward constant loads across fences (added test case in GVN).
There were no changes in behaviour for similar test cases in early-cse and licm.

Reviewers: dberlin, sanjoy, reames

Subscribers: llvm-commits

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

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

8 years agoGlobalISel: Pass the MachineFunction in to reportSelectionError directly
Justin Bogner [Fri, 20 Jan 2017 00:16:19 +0000 (00:16 +0000)]
GlobalISel: Pass the MachineFunction in to reportSelectionError directly

Rather than trying to find MF based on the possibly-null MI we've
passed in here, just pass it in directly. It's already available at
all callers anyway.

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

8 years agoLiveRegUnits: Add accumulateBackward() function
Matthias Braun [Fri, 20 Jan 2017 00:16:17 +0000 (00:16 +0000)]
LiveRegUnits: Add accumulateBackward() function

This function can be used to accumulate the set of all read and modified
register in a sequence of instructions.

Use this code in AArch64A57FPLoadBalancing::scavengeRegister() to prove
the concept.

- The AArch64A57LoadBalancing code is using a backwards analysis now
  which is irrespective of kill flags. This is the main motivation for
  this change.

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

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

8 years agoCodeGen: Add/Factor out LiveRegUnits class; NFCI
Matthias Braun [Fri, 20 Jan 2017 00:16:14 +0000 (00:16 +0000)]
CodeGen: Add/Factor out LiveRegUnits class; NFCI

This is a set of register units intended to track register liveness, it
is similar in spirit to LivePhysRegs.
You can also think of this as the liveness tracking parts of the
RegisterScavenger factored out into an own class.

This was proposed in http://llvm.org/PR27609

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

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

8 years agoAArch64: fall back to DAG ISel for inline assembly.
Tim Northover [Thu, 19 Jan 2017 23:59:35 +0000 (23:59 +0000)]
AArch64: fall back to DAG ISel for inline assembly.

We can't currently handle "calls" to inlineasm strings so it's better to let
the DAG handle it than generate rubbish.

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

8 years agoFix a few more build errors.
Zachary Turner [Thu, 19 Jan 2017 23:44:14 +0000 (23:44 +0000)]
Fix a few more build errors.

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

8 years agoFix incorrectly formed assert statement.
Zachary Turner [Thu, 19 Jan 2017 23:41:11 +0000 (23:41 +0000)]
Fix incorrectly formed assert statement.

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

8 years ago[PM] Make default pipeline test for the new PM strict
Michael Kuperstein [Thu, 19 Jan 2017 23:39:28 +0000 (23:39 +0000)]
[PM] Make default pipeline test for the new PM strict

Use CHECK-NEXT to verify that a test breaks whenever unexpected passes,
analyses, or invalidations show up in default pipelines. The test case
is constructed so that we don't expect to invalidate anything, and needs
to be kept that way.

The test is slightly less strict than we'd like because of differences
in type pretty-printing.

(Right now it does show some invalidations - all of those are intentional
and temporary.)

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

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

8 years ago[pdb] Add HashTable data structure.
Zachary Turner [Thu, 19 Jan 2017 23:31:24 +0000 (23:31 +0000)]
[pdb] Add HashTable data structure.

This was being parsed / serialized ad-hoc inside the code
for a specific PDB stream.  But this data structure is used
in multiple ways / places within the PDB format.  To be able
to re-use it we need to raise this code out and make it more
generic.  In doing so, a number of bugs are fixed in the
original implementation, and support is added for growing
the hash table and deleting items from the hash table,
which had either been omitted or incorrect implemented in
the initial version.

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

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

8 years agoRevert r292530 since it breaks buildbots.
Michael Kuperstein [Thu, 19 Jan 2017 23:22:55 +0000 (23:22 +0000)]
Revert r292530 since it breaks buildbots.

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

8 years agoclang-format SampleProfile.cpp (NFC)
Dehao Chen [Thu, 19 Jan 2017 23:20:31 +0000 (23:20 +0000)]
clang-format SampleProfile.cpp (NFC)

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

8 years agoLTO: Flush the resolution file after writing to it.
Peter Collingbourne [Thu, 19 Jan 2017 23:10:14 +0000 (23:10 +0000)]
LTO: Flush the resolution file after writing to it.

Without this the file could be truncated if the linker crashes.

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

8 years ago[SCCP] Teach the pass how to handle `div` with overdefined operands.
Davide Italiano [Thu, 19 Jan 2017 23:07:51 +0000 (23:07 +0000)]
[SCCP] Teach the pass how to handle `div` with overdefined operands.

This can prove that:

extern int f;
int g() {
    int x = 0;
    for (int i = 0; i < 365; ++i) {
        x /= f;
    }
    return x;
}

always returns zero. Thanks to Sanjoy for confirming this
transformation actually made sense (bugs are mine).

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

8 years ago[PM] Make default pipeline test for the new PM strict
Michael Kuperstein [Thu, 19 Jan 2017 22:55:46 +0000 (22:55 +0000)]
[PM] Make default pipeline test for the new PM strict

Use CHECK-NEXT to verify that a test breaks whenever unexpected passes,
analyses, or invalidations show up in default pipelines. The test case
is constructed so that we don't expect to invalidate anything, and needs
to be kept that way.

(Right now it does show some invalidations - all of those are intentional
and temporary.)

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

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

8 years agoRevert "[InlineCost] Use TTI to check if GEP is free."
Haicheng Wu [Thu, 19 Jan 2017 22:51:03 +0000 (22:51 +0000)]
Revert "[InlineCost] Use TTI to check if GEP is free."

This reverts commit r292526.  The test case has problem.

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

8 years ago[SelectionDAG] Improve knownbits handling of UMIN/UMAX (PR31293)
Simon Pilgrim [Thu, 19 Jan 2017 22:41:22 +0000 (22:41 +0000)]
[SelectionDAG] Improve knownbits handling of UMIN/UMAX (PR31293)

This patch improves the knownbits logic for unsigned integer min/max opcodes.

For UMIN we know that the result will have the maximum of the inputs' known leading zero bits in the result, similarly for UMAX the maximum of the inputs' leading one bits.

This is particularly useful for simplifying clamping patterns,. e.g. as SSE doesn't have a uitofp instruction we want to use sitofp instead where possible and for that we need to confirm that the top bit is not set.

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

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

8 years ago[InlineCost] Use TTI to check if GEP is free.
Haicheng Wu [Thu, 19 Jan 2017 22:28:34 +0000 (22:28 +0000)]
[InlineCost] Use TTI to check if GEP is free.

Currently, a GEP is considered free only if its indices are all constant.
TTI::getGEPCost() can give target-specific more accurate analysis. TTI is
already used for the cost of many other instructions.

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

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

8 years ago[AMDGPU] Add exec copy to LiveIntervals in SILowerControlFlow::emitElse
Stanislav Mekhanoshin [Thu, 19 Jan 2017 21:26:22 +0000 (21:26 +0000)]
[AMDGPU] Add exec copy to LiveIntervals in SILowerControlFlow::emitElse

This instruction is missing from LiveIntervals.
I'm not aware of any problems because of this though.

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

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

8 years ago[libFuzzer] ensure that entries in PersistentAutoDictionary are not empty
Kostya Serebryany [Thu, 19 Jan 2017 21:14:47 +0000 (21:14 +0000)]
[libFuzzer] ensure that entries in PersistentAutoDictionary are not empty

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

8 years ago[SCCP] Update comment in visitBinaryOp() after recent changes.
Davide Italiano [Thu, 19 Jan 2017 21:07:42 +0000 (21:07 +0000)]
[SCCP] Update comment in visitBinaryOp() after recent changes.

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

8 years ago[XRay][Arm] Repair XRay table emission on Arm32 and add tests to identify such proble...
Serge Rogatch [Thu, 19 Jan 2017 20:24:23 +0000 (20:24 +0000)]
[XRay][Arm] Repair XRay table emission on Arm32 and add tests to identify such problem earlier

Summary:
Emission of XRay table was occasionally disabled for Arm32, but this bug was not then detected because earlier (also by mistake) testing of XRay was occasionally disabled on 32-bit Arm targets. This patch should fix that problem and detect such problems in the future.
This patch is one of a series, see also
- https://reviews.llvm.org/D28623

Reviewers: rengolin, dberris

Reviewed By: dberris

Subscribers: llvm-commits, aemerson, rengolin, dberris, iid_iunknown

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

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

8 years ago[Assembler] Improve error when unable to evaluate expression.
Chad Rosier [Thu, 19 Jan 2017 20:06:32 +0000 (20:06 +0000)]
[Assembler] Improve error when unable to evaluate expression.

Add a SMLoc to MCExpr. Most code does not generate or consume the SMLoc (yet).

Patch by Sanne Wouda <sanne.wouda@arm.com>!
Differential Revision: https://reviews.llvm.org/D28861

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

8 years agoFix aliases to thumbfunc-based exprs to be thumbfunc.
Evgeniy Stepanov [Thu, 19 Jan 2017 20:04:11 +0000 (20:04 +0000)]
Fix aliases to thumbfunc-based exprs to be thumbfunc.

If F is a Thumb function symbol, and G = F + const, and G is a
function symbol, then G is Thumb. Because what else could it be?

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

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

8 years ago[libFuzzer] improve -minimize_crash: honor -artifact_prefix= and don't special case...
Kostya Serebryany [Thu, 19 Jan 2017 19:38:12 +0000 (19:38 +0000)]
[libFuzzer] improve -minimize_crash: honor -artifact_prefix= and don't special case 2-byte inputs

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

8 years agoImprove what can be promoted in LICM.
Xin Tong [Thu, 19 Jan 2017 19:31:40 +0000 (19:31 +0000)]
Improve what can be promoted in LICM.

Summary:
In case of non-alloca pointers, we check for whether it is a pointer
from malloc-like calls and it is not captured. In such case, we can
promote the pointer, as the caller will have no way to access this pointer
even if there is unwinding in middle of the loop.

Reviewers: hfinkel, sanjoy, reames, eli.friedman

Subscribers: llvm-commits

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

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

8 years ago[libFuzzer] add two tests for experimenting with equivalence fuzzing
Kostya Serebryany [Thu, 19 Jan 2017 19:07:26 +0000 (19:07 +0000)]
[libFuzzer] add two tests for experimenting with equivalence fuzzing

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

8 years agoAdd an interface to scale the frequencies of a set of blocks.
Easwaran Raman [Thu, 19 Jan 2017 18:53:16 +0000 (18:53 +0000)]
Add an interface to scale the frequencies of a set of blocks.

The scaling is done with reference to the the new frequency of a reference block.

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

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

8 years ago[InstCombine] Simplify gep (gep p, a), (b-a)
Davide Italiano [Thu, 19 Jan 2017 18:51:56 +0000 (18:51 +0000)]
[InstCombine] Simplify gep (gep p, a), (b-a)

Patch by Andrea Canciani.

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

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

8 years ago[X86][SSE] Improve comments describing combineTruncatedArithmetic. NFCI.
Simon Pilgrim [Thu, 19 Jan 2017 18:18:32 +0000 (18:18 +0000)]
[X86][SSE] Improve comments describing combineTruncatedArithmetic. NFCI.

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

8 years agoRemove this test from the r292500 commit till Chris and I figure out
Kevin Enderby [Thu, 19 Jan 2017 18:07:22 +0000 (18:07 +0000)]
Remove this test from the r292500 commit till Chris and I figure out
why it is failing on a couple of build bots.

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

8 years agoAdd support for the new LC_NOTE load command.
Kevin Enderby [Thu, 19 Jan 2017 17:36:31 +0000 (17:36 +0000)]
Add support for the new LC_NOTE load command.

It describes a region of arbitrary data included in a Mach-O file.
Its initial use is to record extra data in MH_CORE files.

rdar://30001545
rdar://30001731

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

8 years ago[X86][SSE] Attempt to pre-truncate arithmetic operations that have already been extended
Simon Pilgrim [Thu, 19 Jan 2017 16:25:02 +0000 (16:25 +0000)]
[X86][SSE] Attempt to pre-truncate arithmetic operations that have already been extended

As discussed on D28219 - it is profitable to combine trunc(binop (s/zext(x), s/zext(y)) to binop(trunc(s/zext(x)), trunc(s/zext(y))) assuming the trunc(ext()) will simplify further

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

8 years ago[InstCombine] icmp Pred (shl nsw X, C1), C0 --> icmp Pred X, C0 >> C1
Sanjay Patel [Thu, 19 Jan 2017 16:12:10 +0000 (16:12 +0000)]
[InstCombine] icmp Pred (shl nsw X, C1), C0 --> icmp Pred X, C0 >> C1

Try harder to fold icmp with shl nsw as discussed here:
http://lists.llvm.org/pipermail/llvm-dev/2017-January/108749.html

This is similar to the 'shl nuw' transforms that were added with D25913.

This may eventually help solve:
https://llvm.org/bugs/show_bug.cgi?id=30773

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

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

8 years ago[X86][SSE] Added tests for pre-truncating arithmetic operations that have already...
Simon Pilgrim [Thu, 19 Jan 2017 15:03:00 +0000 (15:03 +0000)]
[X86][SSE] Added tests for pre-truncating arithmetic operations that have already been extended

As discussed on D28219 - it is profitable to combine trunc(binop (s/zext(x), s/zext(y)) to binop(trunc(s/zext(x)), trunc(s/zext(y))) assuming the trunc(ext()) will simplify further

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

8 years ago[DAG] Don't increase SDNodeOrder for dbg.value/declare.
Mikael Holmen [Thu, 19 Jan 2017 13:55:55 +0000 (13:55 +0000)]
[DAG] Don't increase SDNodeOrder for dbg.value/declare.

Summary:
The SDNodeOrder is saved in the IROrder field in the SDNode, and this
field may affects scheduling. Thus, letting dbg.value/declare increase
the order numbers may in turn affect scheduling.

Because of this change we also need to update the code deciding when
dbg values should be output, in ScheduleDAGSDNodes.cpp/ProcessSDDbgValues.

Dbg values now have the same order as the SDNode they are connected to,
not the following orders.

Test cases provided by Florian Hahn.

Reviewers: bogner, aprantl, sunfish, atrick

Reviewed By: atrick

Subscribers: fhahn, probinson, andreadb, llvm-commits, MatzeB

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

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

8 years ago[docs] Tell Doxygen to expand LLVM_ALIGNAS to nothing
Malcolm Parsons [Thu, 19 Jan 2017 13:37:42 +0000 (13:37 +0000)]
[docs] Tell Doxygen to expand LLVM_ALIGNAS to nothing

Summary:
Docs for clang::Decl and clang::TemplateSpecializationType have
not been generated since LLVM_ALIGNAS was added to them.

Tell Doxygen to expand LLVM_ALIGNAS to nothing as described at
https://www.stack.nl/~dimitri/doxygen/manual/preprocessing.html

Reviewers: aaron.ballman, klimek, alexfh

Subscribers: ioeric, cfe-commits

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

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

8 years agoTest commit access, remove trailing whitespace
Mikael Holmen [Thu, 19 Jan 2017 13:35:13 +0000 (13:35 +0000)]
Test commit access, remove trailing whitespace

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

8 years ago[GlobalISel] Pointers are legal operands for G_SELECT on AArch64
Kristof Beyls [Thu, 19 Jan 2017 13:32:14 +0000 (13:32 +0000)]
[GlobalISel] Pointers are legal operands for G_SELECT on AArch64

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

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

8 years agoRecommiting unsigned saturation with a bugfix.
Elena Demikhovsky [Thu, 19 Jan 2017 12:08:21 +0000 (12:08 +0000)]
Recommiting unsigned saturation with a bugfix.
A test case that crached is added to avx512-trunc.ll.
(PR31589)

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

8 years agoRe-commit: [globalisel] Tablegen-erate current Register Bank Information
Daniel Sanders [Thu, 19 Jan 2017 11:15:55 +0000 (11:15 +0000)]
Re-commit: [globalisel] Tablegen-erate current Register Bank Information

Summary:
Adds a RegisterBank tablegen class that can be used to declare the register
banks and an associated tablegen pass to generate the necessary code.

Changes since first commit attempt:
* Added missing guards
* Added more missing guards
* Found and fixed a use-after-free bug involving Twine locals

Reviewers: t.p.northover, ab, rovka, qcolombet

Reviewed By: qcolombet

Subscribers: aditya_nandakumar, rengolin, kristof.beyls, vkalintiris, mgorny, dberris, llvm-commits, rovka

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

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

8 years agoGlobalISel: Implement widening for shifts
Justin Bogner [Thu, 19 Jan 2017 07:51:17 +0000 (07:51 +0000)]
GlobalISel: Implement widening for shifts

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

8 years ago[AVX-512] Add test cases that show where we are using two subvector inserts to broadc...
Craig Topper [Thu, 19 Jan 2017 07:37:45 +0000 (07:37 +0000)]
[AVX-512] Add test cases that show where we are using two subvector inserts to broadcast a 128-bit subvector into a 512-bit vector. We'd be better off using something like SHUFF32X4.

If the subvector comes from a load, we convert to SUBV_BROADCAST and use a broadcast instruction. But if there is no load we keep the inserts. I think we should create the SUBV_BROADCAST even without the load and let isel use the fallback patterns that are used if the load can't be folded. This will use the SHUFF32X4 or similar instruction for the 128-bit into 512-bit case and a single insert for 128 into 256 or 256 into 512.

This should be fixed so subvector broadcast intrinsics can be replaced with native IR since some of those currently lower directly to SHUFF32X4.

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

8 years ago[AVX-512] Support ADD/SUB/MUL of mask vectors
Craig Topper [Thu, 19 Jan 2017 07:12:35 +0000 (07:12 +0000)]
[AVX-512] Support ADD/SUB/MUL of mask vectors

Summary:
Currently we expand and scalarize these operations, but I think we should be able to implement ADD/SUB with KXOR and MUL with KAND.

We already do this for scalar i1 operations so I just extended it to vectors of i1.

Reviewers: zvi, delena

Reviewed By: delena

Subscribers: guyblank, llvm-commits

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

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

8 years agoAMDGPU: Disable some fneg combines unless nsz
Matt Arsenault [Thu, 19 Jan 2017 06:35:27 +0000 (06:35 +0000)]
AMDGPU: Disable some fneg combines unless nsz

For -(x + y) -> (-x) + (-y), if x == -y, this would
change the result from -0.0 to 0.0. Since the fma/fmad
combine is an extension of this problem it also
applies there.

fmul should be fine, and I don't think any of the unary
operators or conversions should be a problem either.

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

8 years agoAMDGPU: Remove modifiers from v_div_scale_*
Matt Arsenault [Thu, 19 Jan 2017 06:04:12 +0000 (06:04 +0000)]
AMDGPU: Remove modifiers from v_div_scale_*

They seem to produce nonsense results when used.

This should be applied to the release branch.

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

8 years ago[X86] Merge LowerADD and LowerSUB into a single LowerADD_SUB since they are identical.
Craig Topper [Thu, 19 Jan 2017 03:49:29 +0000 (03:49 +0000)]
[X86] Merge LowerADD and LowerSUB into a single LowerADD_SUB since they are identical.

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

8 years ago[sancov] applying blacklist to covered points too
Mike Aizatsky [Thu, 19 Jan 2017 03:49:18 +0000 (03:49 +0000)]
[sancov] applying blacklist to covered points too

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

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

8 years agollvm-cxxfilt: filter out invalid manglings
Saleem Abdulrasool [Thu, 19 Jan 2017 02:58:46 +0000 (02:58 +0000)]
llvm-cxxfilt: filter out invalid manglings

c++filt does not attempt to demangle symbols which do not match its
expected format.  This means that the symbol must start with _Z or ___Z
(block invocation function extension).  Any other symbols are returned
as is.  Note that this is different from the behaviour of __cxa_demangle
which will demangle fragments.

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

8 years ago[AVX-512] Use VSHUF instructions instead of two inserts as fallback for subvector...
Craig Topper [Thu, 19 Jan 2017 02:34:29 +0000 (02:34 +0000)]
[AVX-512] Use VSHUF instructions instead of two inserts as fallback for subvector broadcasts that can't fold the load.

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

8 years ago[AVX-512] Add additional test cases for broadcast intrinsics that demonstates that...
Craig Topper [Thu, 19 Jan 2017 02:34:25 +0000 (02:34 +0000)]
[AVX-512] Add additional test cases for broadcast intrinsics that demonstates that we don't fold the loads to use a broadcast instruction.

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

8 years ago[PM] Add LoopVectorize to the default module pipeline
Michael Kuperstein [Thu, 19 Jan 2017 02:21:54 +0000 (02:21 +0000)]
[PM] Add LoopVectorize to the default module pipeline

LV no longer "requires" LCSSA and LoopSimplify, and instead forms
them internally as required. So, there's nothing preventing it from
being enabled.

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

8 years agoLowerTypeTests: Implement exporting of type identifiers.
Peter Collingbourne [Thu, 19 Jan 2017 01:20:11 +0000 (01:20 +0000)]
LowerTypeTests: Implement exporting of type identifiers.

Type identifiers are exported by:
- Adding coarse-grained information about how to test the type
  identifier to the summary.
- Creating symbols in the object file (aliases and absolute symbols)
  containing fine-grained information about the type identifier.

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

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

8 years agoGlobalISel: Implement narrowing for G_LOAD
Justin Bogner [Thu, 19 Jan 2017 01:05:48 +0000 (01:05 +0000)]
GlobalISel: Implement narrowing for G_LOAD

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

8 years agoGlobalISel: Fix text wrapping in a comment. NFC
Justin Bogner [Thu, 19 Jan 2017 01:04:46 +0000 (01:04 +0000)]
GlobalISel: Fix text wrapping in a comment. NFC

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

8 years agoUse an actual valid register in test
Matthias Braun [Thu, 19 Jan 2017 01:04:08 +0000 (01:04 +0000)]
Use an actual valid register in test

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

8 years agoAdd -debug-info-for-profiling to emit more debug info for sample pgo profile collection
Dehao Chen [Thu, 19 Jan 2017 00:44:11 +0000 (00:44 +0000)]
Add -debug-info-for-profiling to emit more debug info for sample pgo profile collection

Summary:
SamplePGO binaries built with -gmlt to collect profile. The current -gmlt debug info is limited, and we need some additional info:

* start line of all subprograms
* linkage name of all subprograms
* standalone subprograms (functions that has neither inlined nor been inlined)

This patch adds these information to the -gmlt binary. The impact on speccpu2006 binary size (size increase comparing with -g0 binary, also includes data for -g binary, which does not change with this patch):

               -gmlt(orig) -gmlt(patched) -g
433.milc       4.68%       5.40%          19.73%
444.namd       8.45%       8.93%          45.99%
447.dealII     97.43%      115.21%        374.89%
450.soplex     27.75%      31.88%         126.04%
453.povray     21.81%      26.16%         92.03%
470.lbm        0.60%       0.67%          1.96%
482.sphinx3    5.77%       6.47%          26.17%
400.perlbench  17.81%      19.43%         73.08%
401.bzip2      3.73%       3.92%          12.18%
403.gcc        31.75%      34.48%         122.75%
429.mcf        0.78%       0.88%          3.89%
445.gobmk      6.08%       7.92%          42.27%
456.hmmer      10.36%      11.25%         35.23%
458.sjeng      5.08%       5.42%          14.36%
462.libquantum 1.71%       1.96%          6.36%
464.h264ref    15.61%      16.56%         43.92%
471.omnetpp    11.93%      15.84%         60.09%
473.astar      3.11%       3.69%          14.18%
483.xalancbmk  56.29%      81.63%         353.22%
geomean        15.60%      18.30%         57.81%

Debug info size change for -gmlt binary with this patch:

433.milc       13.46%
444.namd       5.35%
447.dealII     18.21%
450.soplex     14.68%
453.povray     19.65%
470.lbm        6.03%
482.sphinx3    11.21%
400.perlbench  8.91%
401.bzip2      4.41%
403.gcc        8.56%
429.mcf        8.24%
445.gobmk      29.47%
456.hmmer      8.19%
458.sjeng      6.05%
462.libquantum 11.23%
464.h264ref    5.93%
471.omnetpp    31.89%
473.astar      16.20%
483.xalancbmk  44.62%
geomean        16.83%

Reviewers: davidxl, echristo, dblaikie

Reviewed By: echristo, dblaikie

Subscribers: aprantl, probinson, llvm-commits, mehdi_amini

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

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

8 years ago[LV] Run loop-simplify and LCSSA explicitly instead of "requiring" them
Michael Kuperstein [Thu, 19 Jan 2017 00:42:28 +0000 (00:42 +0000)]
[LV] Run loop-simplify and LCSSA explicitly instead of "requiring" them

This changes the vectorizer to explicitly use the loopsimplify and lcssa utils,
instead of "requiring" the transformations as if they were analyses.

This is not NFC, since it changes the LCSSA behavior - we no longer run LCSSA
for all loops, but rather only for the loops we expect to modify.

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

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

8 years agoLiveIntervalAnalysis: Cleanup; NFC
Matthias Braun [Thu, 19 Jan 2017 00:32:13 +0000 (00:32 +0000)]
LiveIntervalAnalysis: Cleanup; NFC

- Fix doxygen comments: Do not repeat name, remove duplicated doxygen
  comment (on declaration + implementation), etc.
- Use more range based for

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

8 years ago[NVPTX] Fix lowering of fp16 ISD::FNEG.
Artem Belevich [Thu, 19 Jan 2017 00:14:45 +0000 (00:14 +0000)]
[NVPTX] Fix lowering of fp16 ISD::FNEG.

There's no neg.f16 instruction, so negation has to
be done via subtraction from zero.

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

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

8 years ago[SCEV] Make getUDivExactExpr handle non-nuw multiplies correctly.
Eli Friedman [Wed, 18 Jan 2017 23:56:42 +0000 (23:56 +0000)]
[SCEV] Make getUDivExactExpr handle non-nuw multiplies correctly.

To avoid regressions, make ScalarEvolution::createSCEV a bit more
clever.

Also get rid of some useless code in ScalarEvolution::howFarToZero
which was hiding this bug.

No new testcase because it's impossible to actually expose this bug:
we don't have any in-tree users of getUDivExactExpr besides the two
functions I just mentioned, and they both dodged the problem. I'll
try to add some interesting users in a followup.

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

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

8 years agoPreserve domtree and loop-simplify for runtime unrolling.
Eli Friedman [Wed, 18 Jan 2017 23:26:37 +0000 (23:26 +0000)]
Preserve domtree and loop-simplify for runtime unrolling.

Mostly straightforward changes; we just didn't do the computation before.
One sort of interesting change in LoopUnroll.cpp: we weren't handling
dominance for children of the loop latch correctly, but
foldBlockIntoPredecessor hid the problem for complete unrolling.

Currently punting on loop peeling; made some minor changes to isolate
that problem to LoopUnrollPeel.cpp.

Adds a flag -unroll-verify-domtree; it verifies the domtree immediately
after we finish updating it. This is on by default for +Asserts builds.

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

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

8 years agoTreat segment [B, E) as not overlapping block with boundaries [A, B)
Krzysztof Parzyszek [Wed, 18 Jan 2017 23:12:19 +0000 (23:12 +0000)]
Treat segment [B, E) as not overlapping block with boundaries [A, B)

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

8 years ago[Hexagon] Remove dead defs from the live set when expanding wstores
Krzysztof Parzyszek [Wed, 18 Jan 2017 23:11:40 +0000 (23:11 +0000)]
[Hexagon] Remove dead defs from the live set when expanding wstores

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

8 years agoRevert r291670 because it introduces a crash.
Michael Kuperstein [Wed, 18 Jan 2017 23:05:58 +0000 (23:05 +0000)]
Revert r291670 because it introduces a crash.

r291670 doesn't crash on the original testcase from PR31589,
but it crashes on a slightly more complex one.

PR31589 has the new reproducer.

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

8 years agoImprove the `-filter-print-funcs` option to skip the banner for CGSCC pass when nothi...
Mehdi Amini [Wed, 18 Jan 2017 21:37:11 +0000 (21:37 +0000)]
Improve the `-filter-print-funcs` option to skip the banner for CGSCC pass when nothing is to be printed

Before, it would print a sequence of:

  *** IR Dump After Function Integration/Inlining ******
  *** IR Dump After Function Integration/Inlining ******
  *** IR Dump After Function Integration/Inlining ******
  ...

for every single function in the module.

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

8 years ago[InstCombine] add tests for shl nsw with icmp eq/ne; NFCI
Sanjay Patel [Wed, 18 Jan 2017 21:31:21 +0000 (21:31 +0000)]
[InstCombine] add tests for shl nsw with icmp eq/ne; NFCI

These should be fixed with D28406.

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

8 years ago[InstCombine] add an assert to make a shl+icmp transform assumption explicit; NFCI
Sanjay Patel [Wed, 18 Jan 2017 21:16:12 +0000 (21:16 +0000)]
[InstCombine] add an assert to make a shl+icmp transform assumption explicit; NFCI

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

8 years ago[CodeGenPrepare] Fix a typo in the comment. NFC.
Haicheng Wu [Wed, 18 Jan 2017 21:12:10 +0000 (21:12 +0000)]
[CodeGenPrepare] Fix a typo in the comment. NFC.

encode => endcode.

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

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

8 years ago[InstCombine] remove a redundant check; NFCI
Sanjay Patel [Wed, 18 Jan 2017 20:09:59 +0000 (20:09 +0000)]
[InstCombine] remove a redundant check; NFCI

I missed deleting this check when I refactored this chunk in:
https://reviews.llvm.org/rL292260

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

8 years agoThinLTOBitcodeWriter: Clear comdats on filtered globals.
Peter Collingbourne [Wed, 18 Jan 2017 20:03:02 +0000 (20:03 +0000)]
ThinLTOBitcodeWriter: Clear comdats on filtered globals.

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

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

8 years agoCloning: Copy comdats when cloning globals.
Peter Collingbourne [Wed, 18 Jan 2017 20:02:31 +0000 (20:02 +0000)]
Cloning: Copy comdats when cloning globals.

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

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

8 years agoFix up a comment. NFC.
Michael Kuperstein [Wed, 18 Jan 2017 19:05:48 +0000 (19:05 +0000)]
Fix up a comment. NFC.

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

8 years ago[LV] Allow reductions that have several uses outside the loop
Michael Kuperstein [Wed, 18 Jan 2017 19:02:52 +0000 (19:02 +0000)]
[LV] Allow reductions that have several uses outside the loop

We currently check whether a reduction has a single outside user. We don't
really need to require that - we just need to make sure a single value is
used externally. The number of external users of that value shouldn't actually
matter.

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

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

8 years agocmake: Only sanitize use-after-scope if the host compiler supports it
Justin Bogner [Wed, 18 Jan 2017 19:01:58 +0000 (19:01 +0000)]
cmake: Only sanitize use-after-scope if the host compiler supports it

In r292256, we started adding -fsanitize-use-after-scope when using
the address sanitizer, but that flag wasn't always available. This
fixes the config to only add the flag if the host compiler supports
it.

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

8 years ago[AArch64] Generate literals by the little end
Evandro Menezes [Wed, 18 Jan 2017 18:57:08 +0000 (18:57 +0000)]
[AArch64] Generate literals by the little end

ARM seems to prefer that long literals be formed from their little end in
order to promote the fusion of the instrs pairs MOV/MOVK and MOVK/MOVK on
Cortex A57 and others (v.  "Cortex A57 Software Optimisation Guide", section
4.14).

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

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

8 years ago[NewGVN] We don't use postdom info anymore. Update.
Davide Italiano [Wed, 18 Jan 2017 18:42:28 +0000 (18:42 +0000)]
[NewGVN] We don't use postdom info anymore. Update.

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

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

8 years ago[ThinLTO] Add a recursive step in Metadata lazy-loading
Mehdi Amini [Wed, 18 Jan 2017 18:36:21 +0000 (18:36 +0000)]
[ThinLTO] Add a recursive step in Metadata lazy-loading

Summary:
Without this, we're stressing the RAUW of unique nodes,
which is a costly operation. This is intended to limit
the number of RAUW, and is very effective on the total
link-time of opt with ThinLTO, before:

  real 4m4.587s  user 15m3.401s  sys 0m23.616s

after:

  real 3m25.261s user 12m22.132s sys 0m24.152s

Reviewers: tejohnson, pcc

Subscribers: llvm-commits

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

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

8 years ago[lit] Support sharding testsuites, for parallel execution.
Graydon Hoare [Wed, 18 Jan 2017 18:12:20 +0000 (18:12 +0000)]
[lit] Support sharding testsuites, for parallel execution.

Summary:
This change equips lit.py with two new options, --num-shards=M and
--run-shard=N (set by default from env vars LIT_NUM_SHARDS and LIT_RUN_SHARD).

The options must be used together, and N must be in 1..M.

Together these options effect only test selection: they partition the testsuite
into M equal-sized "shards", then select only the Nth shard. They can be used
in a cluster of test machines to achieve a very crude (static) form of
parallelism, with minimal configuration work.

Reviewers: modocache, ddunbar

Reviewed By: ddunbar

Subscribers: llvm-commits

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

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

8 years ago[SLP] Add a tests for a fix for PR30787.
Alexey Bataev [Wed, 18 Jan 2017 18:07:46 +0000 (18:07 +0000)]
[SLP] Add a tests for a fix for PR30787.

Add a test for PR30787: Failure to beneficially vectorize 'copyable'
elements in integer binary ops.

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

8 years ago[AMDGPU] Do not allow register coalescer to create big superregs
Stanislav Mekhanoshin [Wed, 18 Jan 2017 17:30:05 +0000 (17:30 +0000)]
[AMDGPU] Do not allow register coalescer to create big superregs

Limit register coalescer by not allowing it to artificially increase
size of registers beyond dword. Such super-registers are in fact
register sequences and not distinct HW registers.

With more super-regs we would need to allocate adjacent registers
and constraint regalloc more than needed. Moreover, our super
registers are overlapping. For instance we have VGPR0_VGPR1_VGPR2,
VGPR1_VGPR2_VGPR3, VGPR2_VGPR3_VGPR4 etc, which complicates registers
allocation even more, resulting in excessive spilling.

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

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

8 years agoGlobalISel: Implement narrowing for G_STORE
Justin Bogner [Wed, 18 Jan 2017 17:29:54 +0000 (17:29 +0000)]
GlobalISel: Implement narrowing for G_STORE

Legalize stores of types that are too wide by breaking them up into
sequences of smaller stores.

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

8 years agoGlobalISel: Correct copy-pasted comment. NFC
Justin Bogner [Wed, 18 Jan 2017 17:28:41 +0000 (17:28 +0000)]
GlobalISel: Correct copy-pasted comment. NFC

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

8 years agoDon't create a comdat group for a dropped def with initializer
Teresa Johnson [Wed, 18 Jan 2017 16:58:43 +0000 (16:58 +0000)]
Don't create a comdat group for a dropped def with initializer

Non-prevailing weak/linkonce odr symbols will be dropped by ThinLTO to
available_externally when possible. If they had an initializer in the
global_ctors list, a comdat group was being created. This code
already had logic to skip available_externally defs, but now the
EliminateAvailableExternally pass will drop these symbols to
declarations earlier. Change the check to skip all declarations for
linker (which includes available_externally along with declarations).

Reviewers: mehdi_amini

Subscribers: llvm-commits

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

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

8 years agoRevert 292404 due to buildbot failures.
Kirill Bobyrev [Wed, 18 Jan 2017 16:34:25 +0000 (16:34 +0000)]
Revert 292404 due to buildbot failures.

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

8 years ago[X86] Minor code cleanup to fix several clang-tidy warnings. NFC
Kirill Bobyrev [Wed, 18 Jan 2017 16:15:47 +0000 (16:15 +0000)]
[X86] Minor code cleanup to fix several clang-tidy warnings. NFC

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

8 years ago[ARM] Create SubtargetFeatures from build attrs
Sam Parker [Wed, 18 Jan 2017 15:52:11 +0000 (15:52 +0000)]
[ARM] Create SubtargetFeatures from build attrs

An ELFObjectFile can now create SubtargetFeatures from the available
ARM build attributes, in a similar manner to MIPS. I've moved the
MIPS code into its own function and the ARM handler also has a
separate function.

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

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

8 years agoraw_fd_ostream: Make file handles non-inheritable by default
Pavel Labath [Wed, 18 Jan 2017 15:46:50 +0000 (15:46 +0000)]
raw_fd_ostream: Make file handles non-inheritable by default

Summary:
This makes the file descriptors on unix platform non-inheritable (O_CLOEXEC).

There is no change in behavior on windows, as the handles were already
non-inheritable there.

Reviewers: rnk, rafael

Subscribers: llvm-commits, mgorny

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

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

8 years ago[Assembler] Fix crash when assembling .quad for AArch32.
Chad Rosier [Wed, 18 Jan 2017 15:02:54 +0000 (15:02 +0000)]
[Assembler] Fix crash when assembling .quad for AArch32.

A 64-bit relocation does not exist in 32-bit ARMELF. Report an error
instead of crashing.

PR23870
Patch by Sanne Wouda (sanwou01).
Differential Revision: https://reviews.llvm.org/D28851

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

8 years ago[thumb,framelowering] Reset NoVRegs in Thumb1FrameLowering::emitPrologue.
Florian Hahn [Wed, 18 Jan 2017 15:01:22 +0000 (15:01 +0000)]
[thumb,framelowering] Reset NoVRegs in Thumb1FrameLowering::emitPrologue.

Summary:
In this function, virtual registers can be introduced (for example
through calls to emitThumbRegPlusImmInReg). doScavengeFrameVirtualRegs
will replace those virtual registers with concrete registers later on
in PrologEpilogInserter, which sets NoVRegs again.

This patch fixes the Codegen/Thumb/segmented-stacks.ll test case which
failed with expensive checks.
https://llvm.org/bugs/show_bug.cgi?id=27484

Reviewers: rnk, bkramer, olista01

Reviewed By: olista01

Subscribers: llvm-commits, rengolin

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

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