Commit Graph

128113 Commits

Author SHA1 Message Date
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
Duncan P. N. Exon Smith
20a62528ef Revert "CodeGen: MachineInstr::getIterator() => getInstrIterator(), NFC"
This reverts commit r261504, since it's not obvious the new name is
better:
http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20160222/334298.html

I'll recommit if we get consensus that it's the right direction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261567 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-22 20:49:58 +00:00
Dan Gohman
e1553a649a [WebAssembly] Re-enable the TailDuplicate pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261566 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-22 20:47:12 +00:00
Philip Reames
a40db4f634 [RS4GC] Revert optimization attempt due to memory corruption
This change reverts "246133 [RewriteStatepointsForGC] Reduce the number of new instructions for base pointers" and a follow on bugfix 12575.

As pointed out in pr25846, this code suffers from a memory corruption bug.  Since I'm (empirically) not going to get back to this any time soon, simply reverting the problematic change is the right answer.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261565 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-22 20:45:56 +00:00
JF Bastien
4a8755bfe6 WebAssembly: update expected failures
clang r261557 lowers va_arg in clang.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261564 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-22 20:37:34 +00:00
Dan Gohman
1b10833563 [WebAssembly] Teach address folding to fold bitwise-or nodes.
LLVM converts adds into ors when it can prove that the operands don't share
any non-zero bits. Teach address folding to recognize or instructions with
constant operands with this property that can be folded into addresses as
if they were adds.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261562 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-22 20:04:02 +00:00
Tom Stellard
1d53227930 [AMDGPU][llvm-mc] Support for 32-bit inline literals
Patch by: Artem Tamazov

Summary:
Note: Support for 64-bit inline literals TBD
Added: Support of abs/neg modifiers for literals (incomplete; parsing TBD).
Added: Some TODO comments.
Reworked/clarity: rename isInlineImm() to isInlinableImm()
Reworked/robustness: disallow BitsToFloat() with undefined value in isInlinableImm()
Reworked/reuse: isSSrc32/64(), isVSrc32/64()
Tests added.

Reviewers: tstellarAMD, arsenm

Subscribers: vpykhtin, nhaustov, SamWot, arsenm

Projects: #llvm-amdgpu-spb

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261559 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-22 19:17:56 +00:00
Tom Stellard
52b2fdbe17 [AMDGPU] [llvm-mc] [VI] Fix encoding of LDS/GDS instructions.
Patch by: Artem Tamazov

Summary: Tests added.

Reviewers: tstellarAMD, arsenm

Subscribers: vpykhtin, SamWot, #llvm-amdgpu-spb

Projects: #llvm-amdgpu-spb

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261558 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-22 19:17:53 +00:00
Tom Stellard
58ca760083 docs/AMDGPUUsage: Update assembly example
Reviewers: arsenm, nhaustov

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261550 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-22 18:36:00 +00:00
Justin Lebar
0bbc549035 Revert "[attrs] Handle convergent CallSites."
This reverts r261544, which was causing a test failure in
Transforms/FunctionAttrs/readattrs.ll.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261549 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-22 18:24:43 +00:00
Justin Lebar
406b3fe7ae Revert "[ifcnv] Add comment explaining why it's OK to duplicate convergent MIs in ifcnv."
This reverts r261543.  Accidental commit (not LGTM'ed).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261547 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-22 18:17:27 +00:00
Nemanja Ivanovic
94db889776 Fix for PR26690 take 2
This is what was meant to be in the initial commit to fix this bug. The
parens were missing. This commit also adds a test case for the bug and
has undergone full testing on PPC and X86.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261546 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-22 18:04:00 +00:00
Justin Lebar
4644890a51 [attrs] Handle convergent CallSites.
Summary:
Previously we had a notion of convergent functions but not of convergent
calls.  This is insufficient to correctly analyze calls where the target
is unknown, e.g. indirect calls.

Now a call is convergent if it targets a known-convergent function, or
if it's explicitly marked as convergent.  As usual, we can remove
convergent where we can prove that no convergent operations are
performed in the call.

Reviewers: chandlerc, jingyue

Subscribers: hfinkel, jhen, tra, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261544 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-22 17:51:35 +00:00
Justin Lebar
4485e598b6 [ifcnv] Add comment explaining why it's OK to duplicate convergent MIs in ifcnv.
Summary:
Also add a comment briefly explaining what ifcnv is.

No functional changes.

Reviewers: resistor

Subscribers: echristo, tra, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261543 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-22 17:51:30 +00:00
Justin Lebar
d1a3737547 [ifcnv] Use unique_ptr in IfConversion. NFC
Reviewers: rnk

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261541 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-22 17:51:28 +00:00
Justin Lebar
6aa1e32f4a Don't tail-duplicate blocks that contain convergent instructions.
Summary:
Convergent instrs shouldn't be made control-dependent on other values,
but this is basically the whole point of tail duplication.  So just bail
if we see a convergent instruction.

Reviewers: iteratee

Subscribers: jholewinski, jhen, hfinkel, tra, jingyue, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261540 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-22 17:50:52 +00:00
Dan Gohman
125ad6e3d9 [WebAssembly] Properly ignore llvm.dbg.value instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261538 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-22 17:45:20 +00:00
Sanjoy Das
e9d736f57c [ConstantRange] Rename a method and add more doc
Rename makeNoWrapRegion to a more obvious makeGuaranteedNoWrapRegion,
and add a comment about the counter-intuitive aspects of the function.
This is to help prevent cases like PR26628.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261532 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-22 16:13:02 +00:00
Zoran Jovanovic
5fa0e4be6e [mips] added support for trunc macro
Author: obucina
Reviewers: dsanders
Differential Revision: http://reviews.llvm.org/D15745


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261529 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-22 16:00:23 +00:00
Nemanja Ivanovic
485b73c671 Revert bad fix for PR26690.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261527 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-22 15:06:32 +00:00
Nemanja Ivanovic
6bf5860c4e Fix for PR26690
I mistook BitVector::empty() to mean BitVector::count() == 0 and it does
not. Corrected the issue with the fix for PR26500.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261525 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-22 14:47:49 +00:00
Benjamin Kramer
b0ce7c7fb5 Fix some abuse of auto flagged by clang's -Wrange-loop-analysis.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261524 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-22 13:11:58 +00:00
Igor Breger
54e0fe8d68 AVX512F: Add assembler Intel syntax tests for knl, fix minor bugs.
Differential Revision: http://reviews.llvm.org/D17498

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261521 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-22 12:37:41 +00:00
Igor Breger
2ec70dbae0 AVX512: Fix scalar mem operands.
Differential Revision: http://reviews.llvm.org/D17500

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261520 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-22 11:48:27 +00:00
Elena Demikhovsky
8659296d0e Allow setting MaxRerollIterations above 16
By Ayal Zaks.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261517 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-22 09:38:28 +00:00
Craig Topper
3e936408dd [X86] Minor formatting fix. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261515 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-22 08:00:04 +00:00