Commit Graph

128338 Commits

Author SHA1 Message Date
Kostya Serebryany
8ca429497a [libFuzzer] remove FuzzerSanitizerOptions.cpp
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262354 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-01 17:46:32 +00:00
Michael Zuckerman
3827ef7a01 [LLVM][AVX512] PSRL{DI|QI} Change imm8 to int
Differential Revision: http://reviews.llvm.org/D17713



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262353 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-01 17:46:32 +00:00
Hans Wennborg
b4e63ec23a [X86] Check that attribute parameters match for tail calls (PR26590)
In the code below on 32-bit targets, x would previously get forwarded to g()
without sign-extension to 32 bits as required by the parameter attribute.

  void g(signed short);
  void f(unsigned short x) {
    g(x);
  }

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262352 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-01 17:45:23 +00:00
Sanjay Patel
449d0dcc2b fix documentation comments; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262351 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-01 17:25:35 +00:00
Petar Jovanovic
7a9adc7562 Revert "calculate builtin_object_size if argument is a removable pointer"
Revert r262337 as "check-llvm ubsan" step failed on
sanitizer-x86_64-linux-fast buildbot.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262349 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-01 16:50:08 +00:00
Sanjay Patel
9079741ca7 function names start with a lowercase letter; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262347 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-01 16:17:48 +00:00
Nikolay Haustov
b7b6e74d4d [AMDGPU] Remove unused disassembler code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262346 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-01 16:02:40 +00:00
Rafael Espindola
93ed620d27 Refactor duplicated code for linking with pthread.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262344 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-01 15:54:40 +00:00
Nikolay Haustov
5d03751938 [AMDGPU] Fix build warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262338 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-01 14:50:59 +00:00
Petar Jovanovic
71c0d4c97d calculate builtin_object_size if argument is a removable pointer
This patch fixes calculating correct value for builtin_object_size function
when pointer is used only in builtin_object_size function call and never
after that.

Patch by Strahinja Petrovic.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262337 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-01 14:39:55 +00:00
Nikolay Haustov
d129fa6931 [AMDGPU] Disassembler code refactored + error messages.
Idea behind this change is to make code shorter and as much common for all targets as possible. Let's even accept more code than is valid for a particular target, leaving it for the assembler to sort out.

64bit instructions decoding added.

Error\warning messages on unrecognized instructions operands added, InstPrinter allowed to print invalid operands helping to find invalid/unsupported code.

The change is massive and hard to compare with previous version, so it makes sense just to take a look on the new version. As a bonus, with a few TD changes following, it disassembles the majority of instructions. Currently it fully disassembles >300K binary source of some blas kernel.

Previous TODOs were saved whenever possible.

Patch by: Valery Pykhtin

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262332 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-01 13:57:29 +00:00
Petr Pavlu
3a3e8ddebb [LTO] Fix error reporting from lto_module_create_in_local_context()
Function lto_module_create_in_local_context() would previously
rely on the default LLVMContext being created for it by
LTOModule::makeLTOModule(). This context exits the program on
error and is not arranged to update sLastStringError in
tools/lto/lto.cpp.

Function lto_module_create_in_local_context() now creates an
LLVMContext by itself, sets it up correctly to its needs and then
passes it to LTOModule::createInLocalContext() which takes
ownership of the context and keeps it present for the lifetime of
the returned LTOModule.

Function LTOModule::makeLTOModule() is modified to take a
reference to LLVMContext (instead of a pointer) and no longer
creates a default context when nullptr is passed to it. Method
LTOModule::createInContext() that takes a pointer to LLVMContext
is removed because it allows to pass a nullptr to it. Instead
LTOModule::createFromBuffer() (that takes a reference to
LLVMContext) should be used.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262330 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-01 13:13:49 +00:00
Michael Zuckerman
b8e07ee5c0 [AVX512][PSRAQ][PSRAD] Change imm8 to int.
Differential Revision: http://reviews.llvm.org/D17692



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262320 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-01 11:36:23 +00:00
Amjad Aboud
45aa3f2e14 Disallow generating vzeroupper before return instruction (iret) in interrupt handler function.
This resolves https://llvm.org/bugs/show_bug.cgi?id=26412

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262319 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-01 11:32:03 +00:00
Simon Atanasyan
940260b1e9 [MC][YAML] Rangify the loop. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262317 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-01 10:11:27 +00:00
Vasileios Kalintiris
ef35f84f09 [mips] Promote the result of SETCC nodes to GPR width.
Summary:
This patch modifies the existing comparison, branch, conditional-move
and select patterns, and adds new ones where needed. Also, the updated
SLT{u,i,iu} set of instructions generate a GPR width result.

The majority of the code changes in the Mips back-end fix the wrong
assumption that the result of SETCC nodes always produce an i32 value.
The changes in the common code path account for the fact that in 64-bit
MIPS targets, i1 is promoted to i32 instead of i64.

Reviewers: dsanders

Subscribers: dsanders, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262316 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-01 10:08:01 +00:00
Nikolay Haustov
344528bfec [TableGen] AsmMatcher: Skip optional operands in the midle of instruction if it is not present
Previosy, if actual instruction have one of optional operands then other optional operands listed before this also should be presented.
For example instruction v_fract_f32 v0, v1, mul:2 have one optional operand - OMod and do not have optional operand clamp. Previously this was not allowed because clamp is listed before omod in AsmString:

string AsmString = "v_fract_f32$vdst, $src0_modifiers$clamp$omod";
Making this work required some hacks (both OMod and Clamp match classes have same PredicateMethod).

Now, if MatchInstructionImpl meets formal optional operand that is not presented in actual instruction it skips this formal operand and tries to match current actual operand with next formal.

Patch by: Sam Kolton

Review: http://reviews.llvm.org/D17568

[AMDGPU] Assembler: Check immediate types for several optional operands in predicate methods
With this change you should place optional operands in order specified by asm string:

clamp -> omod
offset -> glc -> slc -> tfe
Fixes for several tests.
Depends on D17568

Patch by: Sam Kolton

Review: http://reviews.llvm.org/D17644

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262314 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-01 08:34:43 +00:00
Nikolay Haustov
f97e952558 AsmParser: Fix nested .irp/.irpc
Count .irp/.irpc in parseMacroLikeBody similar to .rept
Update tests.

Review: http://reviews.llvm.org/D17707

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262313 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-01 08:18:28 +00:00
Craig Topper
2cf7ebb777 [X86] Centralize the masking of TSFlags with FormMask into a variable earlier so we can stop masking in multiple places. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262312 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-01 07:15:59 +00:00
Craig Topper
936373d0eb [X86] Localize a temporary variable into the cases its need in. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262310 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-01 06:42:48 +00:00
Craig Topper
2c8955f6dd [X86] Be consistent about using pre/post increment/decrement in nearby code. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262309 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-01 06:42:46 +00:00
Craig Topper
7e17931bef [X86] Combine some initialization code with variable declaration and comments. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262301 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-01 05:42:16 +00:00
Matt Arsenault
ffd2af79db LegalizeDAG: Use correct ptr type when expanding unaligned load/store
This fixes regressions exposed in existing AMDGPU tests in a
future commit when all loads are custom lowered.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262299 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-01 05:13:35 +00:00
Matt Arsenault
7ff5c71a61 AMDGPU: Don't emit build_pair during udivrem legalization
Technically you aren't supposed to emit these after type legalization
for some reason, and we use vector extracts of bitcasted integers
as the canonical way to do this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262298 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-01 05:06:05 +00:00
Matt Arsenault
c8a36aecdf AMDGPU: Don't use estimated stack size when we know the real stack size
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262297 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-01 04:58:20 +00:00
Matt Arsenault
12cb9f057f AMDGPU: Set HasExtractBitInsn
This currently does not have the control over the bitwidth,
and there are missing optimizations to reduce the integer to
32-bit if it can be.

But in most situations we do want the sinking to occur.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262296 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-01 04:58:17 +00:00
David Majnemer
dcae508e2e [WinEH] Allocate the registration node before the catch objects
The CatchObjOffset is relative to the end of the EH registration node
for 32-bit x86 WinEH targets.  A special sentinel value, 0, is used to
indicate that no catch object should be initialized.

This means that a catch object allocated immediately before the
registration node would be assigned a CatchObjOffset of 0, leading the
runtime to believe that a catch object should not be initialized.

To handle this, allocate the registration node prior to any other frame
object.  This will ensure that catch objects will not be allocated
before the registration node.

This fixes PR26757.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262294 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-01 04:30:16 +00:00
David Majnemer
a34c14ca02 [Verifier] Diagnose when unwinding out of cycles of blocks
Generally speaking, this can only happen with unreachable code.
However, neglecting to check for this condition would lead us to loop
forever.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262284 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-01 01:19:05 +00:00
Adam Nemet
510e40fe44 [LLE] Add testcase for the fix in r262267
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262280 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-01 00:50:14 +00:00
Adam Nemet
a2e4d15598 [LAA] Add missing debug output
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262279 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-01 00:50:08 +00:00
Sanjay Patel
3f5ed2d9f2 [x86, InstCombine] transform more x86 masked loads to LLVM intrinsics
Continuation of:
http://reviews.llvm.org/rL262269


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262273 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-29 23:59:00 +00:00
Adam Nemet
525f545ba3 [LLE] Fix a comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262270 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-29 23:21:12 +00:00
Sanjay Patel
3a7e753170 [x86, InstCombine] transform x86 AVX masked loads to LLVM intrinsics
The intended effect of this patch in conjunction with:
http://reviews.llvm.org/rL259392
http://reviews.llvm.org/rL260145

is that customers using the AVX intrinsics in C will benefit from combines when
the load mask is constant:

__m128 mload_zeros(float *f) {
  return _mm_maskload_ps(f, _mm_set1_epi32(0));
}

__m128 mload_fakeones(float *f) {
  return _mm_maskload_ps(f, _mm_set1_epi32(1));
}

__m128 mload_ones(float *f) {
  return _mm_maskload_ps(f, _mm_set1_epi32(0x80000000));
}

__m128 mload_oneset(float *f) {
  return _mm_maskload_ps(f, _mm_set_epi32(0x80000000, 0, 0, 0));
}

...so none of the above will actually generate a masked load for optimized code.

This is the masked load counterpart to:
http://reviews.llvm.org/rL262064



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262269 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-29 23:16:48 +00:00
David Majnemer
87e4278b8c [Verifier] Handle more funclet edge cases
This change makes the verifier a little more paranoid.  It was possible
to trick the verifier into crashing or infinite looping.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262268 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-29 22:56:36 +00:00
Adam Nemet
2e073f55eb [LLE] Fix SingleSource/Benchmarks/Polybench/stencils/jacobi-2d-imper with Polly
We can actually have dependences between accesses with different
underlying types.  Bail in this case.

A test will follow shortly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262267 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-29 22:53:59 +00:00
Eric Christopher
912dbc9d0e Simplify some boolean conditional return statements in AArch64.
http://reviews.llvm.org/D9979

Patch by Richard Thomson (and some conflict resolution by me).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262266 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-29 22:50:49 +00:00
Adrian Prantl
388c01f356 Improve the debug output of DwarfDebug::buildLocationList().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262265 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-29 22:28:22 +00:00
Adrian Prantl
692e80bd5c Document an anomaly in this testcase.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262264 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-29 22:28:16 +00:00
Paul Robinson
5dc46f59dd Reapply r262092: [FileCheck] Abort if -NOT is combined with another suffix.
Combinations of suffixes that look useful are actually ignored;
complaining about them will avoid mistakes.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262263 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-29 22:13:03 +00:00
Sanjoy Das
bfc5df0cb4 [Verifier] Minor fix to error message; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262262 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-29 22:04:25 +00:00
Colin LeMahieu
6e4a4d849c [Hexagon] As a size optimization, not lazy extending TPREL or DTPREL variants since they're usually in range.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262258 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-29 21:21:56 +00:00
Colin LeMahieu
adaa70afa6 [Hexagon] Missed member initialization causing ubsan failure.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262252 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-29 20:42:25 +00:00
Adam Nemet
7ff3ae62d2 Enable LoopLoadElimination by default
Summary:
I re-benchmarked this and results are similar to original results in
D13259:

On ARM64:
  SingleSource/Benchmarks/Polybench/linear-algebra/solvers/dynprog -59.27%
  SingleSource/Benchmarks/Polybench/stencils/adi                   -19.78%

On x86:
  SingleSource/Benchmarks/Polybench/linear-algebra/solvers/dynprog  -27.14%

And of course the original ~20% gain on SPECint_2006/456.hmmer with Loop
Distribution.

In terms of compile time, there is ~5% increase on both
SingleSource/Benchmarks/Misc/oourafft and
SingleSource/Benchmarks/Linkpack/linkpack-pc.  These are both very tiny
loop-intensive programs where SCEV computations dominates compile time.

The reason that time spent in SCEV increases has to do with the design
of the old pass manager.  If a transform pass does not preserve an
analysis we *invalidate* the analysis even if there was *no*
modification made by the transform pass.

This means that currently we don't take advantage of LLE and LV sharing
the same analysis (LAA) and unfortunately we recompute LAA *and* SCEV
for LLE.

(There should be a way to work around this limitation in the case of
SCEV and LAA since both compute things on demand and internally cache
their result.  Thus we could pretend that transform passes preserve
these analyses and manually invalidate them upon actual modification.
On the other hand the new pass manager is supposed to solve so I am not
sure if this is worthwhile.)

Reviewers: hfinkel, dberlin

Subscribers: dberlin, reames, mssimpso, aemerson, joker.eph, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262250 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-29 20:35:11 +00:00
Adrian Prantl
30c4a7d4ae Fixup MIPS testcase after r262247 and make it a little more robust.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262249 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-29 20:25:10 +00:00
Geoff Berry
049269de72 [AArch64] Fix isLegalAddImmediate() to return true for valid negative values.
Reviewers: t.p.northover, jmolloy

Subscribers: mcrosier, aemerson, llvm-commits, rengolin

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262248 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-29 19:53:22 +00:00
Adrian Prantl
be45c68b8b Fix PR26585 by improving the promotion of DBG_VALUEs to DW_AT_locations.
When a variable is described by a single DBG_VALUE instruction we can
often use a more efficient inline DW_AT_location instead of using a
location list.

This commit makes the heuristic that decides when to apply this
optimization stricter by also verifying that the DBG_VALUE is live at the
entry of the function (instead of just checking that it is valid until
the end of the function).

<rdar://problem/24611008>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262247 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-29 19:49:46 +00:00
Steven Wu
b9de197a7a Rename embedded bitcode section in MachO
Summary:
Rename the section embeds bitcode from ".llvmbc,.llvmbc" to "__LLVM,__bitcode".
The new name matches MachO section naming convention.

Reviewers: rafael, pcc

Subscribers: davide, llvm-commits, joker.eph

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262245 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-29 19:40:10 +00:00
Ahmed Bougacha
462318cb2d [X86] Move the ATOMIC_LOAD_OP ISel from DAGToDAG to ISelLowering. NFCI.
This is long-standing dirtiness, as acknowledged by r77582:

    The current trick is to select it into a merge_values with
    the first definition being an implicit_def. The proper solution is
    to add new ISD opcodes for the no-output variant.

Doing this before selection will let us combine away some constructs.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262244 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-29 19:28:07 +00:00
Colin LeMahieu
4a487ecba9 [Hexagon] Setting sign mismatch flag on expression instead of using bit tricks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262243 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-29 19:17:56 +00:00
Rong Xu
0158e00998 Minor code cleanup. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262242 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-29 19:16:04 +00:00