OSDN Git Service

android-x86/external-llvm.git
8 years agofix the indentation of the example
Sylvestre Ledru [Tue, 23 Feb 2016 11:17:27 +0000 (11:17 +0000)]
fix the indentation of the example

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

8 years ago[PM] Remove an overly aggressive assert now that I can actually test the
Chandler Carruth [Tue, 23 Feb 2016 10:47:57 +0000 (10:47 +0000)]
[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

8 years ago[PM] Add a unittest for the CGSCC pass manager in the new pass manager
Chandler Carruth [Tue, 23 Feb 2016 10:02:02 +0000 (10:02 +0000)]
[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

8 years ago[ARM] fix initialization of PredictableSelectIsExpensive
Junmo Park [Tue, 23 Feb 2016 09:56:58 +0000 (09:56 +0000)]
[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

8 years ago[AMDGPU] Fix operands of S_BFE_U64 and S_BFM_B64
Nikolay Haustov [Tue, 23 Feb 2016 09:19:14 +0000 (09:19 +0000)]
[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

8 years agoAVX512: Fix predicate of AVX pcmpeqw/b , pcmpgtb/w/d instructions . AVX512 version...
Igor Breger [Tue, 23 Feb 2016 08:55:33 +0000 (08:55 +0000)]
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

8 years ago[WinEH] Visit 'unwind to caller' catchswitches nested in catchswitches
David Majnemer [Tue, 23 Feb 2016 07:18:15 +0000 (07:18 +0000)]
[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

8 years agoAssert when trying to seek un-seekable raw_fd_ostream.
Yaron Keren [Tue, 23 Feb 2016 07:17:58 +0000 (07:17 +0000)]
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

8 years agoAdd prefix based function layout when profile is available.
Dehao Chen [Tue, 23 Feb 2016 03:39:24 +0000 (03:39 +0000)]
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

8 years agoCodeGen: TII: Take MachineInstr& in predicate API, NFC
Duncan P. N. Exon Smith [Tue, 23 Feb 2016 02:46:52 +0000 (02:46 +0000)]
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

8 years agoRevert "Add prefix based function layout when profile is available."
Duncan P. N. Exon Smith [Tue, 23 Feb 2016 02:28:40 +0000 (02:28 +0000)]
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

8 years agoFollow up for r261597: Add the * to the auto.
Michael Zolotukhin [Tue, 23 Feb 2016 00:57:48 +0000 (00:57 +0000)]
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

8 years agoFollow-up for r261595: use range loop.
Michael Zolotukhin [Tue, 23 Feb 2016 00:48:44 +0000 (00:48 +0000)]
Follow-up for r261595: use range loop.

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

8 years ago[LoopUnroll] Avoid unnecessary DT recomputation.
Michael Zolotukhin [Tue, 23 Feb 2016 00:30:50 +0000 (00:30 +0000)]
[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

8 years ago[PM] Improve the API and comments around the analysis manager proxies.
Chandler Carruth [Tue, 23 Feb 2016 00:05:00 +0000 (00:05 +0000)]
[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

8 years agoAMDGPU: Add failing testcase for register coalescer
Matt Arsenault [Mon, 22 Feb 2016 23:45:42 +0000 (23:45 +0000)]
AMDGPU: Add failing testcase for register coalescer

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

8 years agoMore detailed dependence test between volatile and non-volatile accesses
Krzysztof Parzyszek [Mon, 22 Feb 2016 23:07:43 +0000 (23:07 +0000)]
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

8 years agoInclude ProfileData as CodeGen's required library.
Dehao Chen [Mon, 22 Feb 2016 22:54:14 +0000 (22:54 +0000)]
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

8 years agoSet function entry count as 0 if sample profile is not found for the function.
Dehao Chen [Mon, 22 Feb 2016 22:46:21 +0000 (22:46 +0000)]
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

8 years ago[X86] Create mergeable constant pool entries for AVX
David Majnemer [Mon, 22 Feb 2016 22:23:11 +0000 (22:23 +0000)]
[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

8 years agoAdd prefix based function layout when profile is available.
Dehao Chen [Mon, 22 Feb 2016 22:14:14 +0000 (22:14 +0000)]
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

8 years agoSelectionDAG: Use correct addrspace when lowering memcpy
Matt Arsenault [Mon, 22 Feb 2016 22:01:42 +0000 (22:01 +0000)]
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

8 years ago[WebAssembly] Fix writeback of stack pointer with dynamic alloca
Derek Schuff [Mon, 22 Feb 2016 21:57:17 +0000 (21:57 +0000)]
[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

8 years ago[LoopDataPrefetch] Make it testable with opt
Adam Nemet [Mon, 22 Feb 2016 21:41:22 +0000 (21:41 +0000)]
[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

8 years agoCodeGen: Bring back MachineBasicBlock::iterator::getInstrIterator()...
Duncan P. N. Exon Smith [Mon, 22 Feb 2016 21:30:15 +0000 (21:30 +0000)]
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

8 years ago[LoopUnrolling] Fix a bug introduced in r259869 (PR26688).
Michael Zolotukhin [Mon, 22 Feb 2016 21:21:45 +0000 (21:21 +0000)]
[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

8 years ago[X86ISelLowering] Consolidate duplicated code in a single place.
Davide Italiano [Mon, 22 Feb 2016 21:06:46 +0000 (21:06 +0000)]
[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

8 years agoAMDGPU: Fix alignments in test
Matt Arsenault [Mon, 22 Feb 2016 21:04:23 +0000 (21:04 +0000)]
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

8 years agoAMDGPU/R600: Implement allowsMisalignedMemoryAccess
Matt Arsenault [Mon, 22 Feb 2016 21:04:16 +0000 (21:04 +0000)]
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

8 years ago[RS4GC] "Constant fold" the rs4gc-split-vector-values flag
Philip Reames [Mon, 22 Feb 2016 21:01:28 +0000 (21:01 +0000)]
[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

8 years agoARM: sink atomic release barrier as far as possible into cmpxchg.
Tim Northover [Mon, 22 Feb 2016 20:55:50 +0000 (20:55 +0000)]
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

8 years agoRevert "CodeGen: MachineInstr::getIterator() => getInstrIterator(), NFC"
Duncan P. N. Exon Smith [Mon, 22 Feb 2016 20:49:58 +0000 (20:49 +0000)]
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

8 years ago[WebAssembly] Re-enable the TailDuplicate pass.
Dan Gohman [Mon, 22 Feb 2016 20:47:12 +0000 (20:47 +0000)]
[WebAssembly] Re-enable the TailDuplicate pass.

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

8 years ago[RS4GC] Revert optimization attempt due to memory corruption
Philip Reames [Mon, 22 Feb 2016 20:45:56 +0000 (20:45 +0000)]
[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

8 years agoWebAssembly: update expected failures
JF Bastien [Mon, 22 Feb 2016 20:37:34 +0000 (20:37 +0000)]
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

8 years ago[WebAssembly] Teach address folding to fold bitwise-or nodes.
Dan Gohman [Mon, 22 Feb 2016 20:04:02 +0000 (20:04 +0000)]
[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

8 years ago[AMDGPU][llvm-mc] Support for 32-bit inline literals
Tom Stellard [Mon, 22 Feb 2016 19:17:56 +0000 (19:17 +0000)]
[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

8 years ago[AMDGPU] [llvm-mc] [VI] Fix encoding of LDS/GDS instructions.
Tom Stellard [Mon, 22 Feb 2016 19:17:53 +0000 (19:17 +0000)]
[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

8 years agodocs/AMDGPUUsage: Update assembly example
Tom Stellard [Mon, 22 Feb 2016 18:36:00 +0000 (18:36 +0000)]
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

8 years agoRevert "[attrs] Handle convergent CallSites."
Justin Lebar [Mon, 22 Feb 2016 18:24:43 +0000 (18:24 +0000)]
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

8 years agoRevert "[ifcnv] Add comment explaining why it's OK to duplicate convergent MIs in...
Justin Lebar [Mon, 22 Feb 2016 18:17:27 +0000 (18:17 +0000)]
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

8 years agoFix for PR26690 take 2
Nemanja Ivanovic [Mon, 22 Feb 2016 18:04:00 +0000 (18:04 +0000)]
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

8 years ago[attrs] Handle convergent CallSites.
Justin Lebar [Mon, 22 Feb 2016 17:51:35 +0000 (17:51 +0000)]
[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

8 years ago[ifcnv] Add comment explaining why it's OK to duplicate convergent MIs in ifcnv.
Justin Lebar [Mon, 22 Feb 2016 17:51:30 +0000 (17:51 +0000)]
[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

8 years ago[ifcnv] Use unique_ptr in IfConversion. NFC
Justin Lebar [Mon, 22 Feb 2016 17:51:28 +0000 (17:51 +0000)]
[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

8 years agoDon't tail-duplicate blocks that contain convergent instructions.
Justin Lebar [Mon, 22 Feb 2016 17:50:52 +0000 (17:50 +0000)]
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

8 years ago[WebAssembly] Properly ignore llvm.dbg.value instructions.
Dan Gohman [Mon, 22 Feb 2016 17:45:20 +0000 (17:45 +0000)]
[WebAssembly] Properly ignore llvm.dbg.value instructions.

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

8 years ago[ConstantRange] Rename a method and add more doc
Sanjoy Das [Mon, 22 Feb 2016 16:13:02 +0000 (16:13 +0000)]
[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

8 years ago[mips] added support for trunc macro
Zoran Jovanovic [Mon, 22 Feb 2016 16:00:23 +0000 (16:00 +0000)]
[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

8 years agoRevert bad fix for PR26690.
Nemanja Ivanovic [Mon, 22 Feb 2016 15:06:32 +0000 (15:06 +0000)]
Revert bad fix for PR26690.

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

8 years agoFix for PR26690
Nemanja Ivanovic [Mon, 22 Feb 2016 14:47:49 +0000 (14:47 +0000)]
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

8 years agoFix some abuse of auto flagged by clang's -Wrange-loop-analysis.
Benjamin Kramer [Mon, 22 Feb 2016 13:11:58 +0000 (13:11 +0000)]
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

8 years agoAVX512F: Add assembler Intel syntax tests for knl, fix minor bugs.
Igor Breger [Mon, 22 Feb 2016 12:37:41 +0000 (12:37 +0000)]
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

8 years agoAVX512: Fix scalar mem operands.
Igor Breger [Mon, 22 Feb 2016 11:48:27 +0000 (11:48 +0000)]
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

8 years agoAllow setting MaxRerollIterations above 16
Elena Demikhovsky [Mon, 22 Feb 2016 09:38:28 +0000 (09:38 +0000)]
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

8 years ago[X86] Minor formatting fix. NFC
Craig Topper [Mon, 22 Feb 2016 08:00:04 +0000 (08:00 +0000)]
[X86] Minor formatting fix. NFC

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

8 years agoUse EXPECT_EQ in the unittests instead of plain assert
Tobias Grosser [Mon, 22 Feb 2016 07:20:40 +0000 (07:20 +0000)]
Use EXPECT_EQ in the unittests instead of plain assert

This addresses post-review comments from Duncan P. N. Exon Smith to r261485.

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

8 years agoReapply "CodeGen: Use references in MachineTraceMetrics::Trace, NFC"
Duncan P. N. Exon Smith [Mon, 22 Feb 2016 03:33:28 +0000 (03:33 +0000)]
Reapply "CodeGen: Use references in MachineTraceMetrics::Trace, NFC"

This reverts commit r261510, effectively reapplying r261509.  The
original commit missed a caller in AArch64ConditionalCompares.

Original commit message:

Pass non-null arguments by reference in MachineTraceMetrics::Trace,
simplifying future work to remove implicit iterator => pointer
conversions.

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

8 years agoRevert "CodeGen: Use references in MachineTraceMetrics::Trace, NFC"
Duncan P. N. Exon Smith [Mon, 22 Feb 2016 03:12:42 +0000 (03:12 +0000)]
Revert "CodeGen: Use references in MachineTraceMetrics::Trace, NFC"

This reverts commit r261509.  I'm not sure how this compiled locally,
but something was out of whack.

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

8 years agoCodeGen: Use references in MachineTraceMetrics::Trace, NFC
Duncan P. N. Exon Smith [Mon, 22 Feb 2016 03:07:49 +0000 (03:07 +0000)]
CodeGen: Use references in MachineTraceMetrics::Trace, NFC

Pass non-null arguments by reference in MachineTraceMetrics::Trace,
simplifying future work to remove implicit iterator => pointer
conversions.

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

8 years agoCodeGen: Explicitly convert from iterator to pointer, NFC
Duncan P. N. Exon Smith [Mon, 22 Feb 2016 02:53:42 +0000 (02:53 +0000)]
CodeGen: Explicitly convert from iterator to pointer, NFC

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

8 years agoDocument assumption in X86FrameLowering::inlineStackProbe()
Duncan P. N. Exon Smith [Mon, 22 Feb 2016 02:32:35 +0000 (02:32 +0000)]
Document assumption in X86FrameLowering::inlineStackProbe()

Resolve FIXME from r261504.  Apparently bundled instructions are illegal
here:
http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20160215/334146.html

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

8 years ago[X86] More test updates to support fixup-byte-word-insts optimization
Kevin B. Smith [Mon, 22 Feb 2016 01:27:56 +0000 (01:27 +0000)]
[X86] More test updates to support fixup-byte-word-insts optimization
either on or off.
Differential Revisions: http://reviews.llvm.org/D17458

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

8 years agoCodeGen: MachineInstr::getIterator() => getInstrIterator(), NFC
Duncan P. N. Exon Smith [Sun, 21 Feb 2016 22:58:35 +0000 (22:58 +0000)]
CodeGen: MachineInstr::getIterator() => getInstrIterator(), NFC

Delete MachineInstr::getIterator(), since the term "iterator" is
overloaded when talking about MachineInstr.

- Downcast to ilist_node in iplist::getNextNode() and getPrevNode() so
  that ilist_node::getIterator() is still available.
- Add it back as MachineInstr::getInstrIterator().  This matches the
  naming in MachineBasicBlock.
- Add MachineInstr::getBundleIterator().  This is explicitly called
  "bundle" (not matching MachineBasicBlock) to disintinguish it clearly
  from ilist_node::getIterator().
- Update all calls.  Some of these I switched to `auto` to remove
  boiler-plate, since the new name is clear about the type.

There was one call I updated that looked fishy, but it wasn't clear what
the right answer was.  This was in X86FrameLowering::inlineStackProbe(),
added in r252578 in lib/Target/X86/X86FrameLowering.cpp.  I opted to
leave the behaviour unchanged, but I'll reply to the original commit on
the list in a moment.

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

8 years ago[Orc] Add stack-realignment code to the i386 resolver function.
Lang Hames [Sun, 21 Feb 2016 22:50:26 +0000 (22:50 +0000)]
[Orc] Add stack-realignment code to the i386 resolver function.

The resolver uses the fxsave/fxrstor instructions, which require 16-byte
alignment, to save SSE state to the stack. Since 16-byte alignment can't be
assumed on all OSes (and all i386 OSes share this function) - add code to
automatically bump the alignment to 16-bytes on entry to the function.

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

8 years agoCodeGen: Split bundle_iterator into a separate file, NFC
Duncan P. N. Exon Smith [Sun, 21 Feb 2016 22:05:50 +0000 (22:05 +0000)]
CodeGen: Split bundle_iterator into a separate file, NFC

Split MachineBasicBlock::bundle_iterator into a separate file, and
rename the class to MachineBundleIterator.

This is a precursor to adding a `MachineInstr::getBundleIterator()`
accessor, which will eventually let us delete the final call to
getNodePtrUnchecked(), and then remove the UB from ilist_iterator.

As a drive-by, I removed an unnecessary second template parameter.

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

8 years agoCodeGen: Add constructor for MIBuilder from a bundle_iterator, NFC
Duncan P. N. Exon Smith [Sun, 21 Feb 2016 21:15:37 +0000 (21:15 +0000)]
CodeGen: Add constructor for MIBuilder from a bundle_iterator, NFC

Don't require explicit conversions for creating a MachineInstrBuilder
from a bundle_iterator.

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

8 years agoADT: Disallow == and != between pointers and ilist iterators
Duncan P. N. Exon Smith [Sun, 21 Feb 2016 20:46:37 +0000 (20:46 +0000)]
ADT: Disallow == and != between pointers and ilist iterators

I completely missed these non-class operators when I removed the
implicit conversions in r252380.  Remove them now.  r261498 should have
already removed all uses.

Note (repeated from r252380): if you have out-of-tree code, it should be
fairly easy to revert this patch downstream while you update your
out-of-tree call sites.  Note that these conversions are occasionally
latent bugs (that may happen to "work" now, but only because of getting
lucky with UB; follow-ups will change your luck).  When they are valid,
I suggest using `->getIterator()` to go from pointer to iterator, and
`&*` to go from iterator to pointer.

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

8 years agoADT: Remove == and != comparisons between ilist iterators and pointers
Duncan P. N. Exon Smith [Sun, 21 Feb 2016 20:39:50 +0000 (20:39 +0000)]
ADT: Remove == and != comparisons between ilist iterators and pointers

I missed == and != when I removed implicit conversions between iterators
and pointers in r252380 since they were defined outside ilist_iterator.

Since they depend on getNodePtrUnchecked(), they indirectly rely on UB.
This commit removes all uses of these operators.  (I'll delete the
operators themselves in a separate commit so that it can be easily
reverted if necessary.)

There should be NFC here.

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

8 years agoTransformUtils: Avoid getNodePtrUnchecked() in integer division, NFC
Duncan P. N. Exon Smith [Sun, 21 Feb 2016 20:14:29 +0000 (20:14 +0000)]
TransformUtils: Avoid getNodePtrUnchecked() in integer division, NFC

Stop relying on `getNodePtrUnchecked()` being useful on invalid
iterators.  This function is documented to be for internal use only, and
the pointer type will eventually have to change to remove UB from
ilist_iterator.  Instead, check the iterator before it has been
invalidated.

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

8 years agoADT: Stop using getNodePtrUnchecked on end() iterators
Duncan P. N. Exon Smith [Sun, 21 Feb 2016 19:52:15 +0000 (19:52 +0000)]
ADT: Stop using getNodePtrUnchecked on end() iterators

Stop using `getNodePtrUnchecked()` when building IR.  Eventually a
dereference will be required to get at the downcast node, since the
iterator will only store an `ilist_node_base` of some sort.

This should have no functionality change for now, but is a path towards
removing some more UB from ilist.

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

8 years ago[X86] Remove unused encoding types from disassembler. NFC
Craig Topper [Sun, 21 Feb 2016 19:49:16 +0000 (19:49 +0000)]
[X86] Remove unused encoding types from disassembler. NFC

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

8 years agoCodeGen: Avoid getNodePtrUnchecked() where we need a Value, NFC
Duncan P. N. Exon Smith [Sun, 21 Feb 2016 19:37:45 +0000 (19:37 +0000)]
CodeGen: Avoid getNodePtrUnchecked() where we need a Value, NFC

`ilist_iterator<NodeTy>::getNodePtrUnchecked()` is documented as being
for internal use only, but CodeGenPrepare was using it anyway.  This
code relies on pulling out the `Value*` pointer even after the lifetime
of the iterator is over.  But having this pointer available in
ilist_iterator depends on UB in the first place.

Instead, safely pull out the `Value*` when the iterator is alive and
stop using the internal-only API.

There should be no functionality change here.

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

8 years agoADT: clang-format ilist_iterator, NFC
Duncan P. N. Exon Smith [Sun, 21 Feb 2016 19:26:08 +0000 (19:26 +0000)]
ADT: clang-format ilist_iterator, NFC

Also removed a couple of noisy (no-value-added) comments.

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

8 years agoADT: Remove ilist_iterator random access API, NFC
Duncan P. N. Exon Smith [Sun, 21 Feb 2016 19:23:18 +0000 (19:23 +0000)]
ADT: Remove ilist_iterator random access API, NFC

Remove explicitly deleted random access API from ilist_iterator.
Since it no longer has implicit conversions to a pointer type, we
no longer need this protection.

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

8 years ago[X86][AVX] Add shuffle masking support for EltsFromConsecutiveLoads
Simon Pilgrim [Sun, 21 Feb 2016 19:15:48 +0000 (19:15 +0000)]
[X86][AVX] Add shuffle masking support for EltsFromConsecutiveLoads

Add support for the case where we have a consecutive load (which must include the first + last elements) with a mixture of undef/zero elements. We load the vector and then apply a shuffle to clear the zero'd elements.

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

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

8 years agoScalerEvolution: Only erase temporary values if they actually have been added
Tobias Grosser [Sun, 21 Feb 2016 18:50:09 +0000 (18:50 +0000)]
ScalerEvolution: Only erase temporary values if they actually have been added

This addresses post-review comments from Sanjoy Das for r261485.

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

8 years agoScalarEvolution: Do not keep temporary PHI values in ValueExprMap
Tobias Grosser [Sun, 21 Feb 2016 17:42:10 +0000 (17:42 +0000)]
ScalarEvolution: Do not keep temporary PHI values in ValueExprMap

Before this patch simplified SCEV expressions for PHI nodes were only returned
the very first time getSCEV() was called, but later calls to getSCEV always
returned the non-simplified value, which had "temporarily" been stored in the
ValueExprMap, but was never removed and consequently blocked the caching of the
simplified PHI expression.

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

8 years agofix inaccurate comment; NFC
Sanjay Patel [Sun, 21 Feb 2016 17:33:31 +0000 (17:33 +0000)]
fix inaccurate comment; NFC

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

8 years ago[InstCombine] add getNegativeIsTrueBoolVec() helper function; NFC
Sanjay Patel [Sun, 21 Feb 2016 17:29:33 +0000 (17:29 +0000)]
[InstCombine] add getNegativeIsTrueBoolVec() helper function; NFC

Originally part of:
http://reviews.llvm.org/D17485

We need this when simplifying masked memory ops too.

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

8 years agoFix LLVM's handling and detection of skylake and cannonlake CPUs
Sanjoy Das [Sun, 21 Feb 2016 17:12:03 +0000 (17:12 +0000)]
Fix LLVM's handling and detection of skylake and cannonlake CPUs

Summary:
 - Rename `"skylake"` == SkylakeServerProc to `"skylake-avx512"`
 - Change `"skylake"` to denote SkylakeClientProc
 - Fix the detection of cpu family 6 and model 94 to be
   SkylakeClientProc instead of SkylakeServerProc
 - Remove the `"cnl"` for CannonLake

Reviewers: craig.topper, delena

Subscribers: zansari, echristo, qcolombet, RKSimon, spatel, DavidKreitzer, mcrosier, llvm-commits

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

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

8 years ago[LoopDeletion] Add an assert that verifies LCSSA
Sanjoy Das [Sun, 21 Feb 2016 17:11:59 +0000 (17:11 +0000)]
[LoopDeletion] Add an assert that verifies LCSSA

This is inspired by PR24804 -- had this assert been there before,
isolating the root cause for PR24804 would have been far easier.

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

8 years agoWebAssembly: update expected torture test failures
JF Bastien [Sun, 21 Feb 2016 16:52:00 +0000 (16:52 +0000)]
WebAssembly: update expected torture test failures

r261457 handles CopyToReg nodes with flag results in LowerCopyToReg, which was causing the SelectionDAGNodes assert.

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

8 years ago[InstCombine] Added SSE41 roundss/roundsd demanded vector elements invec tests
Simon Pilgrim [Sun, 21 Feb 2016 14:50:27 +0000 (14:50 +0000)]
[InstCombine] Added SSE41 roundss/roundsd demanded vector elements invec tests

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

8 years ago[InstCombine] Added XOP frczss/vfrczsd demanded vector elements tests
Simon Pilgrim [Sun, 21 Feb 2016 12:45:36 +0000 (12:45 +0000)]
[InstCombine] Added XOP frczss/vfrczsd demanded vector elements tests

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

8 years ago[InstCombine] Added SSE41 roundss/roundsd demanded vector elements tests
Simon Pilgrim [Sun, 21 Feb 2016 12:40:39 +0000 (12:40 +0000)]
[InstCombine] Added SSE41 roundss/roundsd demanded vector elements tests

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

8 years ago[WebAssembly] Support physical registers in the rewrite-to-discard optimization.
Dan Gohman [Sun, 21 Feb 2016 03:27:22 +0000 (03:27 +0000)]
[WebAssembly] Support physical registers in the rewrite-to-discard optimization.

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

8 years agoIR: Add ConstantData, for operand-less Constants
Duncan P. N. Exon Smith [Sun, 21 Feb 2016 02:39:49 +0000 (02:39 +0000)]
IR: Add ConstantData, for operand-less Constants

Add a common parent `ConstantData` to the constants that have no
operands.  These are guaranteed to represent abstract data that is in no
way tied to a specific Module.

This is a good cleanup on its own.  It also makes it simpler to disallow
RAUW (and factor away use-lists) on these constants in the future.  (I
have some experimental patches that make RAUW illegal on ConstantData,
and they seem to catch a bunch of bugs...)

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

8 years agoUnbreak non-X86 targets from fallout caused by r261462
David Majnemer [Sun, 21 Feb 2016 01:40:04 +0000 (01:40 +0000)]
Unbreak non-X86 targets from fallout caused by r261462

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

8 years ago[X86] Use the correct alignment for COMDAT constant pool entries
David Majnemer [Sun, 21 Feb 2016 01:30:30 +0000 (01:30 +0000)]
[X86] Use the correct alignment for COMDAT constant pool entries

COFF doesn't have sections with mergeable contents.  Instead, each
constant pool entry ends up in a COMDAT section.  The linker, when
choosing between COMDAT sections, doesn't choose the max alignment of
the two sections.  You just get whatever alignment was on the section.

If one constant needed a higher alignment in one object file from
another one, then we will get into trouble if the linker chooses the
lower alignment one.

Instead, lets promote the alignment of the constant pool entry to make
sure we don't use an under aligned constant with an instruction which
assumed otherwise.

This fixes PR26680.

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

8 years ago[InstCombine] SSE/SSE2 (u)comiss/(u)comisd comparison intrinsics only use the lowest...
Simon Pilgrim [Sat, 20 Feb 2016 23:17:35 +0000 (23:17 +0000)]
[InstCombine] SSE/SSE2 (u)comiss/(u)comisd comparison intrinsics only use the lowest vector element

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

8 years ago[WebAssembly] Refine a README.txt entry.
Dan Gohman [Sat, 20 Feb 2016 23:11:14 +0000 (23:11 +0000)]
[WebAssembly] Refine a README.txt entry.

The register coloring pass may also need to be involved in order to
optimally sort registers.

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

8 years ago[WebAssembly] Handle CopyToReg nodes with flag results in LowerCopyToReg.
Dan Gohman [Sat, 20 Feb 2016 23:09:44 +0000 (23:09 +0000)]
[WebAssembly] Handle CopyToReg nodes with flag results in LowerCopyToReg.

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

8 years ago[InstCombine] Added SSE/SSE2 comparison intrinsics demanded vector elements tests
Simon Pilgrim [Sat, 20 Feb 2016 22:41:31 +0000 (22:41 +0000)]
[InstCombine] Added SSE/SSE2 comparison intrinsics demanded vector elements tests

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

8 years ago[WebAssembly] Write stack pointer back to memory when FP is used
Derek Schuff [Sat, 20 Feb 2016 22:18:47 +0000 (22:18 +0000)]
[WebAssembly] Write stack pointer back to memory when FP is used

The stack pointer is bumped when there is a frame pointer or when there
are static-size objects, but was only getting written back when there
were static-size objects.

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

8 years ago[WebAssembly] Stackify function prologs and epilogs
Derek Schuff [Sat, 20 Feb 2016 21:46:50 +0000 (21:46 +0000)]
[WebAssembly] Stackify function prologs and epilogs

The instructions are the same, but fewer locals are used.

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

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

8 years ago[InstCombine] Added some SSE/SSE2 demanded vector elements tests
Simon Pilgrim [Sat, 20 Feb 2016 21:44:48 +0000 (21:44 +0000)]
[InstCombine] Added some SSE/SSE2 demanded vector elements tests

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

8 years agoDon't scan for SSA register operands to update when not in SSA form.
Dan Gohman [Sat, 20 Feb 2016 21:28:18 +0000 (21:28 +0000)]
Don't scan for SSA register operands to update when not in SSA form.

TailDuplicate can run on either on SSA code or non-SSA code, as indicated to
it by MRI->isSSA() ("PreRegAlloc" here). TailDuplicate does extra work to
preserve SSA invariants when it duplicates code. This patch makes it skip
some of this extra work in the case where the code is not in SSA form.

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

8 years agoFix the build bot break caused by rL261441.
Nemanja Ivanovic [Sat, 20 Feb 2016 20:45:37 +0000 (20:45 +0000)]
Fix the build bot break caused by rL261441.

The patch has a necessary call to a function inside an assert. Which is fine
when you have asserts turned on. Not so much when they're off. Sorry about
the regression.

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

8 years ago[X86][AVX] Added test case for PR22359
Simon Pilgrim [Sat, 20 Feb 2016 19:21:20 +0000 (19:21 +0000)]
[X86][AVX] Added test case for PR22359

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