Commit Graph

224392 Commits

Author SHA1 Message Date
Simon Atanasyan 3b37785fee [ELF][MIPS] Factor out the code reading and calculating AHL addend into the separate function. NFC
llvm-svn: 262706
2016-03-04 10:55:20 +00:00
Simon Atanasyan deed55d706 [ELF][MIPS] Use writeMipsHi16 to apply result of R_MIPS_PCHI16 relocation. NFC
llvm-svn: 262705
2016-03-04 10:55:16 +00:00
Simon Atanasyan a888e6726f [ELF][MIPS] Replace S and A arguments of the writeMipsHi16 function by the single argument V. NFC
llvm-svn: 262704
2016-03-04 10:55:12 +00:00
Simon Atanasyan 3474b907dd [ELF][MIPS] s/applyMipsHi16Reloc/writeMipsHi16/ NFC
llvm-svn: 262703
2016-03-04 10:55:04 +00:00
Benjamin Kramer 4dbf3371bb Make headers self-contained again.
llvm-svn: 262702
2016-03-04 10:49:30 +00:00
Nikolay Haustov 5bf46ac150 AMDGPU/SI: add llvm.amdgcn.image.atomic.* intrinsics
These correspond to IMAGE_ATOMIC_* and are going to be used by Mesa for the
GL_ARB_shader_image_load_store extension.

Initial change by Nicolai H.hnle

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

llvm-svn: 262701
2016-03-04 10:39:50 +00:00
Pavel Labath a174d8709f [SemaExprCXX] Avoid calling isInSystemHeader for invalid source locations
Summary:
While diagnosing a CXXNewExpr warning, we were calling isInSystemHeader(), which expect to be
called with a valid source location. This causes an assertion failure if the location is unknown.
A quick grep shows it's not without precedent to guard calls to the function with a
"Loc.isValid()".

This fixes a test failure in LLDB, which always creates object with invalid source locations as it
does not (always) have access to the source.

Reviewers: nlewycky

Subscribers: lldb-commits, cfe-commits

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

llvm-svn: 262700
2016-03-04 10:00:08 +00:00
Alexey Bataev c5b1d320b8 [OPENMP 4.0] Codegen for 'declare reduction' construct.
Emit function for 'combiner' part of 'declare reduction' construct and
'initialilzer' part, if any.

llvm-svn: 262699
2016-03-04 09:22:22 +00:00
Haojian Wu 678f65a9b4 [clang-tidy] Make 'modernize-use-nullptr' check work on multiple nested implicit cast expressions.
Summary:
For some test cases like:

```
 int func(int, void*, void*);
(double)func(0, 0, 0);
```

The AST contains several `ImplicitCastExpr`s, so we should not only check on the first sub expression.

```
 `-CStyleCastExpr 0x7fe43a088938 <line:6:3, col:24> 'double' <NoOp>
      `-ImplicitCastExpr 0x7fe43a088920 <col:11, col:24> 'double' <IntegralToFloating>
        `-CallExpr 0x7fe43a0888a0 <col:11, col:24> 'int'
          |-ImplicitCastExpr 0x7fe43a088888 <col:11> 'int (*)(int, void *, void *)' <FunctionToPointerDecay>
          | `-DeclRefExpr 0x7fe43a0887d8 <col:11> 'int (int, void *, void *)' lvalue Function 0x7fe43a0886f0 'func1' 'int (int, void *, void *)'
          |-IntegerLiteral 0x7fe43a088800 <col:17> 'int' 0
          |-ImplicitCastExpr 0x7fe43a0888e0 <col:20> 'void *' <NullToPointer>
          | `-IntegerLiteral 0x7fe43a088820 <col:20> 'int' 0
          `-ImplicitCastExpr 0x7fe43a0888f8 <col:23> 'void *' <NullToPointer>
            `-IntegerLiteral 0x7fe43a088840 <col:23> 'int' 0
```

Reviewers: alexfh

Subscribers: cfe-commits

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

llvm-svn: 262698
2016-03-04 08:55:54 +00:00
Vedant Kumar 22bd871ea6 [Coverage] Fix the start/end locations of switch statements
While pushing switch statements onto the region stack we neglected to
specify their start/end locations. This results in a crash (PR26825) if
we end up in nested macro expansions without enough information to
handle the relevant file exits.

I added a test in switchmacro.c and fixed up a bunch of incorrect CHECK
lines that specify strange end locations for switches.

llvm-svn: 262697
2016-03-04 08:07:15 +00:00
Alexey Bataev 37e594c799 [OPENMP] Simplify handling of clauses with postupdates, NFC.
Clauses with post-update expressions always have pre-init statement. So
OMPClauseWithPreInit now is the base for OMPClauseWithPostUpdate.

llvm-svn: 262696
2016-03-04 07:21:16 +00:00
Argyrios Kyrtzidis 7332106499 [index] Distinguish USRs of anonymous enums by using their first enumerator.
rdar://24609949.

llvm-svn: 262695
2016-03-04 07:17:53 +00:00
Argyrios Kyrtzidis 2682f9e5de [index] Include parameter types in the USRs for C functions marked with 'overloadable' attribute.
llvm-svn: 262694
2016-03-04 07:17:48 +00:00
Argyrios Kyrtzidis 9c99867386 [index] In ObjC++ handle objc type parameters for function USRs.
llvm-svn: 262693
2016-03-04 07:17:43 +00:00
Xiuli Pan 4415bdbdc3 [OpenCL] Refine pipe builtin support
Summary:
Refine the type builtin support as the request with
http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20160201/148637.html

Reviewers: pekka.jaaskelainen, Anastasia, yaxunl

Subscribers: rsmith, cfe-commits

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

llvm-svn: 262692
2016-03-04 07:11:16 +00:00
Bhushan D. Attarde bacb988735 [MIPS] initFeatureMap() to handle empty string argument
SUMMARY:
    This patch sets CPU string to its default value when it is not supplied by caller.
    
    Reviewers: vkalintiris, dsanders
    Subscribers: mohit.bhakkad, sagar, jaydeep, cfe-commits
    Differential Revision: http://reviews.llvm.org/D16139

llvm-svn: 262691
2016-03-04 06:56:29 +00:00
Mohit K. Bhakkad b87b2ecb4b [Compiler-rt][safestack] Enable for MIPS
Reviewers: samsonov

Subscribers: jaydeep, sagar, llvm-commits

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

llvm-svn: 262690
2016-03-04 06:15:59 +00:00
Bill Seurer 03ff36bfba [powerpc] pacify lint for java_race_pc.cc
Fix blank lines.

llvm-svn: 262689
2016-03-04 06:02:52 +00:00
David Majnemer e2ae228c76 [X86] Pass __m64 types via SSE registers for GCC compatibility
For compatibility with GCC, classify __m64 as SSE.
However, clang is a platform compiler for certain targets; retain our
old behavior on those targets: classify __m64 as integer.

This fixes PR26832.

llvm-svn: 262688
2016-03-04 05:26:16 +00:00
David Majnemer 6a6206d440 [VFS] Switch from close to SafelyCloseFileDescriptor
The SafelyCloseFileDescriptor machinery does the right thing in the face
of signals while close will do something platform specific which results
in the FD potentially getting leaked.

llvm-svn: 262687
2016-03-04 05:26:14 +00:00
Argyrios Kyrtzidis 8757fc5594 [index] Ignore ObjCTypeParamDecls during indexing.
llvm-svn: 262686
2016-03-04 04:24:32 +00:00
Rui Ueyama a3cb80adfc Use check function.
llvm-svn: 262685
2016-03-04 01:56:52 +00:00
Davide Italiano 255730cdc5 [ELF] Generalize symbol type handling.
SymbolBody constructor and friends take isFunc and isTLS boolean arguments.
ELF symbols have already a type so than be easily passed as argument.
If we want to support another type, this scheme is not good enough, that is,
the current code logic would require passing another `bool isObject` around.
Up to two argument, this stretching exercise was a little bit goofy but
still acceptable, but with more types to support, is just too much, IMHO.

Change the code so that the type is passed instead.

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

llvm-svn: 262684
2016-03-04 01:55:28 +00:00
Justin Bogner 85ddad485c Annotate our undefined behaviour to sneak it past the sanitizers
We have known UB in some ilists where we static cast half nodes to
(larger) derived types and use the address. See llvm.org/PR26753.

This needs to be fixed, but in the meantime it'd be nice if running
ubsan didn't complain. This adds annotations in the two places where
ubsan complains while running check-all of a sanitized clang build.

llvm-svn: 262683
2016-03-04 01:52:47 +00:00
Easwaran Raman 588c68a87b Fix a memory leak.
llvm-svn: 262682
2016-03-04 01:18:40 +00:00
Justin Bogner 87feb4e64e CodeGen: Tune the SmallVector size in LiveRange
The vast majority of LiveRanges (ie, 4/5) have exactly 1 segment and 1
value number, and a good chunk of the rest have 2 of each, so
allocating space for 4 is wasteful. This is especially noticeable when
dealing with a very large number of vregs, and I have an internal case
where dropping this to 2 shaves over 5% off of peak memory when
compiling a particularly large function.

llvm-svn: 262681
2016-03-04 00:58:39 +00:00
Alexey Samsonov 4362a994d2 [TSan] Fix compiler warning in Go sanity test.
llvm-svn: 262680
2016-03-04 00:56:15 +00:00
Easwaran Raman 3b7a8246c9 Fix a use-after-free bug introduced in r262636
llvm-svn: 262679
2016-03-04 00:44:01 +00:00
Alexey Samsonov c8f2c957e0 [asan] Fix odr_c_test failure with gold linker
Summary:
Adds another global to asan's odr_c_test to help force the target global to
not lie at the start of bss with the gold linker where it is always
aligned.

Patch by Derek Bruening!

llvm-svn: 262678
2016-03-04 00:41:39 +00:00
Teresa Johnson a3135be77d Add hardware_concurrency interface to llvm::thread (NFC)
Part of D15390.

llvm-svn: 262677
2016-03-04 00:25:54 +00:00
Evgeniy Stepanov 330c5a60c7 [gold] Handle modules that are not included in the link.
Gold has a newly added LDPT_GET_SYMBOLS_V3 callback that can
distinguish between a module that is not included in the link, and
one that is included but has its entire interface preempted by others.

Fixes PR26674.

llvm-svn: 262676
2016-03-04 00:23:29 +00:00
Bill Seurer 63350ecd32 [powerpc] activate java_race_pc.cc on powerpc64le
The test case compiler-rt/test/tsan/java_race_pc.cc fails on powerpc64
big endian but not little endian.

Add missing blank line.

llvm-svn: 262675
2016-03-04 00:22:40 +00:00
Easwaran Raman 75c21a9428 Fix memory leak in tests.
llvm-svn: 262674
2016-03-03 23:55:41 +00:00
Mike Aizatsky b8627a89a6 [libfuzzer] arbitrary function adapter.
The adapter automates converting sequence of bytes into arbitrary
arguments.

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

llvm-svn: 262673
2016-03-03 23:45:29 +00:00
Philip Reames 2e7383cc1e [docs] Add a description of current problem areas to the statepoint docs
Triggered by a question on llvm-dev about status

llvm-svn: 262671
2016-03-03 23:24:44 +00:00
Guozhi Wei 92e9d0e80e [InstCombine] Combine A->B->A BitCast
This patch enhances InstCombine to handle following case:

        A  ->  B    bitcast
        PHI
        B  ->  A    bitcast

llvm-svn: 262670
2016-03-03 23:21:38 +00:00
Bill Seurer 7b3c72a397 [powerpc] activate java_race_pc.cc on powerpc64le
The test case compiler-rt/test/tsan/java_race_pc.cc fails on powerpc64
big endian but not little endian.

llvm-svn: 262669
2016-03-03 23:07:43 +00:00
NAKAMURA Takumi f2b521ffc5 llvm/test/CodeGen/ARM/rem_crash.ll: Avoid unsupported targets to specify explicit triple.
We will see it for targeting win32;

  LLVM ERROR: CPU: 'generic' does not support ARM mode execution!

llvm-svn: 262668
2016-03-03 22:38:39 +00:00
Kostya Serebryany e483ed2825 [libFuzzer] when interrupted, call _Exit() instead of exit()
llvm-svn: 262667
2016-03-03 22:36:37 +00:00
Rafael Espindola 75714f618c Rename 'fatal' to 'check' when it doesn't always fail.
llvm-svn: 262666
2016-03-03 22:24:39 +00:00
Michael Kruse afd2db5351 [SCEVValidator] Fix loop exit values considered affine.
Index calculations can use the last value that come out of a loop.
Ideally, ScalarEvolution can compute that exit value directly without
depending on the loop induction variable, but not in all cases.

This changes isAffine to not consider such loop exit values as affine to
avoid that SCEVExpander adds uses of the original loop induction
variable.

This fix is analogous to r262404 that applies to general uses of loop
exit values instead of index expressions and loop bouds as in this
patch.

This reduces the number of LNT test-suite fails with
-polly-position=before-vectorizer -polly-unprofitable
from 10 to 8.

llvm-svn: 262665
2016-03-03 22:10:52 +00:00
Michael Kruse 09eb4451d2 Pass scope and LoopInfo to SCEVValidator. NFC.
The scope will be required in the following fix. This commit separates
the large changes that do not change behaviour from the small, but
functional change.

llvm-svn: 262664
2016-03-03 22:10:47 +00:00
Carlo Bertolli 6ad7b5aff2 [OPENMP] firstprivate and private clauses of teams, host codegeneration
Add code generation support for firstprivate and private clauses of teams on the host. Add extensive regression tests including lambda functions and vla testing.

http://reviews.llvm.org/D17582

llvm-svn: 262663
2016-03-03 22:09:40 +00:00
Rui Ueyama 6df27e7f21 Remove dead code.
llvm-svn: 262662
2016-03-03 21:56:21 +00:00
Simon Pilgrim f33cb61471 [X86][AVX512BW] Fixed 512-bit PSHUFB shuffle mask decode and added combine test.
PSHUFB decoder was assuming that input was 128 or 256-bit vector only.

llvm-svn: 262661
2016-03-03 21:55:01 +00:00
Davide Italiano 05920b14c8 [ELF] Be slightly more consistent, use uint8_t instead of unsigned char.
llvm-svn: 262660
2016-03-03 21:54:03 +00:00
Devin Coughlin 578a20a82e [analyzer] ObjCDeallocChecker: Only check for nil-out when type is retainable.
This fixes a crash when setting a property of struct type in -dealloc.

llvm-svn: 262659
2016-03-03 21:38:39 +00:00
Jonathan Peyton c1a7c97c1b [STATS] fix output formatting when sample count is 0
Force 0.0 to be displayed for all statistics which have sample count equal to 0

llvm-svn: 262658
2016-03-03 21:24:13 +00:00
Lang Hames 3b514554a2 [RuntimeDyld] Fix '_' stripping in RTDyldMemoryManager::getSymbolAddressInProcess.
The RTDyldMemoryManager::getSymbolAddressInProcess method accepts a
linker-mangled symbol name, but it calls through to dlsym to do the lookup (via
DynamicLibrary::SearchForAddressOfSymbol), and dlsym expects an unmangled
symbol name.

Historically we've attempted to "demangle" by removing leading '_'s on all
platforms, and fallen back to an extra search if that failed. That's broken, as
it can cause symbols to resolve incorrectly on platforms that don't do mangling
if you query '_foo' and the process also happens to contain a 'foo'.

Fix this by demangling conditionally based on the host platform. That's safe
here because this function is specifically for symbols in the host process, so
the usual cross-process JIT looking concerns don't apply.

M    unittests/ExecutionEngine/ExecutionEngineTest.cpp
M    lib/ExecutionEngine/RuntimeDyld/RTDyldMemoryManager.cpp

llvm-svn: 262657
2016-03-03 21:23:15 +00:00
Jonathan Peyton 30138256fa [STATS] fix master and single timers
Only the thread which executes the single/master section will update its statistics.

llvm-svn: 262656
2016-03-03 21:21:05 +00:00