Commit Graph

126991 Commits

Author SHA1 Message Date
Hemant Kulkarni
84bca23f8d Fix comparison warning (r258845)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258856 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-26 20:38:15 +00:00
Hemant Kulkarni
8d6d9f5096 Fixes build break introduced by r258845
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258854 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-26 20:28:15 +00:00
JF Bastien
9cc9fcdbce WebAssembly NFC: update error message
I forgot to update this one in my previous patch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258853 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-26 20:24:51 +00:00
JF Bastien
d090f8592c WebAssembly: don't optimize memcpy/memmove/memcpy to frame index
r258781 optimized memcpy/memmove/memcpy so the intrinsic call can return its first argument, but missed the frame index case. Teach it to ignore that case so C code doesn't assert out in these cases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258851 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-26 20:22:42 +00:00
Cong Hou
d9b61c4c2d Add a missing test case for r258847.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258848 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-26 20:09:38 +00:00
Cong Hou
c207a75af0 Allow X86::COND_NE_OR_P and X86::COND_NP_OR_E to be reversed.
Currently, AnalyzeBranch() fails non-equality comparison between floating points
on X86 (see https://llvm.org/bugs/show_bug.cgi?id=23875). This is because this
function can modify the branch by reversing the conditional jump and removing
unconditional jump if there is a proper fall-through. However, in the case of
non-equality comparison between floating points, this can turn the branch
"unanalyzable". Consider the following case:

jne.BB1
jp.BB1
jmp.BB2
.BB1:
...
.BB2:
...

AnalyzeBranch() will reverse "jp .BB1" to "jnp .BB2" and then "jmp .BB2" will be
removed:

jne.BB1
jnp.BB2
.BB1:
...
.BB2:
...

However, AnalyzeBranch() cannot analyze this branch anymore as there are two
conditional jumps with different targets. This may disable some optimizations
like block-placement: in this case the fall-through behavior is enforced even if
the fall-through block is very cold, which is suboptimal.

Actually this optimization is also done in block-placement pass, which means we
can remove this optimization from AnalyzeBranch(). However, currently
X86::COND_NE_OR_P and X86::COND_NP_OR_E are not reversible: there is no defined
negation conditions for them.

In order to reverse them, this patch defines two new CondCode X86::COND_E_AND_NP
and X86::COND_P_AND_NE. It also defines how to synthesize instructions for them.
Here only the second conditional jump is reversed. This is valid as we only need
them to do this "unconditional jump removal" optimization.


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




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258847 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-26 20:08:01 +00:00
Davide Italiano
faaeb2ecd8 [llvm-nm] Roll several conditions into a single if. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258846 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-26 19:57:42 +00:00
Hemant Kulkarni
8822b47f7c [llvm-readobj] Add -elf-section-groups option
Adds a way to inspect SHT_GROUP sections in ELF objects.
Displays signature, member sections of these sections.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258845 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-26 19:46:39 +00:00
Chad Rosier
8a607c53be [ScheduleDAGInstrs] Simplify logic to improve readability. NFC.
The call to isInvariantLoad() already returns false for non-load instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258841 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-26 19:33:57 +00:00
Sanjay Patel
5b5085b976 tidy up; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258838 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-26 19:30:14 +00:00
Davide Italiano
dc5172a78f [llvm-nm] Simplify. No functional changes intended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258837 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-26 19:28:51 +00:00
Sanjay Patel
1ccb3f4229 [x86] simplify getOnesVector() ; NFCI
Let DAG.getConstant() handle the splatting; there's no need
to repeat that logic here.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258833 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-26 18:49:36 +00:00
Eugene Zelenko
51ecde1f0a Fix Clang-tidy modernize-use-nullptr and modernize-use-override warnings; other minor fixes.
Differential revision: reviews.llvm.org/D16568


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258831 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-26 18:48:36 +00:00
Aditya Nandakumar
a2fd503e0e Reassociate: Reprocess RedoInsts after each inst
Previously the RedoInsts was processed at the end of the block.
However it was possible that it left behind some instructions that
were not canonicalized.
This should guarantee that any previous instruction in the basic
block is canonicalized before we process a new instruction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258830 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-26 18:42:36 +00:00
Sanjay Patel
c853b6cabe [x86, AVX] tighten checks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258828 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-26 18:22:50 +00:00
Benjamin Kramer
c46572c9c0 Update wasm target for r258819.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258827 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-26 18:21:38 +00:00
Kevin Enderby
ce2bf8c364 Update the comments for the macho-invalid-zero-ncmds test and fix
llvm-objdump when printing the Mach Header to print the unknown
cputype and cpusubtype fields as decimal instead of not printing
them at all.  And change the test to check for that.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258826 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-26 18:20:49 +00:00
Sanjay Patel
b4878ed1be fix formatting; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258825 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-26 18:14:37 +00:00
Sanjay Patel
3d2f666944 don't repeat names in documentation comments; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258820 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-26 17:06:13 +00:00
Benjamin Kramer
b6242a88c2 Reflect the MC/MCDisassembler split on the include/ level.
No functional change, just moving code around.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258818 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-26 16:44:37 +00:00
Sanjay Patel
569647fbec [LibCallSimplifier] fold memset(malloc(x), 0, x) --> calloc(1, x)
This is a step towards solving PR25892:
https://llvm.org/bugs/show_bug.cgi?id=25892

It won't handle the reported case. As noted by the 'TODO' comments in the patch, 
we need to relax the hasOneUse() constraint and also match patterns that include
memset_chk() and the llvm.memset() intrinsic in addition to memset().

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258816 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-26 16:17:24 +00:00
Matthew Simpson
9124889505 Revert "Reapply commit r258404 with fix"
This commit exposes a crash in computeKnownBits on the Chromium buildbots.
Reverting to investigate.

Reference: https://llvm.org/bugs/show_bug.cgi?id=26307

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258812 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-26 15:45:49 +00:00
Igor Laevsky
25574808dc Re-submit r256008 "Improve DWARFDebugFrame::parse to also handle __eh_frame."
Originally this change was causing failures on windows buildbots.
But those problems were fixed in r258806.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258811 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-26 15:09:42 +00:00
Dan Gohman
387092bd32 [WebAssembly] Fix a typo in a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258810 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-26 14:55:17 +00:00
Igor Laevsky
622ed26f8a [DebugInfo] Fix DWARFDebugFrame instruction operand ordering
We can't rely on the evalution order of function arguments.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258806 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-26 13:31:11 +00:00
Simon Pilgrim
05f74a3924 [X86][SSE] Add zero element and general 64-bit VZEXT_LOAD support to EltsFromConsecutiveLoads
This patch adds support for trailing zero elements to VZEXT_LOAD loads (and checks that no zero elts occur within the consecutive load).

It also generalizes the 64-bit VZEXT_LOAD load matching to work for loads other than 2x32-bit loads.

After this patch it will also be easier to add support for other basic load patterns like 32-bit VZEXT_LOAD loads, PMOVZX and subvector load insertion.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258798 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-26 09:30:08 +00:00
Craig Topper
a57544039b [X86] Mark LDS/LES as not being allowed in 64-bit mode.
Their opcodes are used as part of the VEX prefix in 64-bit mode. Clearly the disassembler implicitly decoded them as AVX instructions in 64-bit mode, but I think the AsmParser would have encoded them.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258793 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-26 06:10:15 +00:00
Matt Arsenault
525af5fc5c AMDGPU: Move AMDGPU intrinsics only used by R600
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258790 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-26 04:49:24 +00:00
Matt Arsenault
60a64d9460 AMDGPU: Tidy minor td file issues
Make comments and indentation more consistent.

Rearrange a few things to be in a more consistent order,
such as organizing subtarget features from those describing
an actual device property, and those used as options.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258789 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-26 04:49:22 +00:00
Matt Arsenault
ce00361269 AMDGPU: Make v32i8/v64i8 illegal types
Old intrinsics were forcing these, but they have now all
been removed. This fixes large i8 vector operations generally
being broken.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258788 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-26 04:43:48 +00:00
Matt Arsenault
337264a351 AMDGPU: Remove old sample intrinsics
I did my best to try to update all the uses in tests that
just happened to use the old ones to the newer intrinsics.

I'm not sure I got all of the immediate operand conversions
correct, since the value seems to have been ignored by the
old pattern but I don't think it really matters.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258787 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-26 04:38:08 +00:00
Matt Arsenault
2aa06ab7ea AMDGPU: Add new amdgcn intrinsics for cube instructions
More cleanup to try to get all intrinsics using the correct
amdgcn prefix that are as close to the instruction as possible.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258786 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-26 04:29:56 +00:00
Matt Arsenault
c024d32472 AMDGPU: Implement read_register and write_register intrinsics
Some of the special intrinsics now that now correspond to a instruction
also have special setting of some registers, e.g. llvm.SI.sendmsg sets
m0 as well as use s_sendmsg. Using these explicit register intrinsics
may be a better option.

Reading the exec mask and others may be useful for debugging. For this
I'm not sure this is entirely correct because we would want this to
be convergent, although it's possible this is already treated
sufficently conservatively.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258785 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-26 04:29:24 +00:00
Matt Arsenault
f748e83708 AMDGPU: Note mesa version in release notes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258784 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-26 04:29:15 +00:00
Matt Arsenault
ae4d40b742 AMDGPU: Restore AMDGPU prefixed rsq intrinsic for now
Also move into backend intrinsics to discourage use of the old name.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258783 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-26 04:14:16 +00:00
Dan Gohman
3467854a2d [WebAssembly] Optimize memcpy/memmove/memcpy calls.
These calls return their first argument, but because LLVM uses an intrinsic
with a void return type, they can't use the returned attribute. Generalize
the store results pass to optimize these calls too.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258781 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-26 04:01:11 +00:00
Dan Gohman
523a0b2f62 [WebAssembly] Remove a completed entry from the README.txt.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258780 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-26 03:43:48 +00:00
Dan Gohman
407037aa3d [WebAssembly] Implement unaligned loads and stores.
Differential Revision: http://reviews.llvm.org/D16534


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258779 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-26 03:39:31 +00:00
Haicheng Wu
33a530fbed [LIR] Add support for structs and hand unrolled loops
This is a recommit of r258620 which causes PR26293.

The original message:

Now LIR can turn following codes into memset:

typedef struct foo {
  int a;
  int b;
} foo_t;

void bar(foo_t *f, unsigned n) {
  for (unsigned i = 0; i < n; ++i) {
    f[i].a = 0;
    f[i].b = 0;
  }
}

void test(foo_t *f, unsigned n) {
  for (unsigned i = 0; i < n; i += 2) {
    f[i] = 0;
    f[i+1] = 0;
  }
}

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258777 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-26 02:27:47 +00:00
Reid Kleckner
8a1bace95a Use binary search for intrinsic ID lookups
This improves compile time of Function.cpp from 57s to 37s for me
locally.  Intrinsic IDs are cached on the Function object, so this
shouldn't regress performance.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258774 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-26 02:06:41 +00:00
Matthias Braun
632580f369 LiveIntervalAnalysis: Improve some comments
As recommended by Justin.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258771 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-26 01:40:48 +00:00
Reid Kleckner
fa883c2abc Sort intrinsics by LLVM intrinsic name, rather than tablegen def name
Step one towards using a simple binary search to lookup intrinsic IDs
instead of our crazy table generated switch+memcmp+startswith code that
makes Function.cpp take about a minute to compile.  See PR24785 and
PR11951 for why we should do this.

The X86 backend contains tables that need to be sorted on intrinsic ID,
so reorder those.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258757 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-26 00:55:00 +00:00
Matthias Braun
1b9e9d8523 LiveIntervalAnalysis: Cleanup handleMove{Down|Up}() functions, NFC
These two functions are hard to reason about. This commit makes the code
more comprehensible:

- Use four distinct variables (OldIdxIn, OldIdxOut, NewIdxIn, NewIdxOut)
  with a fixed value instead of a changing iterator I that points to
  different things during the function.
- Remove the early explanation before the function in favor of more
  detailed comments inside the function. Should have more/clearer comments now
  stating which conditions are tested and which invariants hold at
  different points in the functions.

The behaviour of the code was not changed.

I hope that this will make it easier to review the changes in
http://reviews.llvm.org/D9067 which I will adapt next.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258756 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-26 00:43:50 +00:00
Dan Gohman
45afe21783 Followup to 258750; update more tests to use .p2align .
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258755 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-26 00:35:07 +00:00
Dan Gohman
d0eaa3383e Followup to 258750; update all MC tests to use .p2align .
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258754 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-26 00:27:59 +00:00
Dan Gohman
a9319a6e78 Followup to 258750; update this test to use .p2align .
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258752 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-26 00:17:24 +00:00
Dan Gohman
f4e788949d [MC] Use .p2align instead of .align
For historic reasons, the behavior of .align differs between targets.
Fortunately, there are alternatives, .p2align and .balign, which make the
interpretation of the parameter explicit, and which behave consistently across
targets.

This patch teaches MC to use .p2align instead of .align, so that people reading
code for multiple architectures don't have to remember which way each platform
does its .align directive.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258750 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-26 00:03:25 +00:00
Philip Reames
838543bb35 [GVN] Rearrange code to make local vs non-local cases more obvious [NFCI]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258747 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-25 23:37:53 +00:00
Evgeniy Stepanov
3f6b805277 [cfi] Cross-DSO CFI diagnostic mode (LLVM part).
* __cfi_check gets a 3rd argument: ubsan handler data
* Instead of trapping on failure, call __cfi_check_fail which must be
  present in the module (generated in the frontend).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258746 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-25 23:35:03 +00:00
Philip Reames
4d16c2e168 [GVN] Factor out common code [NFCI]
We had the same code duplicated for each type of Def.  We also have the entire block duplicated between the local and non-local case, but let's start with local cleanup.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258740 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-25 23:19:12 +00:00