Commit Graph

128338 Commits

Author SHA1 Message Date
Derek Schuff
64f8810499 [WebAssembly] Stackify code emitted by eliminateFrameIndex
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261685 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-23 21:25:17 +00:00
Chris Bieneman
1a938125ac [CMake] Create an install-distribution target driven by LLVM_DISTRIBUTION_COMPONENTS
The idea here is to provide a customizable install target that only depends on building the things you actually want to install. It relies on each component being installed having an auto-generated install-${component}, which in turn depends only on the target being installed.

This is fundamentally a workaround for the fact that CMake generates build files which have their "install" target depend on the "all" target. This results in "ninja install" building a bunch of unneeded things.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261681 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-23 20:33:53 +00:00
Tim Northover
401c43dfc3 ARM: fix handling of movw/movt relocations with addend.
We were emitting only one half of a the paired relocations needed for these
instructions because we decided that an offset needed a scattered relocation.
In fact, movw/movt relocations can be paired without being scattered.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261679 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-23 20:20:23 +00:00
Geoff Berry
54db5571ec [AArch64] Generate csinv instruction more often
Reviewers: t.p.northover, jmolloy

Subscribers: aemerson, rengolin, mcrosier, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261675 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-23 19:34:13 +00:00
Xinliang David Li
2c17b9c60c Fix comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261672 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-23 19:18:21 +00:00
Hans Wennborg
fab353bdc4 Revert r261633 "Supporting all entities declared in lexical scope in LLVM debug info."
This and the corresponding Clang change caused PR26715.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261671 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-23 19:17:03 +00:00
Davide Italiano
f93279bef6 [X86ISelLowering] Stop typing the same return over and over and over.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261666 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-23 18:39:38 +00:00
Weiming Zhao
c922999776 Fix PR25339: ARM Constant Island
Summary:
Currently, the ARM Constant Island may not converge (or not converge quickly).
This patch let it move to the closest water after the user if it doesn't converge after 15 iterations.

This address https://llvm.org/bugs/show_bug.cgi?id=25339

Reviewers: t.p.northover, srhines, kristof.beyls, aadg, rengolin

Subscribers: weimingz, aemerson, rengolin, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261665 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-23 18:39:19 +00:00
Derek Schuff
c15325e5a1 [WebAssembly] Add TODO comment to revisit red zone size
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261664 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-23 18:17:46 +00:00
Derek Schuff
8ff73c1307 [WebAssembly] Implement red zone for user stack
Implements a mostly-conventional redzone for the userspace
stack. Because we have unsigned load/store offsets we continue to use a
local SP subtracted from the incoming SP but do not write it back to
memory.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261662 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-23 18:13:07 +00:00
Sanjay Patel
7126878363 [InstCombine] improve readability ; NFCI
Less indenting, named local variables, more descriptive names.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261659 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-23 17:41:34 +00:00
David Majnemer
e759b51ef4 [WinEH] Don't inline an 'unwinds to caller' cleanupret into funclets which locally unwind
It is problematic if the inlinee has a cleanupret which unwinds to
caller and we inline it into a call site which doesn't unwind.

If the funclet unwinds anywhere other than to the caller,
then we will give the funclet two unwind destinations.
This will result in a verifier failure.

Seeing as how the caller wasn't an invoke (which would locally unwind)
and that the funclet cannot unwind to caller, we must conclude that an
'unwind to caller' cleanupret is dynamically unreachable.

This fixes PR26698.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261656 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-23 17:11:04 +00:00
Sanjay Patel
a10a4f18bf [InstCombine] less indenting; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261652 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-23 16:59:21 +00:00
Geoff Berry
58820d4f87 [AArch64] Fix fastcc -tailcallopt epilog code generation.
Summary:
Fix a bug in epilog generation where the incoming stack arguments were
not being popped for fastcc functions when -tailcallopt was passed.

Reviewers: t.p.northover, mcrosier, jmolloy, rengolin

Subscribers: aemerson, rengolin, mcrosier, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261650 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-23 16:54:36 +00:00
Sanjay Patel
81780147e7 [InstCombine] add helper function to foldCastedBitwiseLogic() ; NFCI
This is a straight cut and paste of the existing code and is intended to
be the first step in solving part of PR26702:
https://llvm.org/bugs/show_bug.cgi?id=26702

We should be able to reuse most of this and delete the nearly identical 
existing code in visitOr(). Then, we can enhance visitXor() to use the
same code too.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261649 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-23 16:36:07 +00:00
Aaron Ballman
6d92f5b545 Silencing a signed vs unsigned mismatch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261640 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-23 15:02:43 +00:00
Chad Rosier
6828fd91e9 [AArch64] Fix comment typo in Cyclone scheduling defs. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261637 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-23 14:05:13 +00:00
Amjad Aboud
8b94b3a579 Supporting all entities declared in lexical scope in LLVM debug info.
Differential Revision: http://reviews.llvm.org/D15976

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261633 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-23 13:36:51 +00:00
Alexander Kornienko
afd87a0008 Remove a space after a trailing backslash.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261629 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-23 11:19:56 +00:00
Sylvestre Ledru
887de490bd fix the indentation of the example
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261628 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-23 11:17:27 +00:00
Chandler Carruth
e648c53c5c [PM] Remove an overly aggressive assert now that I can actually test the
pattern that triggers it. This essentially requires an immutable
function analysis, as that will survive anything we do to invalidate it.
When we have such patterns, the function analysis manager will not get
cleared between runs of the proxy.

If we actually need an assert about how things are queried, we can add
more elaborate machinery for computing it, but so far I'm not aware of
significant value provided.

Thanks to Justin Lebar for noticing this when he made a (seemingly
innocuous) change to FunctionAttrs that is enough to trigger it in one
test there. Now it is covered by a direct test of the pass manager code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261627 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-23 10:47:57 +00:00
Chandler Carruth
3530d284cd [PM] Add a unittest for the CGSCC pass manager in the new pass manager
system.

Previously, this was only being tested with larger integration tests.
That makes it hard to isolated specific issues with it, and makes the
APIs themselves less well tested. Add a unittest based around the same
patterns used for testing the general pass manager.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261624 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-23 10:02:02 +00:00
Junmo Park
b2eca29685 [ARM] fix initialization of PredictableSelectIsExpensive
Summary:
If we want classify OoO or not, using getSchedModel().isOutOfOrder()
could be more proper way than using Subtarget->isLikeA9().

Reviewers: jmolloy, rengolin

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261623 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-23 09:56:58 +00:00
Nikolay Haustov
0e5677e2b4 [AMDGPU] Fix operands of S_BFE_U64 and S_BFM_B64
src1 of s_bfe_u64 is 32-bit (same as s_bfe_i64).
src0 and src1 of s_bfm_b64 are 32-bit.
Update tests.

Review: http://reviews.llvm.org/D17480

Reviewers: arsenm

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261621 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-23 09:19:14 +00:00
Igor Breger
ec0406b1e1 AVX512: Fix predicate of AVX pcmpeqw/b , pcmpgtb/w/d instructions . AVX512 version of this instructions return result in kmask register, so AVX patterns should not be disabled.
Differential Revision: http://reviews.llvm.org/D17517

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261619 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-23 08:55:33 +00:00
David Majnemer
d7746920fa [WinEH] Visit 'unwind to caller' catchswitches nested in catchswitches
We had the right logic for the nested cleanuppad case but omitted it for
catchswitches.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261615 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-23 07:18:15 +00:00
Yaron Keren
e5636de5ec Assert when trying to seek un-seekable raw_fd_ostream.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261614 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-23 07:17:58 +00:00
Dehao Chen
5261d1373d Add prefix based function layout when profile is available.
Summary: If a function is hot, put it in text.hot section.

Reviewers: davidxl

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261607 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-23 03:39:24 +00:00
Duncan P. N. Exon Smith
5b9b80ea30 CodeGen: TII: Take MachineInstr& in predicate API, NFC
Change TargetInstrInfo API to take `MachineInstr&` instead of
`MachineInstr*` in the functions related to predicated instructions
(I'll try to come back later and get some of the rest).  All of these
functions require non-null parameters already, so references are more
clear.  As a bonus, this happens to factor away a host of implicit
iterator => pointer conversions.

No functionality change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261605 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-23 02:46:52 +00:00
Duncan P. N. Exon Smith
d6f29696e2 Revert "Add prefix based function layout when profile is available."
This reverts commit r261582, since this bot has been broken for four
hours:
http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-incremental_check/19399/

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261604 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-23 02:28:40 +00:00
Michael Zolotukhin
df3c5e0ad6 Follow up for r261597: Add the * to the auto.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261600 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-23 00:57:48 +00:00
Michael Zolotukhin
977fb4cb98 Follow-up for r261595: use range loop.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261597 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-23 00:48:44 +00:00
Michael Zolotukhin
7da6d8d393 [LoopUnroll] Avoid unnecessary DT recomputation.
Summary:
When we completely unroll a loop, it's pretty easy to update DT in-place and
thus avoid rebuilding it. DT recalculation is one of the most time-consuming
tasks in loop-unroll, so avoiding it at least in case of full unroll should be
beneficial.

On some extreme (but still real-world) tests this patch improves compile time by
~2x.

Reviewers: escha, jmolloy, hfinkel, sanjoy, chandlerc

Subscribers: joker.eph, sanjoy, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261595 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-23 00:30:50 +00:00
Chandler Carruth
73ba9bfc2e [PM] Improve the API and comments around the analysis manager proxies.
These are really handles that ensure the analyses get cleared at
appropriate places, and as such copying doesn't really make sense.
Instead, they should look more like unique ownership objects. Make that
the case.

Relatedly, if you create a temporary of one and move out of it
its destructor shouldn't actually clear anything. I don't think there is
any code that can trigger this currently, but it seems like a more
robust implementation.

If folks want, I can add a unittest that forces this to be exercised,
but that seems somewhat pointless -- whether a temporary is ever created
in the innards of AnalysisManager is not really something we should be
adding a reliance on, but I didn't want to leave a timebomb in the code
here.

If anyone has a cleaner way to represent this, I'm all ears, but
I wanted to assure myself that this wasn't in fact responsible for
another bug I'm chasing down (it wasn't) and figured I'd commit that.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261594 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-23 00:05:00 +00:00
Matt Arsenault
4a5938727a AMDGPU: Add failing testcase for register coalescer
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261592 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-22 23:45:42 +00:00
Krzysztof Parzyszek
30f366d087 More detailed dependence test between volatile and non-volatile accesses
Differential Revision: http://reviews.llvm.org/D16857



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261589 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-22 23:07:43 +00:00
Dehao Chen
2be99e439c Include ProfileData as CodeGen's required library.
Summary: Fixing buildbot failure introduced by http://reviews.llvm.org/D17460

Reviewers: davidxl, hans

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261588 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-22 22:54:14 +00:00
Dehao Chen
be55cfa5fd Set function entry count as 0 if sample profile is not found for the function.
Summary: This change makes the sample profile's behavior consistent with instr profile.

Reviewers: davidxl, eraman, dnovillo

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261587 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-22 22:46:21 +00:00
David Majnemer
b23b0fffbc [X86] Create mergeable constant pool entries for AVX
We supported creating mergeable constant pool entries for smaller
constants but not for 32-byte AVX constants.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261584 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-22 22:23:11 +00:00
Dehao Chen
c1ae1f5b84 Add prefix based function layout when profile is available.
Summary: If a function is hot, put it in text.hot section.

Reviewers: davidxl

Subscribers: eraman, mcrosier, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261582 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-22 22:14:14 +00:00
Matt Arsenault
c97b66787e SelectionDAG: Use correct addrspace when lowering memcpy
This was causing assertions later from using the wrong pointer
size with LDS operations. getOptimalMemOpType should also have
address space arguments later.

This avoids assertions in existing tests exposed by
a future commit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261580 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-22 22:01:42 +00:00
Derek Schuff
718d992d1f [WebAssembly] Fix writeback of stack pointer with dynamic alloca
Previously the stack pointer was only written back to memory in the
prolog. But this is wrong for dynamic allocas, for which
target-independent codegen handles SP updates after the prolog (and
possibly even in another BB). Instead update the SP global in
ADJCALLSTACKDOWN which is generated after the SP update sequence.
This will have further refinements when we add red zone support.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261579 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-22 21:57:17 +00:00
Adam Nemet
fddbd94e1d [LoopDataPrefetch] Make it testable with opt
Summary:
Since this is an IR pass it's nice to be able to write tests without
llc.  This is the counterpart of the llc test under
CodeGen/PowerPC/loop-data-prefetch.ll.

Reviewers: hfinkel

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261578 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-22 21:41:22 +00:00
Duncan P. N. Exon Smith
110284e56c CodeGen: Bring back MachineBasicBlock::iterator::getInstrIterator()...
This is a little embarrassing.

When I reverted r261504 (getIterator() => getInstrIterator()) in
r261567, I did a `git grep` to see if there were new calls to
`getInstrIterator()` that I needed to migrate.  There were 10-20 hits,
and I blindly did a `sed ...` before calling `ninja check`.

However, these were `MachineInstrBundleIterator::getInstrIterator()`,
which predated r261567.  Perhaps coincidentally, these had an identical
name and return type.

This commit undoes my careless sed and restores
`MachineBasicBlock::iterator::getInstrIterator()`.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261577 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-22 21:30:15 +00:00
Michael Zolotukhin
0070b261d7 [LoopUnrolling] Fix a bug introduced in r259869 (PR26688).
The issue was that we only required LCSSA rebuilding if the immediate
parent-loop had values used outside of it. The fix is to enaable the
same logic for all outer loops, not only immediate parent.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261575 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-22 21:21:45 +00:00
Davide Italiano
cd25a02e5e [X86ISelLowering] Consolidate duplicated code in a single place.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261573 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-22 21:06:46 +00:00
Matt Arsenault
e518fdc6db AMDGPU: Fix alignments in test
I don't think this test was intending to test unaligned load/store.
Change it to use the natural alignment to avoid regressing.

Also adds missing SI checks.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261571 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-22 21:04:23 +00:00
Matt Arsenault
2f65ff664c AMDGPU/R600: Implement allowsMisalignedMemoryAccess
This avoids some test regressions in a future commit
when unaligned operations are expanded when they
have custom lowering.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261570 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-22 21:04:16 +00:00
Philip Reames
b11315c0e5 [RS4GC] "Constant fold" the rs4gc-split-vector-values flag
This flag was part of a migration to a new means of handling vectors-of-points which was described in the llvm-dev thread "FYI: Relocating vector of pointers".  The old code path has been off by default for a while without complaints, so time to cleanup.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261569 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-22 21:01:28 +00:00
Tim Northover
dc0c75dcb1 ARM: sink atomic release barrier as far as possible into cmpxchg.
DMB instructions can be expensive, so it's best to avoid them if possible. In
atomicrmw operations there will always be an attempted store so a release
barrier is always needed, but in the cmpxchg case we can delay the DMB until we
know we'll definitely try to perform a store (and so need release semantics).

In the strong cmpxchg case this isn't quite free: we must duplicate the LDREX
instructions to skip the barrier on subsequent iterations. The basic outline
becomes:

        ldrex rOld, [rAddr]
        cmp rOld, rDesired
        bne Ldone
        dmb
    Lloop:
        strex rRes, rNew, [rAddr]
        cbz rRes Ldone
        ldrex rOld, [rAddr]
        cmp rOld, rDesired
        beq Lloop
    Ldone:

So we'll skip this version for strong operations in "minsize" functions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261568 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-22 20:55:50 +00:00