Commit Graph

126828 Commits

Author SHA1 Message Date
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
Vedant Kumar
56ad20691a [docs] Document how to merge patches into release branches
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258736 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-25 22:47:54 +00:00
Matthias Braun
64d9b9e783 X86ISelLowering: Fix cmov(cmov) special lowering bug
There's a special case in EmitLoweredSelect() that produces an improved
lowering for cmov(cmov) patterns. However this special lowering is
currently broken if the inner cmov has multiple users so this patch
stops using it in this case.

If you wonder why this wasn't fixed by continuing to use the special
lowering and inserting a 2nd PHI for the inner cmov: I believe this
would incur additional copies/register pressure so the special lowering
does not improve upon the normal one anymore in this case.

This fixes http://llvm.org/PR26256 (= rdar://24329747)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258729 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-25 22:08:25 +00:00
Teresa Johnson
0e59f68161 [ThinLTO] Find all needed metadata when linking metadata as postpass
For metadata postpass linking, after importing all functions, we need
to recursively walk through any nodes reached via imported functions to
locate needed subprogram metadata. Some might only be reached indirectly
via the variable list for an inlined function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258728 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-25 22:04:56 +00:00
Simon Pilgrim
841d92c472 [X86][AVX] Add commutation support for VPERM2X128 instructions
Its main use is to allow memory folding of the 1st operand

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258726 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-25 21:51:34 +00:00
Teresa Johnson
63ac4d7e8a [ThinLTO] Handle DISubprogram reached indirectly from DIImportedEntity
Extend fix for PR26037 to identify DISubprogram reached from a
DIImportedEntity via a DILexicalBlock.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258722 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-25 21:29:55 +00:00
Xinliang David Li
1c5981f8c7 Fix a typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258716 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-25 20:38:13 +00:00
Lawrence Hu
685c628a18 Enable loopreroll to rerool loop with pointer induction variable.
Example:

while (buf !=end ) {
   S += buf[0];
   S += buf[1];
   buf +=2;
};

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258709 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-25 19:43:45 +00:00
Lawrence Hu
3602687a21 Undo commit 258700 due to missing commit message
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258708 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-25 19:36:30 +00:00
Matthew Simpson
ceb1e843a0 Reapply commit r25804 with fix
We were hitting an assertion because we were computing smaller type sizes for
instructions that cannot be demoted. The fix first determines the instructions
that will be demoted, and then applies the smaller type size to only those
instructions.

This should fix PR26239.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258705 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-25 19:24:29 +00:00
Quentin Colombet
79b3dc3c04 Speculatively revert r258620 as it is the likely culprid of PR26293.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258703 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-25 19:12:49 +00:00
Ivan Krasin
79890da71d Temporary disable broken fuzzer/timeout tests.
Reviewers: kcc

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258702 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-25 19:05:45 +00:00
Rafael Espindola
859d998768 Add a test showing we can write a vector of floats.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258701 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-25 19:02:20 +00:00
Lawrence Hu
1ae8104d77 Differential Revision: http://reviews.llvm.org/D13151
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258700 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-25 18:53:39 +00:00