platform/upstream/llvm.git
8 years agoSwitch krait to use -mcpu=cortex-a15 for assembler tool invocations.
Stephen Hines [Fri, 4 Mar 2016 20:57:22 +0000 (20:57 +0000)]
Switch krait to use -mcpu=cortex-a15 for assembler tool invocations.

Summary:
Using -no-integrated-as causes -mcpu=krait to be transformed into
-march=armv7-a today. This precludes the assembler from using
instructions like sdiv, which are present for krait. Cortex-a15 is the
closest subset of functionality for krait, so we should switch the
assembler to use that instead.

Reviewers: cfe-commits, apazos, weimingz

Subscribers: aemerson

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

llvm-svn: 262742

8 years ago[OPENMP] Codegen for distribute directive
Carlo Bertolli [Fri, 4 Mar 2016 20:24:58 +0000 (20:24 +0000)]
[OPENMP] Codegen for distribute directive

This patch provide basic implementation of codegen for teams directive, excluding all clauses except dist_schedule. It also fixes parts of AST reader/writer to enable correct pre-compiled header handling.

http://reviews.llvm.org/D17170

llvm-svn: 262741

8 years ago[WebAssembly] Add another possible code-size optimization to README.txt
Dan Gohman [Fri, 4 Mar 2016 20:09:57 +0000 (20:09 +0000)]
[WebAssembly] Add another possible code-size optimization to README.txt

llvm-svn: 262740

8 years agoUpdate after r262737 in clang changed the accessor.
James Y Knight [Fri, 4 Mar 2016 19:30:53 +0000 (19:30 +0000)]
Update after r262737 in clang changed the accessor.

llvm-svn: 262739

8 years ago[ARM] Merging 64-bit divmod lib calls into one
Renato Golin [Fri, 4 Mar 2016 19:19:36 +0000 (19:19 +0000)]
[ARM] Merging 64-bit divmod lib calls into one

When div+rem calls on the same arguments are found, the ARM back-end merges the
two calls into one __aeabi_divmod call for up to 32-bits values. However,
for 64-bit values, which also have a lib call (__aeabi_ldivmod), it wasn't
merging the calls, and thus calling ldivmod twice and spilling the temporary
results, which generated pretty bad code.

This patch legalises 64-bit lib calls for divmod, so that now all the spilling
and the second call are gone. It also relaxes the DivRem combiner a bit on the
legal type check, since it was already checking for isLegalOrCustom on every
value, so the extra check for isTypeLegal was redundant.

Second attempt, creating TLI.isOperationCustom like isOperationExpand, to make
sure we only emit valid types or the ones that were explicitly marked as custom.
Now, passing check-all and test-suite on x86, ARM and AArch64.

This patch fixes PR17193 (and a long time FIXME in the tests).

llvm-svn: 262738

8 years agoMake TargetInfo store an actual DataLayout instead of a string.
James Y Knight [Fri, 4 Mar 2016 19:00:41 +0000 (19:00 +0000)]
Make TargetInfo store an actual DataLayout instead of a string.

Use it to calculate UserLabelPrefix, instead of specifying it (often
incorrectly).

Note that the *actual* user label prefix has always come from the
DataLayout, and is handled within LLVM. The main thing clang's
TargetInfo::UserLabelPrefix did was to set the #define value. Having
these be different from each-other is just silly.

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

llvm-svn: 262737

8 years ago[PGO] Add API to check compatibility of profile data in buffer
Xinliang David Li [Fri, 4 Mar 2016 18:58:30 +0000 (18:58 +0000)]
[PGO] Add API to check compatibility of profile data in buffer

This is needed by client which uses in-process merge API.

llvm-svn: 262736

8 years agoAdd a comment about _DYNAMIC.
Rui Ueyama [Fri, 4 Mar 2016 18:34:14 +0000 (18:34 +0000)]
Add a comment about _DYNAMIC.

llvm-svn: 262735

8 years agoFix api visibility
Xinliang David Li [Fri, 4 Mar 2016 18:33:49 +0000 (18:33 +0000)]
Fix api visibility

llvm-svn: 262734

8 years ago[ubsan/float-cast-overflow] Make the test also work with C++11 narrowing
Filipe Cabecinhas [Fri, 4 Mar 2016 18:33:44 +0000 (18:33 +0000)]
[ubsan/float-cast-overflow] Make the test also work with C++11 narrowing

llvm-svn: 262733

8 years agoAMDGPU/SI: Add support for spiling SGPRs to scratch buffer
Tom Stellard [Fri, 4 Mar 2016 18:31:18 +0000 (18:31 +0000)]
AMDGPU/SI: Add support for spiling SGPRs to scratch buffer

Summary:
This is necessary for when we run out of VGPRs and can no
longer use v_{read,write}_lane for spilling SGPRs.

Reviewers: arsenm

Subscribers: arsenm, llvm-commits

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

llvm-svn: 262732

8 years agoFix bot failure from r262721: unintented change in gold-plugin save-temps
Teresa Johnson [Fri, 4 Mar 2016 18:16:00 +0000 (18:16 +0000)]
Fix bot failure from r262721: unintented change in gold-plugin save-temps

The split code gen task ID should not be appended to save-temps output
file when the parallelism factor is 1 (not actually splitting).

llvm-svn: 262731

8 years ago[Statepoint docs] Delete trailing whitespace
Sanjoy Das [Fri, 4 Mar 2016 18:14:09 +0000 (18:14 +0000)]
[Statepoint docs] Delete trailing whitespace

llvm-svn: 262730

8 years ago[analyzer] Add diagnostic in ObjCDeallocChecker for use of -dealloc instead of -release.
Devin Coughlin [Fri, 4 Mar 2016 18:09:58 +0000 (18:09 +0000)]
[analyzer] Add diagnostic in ObjCDeallocChecker for use of -dealloc instead of -release.

In dealloc methods, the analyzer now warns when -dealloc is called directly on
a synthesized retain/copy ivar instead of -release. This is intended to find mistakes of
the form:

- (void)dealloc {
  [_ivar dealloc]; // Mistaken call to -dealloc instead of -release

  [super dealloc];
}

rdar://problem/16227989

llvm-svn: 262729

8 years agoAMDGPU/SI: Enable frame index scavenging during PrologEpilogueInserter
Tom Stellard [Fri, 4 Mar 2016 18:02:01 +0000 (18:02 +0000)]
AMDGPU/SI: Enable frame index scavenging during PrologEpilogueInserter

Summary:
This allows us to use virtual registers when we need extra registers
for inserting spill instructions in SIRegisterInfo:eliminateFrameIndex().

Once all the frame indices have been eliminated, the
PrologEpilogueInserter does an extra pass over the program to replace
all virtual registers with physical ones.

This allows us to make more efficient use of our emergency spill slots,
so we only need to create one.

Reviewers: arsenm

Subscribers: arsenm, llvm-commits

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

llvm-svn: 262728

8 years ago[ThinLTO] Ensure prevailing linkonce emitted as weak in ThinLTO backends
Teresa Johnson [Fri, 4 Mar 2016 17:48:35 +0000 (17:48 +0000)]
[ThinLTO] Ensure prevailing linkonce emitted as weak in ThinLTO backends

Summary:
Since IR files are all compiled into separate independent object files
in ThinLTO mode, the prevailing linkonce symbols must be emitted in its
object file even if it is no longer referenced there, e.g. if no
references remain in the module after inlining, since it may be
referenced by another ThinLTO compiled object file. This is done by
changing LDPR_PREVAILING_DEF_IRONLY* symbols to LDPR_PREVAILING_DEF,
which converts the prevailing linkonce to weak. We also don't need the
other prevailing IRONLY handling for internalization, which is not
currently performed for ThinLTO.

Test case included.

Reviewers: davidxl, rafael

Subscribers: rafael, joker.eph, llvm-commits

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

llvm-svn: 262727

8 years ago[Hexagon] Fix lowering of calls with the return type of i1
Krzysztof Parzyszek [Fri, 4 Mar 2016 17:38:05 +0000 (17:38 +0000)]
[Hexagon] Fix lowering of calls with the return type of i1

This fixes an assertion in test/CodeGen/Hexagon/ifcvt-edge-weight.ll
when run with -debug-only=isel

llvm-svn: 262726

8 years ago[mips][microMIPS] Prevent usage of OR16_MMR6 instruction when code for microMIPS...
Zoran Jovanovic [Fri, 4 Mar 2016 17:34:31 +0000 (17:34 +0000)]
[mips][microMIPS] Prevent usage of OR16_MMR6 instruction when code for microMIPS is generated.

Author: milena.vujosevic.janicic
Reviewers: dsanders
Differential Revision: http://reviews.llvm.org/D17373

llvm-svn: 262725

8 years ago[ThinLTO] Launch importing backends in parallel threads from gold plugin
Teresa Johnson [Fri, 4 Mar 2016 17:06:02 +0000 (17:06 +0000)]
[ThinLTO] Launch importing backends in parallel threads from gold plugin

Summary:
Launch ThinLTO backends (LTO and codegen pipelines with importing) in
parallel using a ThreadPool, after creating the combined index.
The number of threads is controlled by the existing -jobs gold plugin
option, or the hardware concurrency if not specified.

The old behavior of exiting after creating the combined index can be
invoked via a new thinlto-index-only plugin option.

This commit involves just the ThinLTO-specific pieces of D15390, the NFC
and other restructuring pieces were committed independently:
  r262677: Add hardware_concurrency interface to llvm::thread (NFC)
  r262719: Change split code gen to use ThreadPool
  r262721: Refactor gold-plugin codegen to prepare for ThinLTO threads (NFC)

Reviewers: pcc, joker.eph, rafael

Subscribers: rafael, davidxl, llvm-commits, joker.eph

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

llvm-svn: 262724

8 years ago[ubsan/cmake] Make sure we end up adding -frtti to ubsan_type_hash_itanium.cc, even...
Filipe Cabecinhas [Fri, 4 Mar 2016 17:02:06 +0000 (17:02 +0000)]
[ubsan/cmake] Make sure we end up adding -frtti to ubsan_type_hash_itanium.cc, even if -fno-rtti is the default for the platform

llvm-svn: 262723

8 years agoRefactor gold-plugin codegen to prepare for ThinLTO threads (NFC)
Teresa Johnson [Fri, 4 Mar 2016 16:36:06 +0000 (16:36 +0000)]
Refactor gold-plugin codegen to prepare for ThinLTO threads (NFC)

This is the NFC part remaining from D15390, which refactors the
current codegen() into a CodeGen class with various modular methods and
other helper functions that will be used by the follow-on ThinLTO piece.

llvm-svn: 262721

8 years agoRefactor duplicated code.
Rafael Espindola [Fri, 4 Mar 2016 16:14:19 +0000 (16:14 +0000)]
Refactor duplicated code.

llvm-svn: 262720

8 years agoChange split code gen to use ThreadPool
Teresa Johnson [Fri, 4 Mar 2016 15:39:13 +0000 (15:39 +0000)]
Change split code gen to use ThreadPool

Part of D15390.

llvm-svn: 262719

8 years ago[X86][AVX512] Added some basic X86ISD::VPERMV3 shuffle combining tests
Simon Pilgrim [Fri, 4 Mar 2016 15:19:42 +0000 (15:19 +0000)]
[X86][AVX512] Added some basic X86ISD::VPERMV3 shuffle combining tests

None of these actually combine yet as we haven't enabled X86ISD::VPERMV3 for target shuffle combining

llvm-svn: 262718

8 years agoReducing stack usage of test
Ben Craig [Fri, 4 Mar 2016 14:25:13 +0000 (14:25 +0000)]
Reducing stack usage of test

This test has a lot of classes with large amounts of manually inserted padding in them, presumably to prevent various optimizations. The test then creates lots of these objects on the stack. On embedded targets, this was usually enough to overflow the stack.

I moved the objects to global / namespace scope. Since the tests are each in their own namespace, there should be no cross-test conflicts.

llvm-svn: 262717

8 years agoMove class into anonymous namespace. NFC.
Benjamin Kramer [Fri, 4 Mar 2016 14:18:52 +0000 (14:18 +0000)]
Move class into anonymous namespace. NFC.

llvm-svn: 262716

8 years agoAdd a log statement
Pavel Labath [Fri, 4 Mar 2016 12:43:05 +0000 (12:43 +0000)]
Add a log statement

llvm-svn: 262715

8 years agoTest commit access
Sam Kolton [Fri, 4 Mar 2016 12:29:14 +0000 (12:29 +0000)]
Test commit access

llvm-svn: 262714

8 years agoResumbit "Fetch remote log files from LLGS tests"
Pavel Labath [Fri, 4 Mar 2016 11:27:00 +0000 (11:27 +0000)]
Resumbit "Fetch remote log files from LLGS tests"

The problem with the original patch (and my first attempt to fix) was that the value debug
monitor flags could persist from one test to another. Resetting the value in the setUp() function
fixes the problem.

llvm-svn: 262713

8 years agoFix warning in IRExecutionUnit.cpp
Pavel Labath [Fri, 4 Mar 2016 11:26:56 +0000 (11:26 +0000)]
Fix warning in IRExecutionUnit.cpp

llvm-svn: 262712

8 years agoAdd reverse file remapping for breakpoint set
Tamas Berghammer [Fri, 4 Mar 2016 11:26:44 +0000 (11:26 +0000)]
Add reverse file remapping for breakpoint set

LLDB can remap a source file to a new directory based on the
"target.sorce-map" to handle the usecase when the source code moved
between the compliation and the debugging. Previously the remapping
was only used to display the content of the file. This CL fixes the
scenario when a breakpoint is set based on the new an absolute path
with adding an inverse remapping step before looking up the breakpoint
location.

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

llvm-svn: 262711

8 years ago[X86][SSSE3] Added combine test for unary shuffle (pshufb) only referencing elements...
Simon Pilgrim [Fri, 4 Mar 2016 11:15:23 +0000 (11:15 +0000)]
[X86][SSSE3] Added combine test for unary shuffle (pshufb) only referencing elements from the second input of a binary shuffle (punpcklbw)

llvm-svn: 262710

8 years agotest commit
Valery Pykhtin [Fri, 4 Mar 2016 10:59:50 +0000 (10:59 +0000)]
test commit

llvm-svn: 262709

8 years ago[ELF][MIPS] Factor out the code reading and sign-extending low 16-bits of 32-bit...
Simon Atanasyan [Fri, 4 Mar 2016 10:55:29 +0000 (10:55 +0000)]
[ELF][MIPS] Factor out the code reading and sign-extending low 16-bits of 32-bit word. NFC

llvm-svn: 262708

8 years ago[ELF][MIPS] Factor out the code writing relocation result into low 16-bit of destinat...
Simon Atanasyan [Fri, 4 Mar 2016 10:55:24 +0000 (10:55 +0000)]
[ELF][MIPS] Factor out the code writing relocation result into low 16-bit of destination. NFC

llvm-svn: 262707

8 years ago[ELF][MIPS] Factor out the code reading and calculating AHL addend into the separate...
Simon Atanasyan [Fri, 4 Mar 2016 10:55:20 +0000 (10:55 +0000)]
[ELF][MIPS] Factor out the code reading and calculating AHL addend into the separate function. NFC

llvm-svn: 262706

8 years ago[ELF][MIPS] Use writeMipsHi16 to apply result of R_MIPS_PCHI16 relocation. NFC
Simon Atanasyan [Fri, 4 Mar 2016 10:55:16 +0000 (10:55 +0000)]
[ELF][MIPS] Use writeMipsHi16 to apply result of R_MIPS_PCHI16 relocation. NFC

llvm-svn: 262705

8 years ago[ELF][MIPS] Replace S and A arguments of the writeMipsHi16 function by the single...
Simon Atanasyan [Fri, 4 Mar 2016 10:55:12 +0000 (10:55 +0000)]
[ELF][MIPS] Replace S and A arguments of the writeMipsHi16 function by the single argument V. NFC

llvm-svn: 262704

8 years ago[ELF][MIPS] s/applyMipsHi16Reloc/writeMipsHi16/ NFC
Simon Atanasyan [Fri, 4 Mar 2016 10:55:04 +0000 (10:55 +0000)]
[ELF][MIPS] s/applyMipsHi16Reloc/writeMipsHi16/ NFC

llvm-svn: 262703

8 years agoMake headers self-contained again.
Benjamin Kramer [Fri, 4 Mar 2016 10:49:30 +0000 (10:49 +0000)]
Make headers self-contained again.

llvm-svn: 262702

8 years agoAMDGPU/SI: add llvm.amdgcn.image.atomic.* intrinsics
Nikolay Haustov [Fri, 4 Mar 2016 10:39:50 +0000 (10:39 +0000)]
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

8 years ago[SemaExprCXX] Avoid calling isInSystemHeader for invalid source locations
Pavel Labath [Fri, 4 Mar 2016 10:00:08 +0000 (10:00 +0000)]
[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

8 years ago[OPENMP 4.0] Codegen for 'declare reduction' construct.
Alexey Bataev [Fri, 4 Mar 2016 09:22:22 +0000 (09:22 +0000)]
[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

8 years ago[clang-tidy] Make 'modernize-use-nullptr' check work on multiple nested implicit...
Haojian Wu [Fri, 4 Mar 2016 08:55:54 +0000 (08:55 +0000)]
[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

8 years ago[Coverage] Fix the start/end locations of switch statements
Vedant Kumar [Fri, 4 Mar 2016 08:07:15 +0000 (08:07 +0000)]
[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

8 years ago[OPENMP] Simplify handling of clauses with postupdates, NFC.
Alexey Bataev [Fri, 4 Mar 2016 07:21:16 +0000 (07:21 +0000)]
[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

8 years ago[index] Distinguish USRs of anonymous enums by using their first enumerator.
Argyrios Kyrtzidis [Fri, 4 Mar 2016 07:17:53 +0000 (07:17 +0000)]
[index] Distinguish USRs of anonymous enums by using their first enumerator.

rdar://24609949.

llvm-svn: 262695

8 years ago[index] Include parameter types in the USRs for C functions marked with 'overloadable...
Argyrios Kyrtzidis [Fri, 4 Mar 2016 07:17:48 +0000 (07:17 +0000)]
[index] Include parameter types in the USRs for C functions marked with 'overloadable' attribute.

llvm-svn: 262694

8 years ago[index] In ObjC++ handle objc type parameters for function USRs.
Argyrios Kyrtzidis [Fri, 4 Mar 2016 07:17:43 +0000 (07:17 +0000)]
[index] In ObjC++ handle objc type parameters for function USRs.

llvm-svn: 262693

8 years ago[OpenCL] Refine pipe builtin support
Xiuli Pan [Fri, 4 Mar 2016 07:11:16 +0000 (07:11 +0000)]
[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

8 years ago[MIPS] initFeatureMap() to handle empty string argument
Bhushan D. Attarde [Fri, 4 Mar 2016 06:56:29 +0000 (06:56 +0000)]
[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

8 years ago[Compiler-rt][safestack] Enable for MIPS
Mohit K. Bhakkad [Fri, 4 Mar 2016 06:15:59 +0000 (06:15 +0000)]
[Compiler-rt][safestack] Enable for MIPS

Reviewers: samsonov

Subscribers: jaydeep, sagar, llvm-commits

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

llvm-svn: 262690

8 years ago[powerpc] pacify lint for java_race_pc.cc
Bill Seurer [Fri, 4 Mar 2016 06:02:52 +0000 (06:02 +0000)]
[powerpc] pacify lint for java_race_pc.cc

Fix blank lines.

llvm-svn: 262689

8 years ago[X86] Pass __m64 types via SSE registers for GCC compatibility
David Majnemer [Fri, 4 Mar 2016 05:26:16 +0000 (05:26 +0000)]
[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

8 years ago[VFS] Switch from close to SafelyCloseFileDescriptor
David Majnemer [Fri, 4 Mar 2016 05:26:14 +0000 (05:26 +0000)]
[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

8 years ago[index] Ignore ObjCTypeParamDecls during indexing.
Argyrios Kyrtzidis [Fri, 4 Mar 2016 04:24:32 +0000 (04:24 +0000)]
[index] Ignore ObjCTypeParamDecls during indexing.

llvm-svn: 262686

8 years agoUse check function.
Rui Ueyama [Fri, 4 Mar 2016 01:56:52 +0000 (01:56 +0000)]
Use check function.

llvm-svn: 262685

8 years ago[ELF] Generalize symbol type handling.
Davide Italiano [Fri, 4 Mar 2016 01:55:28 +0000 (01:55 +0000)]
[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

8 years agoAnnotate our undefined behaviour to sneak it past the sanitizers
Justin Bogner [Fri, 4 Mar 2016 01:52:47 +0000 (01:52 +0000)]
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

8 years agoFix a memory leak.
Easwaran Raman [Fri, 4 Mar 2016 01:18:40 +0000 (01:18 +0000)]
Fix a memory leak.

llvm-svn: 262682

8 years agoCodeGen: Tune the SmallVector size in LiveRange
Justin Bogner [Fri, 4 Mar 2016 00:58:39 +0000 (00:58 +0000)]
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

8 years ago[TSan] Fix compiler warning in Go sanity test.
Alexey Samsonov [Fri, 4 Mar 2016 00:56:15 +0000 (00:56 +0000)]
[TSan] Fix compiler warning in Go sanity test.

llvm-svn: 262680

8 years agoFix a use-after-free bug introduced in r262636
Easwaran Raman [Fri, 4 Mar 2016 00:44:01 +0000 (00:44 +0000)]
Fix a use-after-free bug introduced in r262636

llvm-svn: 262679

8 years ago[asan] Fix odr_c_test failure with gold linker
Alexey Samsonov [Fri, 4 Mar 2016 00:41:39 +0000 (00:41 +0000)]
[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

8 years agoAdd hardware_concurrency interface to llvm::thread (NFC)
Teresa Johnson [Fri, 4 Mar 2016 00:25:54 +0000 (00:25 +0000)]
Add hardware_concurrency interface to llvm::thread (NFC)

Part of D15390.

llvm-svn: 262677

8 years ago[gold] Handle modules that are not included in the link.
Evgeniy Stepanov [Fri, 4 Mar 2016 00:23:29 +0000 (00:23 +0000)]
[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

8 years ago[powerpc] activate java_race_pc.cc on powerpc64le
Bill Seurer [Fri, 4 Mar 2016 00:22:40 +0000 (00:22 +0000)]
[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

8 years agoFix memory leak in tests.
Easwaran Raman [Thu, 3 Mar 2016 23:55:41 +0000 (23:55 +0000)]
Fix memory leak in tests.

llvm-svn: 262674

8 years ago[libfuzzer] arbitrary function adapter.
Mike Aizatsky [Thu, 3 Mar 2016 23:45:29 +0000 (23:45 +0000)]
[libfuzzer] arbitrary function adapter.

The adapter automates converting sequence of bytes into arbitrary
arguments.

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

llvm-svn: 262673

8 years ago[docs] Add a description of current problem areas to the statepoint docs
Philip Reames [Thu, 3 Mar 2016 23:24:44 +0000 (23:24 +0000)]
[docs] Add a description of current problem areas to the statepoint docs

Triggered by a question on llvm-dev about status

llvm-svn: 262671

8 years ago[InstCombine] Combine A->B->A BitCast
Guozhi Wei [Thu, 3 Mar 2016 23:21:38 +0000 (23:21 +0000)]
[InstCombine] Combine A->B->A BitCast

This patch enhances InstCombine to handle following case:

        A  ->  B    bitcast
        PHI
        B  ->  A    bitcast

llvm-svn: 262670

8 years ago[powerpc] activate java_race_pc.cc on powerpc64le
Bill Seurer [Thu, 3 Mar 2016 23:07:43 +0000 (23:07 +0000)]
[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

8 years agollvm/test/CodeGen/ARM/rem_crash.ll: Avoid unsupported targets to specify explicit...
NAKAMURA Takumi [Thu, 3 Mar 2016 22:38:39 +0000 (22:38 +0000)]
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

8 years ago[libFuzzer] when interrupted, call _Exit() instead of exit()
Kostya Serebryany [Thu, 3 Mar 2016 22:36:37 +0000 (22:36 +0000)]
[libFuzzer] when interrupted, call _Exit() instead of exit()

llvm-svn: 262667

8 years agoRename 'fatal' to 'check' when it doesn't always fail.
Rafael Espindola [Thu, 3 Mar 2016 22:24:39 +0000 (22:24 +0000)]
Rename 'fatal' to 'check' when it doesn't always fail.

llvm-svn: 262666

8 years ago[SCEVValidator] Fix loop exit values considered affine.
Michael Kruse [Thu, 3 Mar 2016 22:10:52 +0000 (22:10 +0000)]
[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

8 years agoPass scope and LoopInfo to SCEVValidator. NFC.
Michael Kruse [Thu, 3 Mar 2016 22:10:47 +0000 (22:10 +0000)]
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

8 years ago[OPENMP] firstprivate and private clauses of teams, host codegeneration
Carlo Bertolli [Thu, 3 Mar 2016 22:09:40 +0000 (22:09 +0000)]
[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

8 years agoRemove dead code.
Rui Ueyama [Thu, 3 Mar 2016 21:56:21 +0000 (21:56 +0000)]
Remove dead code.

llvm-svn: 262662

8 years ago[X86][AVX512BW] Fixed 512-bit PSHUFB shuffle mask decode and added combine test.
Simon Pilgrim [Thu, 3 Mar 2016 21:55:01 +0000 (21:55 +0000)]
[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

8 years ago[ELF] Be slightly more consistent, use uint8_t instead of unsigned char.
Davide Italiano [Thu, 3 Mar 2016 21:54:03 +0000 (21:54 +0000)]
[ELF] Be slightly more consistent, use uint8_t instead of unsigned char.

llvm-svn: 262660

8 years ago[analyzer] ObjCDeallocChecker: Only check for nil-out when type is retainable.
Devin Coughlin [Thu, 3 Mar 2016 21:38:39 +0000 (21:38 +0000)]
[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

8 years ago[STATS] fix output formatting when sample count is 0
Jonathan Peyton [Thu, 3 Mar 2016 21:24:13 +0000 (21:24 +0000)]
[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

8 years ago[RuntimeDyld] Fix '_' stripping in RTDyldMemoryManager::getSymbolAddressInProcess.
Lang Hames [Thu, 3 Mar 2016 21:23:15 +0000 (21:23 +0000)]
[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

8 years ago[STATS] fix master and single timers
Jonathan Peyton [Thu, 3 Mar 2016 21:21:05 +0000 (21:21 +0000)]
[STATS] fix master and single timers

Only the thread which executes the single/master section will update its statistics.

llvm-svn: 262656

8 years agofix some minor typos in the doc
Sylvestre Ledru [Thu, 3 Mar 2016 20:57:16 +0000 (20:57 +0000)]
fix some minor typos in the doc

llvm-svn: 262655

8 years agoFix two minor syntax issues in the documentation
Sylvestre Ledru [Thu, 3 Mar 2016 20:54:26 +0000 (20:54 +0000)]
Fix two minor syntax issues in the documentation

llvm-svn: 262654

8 years agoDelete dead code.
Rafael Espindola [Thu, 3 Mar 2016 20:45:26 +0000 (20:45 +0000)]
Delete dead code.

llvm-svn: 262653

8 years agoAdd code generation for teams directive inside target region
Carlo Bertolli [Thu, 3 Mar 2016 20:34:23 +0000 (20:34 +0000)]
Add code generation for teams directive inside target region

llvm-svn: 262652

8 years ago[ELF] - Do not allow .bss to occupy the file space when producing relocatable output
George Rimar [Thu, 3 Mar 2016 20:24:14 +0000 (20:24 +0000)]
[ELF] - Do not allow .bss to occupy the file space when producing relocatable output

When generating relocatable output SHT_NOBITS sections
were still occupy the file space.

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

llvm-svn: 262650

8 years agotests: Fix some spelling mistakes
Tobias Grosser [Thu, 3 Mar 2016 19:51:03 +0000 (19:51 +0000)]
tests: Fix some spelling mistakes

llvm-svn: 262649

8 years ago[ValueTracking] "constant fold" an experimental hidden option
Philip Reames [Thu, 3 Mar 2016 19:50:32 +0000 (19:50 +0000)]
[ValueTracking] "constant fold" an experimental hidden option

llvm-svn: 262648

8 years agodocs: Fix some spelling mistakes
Tobias Grosser [Thu, 3 Mar 2016 19:48:30 +0000 (19:48 +0000)]
docs: Fix some spelling mistakes

llvm-svn: 262647

8 years ago[ValueTracking] Remove dead code from an old experiment
Philip Reames [Thu, 3 Mar 2016 19:44:06 +0000 (19:44 +0000)]
[ValueTracking] Remove dead code from an old experiment

This experiment was originally about trying to use facts implied dominating conditions to infer more precise known bits.  While the compile time was found to be acceptable on several large code bases, we never found sufficiently profitable examples to justify turning on the code by default.  Given this, it's time to abandon the experiment.

Several folks have commented that they've found this useful for experimentation, but nothing has come of those experiments.  Given how easy the patch is to apply, there's no reason to leave the code in tree.

For anyone interested in further investigation in this area, I recommend finding the summary email I sent on one of the original review threads.  In particular, I now believe the use-list based approach is strictly worse than the dom-tree-walking approach.

llvm-svn: 262646

8 years ago[InstCombine] transform bitcasted bitwise logic ops with constants (PR26702)
Sanjay Patel [Thu, 3 Mar 2016 19:19:04 +0000 (19:19 +0000)]
[InstCombine] transform bitcasted bitwise logic ops with constants (PR26702)

Given that we're not actually reducing the instruction count in the included
regression tests, I think we would call this a canonicalization step.

The motivation comes from the example in PR26702:
https://llvm.org/bugs/show_bug.cgi?id=26702

If we hoist the bitwise logic ahead of the bitcast, the previously unoptimizable
example of:

define <4 x i32> @is_negative(<4 x i32> %x) {
  %lobit = ashr <4 x i32> %x, <i32 31, i32 31, i32 31, i32 31>
  %not = xor <4 x i32> %lobit, <i32 -1, i32 -1, i32 -1, i32 -1>
  %bc = bitcast <4 x i32> %not to <2 x i64>
  %notnot = xor <2 x i64> %bc, <i64 -1, i64 -1>
  %bc2 = bitcast <2 x i64> %notnot to <4 x i32>
  ret <4 x i32> %bc2
}

Simplifies to the expected:

define <4 x i32> @is_negative(<4 x i32> %x) {
  %lobit = ashr <4 x i32> %x, <i32 31, i32 31, i32 31, i32 31>
  ret <4 x i32> %lobit
}

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

llvm-svn: 262645

8 years ago[PGO] Add API for profile merge from buffer
Xinliang David Li [Thu, 3 Mar 2016 18:54:46 +0000 (18:54 +0000)]
[PGO] Add API for profile merge from buffer

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

llvm-svn: 262644

8 years agoFix breakage caused by r262636.
Easwaran Raman [Thu, 3 Mar 2016 18:53:20 +0000 (18:53 +0000)]
Fix breakage caused by r262636.

Use LLVM_ATTRIBUTE_UNUSED instead of __attribute_((unused))

llvm-svn: 262643

8 years agoFix PR26818.
Rafael Espindola [Thu, 3 Mar 2016 18:44:38 +0000 (18:44 +0000)]
Fix PR26818.

The hack of using a plt address as the address of an undefined function
only works in executables. Don't try it with shared libraries.

llvm-svn: 262642

8 years ago[OpenCL] Improve diagnostics of address spaces for variables in function
Anastasia Stulova [Thu, 3 Mar 2016 18:38:40 +0000 (18:38 +0000)]
[OpenCL] Improve diagnostics of address spaces for variables in function

 - Prevent local variables to be declared in global AS
 - Diagnose AS of local variables with an extern storage class
   as if they would be in a program scope

Review: http://reviews.llvm.org/D17345
llvm-svn: 262641

8 years ago[ConstantRange] Rename test; NFC
Sanjoy Das [Thu, 3 Mar 2016 18:31:33 +0000 (18:31 +0000)]
[ConstantRange] Rename test; NFC

llvm-svn: 262640