platform/upstream/llvm.git
8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

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

llvm-svn: 244696

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

llvm-svn: 244695

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

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

llvm-svn: 244661

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

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

llvm-svn: 244639

8 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

8 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

8 years agoAdd support for weak symbols.
Rafael Espindola [Tue, 11 Aug 2015 17:33:02 +0000 (17:33 +0000)]
Add support for weak symbols.

llvm-svn: 244636

8 years agoRevert part of the last cmake change, it broke configuring with libcxx on Linux for me
Reid Kleckner [Tue, 11 Aug 2015 17:22:06 +0000 (17:22 +0000)]
Revert part of the last cmake change, it broke configuring with libcxx on Linux for me

llvm-svn: 244635

8 years ago[cmake] Handle external source for lld and libcxx
Reid Kleckner [Tue, 11 Aug 2015 17:18:23 +0000 (17:18 +0000)]
[cmake] Handle external source for lld and libcxx

As requested in post-commit review of r244549.

llvm-svn: 244634

8 years ago[cmake] Add helper for finding potentially external projects
Reid Kleckner [Tue, 11 Aug 2015 17:16:35 +0000 (17:16 +0000)]
[cmake] Add helper for finding potentially external projects

I plan to use this from compiler-rt, but it's useful for any LLVM
project that depends on more than just LLVM.

llvm-svn: 244633

8 years agoUse real values for DefindeFirst and DefinedLast.
Rafael Espindola [Tue, 11 Aug 2015 17:10:02 +0000 (17:10 +0000)]
Use real values for DefindeFirst and DefinedLast.

With this clang notices that switches are fully covered.

llvm-svn: 244632

8 years agofix minsize detection: minsize attribute implies optimizing for size
Sanjay Patel [Tue, 11 Aug 2015 17:04:31 +0000 (17:04 +0000)]
fix minsize detection: minsize attribute implies optimizing for size

llvm-svn: 244631

8 years agoadd missing tests for powi expansion with size optimizations
Sanjay Patel [Tue, 11 Aug 2015 16:58:49 +0000 (16:58 +0000)]
add missing tests for powi expansion with size optimizations

The minsize test will be fixed in the next commit.

llvm-svn: 244630

8 years ago[windows] Remove CHECK for strdup symbol that comes from the CRT
Reid Kleckner [Tue, 11 Aug 2015 16:56:26 +0000 (16:56 +0000)]
[windows] Remove CHECK for strdup symbol that comes from the CRT

llvm-symbolizer isn't symbolizing it for some reason. I'll investigate.

llvm-svn: 244629

8 years agoDelete unused typedef.
Rafael Espindola [Tue, 11 Aug 2015 16:55:28 +0000 (16:55 +0000)]
Delete unused typedef.

llvm-svn: 244628

8 years agofixed to use FileCheck
Sanjay Patel [Tue, 11 Aug 2015 16:51:31 +0000 (16:51 +0000)]
fixed to use FileCheck

llvm-svn: 244627

8 years agoCOFF: Ignore /editandcontinue option.
Rui Ueyama [Tue, 11 Aug 2015 16:46:08 +0000 (16:46 +0000)]
COFF: Ignore /editandcontinue option.

llvm-svn: 244626

8 years agofixed to test attribute, rather than CPU
Sanjay Patel [Tue, 11 Aug 2015 16:43:18 +0000 (16:43 +0000)]
fixed to test attribute, rather than CPU

llvm-svn: 244625

8 years agoDon't report a conflict between two local symbols.
Rafael Espindola [Tue, 11 Aug 2015 16:30:34 +0000 (16:30 +0000)]
Don't report a conflict between two local symbols.

llvm-svn: 244624

8 years agoSpeculative fix for Mac build
Reid Kleckner [Tue, 11 Aug 2015 16:30:27 +0000 (16:30 +0000)]
Speculative fix for Mac build

llvm-svn: 244623

8 years agoEnable EliminateAvailableExternally pass in the LTO pipeline.
Teresa Johnson [Tue, 11 Aug 2015 16:26:41 +0000 (16:26 +0000)]
Enable EliminateAvailableExternally pass in the LTO pipeline.

Summary:
For LTO we need to enable this pass in the LTO pipeline,
as it is skipped during the "-flto -c" compile step (when PrepareForLTO is
set).

Reviewers: rnk

Subscribers: llvm-commits

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

llvm-svn: 244622

8 years agoRevert "Add non-member begin and end so that drop_begin works on iterator_range."
Rafael Espindola [Tue, 11 Aug 2015 16:26:06 +0000 (16:26 +0000)]
Revert "Add non-member begin and end so that drop_begin works on iterator_range."

This reverts commit r244620.

MSVC doesn't like it :-(

llvm-svn: 244621

8 years agoAdd non-member begin and end so that drop_begin works on iterator_range.
Rafael Espindola [Tue, 11 Aug 2015 16:12:56 +0000 (16:12 +0000)]
Add non-member begin and end so that drop_begin works on iterator_range.

llvm-svn: 244620

8 years agofix typos; NFC
Sanjay Patel [Tue, 11 Aug 2015 16:10:41 +0000 (16:10 +0000)]
fix typos; NFC

llvm-svn: 244619

8 years agoVariable names should start with an upper case letter; NFC
Sanjay Patel [Tue, 11 Aug 2015 16:05:43 +0000 (16:05 +0000)]
Variable names should start with an upper case letter; NFC

llvm-svn: 244618

8 years agofix minsize detection: minsize attribute implies optimizing for size
Sanjay Patel [Tue, 11 Aug 2015 15:56:31 +0000 (15:56 +0000)]
fix minsize detection: minsize attribute implies optimizing for size

llvm-svn: 244617

8 years ago[Windows] Use llvm-symbolizer before using dbghelp
Reid Kleckner [Tue, 11 Aug 2015 15:51:40 +0000 (15:51 +0000)]
[Windows] Use llvm-symbolizer before using dbghelp

Summary:
llvm-symbolizer understands both PDBs and DWARF, so it's a better bet if
it's available. It prints out the function parameter types and column
numbers, so I needed to churn the expected test output a bit.

This makes most of the llvm-symbolizer subprocessing code
target-independent. Pipes on all platforms use fd_t, and we can use the
portable ReadFromFile / WriteToFile wrappers in symbolizer_sanitizer.cc.
Only the pipe creation and process spawning is Windows-specific.

Please check that the libcdep layering is still correct. I don't know
how to reproduce the build configuration that relies on that.

Reviewers: samsonov

Subscribers: llvm-commits

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

llvm-svn: 244616

8 years ago[GlobalMerge] Use private linkage for MergedGlobals variables
John Brawn [Tue, 11 Aug 2015 15:48:04 +0000 (15:48 +0000)]
[GlobalMerge] Use private linkage for MergedGlobals variables

Other objects can never reference the MergedGlobals symbol so external linkage
is never needed. Using private instead of internal linkage means the object is
more similar to what it looks like when global merging is not enabled, with
the only difference being that the merged variables are addressed indirectly
relative to the start of the section they are in.

Also add aliases for merged variables with internal linkage, as this also makes
the object be more like what it is when they are not merged.

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

llvm-svn: 244615

8 years agoFix InstCombine test: invalid CHECK line slipped in r231270
Mehdi Amini [Tue, 11 Aug 2015 15:31:17 +0000 (15:31 +0000)]
Fix InstCombine test: invalid CHECK line slipped in r231270

I incorrectly wrote CHECK-NEXT with followin with ':', the check was
ignored by FileCheck.
The non-inbound GEP is folded here because the DataLayout is no longer
optional, the fold was originally guarded with a comment that said:
    We need TD information to know the pointer size unless this is inbounds.
Now we always have "TD information" and perform the fold.

Thanks Jonathan Roelofs for noticing.

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 244613

8 years agoremove unnecessary settings/attributes from test case
Sanjay Patel [Tue, 11 Aug 2015 15:30:53 +0000 (15:30 +0000)]
remove unnecessary settings/attributes from test case

llvm-svn: 244612

8 years ago[RegionInfo] Verify getRegionFor
Michael Kruse [Tue, 11 Aug 2015 15:16:43 +0000 (15:16 +0000)]
[RegionInfo] Verify getRegionFor

Summary:
Check the contents of BBtoRegion during analysis verification. It only takes place if -verify-region-info is passed or LLVM is compiled with XDEBUG.

RegionBase<Tr>::verifyRegion() also checks the RegionInfoBase<Tr>::VerifyRegionInfo flag, which is redundant, but verifyRegion() is public API and might be invoked from other sites. In order to avoid behavioral change, this check is not removed. In any case, no region will be verified unless VerifyRegionInfo is set.

Reviewers: grosser

Subscribers: llvm-commits

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

llvm-svn: 244611

8 years agofix code that was accidentally commented out in previous commit
Sanjay Patel [Tue, 11 Aug 2015 15:08:29 +0000 (15:08 +0000)]
fix code that was accidentally commented out in previous commit

llvm-svn: 244610

8 years agofix typos in comments; NFC
Sanjay Patel [Tue, 11 Aug 2015 15:04:51 +0000 (15:04 +0000)]
fix typos in comments; NFC

llvm-svn: 244609

8 years agoAssign regions to all BBs from CodeGeneration
Michael Kruse [Tue, 11 Aug 2015 14:47:37 +0000 (14:47 +0000)]
Assign regions to all BBs from CodeGeneration

In order to have a valid region analysis, we assign all newly created blocks to the parent of the scop's region. This is correct for any pre-existing regions (including the scop's region and its parent), but does not discover any region inside the generated code. For Polly this is not necessary because we do not want to re-run Polly on its own generated code anyway.

Reviewers: grosser

Part of Differential Revision: http://reviews.llvm.org/D11867

llvm-svn: 244608

8 years agofix typo in comment; NFC
Sanjay Patel [Tue, 11 Aug 2015 14:45:08 +0000 (14:45 +0000)]
fix typo in comment; NFC

llvm-svn: 244607