platform/upstream/llvm.git
8 years ago[Unittest] Clean up formatting, NFC
Joseph Tremoulet [Wed, 3 Feb 2016 17:11:24 +0000 (17:11 +0000)]
[Unittest] Clean up formatting, NFC

Summary:
Use an early return to reduce indentation.
Remove unused local.

Reviewers: dblaikie, lhames

Subscribers: lhames, llvm-commits

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

llvm-svn: 259663

8 years ago[SCEV] Try to reuse existing value during SCEV expansion
Wei Mi [Wed, 3 Feb 2016 17:05:12 +0000 (17:05 +0000)]
[SCEV] Try to reuse existing value during SCEV expansion

Current SCEV expansion will expand SCEV as a sequence of operations
and doesn't utilize the value already existed. This will introduce
redundent computation which may not be cleaned up throughly by
following optimizations.

This patch introduces an ExprValueMap which is a map from SCEV to the
set of equal values with the same SCEV. When a SCEV is expanded, the
set of values is checked and reused whenever possible before generating
a sequence of operations.

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

llvm-svn: 259662

8 years agoSimplify. NFC.
Rafael Espindola [Wed, 3 Feb 2016 16:53:39 +0000 (16:53 +0000)]
Simplify. NFC.

llvm-svn: 259660

8 years agoProperly build shared libraries if LLVM_LINK_LLVM_DYLIB is enabled.
Tobias Grosser [Wed, 3 Feb 2016 16:29:04 +0000 (16:29 +0000)]
Properly build shared libraries if LLVM_LINK_LLVM_DYLIB is enabled.

Contributed-by: Jack Howarth <howarthjw@gmail.com>
llvm-svn: 259659

8 years agowww: Simplify 'build & install' descriptions
Tobias Grosser [Wed, 3 Feb 2016 16:18:24 +0000 (16:18 +0000)]
www: Simplify 'build & install' descriptions

We remove information for older versions of Polly and also shorten the overall
text. This should make it a lot easier for people to get to the important code
wight away.

llvm-svn: 259658

8 years ago[ARM] Move GNUEABI divmod to __aeabi_divmod*
Renato Golin [Wed, 3 Feb 2016 16:10:54 +0000 (16:10 +0000)]
[ARM] Move GNUEABI divmod to __aeabi_divmod*

The GNU toolchain emits __aeabi_divmod for soft-divide on ARM cores
which happens to be a lot faster than __divsi3/__modsi3 when the core
has hardware divide instructions. Do the same here.

Fixes PR26450.

llvm-svn: 259657

8 years ago[MachineCopyPropagation] Fix comment. NFC
Jun Bum Lim [Wed, 3 Feb 2016 15:56:27 +0000 (15:56 +0000)]
[MachineCopyPropagation] Fix comment. NFC

Reviewers: MatzeB, qcolombet, jmolloy, mcrosier

Subscribers: llvm-commits, mcrosier

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

llvm-svn: 259656

8 years ago[mips] Remove redundant inclusions of MipsAnalyzeImmediate.h
Daniel Sanders [Wed, 3 Feb 2016 15:54:12 +0000 (15:54 +0000)]
[mips] Remove redundant inclusions of MipsAnalyzeImmediate.h

llvm-svn: 259655

8 years ago[OpenMP] Parsing + sema for target parallel for directive.
Arpith Chacko Jacob [Wed, 3 Feb 2016 15:46:42 +0000 (15:46 +0000)]
[OpenMP] Parsing + sema for target parallel for directive.

Summary:
This patch adds parsing + sema for the target parallel for directive along with testcases.

Reviewers: ABataev

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

llvm-svn: 259654

8 years agotScopInfo: Shorten comment slightly
Tobias Grosser [Wed, 3 Feb 2016 15:42:38 +0000 (15:42 +0000)]
tScopInfo: Shorten comment slightly

llvm-svn: 259653

8 years agoMinor cleanup to remove casts and improve some const correctness. NFC.
Aaron Ballman [Wed, 3 Feb 2016 15:20:51 +0000 (15:20 +0000)]
Minor cleanup to remove casts and improve some const correctness. NFC.

Patch by Alexander Riccio.

llvm-svn: 259652

8 years ago[OpenCL] Adding reserved operator logical xor for OpenCL
Anastasia Stulova [Wed, 3 Feb 2016 15:17:14 +0000 (15:17 +0000)]
[OpenCL] Adding reserved operator logical xor for OpenCL

This patch adds the reserved operator ^^ when compiling for OpenCL (spec v1.1 s6.3.g),
which results in a more meaningful error message.

Patch by Neil Hickey!

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

M    test/SemaOpenCL/unsupported.cl
M    include/clang/Basic/TokenKinds.def
M    include/clang/Basic/DiagnosticParseKinds.td
M    lib/Basic/OperatorPrecedence.cpp
M    lib/Lex/Lexer.cpp
M    lib/Parse/ParseExpr.cpp

llvm-svn: 259651

8 years agotsan: disable flaky mmap_stress test
Dmitry Vyukov [Wed, 3 Feb 2016 15:10:00 +0000 (15:10 +0000)]
tsan: disable flaky mmap_stress test

llvm-svn: 259650

8 years ago[DemandedBits] Revert r249687 due to PR26071
James Molloy [Wed, 3 Feb 2016 15:05:06 +0000 (15:05 +0000)]
[DemandedBits] Revert r249687 due to PR26071

This regresses a test in LoopVectorize, so I'll need to go away and think about how to solve this in a way that isn't broken.

From the writeup in PR26071:

What's happening is that ComputeKnownZeroes is telling us that all bits except the LSB are zero. We're then deciding that only the LSB needs to be demanded from the icmp's inputs.

This is where we're wrong - we're assuming that after simplification the bits that were known zero will continue to be known zero. But they're not - during trivialization the upper bits get changed (because an XOR isn't shrunk), so the icmp fails.

The fault is in demandedbits - its contract does clearly state that a non-demanded bit may either be zero or one.

llvm-svn: 259649

8 years agoProvide match function to look over an entire TU again.
Daniel Jasper [Wed, 3 Feb 2016 14:29:55 +0000 (14:29 +0000)]
Provide match function to look over an entire TU again.

llvm-svn: 259648

8 years agoForgot to remove file in previous commit.
Yury Gribov [Wed, 3 Feb 2016 13:36:31 +0000 (13:36 +0000)]
Forgot to remove file in previous commit.

llvm-svn: 259647

8 years ago[analyzer] AnalysisConsumer: print fully-qualified function name while displaying...
Yury Gribov [Wed, 3 Feb 2016 13:35:33 +0000 (13:35 +0000)]
[analyzer] AnalysisConsumer: print fully-qualified function name while displaying progress

-analyzer-display progress option prints only function names which may be ambiguous. This patch forces AnalysisConsumer to print fully-qualified function names.
Patch by Alex Sidorin!

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

llvm-svn: 259646

8 years agoFix for PR 26381
Nemanja Ivanovic [Wed, 3 Feb 2016 12:53:38 +0000 (12:53 +0000)]
Fix for PR 26381

Simple fix - Constant values were not being sign extended in FastIsel.

llvm-svn: 259645

8 years agoAdd ability to override JIT expr compiler options.
Aidan Dodds [Wed, 3 Feb 2016 12:33:05 +0000 (12:33 +0000)]
Add ability to override JIT expr compiler options.

Runtimes should be able to pass custom compilation options to the JIT for their stack frame. This patch adds a custom expression options member class to LanguageOptions, and modifies the clang expression evaluator to check the current runtime for those options. If those options are available on the runtime, they are passed to the clang compiler.

Committed for Luke Drummond.
Differential Revision: http://reviews.llvm.org/D15527

llvm-svn: 259644

8 years ago[clang-tidy] bug fix: Don't warn on partial template specialization in `misc-definiti...
Haojian Wu [Wed, 3 Feb 2016 12:10:27 +0000 (12:10 +0000)]
[clang-tidy] bug fix: Don't warn on partial template specialization in `misc-definitions-in-headers` check.

Reviewers: alexfh

Subscribers: cfe-commits

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

llvm-svn: 259643

8 years agoRemove skipUnlessListedRemote test decorator
Pavel Labath [Wed, 3 Feb 2016 11:51:25 +0000 (11:51 +0000)]
Remove skipUnlessListedRemote test decorator

This decorator was used in only one test, and it's behaviour was quite complicated. It skipped
if:
- test was remote
- platform was *not* android

I am not aware of anyone running tests with this configuration (and even then, I am not aware of
a reason why the test should not pass), but if TestLoadUnload starts breaking for you after this
commit, please disable the test with
@expectedFailureAll(remote=True, oslist=[YOUR_PLATFORM])

llvm-svn: 259642

8 years ago[mips] Add SHF_MIPS_GPREL flag to the MIPS .sbss and .sdata sections
Simon Atanasyan [Wed, 3 Feb 2016 11:50:22 +0000 (11:50 +0000)]
[mips] Add SHF_MIPS_GPREL flag to the MIPS .sbss and .sdata sections

MIPS ABI states that .sbss and .sdata sections must have SHF_MIPS_GPREL
flag. See Figure 4–7 on page 69 in the following document:
ftp://www.linux-mips.org/pub/linux/mips/doc/ABI/mipsabi.pdf.

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

llvm-svn: 259641

8 years agoclang-tidy: [misc-unused-parameters] Ignore template instantiations.
Daniel Jasper [Wed, 3 Feb 2016 11:33:18 +0000 (11:33 +0000)]
clang-tidy: [misc-unused-parameters] Ignore template instantiations.

No functional changes intended as we should already do the
corresponding fixes when visiting the primary template. There are
existing tests that verify that we do change unused parameters of
templated functions.

llvm-svn: 259640

8 years ago-inline-asm][X86] Add ability to use AVX512 in MS inline asm
Marina Yatsina [Wed, 3 Feb 2016 11:32:08 +0000 (11:32 +0000)]
-inline-asm][X86] Add ability to use AVX512 in MS inline asm

Defined the new AVX512 registers in clang inline asm.
Fixed a bug in the MC subtarget info creation during the parsing of MS asm statement - now it receives the actual CPU and target features information.

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

llvm-svn: 259639

8 years agoFix an off-by-one in SocketTest::DecodeHostAndPort
Pavel Labath [Wed, 3 Feb 2016 11:12:23 +0000 (11:12 +0000)]
Fix an off-by-one in SocketTest::DecodeHostAndPort

65535 is still a valid port. This should fix the android failures we were getting when we chose
to connect over 65535 to the remote lldb-server.

llvm-svn: 259638

8 years agoReduce initial Sema memory consumption by 400KB. By Elisavet Sakellari.
Axel Naumann [Wed, 3 Feb 2016 10:45:22 +0000 (10:45 +0000)]
Reduce initial Sema memory consumption by 400KB. By Elisavet Sakellari.

llvm-svn: 259637

8 years ago[TableGen] Add 'register alternative name matching' support
Dylan McKay [Wed, 3 Feb 2016 10:30:16 +0000 (10:30 +0000)]
[TableGen] Add 'register alternative name matching' support

Summary:
This adds a new attribute which targets can set in TableGen which causes a function to be generated which matches register alternative names. This is very similar to `ShouldEmitMatchRegisterName`, except it works on alt names.

This patch is currently used by the out of tree part of the AVR backend. It reduces code duplication greatly, and has the effect that you do not need to hardcode altname to register mappings in C++.

It will not work on targets which have registers which share the same aliases.

Reviewers: stoklund, arsenm, dsanders, hfinkel, vkalintiris

Subscribers: hfinkel, dylanmckay, llvm-commits

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

llvm-svn: 259636

8 years ago[X86][AVX] Add support for 64-bit VZEXT_LOAD of 256/512-bit vectors to EltsFromConsec...
Simon Pilgrim [Wed, 3 Feb 2016 09:41:59 +0000 (09:41 +0000)]
[X86][AVX] Add support for 64-bit VZEXT_LOAD of 256/512-bit vectors to EltsFromConsecutiveLoads

Follow up to D16217 and D16729

This change uncovered an odd pattern where VZEXT_LOAD v4i64 was being lowered to a load of the lower v2i64 (so the 2nd i64 destination element wasn't being zeroed), I can't find any use/reason for this and have removed the pattern and replaced it so only the 1st i64 element is loaded and the upper bits all zeroed. This matches the description for X86ISD::VZEXT_LOAD

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

llvm-svn: 259635

8 years ago[RenderScript] Use LLVM DWARF language enum
Ewan Crawford [Wed, 3 Feb 2016 09:17:03 +0000 (09:17 +0000)]
[RenderScript] Use LLVM DWARF language enum

A DWARF language vender extension for RenderScript was added to LLVM in r259348(http://reviews.llvm.org/D16409)
We should use this generated enum instead of the hardcoded value.

RenderScript is also based on C99 with some extensions, so we want to use ClangASTContext when RS is detected.

Reviewers:  clayborg
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D16766

llvm-svn: 259634

8 years agoScopInfo: Extend description of the access relation.
Tobias Grosser [Wed, 3 Feb 2016 06:37:38 +0000 (06:37 +0000)]
ScopInfo: Extend description of the access relation.

llvm-svn: 259633

8 years agoAdd a compatibility test
Xinliang David Li [Wed, 3 Feb 2016 06:27:38 +0000 (06:27 +0000)]
Add a compatibility test

llvm-svn: 259632

8 years agoFix a typo in comment
Xinliang David Li [Wed, 3 Feb 2016 06:24:11 +0000 (06:24 +0000)]
Fix a typo in comment

llvm-svn: 259631

8 years agoFix uninitiazed variable use problem
Xinliang David Li [Wed, 3 Feb 2016 06:23:16 +0000 (06:23 +0000)]
Fix uninitiazed variable use problem

llvm-svn: 259630

8 years agoRevert "Support loads with differently sized types from a single array"
Tobias Grosser [Wed, 3 Feb 2016 05:53:27 +0000 (05:53 +0000)]
Revert "Support loads with differently sized types from a single array"

This reverts commit (@259587). It needs some further discussions.

llvm-svn: 259629

8 years agoclang-format: [JS/TypeScript] Support "enum" as an optional property name, too.
Daniel Jasper [Wed, 3 Feb 2016 05:33:44 +0000 (05:33 +0000)]
clang-format: [JS/TypeScript] Support "enum" as an optional property name, too.

Before:
  enum?: string
  [];

After:
  enum?: string[];

llvm-svn: 259628

8 years agoSync up with master file
Xinliang David Li [Wed, 3 Feb 2016 04:09:02 +0000 (04:09 +0000)]
Sync up with master file

llvm-svn: 259627

8 years ago[PGO] Profile summary reader/writer support
Xinliang David Li [Wed, 3 Feb 2016 04:08:18 +0000 (04:08 +0000)]
[PGO] Profile summary reader/writer support

With this patch, the profile summary data will be available in indexed
profile data file so that profiler reader/compiler optimizer can start
to make use of.

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

llvm-svn: 259626

8 years agoLowerBitSets: Don't bother to do any work if the llvm.bitset.test intrinsic is unused.
Peter Collingbourne [Wed, 3 Feb 2016 03:48:46 +0000 (03:48 +0000)]
LowerBitSets: Don't bother to do any work if the llvm.bitset.test intrinsic is unused.

llvm-svn: 259625

8 years agoMake CF constant string decl visible to name lookup to fix module errors
Ben Langmuir [Wed, 3 Feb 2016 03:26:19 +0000 (03:26 +0000)]
Make CF constant string decl visible to name lookup to fix module errors

The return type of the __builtin___*StringMakeConstantString functions
is a pointer to a struct, so we need that struct to be visible to name
lookup so that we will correctly merge multiple declarations of that
type if they come from different modules.

Incidentally, to make this visible to name lookup we need to rename the
type to __NSConstantString, since the real NSConstantString is an
Objective-C interface type.  This shouldn't affect anyone outside the
compiler since users of the constant string builtins cast the result
immediately to CFStringRef.

Since this struct type is otherwise implicitly created by the AST
context and cannot access namelookup, we make this a predefined type
and initialize it in Sema.

Note: this issue of builtins that refer to types not visible to name
lookup technically also affects other builtins (e.g. objc_msgSendSuper),
but in all other cases the builtin is a library builtin and the issue
goes away if you include the library that defines the types it uses,
unlike for these constant string builtins.

rdar://problem/24425801

llvm-svn: 259624

8 years agoAdd #include "llvm/Support/raw_ostream.h" to fix Windows build.
Peter Collingbourne [Wed, 3 Feb 2016 03:16:37 +0000 (03:16 +0000)]
Add #include "llvm/Support/raw_ostream.h" to fix Windows build.

llvm-svn: 259623

8 years agoFix miscompile and rejects-valids when disambiguating after an ambiguous
Richard Smith [Wed, 3 Feb 2016 02:58:20 +0000 (02:58 +0000)]
Fix miscompile and rejects-valids when disambiguating after an ambiguous
C-style-cast to function/array type or parenthesized function-style cast/array
indexing.

llvm-svn: 259622

8 years agoTransforms: Move GlobalOpt's Evaluator to Utils where it can be reused.
Peter Collingbourne [Wed, 3 Feb 2016 02:51:00 +0000 (02:51 +0000)]
Transforms: Move GlobalOpt's Evaluator to Utils where it can be reused.

llvm-svn: 259621

8 years agoFix typo in comment. NFC
Nick Lewycky [Wed, 3 Feb 2016 02:15:49 +0000 (02:15 +0000)]
Fix typo in comment. NFC

llvm-svn: 259620

8 years agodocs: Document how bitsets may be used to encode type information.
Peter Collingbourne [Wed, 3 Feb 2016 02:01:08 +0000 (02:01 +0000)]
docs: Document how bitsets may be used to encode type information.

llvm-svn: 259619

8 years agoFix typo in OpenCL type mangling. This is still bogus (we should either use the
Richard Smith [Wed, 3 Feb 2016 01:43:59 +0000 (01:43 +0000)]
Fix typo in OpenCL type mangling. This is still bogus (we should either use the
actual source name of the typedef or a vendor mangling) but at least it stands
a chance of demangling now.

We would also benefit from some test coverage of this (OpenCL +
__attribute__((overloadable)) is probably required to reach this).

llvm-svn: 259618

8 years agoCodegen: [PPC] Fix PPCVSXFMAMutate to handle duplicates.
Kyle Butt [Wed, 3 Feb 2016 01:41:09 +0000 (01:41 +0000)]
Codegen: [PPC] Fix PPCVSXFMAMutate to handle duplicates.

The purpose of PPCVSXFMAMutate is to elide copies by changing FMA forms
on PPC.

    %vreg6<def> = COPY %vreg96
    %vreg6<def,tied1> = XSMADDASP %vreg6<tied0>, %vreg5<kill>, %vreg7
    ;v6 = v6 + v5 * v7

is replaced by

    %vreg5<def,tied1> = XSMADDMSP %vreg5<tied0>, %vreg7, %vreg96
    ;v5 = v5 * v7 + v96

This was broken in the case where the target register was also used as a
multiplicand. Fix this case by checking for it and replacing both uses
with the copied register.

    %vreg6<def> = COPY %vreg96
    %vreg6<def,tied1> = XSMADDASP %vreg6<tied0>, %vreg5<kill>, %vreg6
    ;v6 = v6 + v5 * v6

is replaced by

    %vreg5<def,tied1> = XSMADDMSP %vreg5<tied0>, %vreg96, %vreg96
    ;v5 = v5 * v96 + v96

llvm-svn: 259617

8 years agoFix Itanium RTTI emission so that we emit fundamental type information into the
Richard Smith [Wed, 3 Feb 2016 01:32:42 +0000 (01:32 +0000)]
Fix Itanium RTTI emission so that we emit fundamental type information into the
C++ ABI library for the same set of types for which we expect the C++ ABI
library to provide the RTTI.

Specifically:
 1) __int128 and unsigned __int128 are now emitted into the ABI library. We
    always expected them to be there but never actually made sure to emit them.
 2) Do not expect OpenCL builtin types to have type info in the C++ ABI library.
    Neither libc++abi nor libstdc++ puts them there when built with either GCC
    or Clang.

This matches GCC's behavior.

llvm-svn: 259616

8 years agoRevert r259576: Disable the vzeroupper insertion pass on PS4.
Yunzhong Gao [Wed, 3 Feb 2016 01:25:12 +0000 (01:25 +0000)]
Revert r259576: Disable the vzeroupper insertion pass on PS4.
Will re-implement based on review feedback.

llvm-svn: 259615

8 years agoRegCoalescer: Making sure re-materialization defines all subranges
Marcello Maggioni [Wed, 3 Feb 2016 00:22:32 +0000 (00:22 +0000)]
RegCoalescer: Making sure re-materialization defines all subranges

The register coalescer can rematerialize constants that define
more of a register than the copy it is going to replace was going
to do.
This is valid in the case the register was undef before the
copy happened.
This patch makes sure that all the subranges defined by the new
rematerialization instructions have at least a dead def.

Review: http://reviews.llvm.org/D16693
llvm-svn: 259614

8 years agoDefine SymbolBody::getSize instead of getSymSize(SymbolBody&). NFC.
Rui Ueyama [Wed, 3 Feb 2016 00:12:24 +0000 (00:12 +0000)]
Define SymbolBody::getSize instead of getSymSize(SymbolBody&). NFC.

llvm-svn: 259613

8 years agoDiagnosticInfoWithDebugLocBase: Appease Twine for now.
NAKAMURA Takumi [Wed, 3 Feb 2016 00:09:22 +0000 (00:09 +0000)]
DiagnosticInfoWithDebugLocBase: Appease Twine for now.

FIXME: We should get rid of Twine in the record.
llvm-svn: 259612

8 years agoThe compiler may use "line number 0" to indicate compiler generated goo that it can't
Jim Ingham [Wed, 3 Feb 2016 00:07:23 +0000 (00:07 +0000)]
The compiler may use "line number 0" to indicate compiler generated goo that it can't
track a source for.  When we are pushing breakpoints and stepping past function prologues,
also push past code from line 0 immediately following the prologue end.

<rdar://problem/23730696>

llvm-svn: 259611

8 years ago[LoopVersioning] Expose loop versioning as a pass too
Adam Nemet [Wed, 3 Feb 2016 00:06:10 +0000 (00:06 +0000)]
[LoopVersioning] Expose loop versioning as a pass too

Summary:
LoopVersioning is a transform utility that transform passes can use to
run-time disambiguate may-aliasing accesses. I'd like to also expose as
pass to allow it to be unit-tested.

I am planning to add support for non-aliasing annotation in
LoopVersioning and I'd like to be able to write tests directly using
this pass.

(After that feature is done, the pass could also be used to look for
optimization opportunities that are hidden behind incomplete alias
information at compile time.)

The pass drives LoopVersioning in its default way which is to fully
disambiguate may-aliasing accesses no matter how many checks are
required.

Reviewers: hfinkel, ashutosh.nema, sbaranga

Subscribers: zzheng, mssimpso, llvm-commits, sanjoy

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

llvm-svn: 259610

8 years agoPR24989: Stop trying to use the C++11 rules for lambda return type inference in
Richard Smith [Tue, 2 Feb 2016 23:58:56 +0000 (23:58 +0000)]
PR24989: Stop trying to use the C++11 rules for lambda return type inference in
C++14 generic lambdas. It conflicts with the C++14 return type deduction
mechanism, and results in us failing to actually deduce the lambda's return
type in some cases.

llvm-svn: 259609

8 years agoFix inverted conditional in TestInferiorAssert.py
Zachary Turner [Tue, 2 Feb 2016 23:56:45 +0000 (23:56 +0000)]
Fix inverted conditional in TestInferiorAssert.py

llvm-svn: 259608

8 years agoFix a thinko in StackFrame::GetInScopeVariableList.
Siva Chandra [Tue, 2 Feb 2016 23:49:41 +0000 (23:49 +0000)]
Fix a thinko in StackFrame::GetInScopeVariableList.

Reviewers: clayborg

Subscribers: lldb-commits

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

llvm-svn: 259607

8 years agoELF: Write about the current policy to README.
Rui Ueyama [Tue, 2 Feb 2016 23:45:54 +0000 (23:45 +0000)]
ELF: Write about the current policy to README.

llvm-svn: 259606

8 years agoSet correct thread stop info when single-step lands on a breakpoint [Windows]
Adrian McCarthy [Tue, 2 Feb 2016 23:38:08 +0000 (23:38 +0000)]
Set correct thread stop info when single-step lands on a breakpoint [Windows]

I don't understand how this worked before, but this fixes the recent test regressions on Windows in TestConsecutiveBreakpoints.py.

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

llvm-svn: 259605

8 years agoFix rejects-valid when forming a pointer-to-member with 'decltype(expr)::*'.
Richard Smith [Tue, 2 Feb 2016 23:34:49 +0000 (23:34 +0000)]
Fix rejects-valid when forming a pointer-to-member with 'decltype(expr)::*'.

llvm-svn: 259604

8 years agoAttempt #2 to unbreak r259595.
George Burgess IV [Tue, 2 Feb 2016 23:26:01 +0000 (23:26 +0000)]
Attempt #2 to unbreak r259595.

llvm-svn: 259602

8 years ago[codeview] Improve readability of codeview assembly output
David Majnemer [Tue, 2 Feb 2016 23:18:23 +0000 (23:18 +0000)]
[codeview] Improve readability of codeview assembly output

Strictly speaking, this is not an improvement in functionality per se
but a usability improvement to those debugging codeview.

llvm-svn: 259601

8 years ago[libFuzzer] don't create too many trace-based mutations as it may be too slow
Kostya Serebryany [Tue, 2 Feb 2016 23:17:45 +0000 (23:17 +0000)]
[libFuzzer] don't create too many trace-based mutations as it may be too slow

llvm-svn: 259600

8 years agoAttempt to fix builds broken by r259595.
George Burgess IV [Tue, 2 Feb 2016 23:15:26 +0000 (23:15 +0000)]
Attempt to fix builds broken by r259595.

llvm-svn: 259599

8 years agoWork around build failure due to GCC 4.8.1 bug. We don't completely understand
Richard Smith [Tue, 2 Feb 2016 23:11:49 +0000 (23:11 +0000)]
Work around build failure due to GCC 4.8.1 bug. We don't completely understand
the details of the bug, but avoiding overloading llvm::cast with another
function template sidesteps it.

See gcc.gnu.org/PR58022 for details of the bug, and llvm.org/PR26362 for more
backgound on how it manifested in Clang. Patch by Igor Sugak!

llvm-svn: 259598

8 years agoELF: Make link() to take an output stream to which error messages are written.
Rui Ueyama [Tue, 2 Feb 2016 22:49:32 +0000 (22:49 +0000)]
ELF: Make link() to take an output stream to which error messages are written.

http://reviews.llvm.org/D16668

llvm-svn: 259597

8 years agoELF: Do not exit if it cannot open an output file.
Rui Ueyama [Tue, 2 Feb 2016 22:48:04 +0000 (22:48 +0000)]
ELF: Do not exit if it cannot open an output file.

It can fail to open an output file for various reasons, including
lack of permission, too long filename, or the output file is not
a mmap'able file.

llvm-svn: 259596

8 years agoThis patch adds MemorySSA to LLVM.
George Burgess IV [Tue, 2 Feb 2016 22:46:49 +0000 (22:46 +0000)]
This patch adds MemorySSA to LLVM.

Please see include/llvm/Transforms/Utils/MemorySSA.h for a description
of MemorySSA, and what it does.

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

llvm-svn: 259595

8 years ago[LVI] Fix debug output
Philip Reames [Tue, 2 Feb 2016 22:43:08 +0000 (22:43 +0000)]
[LVI] Fix debug output

Due to staleness in a patch I committed yesterday, the debug output was reporting overdefined cases as being undefined.  Confusing to say the least.  The mistake appears to have only effected the debug output thankfully.

llvm-svn: 259594

8 years ago[TSan] Use darwin_filter_host_arch to restrict set of test arch on Mac OS.
Alexey Samsonov [Tue, 2 Feb 2016 22:42:25 +0000 (22:42 +0000)]
[TSan] Use darwin_filter_host_arch to restrict set of test arch on Mac OS.

This also reverts r259577 which was a quick-fix to fix buildbots.

llvm-svn: 259593

8 years ago[CUDA] Do not allow dynamic initialization of global device side variables.
Artem Belevich [Tue, 2 Feb 2016 22:29:48 +0000 (22:29 +0000)]
[CUDA] Do not allow dynamic initialization of global device side variables.

In general CUDA does not allow dynamic initialization of
global device-side variables. One exception is that CUDA allows
records with empty constructors as described in section E2.2.1 of
CUDA 7.5 Programming guide.

This patch applies initializer checks for all device-side variables.
Empty constructors are accepted, but no code is generated for them.

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

llvm-svn: 259592

8 years agoObjCXX: fix a crash during typo correction.
Manman Ren [Tue, 2 Feb 2016 22:23:03 +0000 (22:23 +0000)]
ObjCXX: fix a crash during typo correction.

For ObjCXX, we can create a CastExpr with Kind being CK_UserDefinedConversion
and SubExpr being BlockExpr. Specifically one can return BlockExpr from
BuildCXXMemberCallExpr and the result can be used to build a CastExpr.

Fix the assumption in CastExpr::getSubExprAsWritten that SubExpr can only
be CXXMemberCallExpr.

rdar://problem/24364077

llvm-svn: 259591

8 years agoDon't return a tuple from the skip test function.
Zachary Turner [Tue, 2 Feb 2016 22:22:53 +0000 (22:22 +0000)]
Don't return a tuple from the skip test function.

Previously we were returning a tuple of (bool, skip_reason) from
the tuple function.  This makes for some awkward code, especially
since a value of True for the first argument implies that the
second argument is None, and a value of False implies that the
second argument is not None.  So it was basically redundant, and
with this patch we simply return the skip reason or None directly.

llvm-svn: 259590

8 years ago__mh_execute_header atoms should be global and never dead strippped.
Pete Cooper [Tue, 2 Feb 2016 22:19:01 +0000 (22:19 +0000)]
__mh_execute_header atoms should be global and never dead strippped.

In r259574 I fixed some of the issues with the mach header symbols
and DSO handles.

This is the next issue whereby the __mh_execute_header has to not
be dead stripped, and (to match ld64) should be dynamically referenced.

The test here should also have been added in r259574 to make sure that
we emit this symbol.  But checking that it is not only emitted but also
has the correct reference type is fine.

llvm-svn: 259589

8 years ago[asan] Remove redundant elif
Anna Zaks [Tue, 2 Feb 2016 22:05:47 +0000 (22:05 +0000)]
[asan] Remove redundant elif

This is a fixup to r259451.

llvm-svn: 259588

8 years agoSupport loads with differently sized types from a single array
Tobias Grosser [Tue, 2 Feb 2016 22:05:29 +0000 (22:05 +0000)]
Support loads with differently sized types from a single array

We support now code such as:

void multiple_types(char *Short, char *Float, char *Double) {
  for (long i = 0; i < 100; i++) {
    Short[i] = *(short *)&Short[2 * i];
    Float[i] = *(float *)&Float[4 * i];
    Double[i] = *(double *)&Double[8 * i];
  }
}

To support such code we use as element type of the modeled array the smallest
element type of all original array accesses. Accesses with larger types are
modeled as multiple accesses with the smaller type.

For example the second load access is modeled as:

  { Stmt_bb2[i0] -> MemRef_Float[o0] : 4i0 <= o0 <= 3 + 4i0 }

To support jscop-rewritable memory accesses we need each statement instance to
only be assigned a single memory location, which will be the address at which
we load the value. Currently we obtain this address by taking the lexmin of
the access function. We may consider keeping track of the memory location more
explicitly in the future.

llvm-svn: 259587

8 years ago[asan] Add iOS support to AddressSanitzier
Anna Zaks [Tue, 2 Feb 2016 22:05:07 +0000 (22:05 +0000)]
[asan] Add iOS support to AddressSanitzier

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

llvm-svn: 259586

8 years ago[LVI] Code motion only [NFC]
Philip Reames [Tue, 2 Feb 2016 22:03:19 +0000 (22:03 +0000)]
[LVI] Code motion only [NFC]

I introduced a declaration in 259583 to keep the diff readable.  This change just moves the definition up to remove the declaration again.

llvm-svn: 259585

8 years agoAdd "REQUIRES: shell" to fix Windows buildbot.
Rui Ueyama [Tue, 2 Feb 2016 21:58:39 +0000 (21:58 +0000)]
Add "REQUIRES: shell" to fix Windows buildbot.

llvm-svn: 259584

8 years ago[LVI] Refactor to use newly introduced intersect utility
Philip Reames [Tue, 2 Feb 2016 21:57:37 +0000 (21:57 +0000)]
[LVI] Refactor to use newly introduced intersect utility

This patch uses the newly introduced 'intersect' utility (from 259461: [LVI] Introduce an intersect operation on lattice values) to simplify existing code in LVI.

While not introducing any new concepts, this change is probably not NFC.  The common 'intersect' function is more powerful that the ad-hoc implementations we'd had in a couple of places.  Given that, we may see optimizations triggering a bit more often.

llvm-svn: 259583

8 years agoRemove utils/buildit
Justin Bogner [Tue, 2 Feb 2016 21:56:16 +0000 (21:56 +0000)]
Remove utils/buildit

The autoconf build system was removed - this doesn't even work and
doesn't need to be here.

llvm-svn: 259582

8 years agoCorrect size calculations for ELF files
Hemant Kulkarni [Tue, 2 Feb 2016 21:41:49 +0000 (21:41 +0000)]
Correct size calculations for ELF files

llvm-svn: 259578

8 years ago[tsan] Disable x86_64h build that was enabled as part of r259542.
Daniel Sanders [Tue, 2 Feb 2016 21:41:17 +0000 (21:41 +0000)]
[tsan] Disable x86_64h build that was enabled as part of r259542.

It fails almost every test on clang-stage1-cmake-RA_check.

llvm-svn: 259577

8 years agoDisable the vzeroupper insertion pass on PS4.
Yunzhong Gao [Tue, 2 Feb 2016 21:39:23 +0000 (21:39 +0000)]
Disable the vzeroupper insertion pass on PS4.
See comments in test/CodeGen/X86/avx-vzeroupper.ll for more explanation.

Original patch by: Sean Silva

llvm-svn: 259576

8 years ago[Orc] Stub addresses should be based on stub size, not pointer size.
Lang Hames [Tue, 2 Feb 2016 21:38:30 +0000 (21:38 +0000)]
[Orc] Stub addresses should be based on stub size, not pointer size.

This didn't affect X86_64, which is the only client of this code at the moment,
as stubs and pointers are both 8-bytes there. It will affect other platforms
though.

llvm-svn: 259575

8 years agoFix handling of mach header and DSO handle symbols.
Pete Cooper [Tue, 2 Feb 2016 21:37:15 +0000 (21:37 +0000)]
Fix handling of mach header and DSO handle symbols.

The magic file which contained these symbols inherited from archive
which meant that the resolver didn't add the required atoms as archive
members only get added when referenced.  Instead we now inherit from
SimpleFile which always links in the atoms needed.

The second issue was in the handling of these symbols when we emit
the MachO.  The mach header symbol needs to be in the atom list as
it gets an offset (0), and being in the atom list makes sure it is
emitted to the symbol table.  DSO handles are not emitted to the
symbol table.

rdar://problem/24450654

llvm-svn: 259574

8 years agoAMDGPU: Do not promote allocas with non-inbounds GEPs
Matt Arsenault [Tue, 2 Feb 2016 21:16:12 +0000 (21:16 +0000)]
AMDGPU: Do not promote allocas with non-inbounds GEPs

If we can't assume the pointer value isn't within the bounds
of the object, it seems risky to try to replace the pointer
calculations.

llvm-svn: 259573

8 years agoRe-submit ELF: Report multiple errors from the driver.
Rui Ueyama [Tue, 2 Feb 2016 21:13:09 +0000 (21:13 +0000)]
Re-submit ELF: Report multiple errors from the driver.

This reverts r259395 which reverted r259143.

llvm-svn: 259572

8 years agoELF: Rewrite "echo" command arguments in hope that would fix a test breakage.
Rui Ueyama [Tue, 2 Feb 2016 21:03:56 +0000 (21:03 +0000)]
ELF: Rewrite "echo" command arguments in hope that would fix a test breakage.

Previously, we used both single quotes and double quotes, and
some single-quoted tokens are concatenated with next tokens because
there were no spaces between them. That may be a cause of test flakiness
on Windows, which is reported as https://llvm.org/bugs/show_bug.cgi?id=26388.

The new test commands are more straightforward than before.

llvm-svn: 259559

8 years agoAMDGPU: Handle promoting memmove
Matt Arsenault [Tue, 2 Feb 2016 20:28:10 +0000 (20:28 +0000)]
AMDGPU: Handle promoting memmove

Also add missing tests for the others.

llvm-svn: 259558

8 years agoELF: Do not use fatal in LinkerScript.cpp.
Rui Ueyama [Tue, 2 Feb 2016 20:27:59 +0000 (20:27 +0000)]
ELF: Do not use fatal in LinkerScript.cpp.

This patch adds "Error" field to LinkerScript class. That field
is false by default, and set to true if there is a syntax error
in an input file. The linker script parser is a recursive-descedent
parser. Each function returns if Error is true -- so that
eventually the whole parser returns to a caller.

http://reviews.llvm.org/D16667

llvm-svn: 259557

8 years agoRevert "[NFC] Cleanup RangeMap.h"
Todd Fiala [Tue, 2 Feb 2016 20:26:50 +0000 (20:26 +0000)]
Revert "[NFC] Cleanup RangeMap.h"

This reverts commit r259538.  Caused 92 test failures on
the OS X testbot.

llvm-svn: 259556

8 years agoDo not use filename in a lit test.
Rui Ueyama [Tue, 2 Feb 2016 20:24:33 +0000 (20:24 +0000)]
Do not use filename in a lit test.

So that the file is move-safe.

llvm-svn: 259555

8 years agoELF: Use StringRef instead of std::string.
Rui Ueyama [Tue, 2 Feb 2016 20:24:31 +0000 (20:24 +0000)]
ELF: Use StringRef instead of std::string.

All MemoryBuffers for archive files are guaranteed to exist as long
as their children are used in the linker. So we don't need to copy
strings here. Thanks to Sean Silva for pointing this out.

llvm-svn: 259554

8 years ago[X86] Fix the merging of SP updates in prologue/epilogue insertions.
Quentin Colombet [Tue, 2 Feb 2016 20:11:17 +0000 (20:11 +0000)]
[X86] Fix the merging of SP updates in prologue/epilogue insertions.
When the merging was involving LEAs, we were taking the wrong immediate
from the list of operands.

rdar://problem/24446069

llvm-svn: 259553

8 years agoMachineVerifier: Check that defs/uses are live in subregisters as well.
Matthias Braun [Tue, 2 Feb 2016 20:04:51 +0000 (20:04 +0000)]
MachineVerifier: Check that defs/uses are live in subregisters as well.

llvm-svn: 259552

8 years agoAMDGPU: Skip promote alloca with no optimizations
Matt Arsenault [Tue, 2 Feb 2016 19:32:42 +0000 (19:32 +0000)]
AMDGPU: Skip promote alloca with no optimizations

llvm-svn: 259551

8 years agoAMDGPU: Minor cleanups for AMDGPUPromoteAlloca
Matt Arsenault [Tue, 2 Feb 2016 19:32:35 +0000 (19:32 +0000)]
AMDGPU: Minor cleanups for AMDGPUPromoteAlloca

Mostly convert to use range loops.

llvm-svn: 259550

8 years ago[Orc] Turn OrcX86_64::IndirectStubsInfo into a template helper class:
Lang Hames [Tue, 2 Feb 2016 19:31:15 +0000 (19:31 +0000)]
[Orc] Turn OrcX86_64::IndirectStubsInfo into a template helper class:
GenericIndirectStubsInfo.

This will allow architecture support classes for other architectures to re-use
this code.

llvm-svn: 259549

8 years ago[codeview] Correctly handle inlining functions post-dominated by unreachable
David Majnemer [Tue, 2 Feb 2016 19:22:34 +0000 (19:22 +0000)]
[codeview] Correctly handle inlining functions post-dominated by unreachable

CodeView requires us to accurately describe the extent of the inlined
code.  We did this by grabbing the next debug location in source order
and using *that* to denote where we stopped inlining.  However, this is
not sufficient or correct in instances where there is no next debug
location or the next debug location belongs to the start of another
function.

To get this correct, use the end symbol of the function to denote the
last possible place the inlining could have stopped at.

llvm-svn: 259548

8 years agoAMDGPU: Report AMDGPUPromoteAlloca changed the function
Matt Arsenault [Tue, 2 Feb 2016 19:18:57 +0000 (19:18 +0000)]
AMDGPU: Report AMDGPUPromoteAlloca changed the function

llvm-svn: 259547