platform/upstream/llvm.git
9 years agoFix LLGS to enable read type watchpoints
Omair Javaid [Wed, 12 Aug 2015 11:30:21 +0000 (11:30 +0000)]
Fix LLGS to enable read type watchpoints
http://reviews.llvm.org/D11902

llvm-svn: 244741

9 years ago[X86] Disable mul -> shl + lea combine when compiling for minsize
Michael Kuperstein [Wed, 12 Aug 2015 11:27:26 +0000 (11:27 +0000)]
[X86] Disable mul -> shl + lea combine when compiling for minsize

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

llvm-svn: 244740

9 years agoImprove check for ASAN callbacks
Tamas Berghammer [Wed, 12 Aug 2015 11:13:11 +0000 (11:13 +0000)]
Improve check for ASAN callbacks

The ASAN callbacks are public symbols so we can search for them
with reading only the symbol table (not the debug info). Whit this
change the attach time for big executables with debug symbols
decreased by a factor of ~4.

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

llvm-svn: 244739

9 years agoDownload symbol file for .oat files on android
Tamas Berghammer [Wed, 12 Aug 2015 11:10:25 +0000 (11:10 +0000)]
Download symbol file for .oat files on android

On android .oat files (compiled java code) don't have symbol
information but on SDK 23+ it can be generated by the oatdump tool
(based on the dex information).

This CL adds logic to download this information and store it in the
module cache.

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

llvm-svn: 244738

9 years agoFetch SDK version from PlatformAndroid
Tamas Berghammer [Wed, 12 Aug 2015 11:10:19 +0000 (11:10 +0000)]
Fetch SDK version from PlatformAndroid

The SDK version implies the features supported by a given android
device. This version number will be used in future changes to execute
the right command on the device.

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

llvm-svn: 244737

9 years agoRemove identity operation from SCEVAffinator
Johannes Doerfert [Wed, 12 Aug 2015 10:58:01 +0000 (10:58 +0000)]
Remove identity operation from SCEVAffinator

llvm-svn: 244736

9 years agoRevert r244459 'Make StmtSet a list'
Johannes Doerfert [Wed, 12 Aug 2015 10:55:52 +0000 (10:55 +0000)]
Revert r244459 'Make StmtSet a list'

llvm-svn: 244735

9 years agoAdd caching to the SCEVAffinator
Johannes Doerfert [Wed, 12 Aug 2015 10:46:33 +0000 (10:46 +0000)]
Add caching to the SCEVAffinator

  While the compile time is not affected by this patch much it will
  allow us to look at all translated expressions after the SCoP is build
  in a convenient way. Additionally, bigger SCoPs or SCoPs with
  repeating complicated expressions might benefit from the cache later
  on.

Reviewers: grosser, Meinersbur

Subscribers: #polly

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

llvm-svn: 244734

9 years ago[FIX] Typo
Johannes Doerfert [Wed, 12 Aug 2015 10:45:20 +0000 (10:45 +0000)]
[FIX] Typo

llvm-svn: 244733

9 years ago[MC] Convert the last test using macho-dump under X86/ to llvm-readobj.
Davide Italiano [Wed, 12 Aug 2015 10:36:16 +0000 (10:36 +0000)]
[MC] Convert the last test using macho-dump under X86/ to llvm-readobj.

llvm-svn: 244732

9 years agoExpose the SCEVAffinator and make it a member of a SCoP (cont'd)
Johannes Doerfert [Wed, 12 Aug 2015 10:28:45 +0000 (10:28 +0000)]
Expose the SCEVAffinator and make it a member of a SCoP (cont'd)

  Added missing documentation and linked to the correct revision.

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

llvm-svn: 244731

9 years agoExpose the SCEVAffinator and make it a member of a SCoP.
Johannes Doerfert [Wed, 12 Aug 2015 10:19:50 +0000 (10:19 +0000)]
Expose the SCEVAffinator and make it a member of a SCoP.

  This change has three major advantages:
    - The ScopInfo becomes smaller.
    - It allows to use the SCEVAffinator from outside the ScopInfo.
    - A member object allows state which in turn allows e.g., caching.

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

llvm-svn: 244730

9 years ago[X86] Allow x86 call frame optimization to fold more loads into pushes
Michael Kuperstein [Wed, 12 Aug 2015 10:14:58 +0000 (10:14 +0000)]
[X86] Allow x86 call frame optimization to fold more loads into pushes

This abstracts away the test for "when can we fold across a MachineInstruction"
into the the MI interface, and changes call-frame optimization use the same test
the peephole optimizer users.

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

llvm-svn: 244729

9 years agoAMDGPU: Fix assert on dbg_value instructions
Matt Arsenault [Wed, 12 Aug 2015 09:04:44 +0000 (09:04 +0000)]
AMDGPU: Fix assert on dbg_value instructions

llvm-svn: 244728

9 years agoMake arc unit work with ninja builds
Johannes Doerfert [Wed, 12 Aug 2015 09:02:20 +0000 (09:02 +0000)]
Make arc unit work with ninja builds

  In order to find the llvm-obj directory it has to be (or a soft link
  to it) at one of the following locations:

    ${POLLY_SRC_DIR}/build
    ${POLLY_SRC_DIR}.build
    ${POLLY_SRC_DIR}-build
    s/${POLLY_SRC_DIR}/src/build

  Alternatively, the environment variable $POLLY_BIN_DIR can point to it.

llvm-svn: 244727

9 years agoAdjusted arc linter config for modern version of arcanist
Johannes Doerfert [Wed, 12 Aug 2015 09:01:16 +0000 (09:01 +0000)]
Adjusted arc linter config for modern version of arcanist

llvm-svn: 244726

9 years agounused variable warning fix.
Simon Pilgrim [Wed, 12 Aug 2015 08:23:36 +0000 (08:23 +0000)]
unused variable warning fix.

llvm-svn: 244725

9 years agoRevert "Revised test to pass under updated dtor callback implementation"
Daniel Jasper [Wed, 12 Aug 2015 08:13:39 +0000 (08:13 +0000)]
Revert "Revised test to pass under updated dtor callback implementation"

This breaks the buildbot:
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux/builds/19656

llvm-svn: 244724

9 years ago[InstCombine] Move SSE/AVX vector blend folding to instcombiner
Simon Pilgrim [Wed, 12 Aug 2015 08:08:56 +0000 (08:08 +0000)]
[InstCombine] Move SSE/AVX vector blend folding to instcombiner

As discussed in D11886, this patch moves the SSE/AVX vector blend folding to instcombiner from PerformINTRINSIC_WO_CHAINCombine (which allows us to remove this completely).

InstCombiner already had partial support for this, I just had to add support for zero (ConstantAggregateZero) masks and also the case where both selection inputs were the same (allowing us to ignore the mask).

I also moved all the relevant combine tests into InstCombine/blend_x86.ll

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

llvm-svn: 244723

9 years agoReinstantiate better diagnostic, this time with a fatal error so we don't add a depen...
Manuel Klimek [Wed, 12 Aug 2015 07:57:16 +0000 (07:57 +0000)]
Reinstantiate better diagnostic, this time with a fatal error so we don't add a dependency onto gtest from the header.

llvm-svn: 244722

9 years agoAlways model PHI nodes in scop (if not in same nonaffine subregion)
Tobias Grosser [Wed, 12 Aug 2015 07:48:54 +0000 (07:48 +0000)]
Always model PHI nodes in scop (if not in same nonaffine subregion)

Before we only modeled PHI nodes if at least one incoming basic block was itself
part of the region, now we always model them except if all of their operands are
part of a single non-affine subregion which we model as a black-box.

This change only affects PHI nodes in the entry block, that have exactly one
incoming edge. Before this change, we did not model them and as a result code
generation would not know how to code generate them. With this change, code
generation can code generate them like any other PHI node.

This issue was exposed by r244606. Before this change simplifyRegion would have
moved these PHI nodes out of the SCoP, so we would never have tried to code
generate them. We could implement this behavior again, but changing the IR
after the scop has been modeled and transformed always adds a risk of us
invalidating earlier analysis results. It seems more save and overall also more
consistent to just model and handle this one-entry-edge PHI nodes like any
other PHI node in the scop.

Solution proposed by:  Michael Kruse  <llvm@meinersbur.de>

llvm-svn: 244721

9 years agoAdd another test case with trival PHI in entry BB
Michael Kruse [Wed, 12 Aug 2015 07:34:55 +0000 (07:34 +0000)]
Add another test case with trival PHI in entry BB

This one was extracted from the test-suite's pifft and caused a
miscompilation because a scalar was not written to its alloca address.

llvm-svn: 244720

9 years ago[OPENMP] Fix for http://llvm.org/PR24430: clang hangs on invalid input with openmp...
Alexey Bataev [Wed, 12 Aug 2015 07:10:54 +0000 (07:10 +0000)]
[OPENMP] Fix for llvm.org/PR24430: clang hangs on invalid input with openmp directive

Add parsing of openmp directives inside structs/unions in C mode.

llvm-svn: 244719

9 years ago[TableGen] Remove unused constructor.
Craig Topper [Wed, 12 Aug 2015 06:43:10 +0000 (06:43 +0000)]
[TableGen] Remove unused constructor.

llvm-svn: 244718

9 years agoFix CMake error whet llvm-config reports a non-existent source directory.
Eric Fiselier [Wed, 12 Aug 2015 06:36:19 +0000 (06:36 +0000)]
Fix CMake error whet llvm-config reports a non-existent source directory.

llvm-svn: 244717

9 years agoHave debugserver send the OS version string plus
Jason Molenda [Wed, 12 Aug 2015 03:27:33 +0000 (03:27 +0000)]
Have debugserver send the OS version string plus
major, minor, and patchlevel in the qHostInfo reply.
Document that qHostInfo may report major/minor/patch
separately / in addition to the version: combination.

<rdar://problem/22125465>

llvm-svn: 244716

9 years agolibclang: Add period to typedef kind docblock
Saleem Abdulrasool [Wed, 12 Aug 2015 03:21:44 +0000 (03:21 +0000)]
libclang: Add period to typedef kind docblock

All of the other docblocks for the CXCursor_* cursor kind enum values
include documentation that ends with a period. Add a period to the end
of the CXCursor_TypedefDecl documentation to follow this convention.

Patch by Brian Gesiak!

llvm-svn: 244715

9 years ago[modules] Fix thread safety analysis to cope with merging of FieldDecls across modules.
Richard Smith [Wed, 12 Aug 2015 02:17:52 +0000 (02:17 +0000)]
[modules] Fix thread safety analysis to cope with merging of FieldDecls across modules.

llvm-svn: 244714

9 years agoX86: hoist a condition into a variable (NFC)
Saleem Abdulrasool [Wed, 12 Aug 2015 02:01:36 +0000 (02:01 +0000)]
X86: hoist a condition into a variable (NFC)

The same value is used multiple times through the function.  Hoist the condition
into a variable.  This should fix a silly static analysis warning where the
conditions flip around.  No functional change intended.

llvm-svn: 244713

9 years ago[libFuzzer] add two flags, -tbm_depth and -tbm_width to control how the trace-based...
Kostya Serebryany [Wed, 12 Aug 2015 01:55:37 +0000 (01:55 +0000)]
[libFuzzer] add two flags, -tbm_depth and -tbm_width to control how the trace-based-mutations are applied

llvm-svn: 244712

9 years agoFix the alignment of the section headers.
Rafael Espindola [Wed, 12 Aug 2015 01:45:28 +0000 (01:45 +0000)]
Fix the alignment of the section headers.

Thanks a lot to Rui for noticing it.

llvm-svn: 244711

9 years agoExport snprintf to avoid linking error with liblldb on Windows.
Chaoren Lin [Wed, 12 Aug 2015 01:22:24 +0000 (01:22 +0000)]
Export snprintf to avoid linking error with liblldb on Windows.

Reviewers: zturner, ovyalov

Subscribers: lldb-commits

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

llvm-svn: 244710

9 years agoRevised test to pass under updated dtor callback implementation
Naomi Musgrave [Wed, 12 Aug 2015 01:15:28 +0000 (01:15 +0000)]
Revised test to pass under updated dtor callback implementation

Summary: New implementation for dtor sanitizer callback poisons only class members, and emits poisoning callback before base dtor invoked.

Reviewers: eugenis, kcc

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

Explicit dtor invocation

llvm-svn: 244709

9 years ago[libFuzzer] add colons to the stats output to avoid confusion
Kostya Serebryany [Wed, 12 Aug 2015 01:04:27 +0000 (01:04 +0000)]
[libFuzzer] add colons to the stats output to avoid confusion

llvm-svn: 244708

9 years ago[libFuzzer] use raw C IO to reduce the risk of a deadlock in a signal handler.
Kostya Serebryany [Wed, 12 Aug 2015 00:55:09 +0000 (00:55 +0000)]
[libFuzzer] use raw C IO to reduce the risk of a deadlock in a signal handler.

llvm-svn: 244707

9 years agoDeleted old fixme ( ͡° ͜ʖ ͡°)
Piotr Padlewski [Wed, 12 Aug 2015 00:47:19 +0000 (00:47 +0000)]
Deleted old fixme ( ͡° ͜ʖ ͡°)

http://reviews.llvm.org/D11928

llvm-svn: 244706

9 years ago[x86] enable machine combiner reassociations for 256-bit vector FP mul/add
Sanjay Patel [Wed, 12 Aug 2015 00:29:10 +0000 (00:29 +0000)]
[x86] enable machine combiner reassociations for 256-bit vector FP mul/add

llvm-svn: 244705

9 years ago[LoopDist] Add test for missing coverage
Adam Nemet [Wed, 12 Aug 2015 00:21:59 +0000 (00:21 +0000)]
[LoopDist] Add test for missing coverage

Add a testcase to ensure that if we can't find bounds for a necessary
memcheck we don't distribute.

llvm-svn: 244703

9 years agoELF: Create a string table.
Rafael Espindola [Wed, 12 Aug 2015 00:00:24 +0000 (00:00 +0000)]
ELF: Create a string table.

For now only the sections are in it, but it already makes the output easier
to read and test.

llvm-svn: 244702

9 years agoELF2: Make Defined{Regular,Weak} ctors look the same as other SymbolBody ctors.
Rui Ueyama [Tue, 11 Aug 2015 23:37:25 +0000 (23:37 +0000)]
ELF2: Make Defined{Regular,Weak} ctors look the same as other SymbolBody ctors.

llvm-svn: 244701

9 years agoTemplate ELF's OutputSection.
Rafael Espindola [Tue, 11 Aug 2015 23:34:29 +0000 (23:34 +0000)]
Template ELF's OutputSection.

This removes what I think is the last hard coded ELF64 structure.

llvm-svn: 244700

9 years agoNFC. Fixing a red squiggly line in my editor.
Chris Bieneman [Tue, 11 Aug 2015 23:31:43 +0000 (23:31 +0000)]
NFC. Fixing a red squiggly line in my editor.

llvm-svn: 244699

9 years agoPseudoSourceValue: Transform the mips subclass to target independent subclasses
Alex Lorenz [Tue, 11 Aug 2015 23:23:17 +0000 (23:23 +0000)]
PseudoSourceValue: Transform the mips subclass to target independent subclasses

This commit transforms the mips-specific 'MipsCallEntry' subclass of the
'PseudoSourceValue' class into two, target-independent subclasses named
'GlobalValuePseudoSourceValue' and 'ExternalSymbolPseudoSourceValue'.

This change makes it easier to serialize the pseudo source values by removing
target-specific pseudo source values.

Reviewers: Akira Hatanaka
llvm-svn: 244698

9 years agoMove more code that is local to Writer.cpp to an anonymous namespace.
Rafael Espindola [Tue, 11 Aug 2015 23:22:24 +0000 (23:22 +0000)]
Move more code that is local to Writer.cpp to an anonymous namespace.

llvm-svn: 244697

9 years agoDelete dead code.
Rafael Espindola [Tue, 11 Aug 2015 23:19:06 +0000 (23:19 +0000)]
Delete dead code.

llvm-svn: 244696

9 years agoUntabify.
Eric Christopher [Tue, 11 Aug 2015 23:17:31 +0000 (23:17 +0000)]
Untabify.

llvm-svn: 244695

9 years agoBe a bit more consistent about using uintX_t for offsets and sizes. NFC.
Rafael Espindola [Tue, 11 Aug 2015 23:14:13 +0000 (23:14 +0000)]
Be a bit more consistent about using uintX_t for offsets and sizes. NFC.

llvm-svn: 244694

9 years agoPseudoSourceValue: Replace global manager with a manager in a machine function.
Alex Lorenz [Tue, 11 Aug 2015 23:09:45 +0000 (23:09 +0000)]
PseudoSourceValue: Replace global manager with a manager in a machine function.

This commit removes the global manager variable which is responsible for
storing and allocating pseudo source values and instead it introduces a new
manager class named 'PseudoSourceValueManager'. Machine functions now own an
instance of the pseudo source value manager class.

This commit also modifies the 'get...' methods in the 'MachinePointerInfo'
class to construct pseudo source values using the instance of the pseudo
source value manager object from the machine function.

This commit updates calls to the 'get...' methods from the 'MachinePointerInfo'
class in a lot of different files because those calls now need to pass in a
reference to a machine function to those methods.

This change will make it easier to serialize pseudo source values as it will
enable me to transform the mips specific MipsCallEntry PseudoSourceValue
subclass into two target independent subclasses.

Reviewers: Akira Hatanaka
llvm-svn: 244693

9 years agoAdd test case for entry node with trivial PHI
Michael Kruse [Tue, 11 Aug 2015 23:09:19 +0000 (23:09 +0000)]
Add test case for entry node with trivial PHI

This is a break-down from the test-suite's oggenc where Polly currently
crashes.

llvm-svn: 244692

9 years agoCOFF: Align sections to 512-byte boundaries on disk.
Rui Ueyama [Tue, 11 Aug 2015 23:09:00 +0000 (23:09 +0000)]
COFF: Align sections to 512-byte boundaries on disk.

Sections must start at page boundaries in memory, but they
can be aligned to sector boundaries (512-bytes) on disk.
We aligned them to 4096-byte boundaries even on disk, so we
wasted disk space a bit.

llvm-svn: 244691

9 years ago[LAA] Fix typo in test
Adam Nemet [Tue, 11 Aug 2015 23:03:09 +0000 (23:03 +0000)]
[LAA] Fix typo in test

llvm-svn: 244690

9 years agoClangASTType is now CompilerType.
Greg Clayton [Tue, 11 Aug 2015 22:53:00 +0000 (22:53 +0000)]
ClangASTType is now CompilerType.

This is more preparation for multiple different kinds of types from different compilers (clang, Pascal, Go, RenderScript, Swift, etc).

llvm-svn: 244689

9 years agoPseudoSourceValue: Introduce a 'PSVKind' enumerator.
Alex Lorenz [Tue, 11 Aug 2015 22:32:00 +0000 (22:32 +0000)]
PseudoSourceValue: Introduce a 'PSVKind' enumerator.

This commit introduces a new enumerator named 'PSVKind' in the
'PseudoSourceValue' class. This enumerator is now used to distinguish between
the various kinds of pseudo source values.

This change is done in preparation for the changes to the pseudo source value
object management and to the PseudoSourceValue's class hierarchy - the next two
PseudoSourceValue commits will get rid of the global variable that manages the
pseudo source values and the mips specific MipsCallEntry subclass.

Reviewers: Akira Hatanaka
llvm-svn: 244687

9 years agoPseudoSourceValue: Update comments and fix lowercase variable names. NFC.
Alex Lorenz [Tue, 11 Aug 2015 22:23:19 +0000 (22:23 +0000)]
PseudoSourceValue: Update comments and fix lowercase variable names. NFC.

This commit updates the documentation comments in PseudoSourceValue.cpp and
PseudoSourceValue.h based on the LLVM's documentation style. It also fixes
several instances of variable names that started with a lowercase letter.

This change is done in preparation for the changes to the pseudo source value
object management and to the PseudoSourceValue's class hierarchy.

llvm-svn: 244686

9 years agoReformat PseudoSourceValue.cpp and PseudoSourceValue.h. NFC.
Alex Lorenz [Tue, 11 Aug 2015 22:17:22 +0000 (22:17 +0000)]
Reformat PseudoSourceValue.cpp and PseudoSourceValue.h. NFC.

This commit reformats the files lib/CodeGen/PseudoSourceValue.cpp and
include/llvm/CodeGen/PseudoSourceValue.h using clang-format. This change is
done in preparation for the changes to the pseudo source value object
management and to the PseudoSourceValue's class hierarchy.

llvm-svn: 244685

9 years agoUse 32-bit divides instead of 64-bit divides where possible.
Mark Heffernan [Tue, 11 Aug 2015 22:16:34 +0000 (22:16 +0000)]
Use 32-bit divides instead of 64-bit divides where possible.

For NVPTX, try to use 32-bit division instead of 64-bit division when the dividend and divisor
fit in 32 bits. This speeds up some internal benchmarks significantly. The underlying reason
is that many index computations are carried out in 64-bits but never actually exceed the
capacity of a 32-bit word.

llvm-svn: 244684

9 years agoFix a infinite loop when killing a process that is in the middle of loading shared...
Greg Clayton [Tue, 11 Aug 2015 22:07:46 +0000 (22:07 +0000)]
Fix a infinite loop when killing a process that is in the middle of loading shared libraries.

The issue was we were sending a "qSymbol::" packet and it we were already disconnected were weren't exiting the while loop if we didn't successfully send the qSymbol packet.

<rdar://problem/22098746>

llvm-svn: 244683

9 years ago[modules] When instantiating the contents of an imported CXXRecordDecl, we can
Richard Smith [Tue, 11 Aug 2015 22:00:24 +0000 (22:00 +0000)]
[modules] When instantiating the contents of an imported CXXRecordDecl, we can
emit lexical contents for a declaration for another module. Track which module
those contents came from, and ensure that we only grab the lexical contents
from a single such instantiation.

llvm-svn: 244682

9 years agoAdded missing files from checking regarding:
Greg Clayton [Tue, 11 Aug 2015 21:49:32 +0000 (21:49 +0000)]
Added missing files from checking regarding:

http://reviews.llvm.org/D8712

llvm-svn: 244681

9 years agoELF2: Remove unused global variable.
Rui Ueyama [Tue, 11 Aug 2015 21:45:55 +0000 (21:45 +0000)]
ELF2: Remove unused global variable.

A global variable "Driver" is to re-entry to the driver to parse a
.drectve section. Because the need is COFF-specific, we don't need
this variable for ELF.

llvm-svn: 244680

9 years agoFirst step in getting LLDB ready to support multiple different type systems.
Greg Clayton [Tue, 11 Aug 2015 21:38:15 +0000 (21:38 +0000)]
First step in getting LLDB ready to support multiple different type systems.

This is the work done by Ryan Brown from http://reviews.llvm.org/D8712 that makes a TypeSystem class and abstracts types to be able to use a type system.

All tests pass on MacOSX and passed on linux the last time this was submitted.

llvm-svn: 244679

9 years agoMake DW_AT_[MIPS_]linkage_name optional, and off by default for SCE.
Paul Robinson [Tue, 11 Aug 2015 21:36:45 +0000 (21:36 +0000)]
Make DW_AT_[MIPS_]linkage_name optional, and off by default for SCE.

Mangled "linkage" names can be huge, and if the debugger (or other
tools) have no use for them, the size savings can be very impressive
(on the order of 40%).

Add one test for controlling behavior, and modify a number of tests to
either stop using linkage names, or make llc emit them (so these tests
will still run when the default triple is for PS4).

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

llvm-svn: 244678

9 years agoTidy statistics collection
Jonathan Peyton [Tue, 11 Aug 2015 21:36:41 +0000 (21:36 +0000)]
Tidy statistics collection

This removes some statistics counters and timers which were not used,
adds new counters and timers for some language features that were not
monitored previously and separates the counters and timers into those
which are of interest for investigating user code and those which are
only of interest to the developer of the runtime itself.
The runtime developer statistics are now ony collected if the
additional #define KMP_DEVELOPER_STATS is set.

Additional user statistics which are now collected include:
* Count of nested parallelism (omp parallel inside a parallel region)
* Count of omp distribute occurrences
* Count of omp teams occurrences
* Counts of task related statistics (taskyield, task execution, task
  cancellation, task steal)
* Values passed to omp_set_numtheads
* Time spent in omp single and omp master

None of this affects code compiled without stats gathering enabled,
which is the normal library build mode.

This also fixes the CMake build by linking to the standard c++ library
when building the stats library as it is a requirement.  The normal library
does not have this requirement and its link phase is left alone.

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

llvm-svn: 244677

9 years agoFix PR24354.
Sanjoy Das [Tue, 11 Aug 2015 21:33:55 +0000 (21:33 +0000)]
Fix PR24354.

`InstCombiner::OptimizeOverflowCheck` was asserting an
invariant (operands to binary operations are ordered by decreasing
complexity) that wasn't really an invariant.  Fix this by instead having
`InstCombiner::OptimizeOverflowCheck` establish the invariant if it does
not hold.

llvm-svn: 244676

9 years ago[MIPS] Use arch values for lock-free atomic operations
Petar Jovanovic [Tue, 11 Aug 2015 21:27:39 +0000 (21:27 +0000)]
[MIPS] Use arch values for lock-free atomic operations

Let NaClMips32ELTargetInfo inherit arch values for maximum width lock-free
atomic operations.

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

llvm-svn: 244675

9 years ago[lit] Don't disable the lit progress bar by default with MSVC
Reid Kleckner [Tue, 11 Aug 2015 21:24:59 +0000 (21:24 +0000)]
[lit] Don't disable the lit progress bar by default with MSVC

Only disable the progress bar when we're generating VS project files,
like we do for XCode. This makes lit use the simple, non-curses progress
bar that looks like this with:

Testing: 0 .. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90..
Testing Time: 5.87s

llvm-svn: 244674

9 years ago[analyzer] Incorrect env variable replaced.
Anton Yartsev [Tue, 11 Aug 2015 21:24:19 +0000 (21:24 +0000)]
[analyzer] Incorrect env variable replaced.

llvm-svn: 244673

9 years agodon't repeat function names in comments; NFC
Sanjay Patel [Tue, 11 Aug 2015 21:24:04 +0000 (21:24 +0000)]
don't repeat function names in comments; NFC

llvm-svn: 244672

9 years agoAdd an assert to catch lexical decl deserialization bugs.
Richard Smith [Tue, 11 Aug 2015 21:21:20 +0000 (21:21 +0000)]
Add an assert to catch lexical decl deserialization bugs.

llvm-svn: 244671

9 years agoFixing a few C++0x comments to be C++11; NFC.
Aaron Ballman [Tue, 11 Aug 2015 21:17:53 +0000 (21:17 +0000)]
Fixing a few C++0x comments to be C++11; NFC.

llvm-svn: 244670

9 years agoAdd missing documentation for conversionDecl; NFC.
Aaron Ballman [Tue, 11 Aug 2015 21:12:46 +0000 (21:12 +0000)]
Add missing documentation for conversionDecl; NFC.

llvm-svn: 244669

9 years agofix 80-cols; NFC
Sanjay Patel [Tue, 11 Aug 2015 21:11:56 +0000 (21:11 +0000)]
fix 80-cols; NFC

llvm-svn: 244668

9 years agoNFC SelectionDAGDumper: fix typo
JF Bastien [Tue, 11 Aug 2015 21:10:07 +0000 (21:10 +0000)]
NFC SelectionDAGDumper: fix typo

Subscribers: llvm-commits

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

llvm-svn: 244667

9 years agoAdd a polymorphic AST matcher for testing whether a constructor or a conversion decla...
Aaron Ballman [Tue, 11 Aug 2015 21:09:52 +0000 (21:09 +0000)]
Add a polymorphic AST matcher for testing whether a constructor or a conversion declaration is marked as explicit or not.

llvm-svn: 244666

9 years agoWebAssembly: implement comparison.
JF Bastien [Tue, 11 Aug 2015 21:02:46 +0000 (21:02 +0000)]
WebAssembly: implement comparison.

Some of the FP comparisons (ueq, one, ult, ule, ugt, uge) are currently broken, I'll fix them in a follow-up.

Reviewers: sunfish

Subscribers: llvm-commits, jfb

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

llvm-svn: 244665

9 years agoDon't crash if the file we want to touch doesn't exist.
Greg Clayton [Tue, 11 Aug 2015 21:01:32 +0000 (21:01 +0000)]
Don't crash if the file we want to touch doesn't exist.

llvm-svn: 244663

9 years agoAdd an AST matcher to match member intializers of a CXXCtorInitializer.
Aaron Ballman [Tue, 11 Aug 2015 20:42:00 +0000 (20:42 +0000)]
Add an AST matcher to match member intializers of a CXXCtorInitializer.

llvm-svn: 244662

9 years ago[libFuzzer] more trophies
Kostya Serebryany [Tue, 11 Aug 2015 20:34:48 +0000 (20:34 +0000)]
[libFuzzer] more trophies

llvm-svn: 244661

9 years agoclang-format: Make SpaceBeforeParens work with overloaded operators.
Daniel Jasper [Tue, 11 Aug 2015 20:32:24 +0000 (20:32 +0000)]
clang-format: Make SpaceBeforeParens work with overloaded operators.

Patch by Jon Chesterfield, thank you!

llvm-svn: 244660

9 years ago[cmake] Shorten FreeBSD and DragonFly checks as suggested post-commit
Reid Kleckner [Tue, 11 Aug 2015 20:28:28 +0000 (20:28 +0000)]
[cmake] Shorten FreeBSD and DragonFly checks as suggested post-commit

NFC

llvm-svn: 244659

9 years agoRevert the diagnostic improvements in r244602 as they introduced a problematic dependency
David Blaikie [Tue, 11 Aug 2015 20:21:45 +0000 (20:21 +0000)]
Revert the diagnostic improvements in r244602 as they introduced a problematic dependency

Seems we had some internal uses that include ClangTidyTest.h and weren't
ready for a gtest dependency. Reverting to give Manuel some time to look
into it.

llvm-svn: 244658

9 years ago[x86] enable machine combiner reassociations for 128-bit vector single/double multiplies
Sanjay Patel [Tue, 11 Aug 2015 20:19:23 +0000 (20:19 +0000)]
[x86] enable machine combiner reassociations for 128-bit vector single/double multiplies

llvm-svn: 244657

9 years ago[LowerSwitch] Skip dead blocks for processSwitchInst()
Chen Li [Tue, 11 Aug 2015 20:16:17 +0000 (20:16 +0000)]
[LowerSwitch] Skip dead blocks for processSwitchInst()

Summary: This patch adds check for dead blocks and skip them for processSwitchInst(). This will help reduce compilation time.

Reviewers: reames, hans

Subscribers: llvm-commits

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

llvm-svn: 244656

9 years agoWebAssembly: implement WebAssemblyTargetLowering::getTargetNodeName
JF Bastien [Tue, 11 Aug 2015 20:13:18 +0000 (20:13 +0000)]
WebAssembly: implement WebAssemblyTargetLowering::getTargetNodeName

Summary: Implementation is the same as in AArch64.

Subscribers: aemerson, jfb, llvm-commits, sunfish

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

llvm-svn: 244655

9 years agoFix mismatched sign comparison
Reid Kleckner [Tue, 11 Aug 2015 20:06:51 +0000 (20:06 +0000)]
Fix mismatched sign comparison

llvm-svn: 244653

9 years agofix minsize detection: minsize attribute implies optimizing for size
Sanjay Patel [Tue, 11 Aug 2015 19:39:36 +0000 (19:39 +0000)]
fix minsize detection: minsize attribute implies optimizing for size

Also, add a test for optsize because this was not part of any existing regression test.

llvm-svn: 244651

9 years ago[MSVC Compatibility] Classify ext_ms_cast_fn_obj as DefaultError
David Majnemer [Tue, 11 Aug 2015 19:25:13 +0000 (19:25 +0000)]
[MSVC Compatibility] Classify ext_ms_cast_fn_obj as DefaultError

This non-conforming extension was introduced to make it possible for us
to correctly compile <atomic> in VS 2013 and 2015.  Let's limit its
impact to system headers to encourage portable code.

llvm-svn: 244650

9 years agoSelectionDAG: Prefer to combine multiplication with less uses for fma
Jingyue Wu [Tue, 11 Aug 2015 19:21:46 +0000 (19:21 +0000)]
SelectionDAG: Prefer to combine multiplication with less uses for fma

Summary:
For example:

  s6 = s0*s5;
  s2 = s6*s6 + s6;
  ...
  s4 = s6*s3;

We notice that it is possible for s2 is folded to fma (s0, s5, fmul (s6 s6)).
This only happens when Aggressive is true, otherwise hasOneUse() check
already prevents from folding the multiplication with more uses.

Test Plan: test/CodeGen/NVPTX/fma-assoc.ll

Patch by Xuetian Weng

Reviewers: hfinkel, apazos, jingyue, ohsallen, arsenm

Subscribers: arsenm, jholewinski, llvm-commits

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

llvm-svn: 244649

9 years agoRevert "[cmake] Add helper for finding potentially external projects"
Reid Kleckner [Tue, 11 Aug 2015 19:02:57 +0000 (19:02 +0000)]
Revert "[cmake] Add helper for finding potentially external projects"

This reverts commit r244633.

We aren't going to be able to use it because the compiler-rt build can
be built standalone without an LLVM source dir *or* an installed copy of
LLVM.

llvm-svn: 244648

9 years agoRevert the rest of r244634, since it breaks the standalone build
Reid Kleckner [Tue, 11 Aug 2015 18:43:13 +0000 (18:43 +0000)]
Revert the rest of r244634, since it breaks the standalone build

compiler-rt can apparently be built without an installed copy of LLVM,
so we can't call its cmake code.

llvm-svn: 244647

9 years ago[ubsan][mips] Revise r243384 to avoid special casing big-endian mips.
Daniel Sanders [Tue, 11 Aug 2015 18:40:02 +0000 (18:40 +0000)]
[ubsan][mips] Revise r243384 to avoid special casing big-endian mips.

Account for the case when uptr is 32-bit instead of trying to fix this case
using the little endian path.

llvm-svn: 244646

9 years agoInclude sanitizer_posix.h to try to fix the mac build
Reid Kleckner [Tue, 11 Aug 2015 18:29:32 +0000 (18:29 +0000)]
Include sanitizer_posix.h to try to fix the mac build

Linux must pick it up transitively.

llvm-svn: 244645

9 years agoFix UB in MCJIT test cases that relied on union type punning
David Blaikie [Tue, 11 Aug 2015 18:17:45 +0000 (18:17 +0000)]
Fix UB in MCJIT test cases that relied on union type punning

Reviewers: lhames, aaron.ballman

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

llvm-svn: 244644

9 years agoRe-apply "cmake: Make CMAKE_BUILD_TYPE check case-insensitive"
Justin Bogner [Tue, 11 Aug 2015 18:17:41 +0000 (18:17 +0000)]
Re-apply "cmake: Make CMAKE_BUILD_TYPE check case-insensitive"

This re-applies r244516 (effectively reverting r244516) without losing
the check that caused failures for VS.

llvm-svn: 244643

9 years ago[LowerSwitch] Fix a bug when LowerSwitch deletes the default block
Chen Li [Tue, 11 Aug 2015 18:12:26 +0000 (18:12 +0000)]
[LowerSwitch] Fix a bug when LowerSwitch deletes the default block

Summary: LowerSwitch crashed with the attached test case after deleting the default block. This happened because the current implementation of deleting dead blocks is wrong. After the default block being deleted, it contains no instruction or terminator, and it should no be traversed anymore. However, since the iterator is advanced before processSwitchInst() function is executed, the block advanced to could be deleted inside processSwitchInst(). The deleted block would then be visited next and crash dyn_cast<SwitchInst>(Cur->getTerminator()) because Cur->getTerminator() returns a nullptr. This patch fixes this problem by recording dead default blocks into a list, and delete them after all processSwitchInst() has been done. It still possible to visit dead default blocks and waste time process them. But it is a compile time issue, and I plan to have another patch to add support to skip dead blocks.

Reviewers: kariddi, resistor, hans, reames

Subscribers: llvm-commits

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

llvm-svn: 244642

9 years agoUse llvm::make_unique to fix the MSVC build.
Rafael Espindola [Tue, 11 Aug 2015 18:11:17 +0000 (18:11 +0000)]
Use llvm::make_unique to fix the MSVC build.

llvm-svn: 244641

9 years agoAdd support for weak undefined symbols.
Rafael Espindola [Tue, 11 Aug 2015 17:57:05 +0000 (17:57 +0000)]
Add support for weak undefined symbols.

llvm-svn: 244640

9 years agoRemove unused templating.
Rafael Espindola [Tue, 11 Aug 2015 17:51:57 +0000 (17:51 +0000)]
Remove unused templating.

llvm-svn: 244639

9 years ago[windows] Use lld-link instead of lld-link2, the latter no longer exists
Reid Kleckner [Tue, 11 Aug 2015 17:36:09 +0000 (17:36 +0000)]
[windows] Use lld-link instead of lld-link2, the latter no longer exists

The test passed for me locally because I had a stale copy of
lld-link2.exe.

llvm-svn: 244638

9 years agoAdd SmallString test trying to exercise the realloc() code path
Yaron Keren [Tue, 11 Aug 2015 17:35:49 +0000 (17:35 +0000)]
Add SmallString test trying to exercise the realloc() code path
by allocating a small size (will go through malloc) and then large size.

llvm-svn: 244637