Commit Graph

35912 Commits

Author SHA1 Message Date
Craig Topper
4234d815f9 [AArch64] Expand v1i64 and v2i64 ctlz.
The default is legal, which results in 'Cannot select' errors.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267522 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-26 05:26:51 +00:00
Craig Topper
98e886bc6d [ARM] Expand vector ctlz_zero_undef so it becomes ctlz.
The default is Legal, which results in 'Cannot select' errors.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267521 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-26 05:04:37 +00:00
Craig Topper
da46b1d25d [ARM] Expand v1i64 and v2i64 ctlz.
The default is legal, which results in 'Cannot select' errors.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267520 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-26 05:04:33 +00:00
Dehao Chen
0002560113 Tune basic block annotation algorithm.
Summary:
Instead of using maximum IR weight as the basic block weight, this patch uses the voting algorithm to find the most likely weight for the basic block. This can effectively avoid the cases when some IRs are annotated incorrectly due to code motion of the profiled binary.

This patch also updates propagate.ll unittest to include discriminator in the input file so that it is testing something meaningful.

Reviewers: davidxl, dnovillo

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267519 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-26 04:59:11 +00:00
Bill Seurer
edae2f4f96 [powerpc] mark JIT tests as UNSUPPORTED on powerpc64 big endian
Some of the JIT tests began failing with "[llvm] r266663 - [Orc] Re-commit 
r266581 with fixes for MSVC, and format cleanups." on powerpc64 big endian.  
To get the buildbots running I am marking these as UNSUPPORTED for now.

If this is fixed remove the UNSUPPORTED flag "powerpc64-unknown-linux-gnu".

In r267516 I marked these as XFAIL but they succeed on some of the bots
on stage1.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267518 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-26 03:59:19 +00:00
Richard Trieu
9c8065521a Pass the test file in through stdin instead of by filename.
When passed in via filename, this test will fail if the path to the test
has the strings "f1" and "f2" in somewhere.  Pass the file through stdin
to prevent test failures due to coincidences in path names.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267517 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-26 03:43:49 +00:00
Bill Seurer
8ee491358a [powerpc] mark JIT tests as XFAIL on powerpc64 big endian
Some of the JIT tests began failing with "[llvm] r266663 - [Orc] Re-commit 
r266581 with fixes for MSVC, and format cleanups." on powerpc64 big endian.  
To get the buildbots running I am marking these as XFAIL for now.

If this is fixed remove the XFAIL flag "powerpc64-unknown-linux-gnu".



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267516 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-26 02:33:22 +00:00
Hal Finkel
1ccb72c441 [SimplifyCFG] Preserve !llvm.mem.parallel_loop_access when merging
When SimplifyCFG merges identical instructions from both sides of a diamond, it
can preserve !llvm.mem.parallel_loop_access (as it does with most of the other
metadata). There's no real data or control dependency change in this case.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267515 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-26 02:06:06 +00:00
Hal Finkel
681428ed7d [LoopVectorize] Don't consider conditional-load dereferenceability for marked parallel loops
I really thought we were doing this already, but we were not. Given this input:

void Test(int *res, int *c, int *d, int *p) {
  for (int i = 0; i < 16; i++)
    res[i] = (p[i] == 0) ? res[i] : res[i] + d[i];
}

we did not vectorize the loop. Even with "assume_safety" the check that we
don't if-convert conditionally-executed loads (to protect against
data-dependent deferenceability) was not elided.

One subtlety: As implemented, it will still prefer to use a masked-load
instrinsic (given target support) over the speculated load. The choice here
seems architecture specific; the best option depends on how expensive the
masked load is compared to a regular load. Ideally, using the masked load still
reduces unnecessary memory traffic, and so should be preferred. If we'd rather
do it the other way, flipping the order of the checks is easy.

The LangRef is updated to make explicit that llvm.mem.parallel_loop_access also
implies that if conversion is okay.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267514 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-26 02:00:36 +00:00
Dan Gohman
1a09f22368 [WebAssembly] Account for implicit operands when computing operand indices.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267511 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-26 01:40:56 +00:00
Sanjay Patel
e59120290f [CodeGenPrepare] don't convert an unpredictable select into control flow
Suggested in the review of D19488:
http://reviews.llvm.org/D19488



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267504 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-26 00:47:39 +00:00
Justin Bogner
1a9ed3005a PM: Port GlobalOpt to the new pass manager
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267499 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-26 00:28:01 +00:00
Ahmed Bougacha
58f127163a [X86] Use LivePhysRegs in X86FixupBWInsts.
Kill-flags, which computeRegisterLiveness uses, are not reliable.
LivePhysRegs is.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267495 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-26 00:00:48 +00:00
Justin Bogner
02b4c05847 GlobalOpt: Convert a bunch of tests from grep to FileCheck
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267493 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-25 23:36:50 +00:00
Sanjay Patel
d08220a7df Add check for "branch_weights" with prof metadata
While we're here, fix the comment and variable names to make it
clear that these are raw weights, not percentages.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267491 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-25 23:15:16 +00:00
James Y Knight
90cc544fef [Sparc] Fix double-float fabs and fneg on little endian CPUs.
The SparcV8 fneg and fabs instructions interestingly come only in a
single-float variant. Since the sign bit is always the topmost bit no
matter what size float it is, you simply operate on the high
subregister, as if it were a single float.

However, the layout of double-floats in the float registers is reversed
on little-endian CPUs, so that the high bits are in the second
subregister, rather than the first.

Thus, this expansion must check the endianness to use the correct
subregister.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267489 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-25 22:54:09 +00:00
Tim Northover
426203a86d ARM: put correct symbol index on indirect pointers in __thread_ptr.
Otherwise the linker has no idea what should be resolved.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267488 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-25 22:36:07 +00:00
Arch D. Robison
1ca1fcaa5b Optimize store of "bitcast" from vector to aggregate.
This patch is what was the "instcombine" portion of D14185, with an additional 
test added (see julia_pseudovec in test/Transforms/InstCombine/insert-val-extract-elem.ll). 
The patch causes instcombine to replace sequences of extractelement-insertvalue-store 
that act essentially like a bitcast followed by a store.

Differential review: http://reviews.llvm.org/D14260



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267482 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-25 22:22:39 +00:00
Tim Northover
02e4498043 ARM: put extern __thread stubs in a special section.
The linker needs to know that the symbols are thread-local to do its job
properly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267473 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-25 21:12:04 +00:00
Quentin Colombet
3f7fbf7831 Re-apply r267206 with a fix for the encoding problem: when the immediate of
log2(Mask) is smaller than 32, we must use the 32-bit variant because the 64-bit
variant cannot encode it. Therefore, set the subreg part accordingly.

[AArch64] Fix optimizeCondBranch logic.

The opcode for the optimized branch does not depend on the size
of the activate bits in the AND masks, but the AND opcode itself.
Indeed, we need to use a X or W variant based on the AND variant
not based on whether the mask fits into the related variant.
Otherwise, we may end up using the W variant of the optimized branch
for 64-bit register inputs!

This fixes the last make check verifier issues for AArch64: PR27479.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267465 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-25 20:54:08 +00:00
Matt Arsenault
f9fe659922 AMDGPU: Implement addrspacecast
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267452 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-25 19:27:24 +00:00
Matt Arsenault
51b6e0bf3a AMDGPU: Add queue ptr intrinsic
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267451 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-25 19:27:18 +00:00
Evgeniy Stepanov
c650ff5ec6 [gold] Fix linkInModule and extend common.ll test.
Fix early exit from linkInModule. IRMover::move returns false on
success and true on error.

Add a few more cases of merged common linkage variables with
different sizes and alignments.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267437 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-25 18:23:29 +00:00
Chad Rosier
82f582e20e Fix typo from r267432.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267436 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-25 18:20:27 +00:00
Krzysztof Parzyszek
4eb3510bcd [Hexagon] Use llvm-mc instead of llc in an MC testcase
Remember to svn add the new file.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267435 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-25 18:09:36 +00:00
Krzysztof Parzyszek
2cbb474b0b [Hexagon] Use llvm-mc instead of llc in an MC testcase
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267434 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-25 18:08:33 +00:00
Krzysztof Parzyszek
f104001091 [Hexagon] Register save/restore functions do not follow regular conventions
Do not mark them as modifying any of the volatile registers by default.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267433 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-25 17:49:44 +00:00
Chad Rosier
cf9b63d0e4 [ValueTracking] Add an additional test case for r266767 where one operand is a const.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267432 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-25 17:41:48 +00:00
Zachary Turner
8ba06b56fb Resubmit "Refactor raw pdb dumper into library"
This fixes a number of endianness issues as well as an ODR
violation that hopefully causes everything to be happy.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267431 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-25 17:38:08 +00:00
Chad Rosier
3ac68db42d [ValueTracking] Improve isImpliedCondition when the dominating cond is false.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267430 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-25 17:23:36 +00:00
Adrian Prantl
cbea336132 dsymutil: Only warn about clang module DWO id mismatches in verbose mode.
Until PR27449 (https://llvm.org/bugs/show_bug.cgi?id=27449) is fixed in
clang this warning is pointless, since ASTFileSignatures will change
randomly when a module is rebuilt.

rdar://problem/25610919

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267427 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-25 17:04:32 +00:00
Sanjay Patel
16c04d1922 add tests for potential CGP transform (PR27344)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267426 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-25 16:56:52 +00:00
Marcin Koscielnicki
e7311dc60e [PR27390] [CodeGen] Reject indexed loads in CombinerDAG.
visitAND, when folding and (load) forgets to check which output of
an indexed load is involved, happily folding the updated address
output on the following testcase:

target datalayout = "e-m:e-i64:64-n32:64"
target triple = "powerpc64le-unknown-linux-gnu"

%typ = type { i32, i32 }

define signext i32 @_Z8access_pP1Tc(%typ* %p, i8 zeroext %type) {
  %b = getelementptr inbounds %typ, %typ* %p, i64 0, i32 1
  %1 = load i32, i32* %b, align 4
  %2 = ptrtoint i32* %b to i64
  %3 = and i64 %2, -35184372088833
  %4 = inttoptr i64 %3 to i32*
  %_msld = load i32, i32* %4, align 4
  %zzz = add i32 %1,  %_msld
  ret i32 %zzz
}

Fix this by checking ResNo.

I've found a few more places that currently neglect to check for
indexed load, and tightened them up as well, but I don't have test
cases for them.  In fact, they might not be triggerable at all,
at least with current targets.  Still, better safe than sorry.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267420 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-25 15:43:44 +00:00
Hrvoje Varga
0f2c518ef7 [mips][microMIPS] Revert commit r267137
Commit r267137 was the reason for failing tests in LLVM test suite.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267419 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-25 15:40:08 +00:00
Zlatko Buljan
0b9fb1e975 [mips][microMIPS] Revert commit r266977
Commit r266977 was reason for failing LLVM test suite with error message: fatal error: error in backend: Cannot select: t17: i32 = rotr t2, t11 ...




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267418 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-25 15:34:57 +00:00
Sanjay Patel
6cf0df3c1d [x86] auto-generate checks for cmov tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267417 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-25 15:26:57 +00:00
David Majnemer
e7edf2d8d2 [WinEH] Update SplitAnalysis::computeLastSplitPoint to cope with multiple EH successors
We didn't have logic to correctly handle CFGs where there was more than
one EH-pad successor (these are novel with WinEH).
There were situations where a register was live in one exceptional
successor but not another but the code as written would only consider
the first exceptional successor it found.

This resulted in split points which were insufficiently early if an
invoke was present.

This fixes PR27501.

N.B.  This removes getLandingPadSuccessor.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267412 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-25 14:31:32 +00:00
Silviu Baranga
a1ebe98fd3 [ARM] Add support for the X asm constraint
Summary:
This patch adds support for the X asm constraint.

To do this, we lower the constraint to either a "w" or "r" constraint
depending on the operand type (both constraints are supported on ARM).

Fixes PR26493

Reviewers: t.p.northover, echristo, rengolin

Subscribers: joker.eph, jgreenhalgh, aemerson, rengolin, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267411 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-25 14:29:18 +00:00
Artem Tamazov
2bc6d42753 [AMDGPU][llvm-mc] s_getreg/setreg* - Add hwreg(...) syntax.
Added hwreg(reg[,offset,width]) syntax.
Default offset = 0, default width = 32.
Possibility to specify 16-bit immediate kept.
Added out-of-range checks.
Disassembling is always to hwreg(...) format.
Tests updated/added.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267410 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-25 14:13:51 +00:00
Krzysztof Parzyszek
8a38a6017e [Hexagon] Correctly set "Flags" in ELF header
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267397 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-25 12:49:47 +00:00
James Molloy
c8f01da286 [GlobalOpt] Allow constant globals to be SRA'd
The current logic assumes that any constant global will never be SRA'd. I presume this is because normally constant globals can be pushed into their uses and deleted. However, that sometimes can't happen (which is where you really want SRA, so the elements that can be eliminated, are!).

There seems to be no reason why we can't SRA constants too, so let's do it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267393 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-25 10:48:29 +00:00
Igor Kudrin
3c7ad33b0b [Coverage] Restore the correct count value after processing a nested region in case of combined regions.
If several regions cover the same area of code, we have to restore
the combined value for that area when return from a nested region.

This patch achieves that by combining regions before calling buildSegments.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267390 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-25 09:43:37 +00:00
Silviu Baranga
5a397274ef [SCEV] Improve the run-time checking of the NoWrap predicate
Summary:
This implements a new method of run-time checking the NoWrap
SCEV predicates, which should be easier to optimize and nicer
for targets that don't correctly handle multiplication/addition
of large integer types (like i128).

If the AddRec is {a,+,b} and the backedge taken count is c,
the idea is to check that |b| * c doesn't have unsigned overflow,
and depending on the sign of b, that:

   a + |b| * c >= a (b >= 0) or
   a - |b| * c <= a (b <= 0)

where the comparisons above are signed or unsigned, depending on
the flag that we're checking.

The advantage of doing this is that we avoid extending to a larger
type and we avoid the multiplication of large types (multiplying
i128 can be expensive).

Reviewers: sanjoy

Subscribers: llvm-commits, mzolotukhin

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267389 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-25 09:27:16 +00:00
Marcin Koscielnicki
c627cc351a [PowerPC] [PR27387] Disallow r0 for ADD8TLS.
ADD8TLS, a variant of add instruction used for initial-exec TLS,
currently accepts r0 as a source register.  While add itself supports
r0 just fine, linker can relax it to a local-exec sequence, converting
it to addi - which doesn't support r0.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267388 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-25 09:24:34 +00:00
Michael Zuckerman
72cd5936fd Fixing wrong mask size error. From __mmask8 to __mmask16.
Was reviewed over the shoulder by AsafBadouh.
Connected to review http://reviews.llvm.org/D19195.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267379 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-25 05:27:51 +00:00
Craig Topper
85a7d561e2 [X86] Add a complete set of tests for all operand sizes of cttz/ctlz with and without zero undef being lowered to bsf/bsr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267373 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-25 01:01:15 +00:00
Adrian Prantl
c5cc3f2a20 Verifier: Verify that each inlinable callsite of a debug-info-bearing function
in a debug-info-bearing function has a debug location attached to it. Failure to
do so causes an "!dbg attachment points at wrong subprogram for function"
assertion failure when the inliner sets up inline scope info.

rdar://problem/25878916

This reaplies r267320 without changes after fixing an issue in the OpenMP IR
generator in clang.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267370 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-24 22:23:13 +00:00
Rafael Espindola
4c6a7658fc Also check the IR.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267367 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-24 21:42:56 +00:00
Rafael Espindola
5a63926ffa Add a test for how we handle protected visibility.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267366 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-24 21:30:18 +00:00
Simon Pilgrim
ff7d156e10 [X86][AVX] Added PR24935 test case
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267362 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-24 20:30:48 +00:00