129094 Commits

Author SHA1 Message Date
Matthias Braun
a31e891389 Revert "Support arbitrary addrspace pointers in masked load/store intrinsics"
This commit broke LTO builds. Reverting it to unbreak the bots while the
issue is investigated. See also:

http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20160321/341002.html

This reverts r263158

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264088 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-22 20:24:34 +00:00
Simon Pilgrim
e74069e335 [X86][AVX] Added AVX1 tests for 256-bit vector idiv-by-constant
Prep work based on feedback for D18307 

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264086 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-22 20:10:49 +00:00
Simon Pilgrim
4ec7162ead [SelectionDAG] Ensure constant folded legalized vector element types are compatible with the BUILD_VECTOR type
Found during fuzz testing - 32-bit x86 targets were legalizing a <2 x i1> compare result to <2 x i32> when <2 x i64> was expected.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264085 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-22 19:59:53 +00:00
Tim Northover
7561ec8b4b CodeGen: check return types match when emitting tail call to builtin.
We were just completely ignoring the types when determining whether we could
safely emit a libcall as a tail call. This is clearly wrong.

Theoretically, we could dig deeper looking for incidental matches (much like
the generic code in Analysis.cpp does), but it's probably not worth it for the
few libcalls that exist.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264084 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-22 19:14:38 +00:00
Sanjoy Das
e6f4276ebb Remove unnecessary branch from test
(Addresses post commit review by Reid Kleckner)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264083 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-22 18:45:41 +00:00
Adam Nemet
0645f68799 [LoopVersioning] Relax an assert for LCSSA PHIs
When you have multiple LCSSA (single-operand) PHIs that are converted
into two-operand PHIs due to versioning, only assert that the PHI
currently being converted has a single operand.  I.e. we don't want to
check PHIs that were converted earlier in the loop.

Fixes PR27023.

Thanks to Karl-Johan Karlsson for the minimized testcase!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264081 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-22 18:38:15 +00:00
Sanjoy Das
340dafa6bd Allow lowering call sites with both funclets and deopt state
Lowering funclets is a no-op, so we can just go ahead and lower the
deopt state.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264078 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-22 18:10:39 +00:00
Dan Gohman
35d7235fd8 [WebAssembly] Implement the rotate instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264076 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-22 18:01:49 +00:00
Sanjoy Das
0a4f1f9b9d Add a hasOperandBundlesOtherThan helper, and use it; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264072 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-22 17:51:25 +00:00
Simon Pilgrim
67edb4c4ef [X86][SSE] Reapplied: Simplify vector LOAD + EXTEND on pre-SSE41 hardware
Improve vector extension of vectors on hardware without dedicated VSEXT/VZEXT instructions.

We already convert these to SIGN_EXTEND_VECTOR_INREG/ZERO_EXTEND_VECTOR_INREG but can further improve this by using the legalizer instead of prematurely splitting into legal vectors in the combine as this only properly helps for lowering to VSEXT/VZEXT.

Removes a lot of unnecessary any_extend + mask pattern - (Fix for PR25718).

Reapplied with a fix for PR26953 (missing vector widening legalization).

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264062 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-22 16:22:08 +00:00
Vedant Kumar
a9e82b41a3 [unittests] clang-format a line, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264059 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-22 15:14:18 +00:00
Daniel Sanders
36aa21137b [mips] Make simm6 consistent with the rest. NFC.
Summary:

Reviewers: vkalintiris

Subscribers: dsanders, llvm-commits

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264057 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-22 14:50:22 +00:00
Daniel Sanders
7dc891bfa4 [mips] Range check simm7.
Summary:
Also renamed li_simm7 to li16_imm since it's not a simm7 and has an unusual
encoding (it's a uimm7 except that 0x7f represents -1).

Reviewers: vkalintiris

Subscribers: dsanders, llvm-commits

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264056 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-22 14:40:00 +00:00
Daniel Sanders
149ab53180 [mips] Range check simm5.
Summary:
We can't check the error message for this one because there's another lw/sw
available that covers a larger range. We therefore check the transition
between the two sizes.

Reviewers: vkalintiris

Subscribers: llvm-commits, dsanders

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264054 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-22 14:29:53 +00:00
Daniel Sanders
c0e5ca9c1c [mips] Range check vsplat_uimm[1234568].
Summary:

Reviewers: vkalintiris

Subscribers: dsanders, llvm-commits

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264053 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-22 14:17:41 +00:00
Daniel Sanders
e3f4c39d8d [mips] Range check uimm4_ptr, remove uimm6_ptr, and use correctly sized immediates in MSA copy/insert.
Reviewers: vkalintiris

Subscribers: dsanders, llvm-commits

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264052 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-22 13:58:53 +00:00
Zinovy Nis
047a636bab [PATCH] Force LoopReroll to reset the loop trip count value after reroll.
It's a bug fix. 
For rerolled loops SE trip count remains unchanged. It leads to incorrect work of the next passes.
My patch just resets SE info for rerolled loop forcing SE to re-evaluate it next time it requested.
I also added a verifier call in the exisitng test to be sure no invalid SE data remain. Without my fix this test would fail with -verify-scev.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264051 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-22 13:50:57 +00:00
Marina Yatsina
02b7dd6f82 [ELF][gcc compatibility]: support section names with special characters (e.g. "/")
Adding support for section names with special characters in them (e.g. "/").
GCC successfully compiles such section names.
This also fixes PR24520.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264038 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-22 11:23:15 +00:00
Mehdi Amini
d4501fffa8 Fix unittests: resize() -> reserve()
From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264029 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-22 07:35:51 +00:00
Mehdi Amini
ba3fe48d48 Rename DenseMap::resize() into DenseMap::reserve() (NFC)
This is more coherent with usual containers.

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264026 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-22 07:20:00 +00:00
Junmo Park
f04d589b26 Minor code cleanup. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264024 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-22 04:37:32 +00:00
Sanjoy Das
2576216f6c Appease the windows buildbots
The guess is that the stdout/stderr ordering may differ between windows
/ unix.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264019 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-22 02:11:57 +00:00
Sanjoy Das
1ceb821951 Add "first class" lowering for deopt operand bundles
Summary:
After this change, deopt operand bundles can be lowered directly by
SelectionDAG into STATEPOINT instructions (which are then lowered to a
call or sequence of nop, with an associated __llvm_stackmaps entry0.
This obviates the need to round-trip deoptimization state through
gc.statepoint via RewriteStatepointsForGC.

Reviewers: reames, atrick, majnemer, JosephTremoulet, pgavlin

Subscribers: sanjoy, mcrosier, majnemer, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264015 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-22 00:59:13 +00:00
Mike Aizatsky
668a12461d [sancov] do not instrument nodes that are full pre-dominators
Summary:
Without tree pruning clang has 2,667,552 points.
Wiht only dominators pruning: 1,515,586.
With both dominators & predominators pruning: 1,340,534.

Resubmit of r262103.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264003 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-21 23:08:16 +00:00
Justin Lebar
9dd6a5392f [CUDA] Add documentation explaining how to detect clang vs nvcc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264002 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-21 23:05:15 +00:00
Nicolai Haehnle
3f4c92194f AMDGPU: Fix dangling references introduced by r263982
Fixes Valgrind errors on the test cases that were reported as failing
by buildbots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264000 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-21 22:54:02 +00:00
Simon Pilgrim
752e5f9178 [InstCombine] Ensure all undef operands are handled before binary instruction constant folding
As noted in PR18355, this patch makes it clear that all cases with undef operands have been handled before further constant folding is attempted.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263994 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-21 22:15:50 +00:00
Duncan P. N. Exon Smith
814be6ba00 Fix -Wdocumentation warnings from r263853
Thanks to chapuni for catching this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263993 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-21 22:13:44 +00:00
George Burgess IV
127a8ddf85 [MemorySSA] Consider def-only BBs for live-in calculations.
If we have a BB with only MemoryDefs, live-in calculations will ignore
it. This means we get results like this:

define void @foo(i8* %p) {
  ; 1 = MemoryDef(liveOnEntry)
  store i8 0, i8* %p
  br i1 undef, label %if.then, label %if.end

if.then:
  ; 2 = MemoryDef(1)
  store i8 1, i8* %p
  br label %if.end

if.end:
  ; 3 = MemoryDef(1)
  store i8 2, i8* %p
  ret void
}

...When there should be a MemoryPhi in the `if.end` BB.

This patch fixes that behavior.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263991 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-21 21:25:39 +00:00
Krzysztof Parzyszek
4a0d91478f Remove leftover options from multiline.ll
I added -march=hexagon to force using Hexagon target when testing
locally, and I forgot to take it out.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263990 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-21 21:25:01 +00:00
Rafael Espindola
5ba9f15845 Add a testcase that would have found the bug in r263971.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263988 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-21 21:09:38 +00:00
Rafael Espindola
05601d5da5 Revert "[llvm-objdump] Printing relocations in executable and shared object files. This partially reverts r215844 by removing test objdump-reloc-shared.test which stated GNU objdump doesn't print relocations, it does."
This reverts commit r263971.
It produces the wrong results for .rela.dyn. I will add a test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263987 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-21 20:59:15 +00:00
Krzysztof Parzyszek
5061f597c1 Unxfail test/DebugInfo/Generic/multiline.ll on Hexagon
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263986 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-21 20:55:59 +00:00
Nicolai Haehnle
739e4c8f8b AMDGPU: Coding style fixes
I meant to add these before committing r263982 as per the review,
but I forgot to squash.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263983 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-21 20:39:24 +00:00
Nicolai Haehnle
f0b7f107b9 AMDGPU: Add SIWholeQuadMode pass
Summary:
Whole quad mode is already enabled for pixel shaders that compute
derivatives, but it must be suspended for instructions that cause a
shader to have side effects (i.e. stores and atomics).

This pass addresses the issue by storing the real (initial) live mask
in a register, masking EXEC before instructions that require exact
execution and (re-)enabling WQM where required.

This pass is run before register coalescing so that we can use
machine SSA for analysis.

The changes in this patch expose a problem with the second machine
scheduling pass: target independent instructions like COPY implicitly
use EXEC when they operate on VGPRs, but this fact is not encoded in
the MIR. This can lead to miscompilation because instructions are
moved past changes to EXEC.

This patch fixes the problem by adding use-implicit operands to
target independent instructions. Some general codegen passes are
relaxed to work with such implicit use operands.

Reviewers: arsenm, tstellarAMD, mareko

Subscribers: MatzeB, arsenm, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263982 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-21 20:28:33 +00:00
Krzysztof Parzyszek
3a1da81cd1 [Hexagon] Add handling fixups and instruction relaxation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263981 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-21 20:27:17 +00:00
Krzysztof Parzyszek
1608a747d5 [Hexagon] Properly encode registers in duplex instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263980 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-21 20:13:33 +00:00
Krzysztof Parzyszek
2be5a89f8e [Hexagon] Fix reserving emergency spill slots for register scavenger
- R10 and R11 are not reserved registers.
- Check for reserved registers when finding unused caller-saved registers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263977 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-21 19:57:08 +00:00
Dan Gohman
c13556c771 [WebAssembly] Implement the eqz instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263976 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-21 19:54:41 +00:00
Chad Rosier
dc7ed9fc0a [SLP] Remove unnecessary member variables by using container APIs.
This changes the debug output, but still retains its usefulness.
Differential Revision: http://reviews.llvm.org/D18324

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263975 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-21 19:47:44 +00:00
Colin LeMahieu
bb93856810 [llvm-objdump] Printing relocations in executable and shared object files. This partially reverts r215844 by removing test objdump-reloc-shared.test which stated GNU objdump doesn't print relocations, it does.
In executable and shared object ELF files, relocations in the file contain the final virtual address rather than section offset so this is adjusted to display section offset.

Differential revision: http://reviews.llvm.org/D15965

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263971 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-21 19:14:50 +00:00
Tom Stellard
1f213b9b37 AMDGPU/SI: Fix threshold calculation for branching when exec is zero
Summary:
When control flow is implemented using the exec mask, the compiler will
insert branch instructions to skip over the masked section when exec is
zero if the section contains more than a certain number of instructions.

The previous code would only count instructions in successor blocks,
and this patch modifies the code to start counting instructions in all
blocks between the start and end of the branch.

Reviewers: nhaehnle, arsenm

Subscribers: arsenm, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263969 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-21 18:56:58 +00:00
Chad Rosier
9c1ab0ea68 [AArch64] Add a helpful assert. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263965 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-21 18:04:10 +00:00
Matt Arsenault
ea35ca49f2 AMDGPU: Remove SignBitIsZero for mubuf scratch offsets
These instructions do not have the same negative base
address problem that DS instructions do on SI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263964 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-21 18:02:18 +00:00
Peter Collingbourne
f24c9d47b6 ARM: Better codegen for 64-bit compares.
This introduces a custom lowering for ISD::SETCCE (introduced in r253572)
that allows us to emit a short code sequence for 64-bit compares.

Before:

	push	{r7, lr}
	cmp	r0, r2
	mov.w	r0, #0
	mov.w	r12, #0
	it	hs
	movhs	r0, #1
	cmp	r1, r3
	it	ge
	movge.w	r12, #1
	it	eq
	moveq	r12, r0
	cmp.w	r12, #0
	bne	.LBB1_2
@ BB#1:                                 @ %bb1
	bl	f
	pop	{r7, pc}
.LBB1_2:                                @ %bb2
	bl	g
	pop	{r7, pc}

After:

	push	{r7, lr}
	subs	r0, r0, r2
	sbcs.w	r0, r1, r3
	bge	.LBB1_2
@ BB#1:                                 @ %bb1
	bl	f
	pop	{r7, pc}
.LBB1_2:                                @ %bb2
	bl	g
	pop	{r7, pc}

Saves around 80KB in Chromium's libchrome.so.

Some notes on this patch:

- I don't much like the ARMISD::BRCOND and ARMISD::CMOV combines I
  introduced (nothing else needs them). However, they are necessary in
  order to avoid poor codegen, and they seem similar to existing combines
  in other backends (e.g. X86 combines (brcond (cmp (setcc Compare))) to
  (brcond Compare)).

- No support for Thumb-1. This is in principle possible, but we'd need
  to implement ARMISD::SUBE for Thumb-1.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263962 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-21 18:00:02 +00:00
Renato Golin
faf3d27a21 [ARM] Add Cortex-A32 support
Adding Cortex-A32 as an available target in the ARM backend.

Patch by Sam Parker.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263956 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-21 17:29:01 +00:00
Hemant Kulkarni
962167f0e2 [llvm-readobj] Impl GNU style symbols printing
Implements "readelf -sW and readelf -DsW"

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263952 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-21 17:18:23 +00:00
Lang Hames
43f3f60fb4 [Orc] Switch RPC Procedure to take a function type, rather than an arg list.
No functional change, just a little more readable.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263951 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-21 16:56:25 +00:00
Matt Arsenault
7c9226fea8 APFloat: Add frexp
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263950 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-21 16:49:16 +00:00
Matt Arsenault
c8d042bec9 AMDGPU: Add frexp_mant intrinsic
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263948 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-21 16:11:05 +00:00