platform/upstream/llvm.git
7 years agoTry to fix Android build.
Zachary Turner [Wed, 5 Oct 2016 17:58:46 +0000 (17:58 +0000)]
Try to fix Android build.

Seems it doesn't like the implicit conversion from
StringRef[] to ArrayRef<StringRef>.

llvm-svn: 283351

7 years ago[LV] Add isScalarWithPredication helper function (NFC)
Matthew Simpson [Wed, 5 Oct 2016 17:52:34 +0000 (17:52 +0000)]
[LV] Add isScalarWithPredication helper function (NFC)

This patch adds a single helper function for checking if an instruction will be
scalarized with predication. Such instructions include conditional stores and
instructions that may divide by zero. Existing checks have been updated to use
the new function.

llvm-svn: 283350

7 years agoRevert "[asan] Switch to using dynamic shadow offset on iOS"
Anna Zaks [Wed, 5 Oct 2016 17:42:24 +0000 (17:42 +0000)]
Revert "[asan] Switch to using dynamic shadow offset on iOS"

This reverts commit b2af965b7924ad793b313996a96633bb72daf629.

Revert as these changes broke a Chromium buildbot.

llvm-svn: 283349

7 years agoRevert "[asan] LLVM: Switch to using dynamic shadow offset on iOS"
Anna Zaks [Wed, 5 Oct 2016 17:42:02 +0000 (17:42 +0000)]
Revert "[asan] LLVM: Switch to using dynamic shadow offset on iOS"

This reverts commit abe77a118615cd90b0d7f127e4797096afa2b394.

Revert as these changes broke a Chromium buildbot.

llvm-svn: 283348

7 years ago[DAG] Teach computeKnownBits and ComputeNumSignBits in SelectionDAG to look through...
Bjorn Pettersson [Wed, 5 Oct 2016 17:40:27 +0000 (17:40 +0000)]
[DAG] Teach computeKnownBits and ComputeNumSignBits in SelectionDAG to look through EXTRACT_VECTOR_ELT.

Summary: Both computeKnownBits and ComputeNumSignBits can now do a simple
look-through of EXTRACT_VECTOR_ELT. It will compute the result based
on the known bits (or known sign bits) for the vector that the element
is extracted from.

Reviewers: bogner, tstellarAMD, mkuper

Subscribers: wdng, RKSimon, jyknight, llvm-commits, nhaehnle

Differential Revision: https://reviews.llvm.org/D25007

llvm-svn: 283347

7 years agoTest commit permission. NFC
Bjorn Pettersson [Wed, 5 Oct 2016 17:22:11 +0000 (17:22 +0000)]
Test commit permission. NFC

llvm-svn: 283346

7 years agoConvert some breakpoint code to use StringRef.
Zachary Turner [Wed, 5 Oct 2016 17:07:47 +0000 (17:07 +0000)]
Convert some breakpoint code to use StringRef.

Differential revision: https://reviews.llvm.org/D25158

llvm-svn: 283345

7 years agoMake lldb -Werror clean on Windows.
Zachary Turner [Wed, 5 Oct 2016 17:07:34 +0000 (17:07 +0000)]
Make lldb -Werror clean on Windows.

Differential Revision: https://reviews.llvm.org/D25247

llvm-svn: 283344

7 years agoDisable warnings in LLDBWrapPython.cpp with -Werror.
Zachary Turner [Wed, 5 Oct 2016 17:07:16 +0000 (17:07 +0000)]
Disable warnings in LLDBWrapPython.cpp with -Werror.

When -Werror is used, we don't have control over the generated
code from SWIG, and it often has warnings.  Just disable them for
this file when -Werror is used, they are usually not important
anyway.

Differential revision: https://reviews.llvm.org/D25246

llvm-svn: 283343

7 years agoFix build due to comparison of std::pairs.
Zachary Turner [Wed, 5 Oct 2016 17:04:36 +0000 (17:04 +0000)]
Fix build due to comparison of std::pairs.

llvm-svn: 283342

7 years agoMark LWG#2358 as done
Marshall Clow [Wed, 5 Oct 2016 17:02:43 +0000 (17:02 +0000)]
Mark LWG#2358 as done

llvm-svn: 283341

7 years agoSimplify setting the Live bit in SectionPiece. NFC.
Rafael Espindola [Wed, 5 Oct 2016 17:02:09 +0000 (17:02 +0000)]
Simplify setting the Live bit in SectionPiece. NFC.

llvm-svn: 283340

7 years agoMake tests for is_empty better. No functional change.
Marshall Clow [Wed, 5 Oct 2016 17:01:16 +0000 (17:01 +0000)]
Make tests for is_empty better. No functional change.

llvm-svn: 283339

7 years ago[change-namespace] Pass Style to ChangeNamespaceTool.
Haojian Wu [Wed, 5 Oct 2016 17:00:40 +0000 (17:00 +0000)]
[change-namespace] Pass Style to ChangeNamespaceTool.

llvm-svn: 283338

7 years agoAdd llvm::enumerate() range adapter.
Zachary Turner [Wed, 5 Oct 2016 16:54:09 +0000 (16:54 +0000)]
Add llvm::enumerate() range adapter.

This allows you to enumerate over a range using a range-based
for while the return type contains the index of the enumeration.

Differential revision: https://reviews.llvm.org/D25124

llvm-svn: 283337

7 years agoDon't pass null to memcpy. Should fix the asan bots.
Rafael Espindola [Wed, 5 Oct 2016 16:33:03 +0000 (16:33 +0000)]
Don't pass null to memcpy. Should fix the asan bots.

llvm-svn: 283336

7 years ago[RenderScript] reflow/reword some comments and normalize names
Luke Drummond [Wed, 5 Oct 2016 16:27:48 +0000 (16:27 +0000)]
[RenderScript] reflow/reword some comments and normalize names

Pay more attention to comment alignement (Since _The Great Reformat_ (a015ff50)
comments are no longer properly aligned) and variable naming conventions.

- Manually reflow and cleanup comments and array literals
- Be more economical with our naming conventions
- Be internally consistent with regard to local variable/member function
  naming

llvm-svn: 283335

7 years agoRecommit: "[mips] Add rsqrt, recip for MIPS"
Simon Dardis [Wed, 5 Oct 2016 16:11:01 +0000 (16:11 +0000)]
Recommit: "[mips] Add rsqrt, recip for MIPS"

Add rsqrt.[ds], recip.[ds] for MIPS. Correct the microMIPS definitions for
architecture support and register usage.

Reviewers: vkalintiris, zoran.jovanoic

Differential Review: https://reviews.llvm.org/D24499

llvm-svn: 283334

7 years ago[change-namespace] Fixed a bug in getShortestQualifiedNameInNamespace.
Eric Liu [Wed, 5 Oct 2016 15:52:39 +0000 (15:52 +0000)]
[change-namespace] Fixed a bug in getShortestQualifiedNameInNamespace.

Reviewers: hokein

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D25065

llvm-svn: 283333

7 years agoMake DeletedLines local variables in checkEmptyNamespace.
Eric Liu [Wed, 5 Oct 2016 15:49:01 +0000 (15:49 +0000)]
Make DeletedLines local variables in checkEmptyNamespace.

Summary: Patch by Sam McCall!

Reviewers: djasper

Subscribers: klimek, cfe-commits

Differential Revision: https://reviews.llvm.org/D25162

llvm-svn: 283332

7 years agoAdd another append test for basic_string
Marshall Clow [Wed, 5 Oct 2016 15:47:13 +0000 (15:47 +0000)]
Add another append test for basic_string

llvm-svn: 283331

7 years ago[clang-format] append newline after code when inserting new headers at the end of...
Eric Liu [Wed, 5 Oct 2016 15:42:19 +0000 (15:42 +0000)]
[clang-format] append newline after code when inserting new headers at the end of the code which does not end with newline.

Summary:
append newline after code when inserting new headers at the end of the
code which does not end with newline.

Reviewers: djasper

Subscribers: cfe-commits, klimek

Differential Revision: https://reviews.llvm.org/D21026

llvm-svn: 283330

7 years agoRevert r282920 "X86: Allow conditional tail calls in Win64 "leaf" functions (PR26302)"
Hans Wennborg [Wed, 5 Oct 2016 15:39:27 +0000 (15:39 +0000)]
Revert r282920 "X86: Allow conditional tail calls in Win64 "leaf" functions (PR26302)"

This is suspected to cause a miscompile in Chromium. Reverting while
investigating.

llvm-svn: 283329

7 years agoRemove redundant check. NFC.
Rafael Espindola [Wed, 5 Oct 2016 15:35:18 +0000 (15:35 +0000)]
Remove redundant check. NFC.

llvm-svn: 283328

7 years agoRevert "[mips] Add rsqrt, recip for MIPS"
Simon Dardis [Wed, 5 Oct 2016 15:28:33 +0000 (15:28 +0000)]
Revert "[mips] Add rsqrt, recip for MIPS"

This reverts commit r282485 which contain two patches instead of
one.

llvm-svn: 283327

7 years ago[X86] Don't randomly encode %rip where illegal
Douglas Katzman [Wed, 5 Oct 2016 15:23:35 +0000 (15:23 +0000)]
[X86] Don't randomly encode %rip where illegal

Differential Revision: https://reviews.llvm.org/D25112

llvm-svn: 283326

7 years agoMark LWG issues 2221, 2556 and 2589 as complete
Marshall Clow [Wed, 5 Oct 2016 15:21:11 +0000 (15:21 +0000)]
Mark LWG issues 2221, 2556 and 2589 as complete

llvm-svn: 283325

7 years agoxfailing minidump tests again ... :(
Dimitar Vlahovski [Wed, 5 Oct 2016 15:00:29 +0000 (15:00 +0000)]
xfailing minidump tests again ... :(

llvm-svn: 283324

7 years ago[Thumb] Don't try and emit LDRH/LDRB from the constant pool
James Molloy [Wed, 5 Oct 2016 14:52:13 +0000 (14:52 +0000)]
[Thumb] Don't try and emit LDRH/LDRB from the constant pool

This is not a valid encoding - these instructions cannot do PC-relative addressing.

The underlying problem here is of whitelist in ARMISelDAGToDAG that unwraps ARMISD::Wrappers during addressing-mode selection. This didn't realise TargetConstantPool was actually possible, so didn't handle it.

llvm-svn: 283323

7 years ago[X86] Fix some tests that didn't assert anything
Douglas Katzman [Wed, 5 Oct 2016 14:46:14 +0000 (14:46 +0000)]
[X86] Fix some tests that didn't assert anything

llvm-svn: 283322

7 years agoFixing new Minidump plugin tests
Dimitar Vlahovski [Wed, 5 Oct 2016 14:35:30 +0000 (14:35 +0000)]
Fixing new Minidump plugin tests

llvm-svn: 283321

7 years agocleanup RSCoordinate handling and factor out coordinate parser
Luke Drummond [Wed, 5 Oct 2016 14:34:52 +0000 (14:34 +0000)]
cleanup RSCoordinate handling and factor out coordinate parser

- This change updates the signature of
`RenderScriptRuntime::PlaceBreakpointOnKernel` to take a default
RSCoordinate pointer of nullptr. We use this as the predicate value for
the breakpoint coordinate rather than trying to fit a sentinel `-1` into
a signed version.

```
- void
- PlaceBreakpointOnKernel(Stream &strm, const char *name, const std::array<int, 3> coords, Error &error,
- lldb::TargetSP target);
```

```
+ bool
+ PlaceBreakpointOnKernel(lldb::TargetSP target, Stream &messages, const char *name,
+ const lldb_renderscript::RSCoordinate *coords = nullptr);
```
The above change makes the API for setting breakpoints on kernels
cleaner as it returns a failure value rather than modify a sentinel in
the caller. The optional arguments are now last and have a default
(falsey) value.

- RSCoordinate objects are now comparable with operator== and have
  zero initializers which should make them easier to work on.
- Added a `FMT_COORD` macro for use in logging format strings which
  should make format strings a little less verbose.

llvm-svn: 283320

7 years agoTest commit permission
Oren Ben Simhon [Wed, 5 Oct 2016 14:12:41 +0000 (14:12 +0000)]
Test commit permission

llvm-svn: 283319

7 years agoTest commit permission
Oren Ben Simhon [Wed, 5 Oct 2016 13:48:33 +0000 (13:48 +0000)]
Test commit permission

llvm-svn: 283318

7 years ago[AVR] Don't select 'MOVW' instructions when they are not supported
Dylan McKay [Wed, 5 Oct 2016 13:38:29 +0000 (13:38 +0000)]
[AVR] Don't select 'MOVW' instructions when they are not supported

We have a subtarget feature which we were ignoring, which was causing us
to generate unsupported instructions for some older chips.

llvm-svn: 283317

7 years ago[AVR] Add AVRRegisterInfo::splitReg function
Dylan McKay [Wed, 5 Oct 2016 13:27:30 +0000 (13:27 +0000)]
[AVR] Add AVRRegisterInfo::splitReg function

No tests are included just yet - this is used from the pseudo
instruction expander pass, which hasn't been pulled in-tree yet.

llvm-svn: 283316

7 years agoFix machine operand traversal in ScheduleDAGInstrs::fixupKills
Krzysztof Parzyszek [Wed, 5 Oct 2016 13:15:06 +0000 (13:15 +0000)]
Fix machine operand traversal in ScheduleDAGInstrs::fixupKills

llvm-svn: 283315

7 years ago[Clang][AVX512][BuiltIn]Adding missing intrinsics move_{sd|ss} to clang
Michael Zuckerman [Wed, 5 Oct 2016 12:56:06 +0000 (12:56 +0000)]
[Clang][AVX512][BuiltIn]Adding missing intrinsics move_{sd|ss} to clang

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

llvm-svn: 283314

7 years agoDelete unused global in ClangExpressionVariable.cpp
Luke Drummond [Wed, 5 Oct 2016 12:40:49 +0000 (12:40 +0000)]
Delete unused global in ClangExpressionVariable.cpp

Differential Revision: https://reviews.llvm.org/D24793

llvm-svn: 283313

7 years ago[AVR] Update return type of dynamic alloca pass
Dylan McKay [Wed, 5 Oct 2016 12:32:24 +0000 (12:32 +0000)]
[AVR] Update return type of dynamic alloca pass

It was recently changed from 'const char*' to StringRef

llvm-svn: 283312

7 years ago[AVR] Add the AVR frame lowering code
Dylan McKay [Wed, 5 Oct 2016 11:48:56 +0000 (11:48 +0000)]
[AVR] Add the AVR frame lowering code

Summary: This allows AVR to lower frames into assembly code.

Reviewers: arsenm, kparzysz

Subscribers: japaric, wdng, beanz, mgorny

Differential Revision: https://reviews.llvm.org/D25032

llvm-svn: 283311

7 years ago[AVR] Split all of the AVR device definitions into a separate file
Dylan McKay [Wed, 5 Oct 2016 10:28:45 +0000 (10:28 +0000)]
[AVR] Split all of the AVR device definitions into a separate file

We have ~500 lines of subtarget feature definitions, they don't belong
in our main TableGen file.

llvm-svn: 283310

7 years ago[AVR] Enable the instruction printer in the target definition
Dylan McKay [Wed, 5 Oct 2016 10:23:38 +0000 (10:23 +0000)]
[AVR] Enable the instruction printer in the target definition

llvm-svn: 283309

7 years ago[AVR] Add definitions for the ATTiny102 and ATtiny104 chips
Dylan McKay [Wed, 5 Oct 2016 10:20:33 +0000 (10:20 +0000)]
[AVR] Add definitions for the ATTiny102 and ATtiny104 chips

llvm-svn: 283308

7 years agoDo not join sections for relocatable object files
Eugene Leviant [Wed, 5 Oct 2016 10:10:45 +0000 (10:10 +0000)]
Do not join sections for relocatable object files

Differential revision: https://reviews.llvm.org/D25232

llvm-svn: 283307

7 years agoOverhaul clang-include-fixer.el
Haojian Wu [Wed, 5 Oct 2016 10:04:13 +0000 (10:04 +0000)]
Overhaul clang-include-fixer.el

General overhaul to fix many coding bugs, simplify the code, and improve readability.

* Clarify documentation strings of user options.
* Say that clang-include-fixer-executable is a file to have auto completion.
* Allow user to select available options for clang-include-fixer-input-format. Turn it into a symbol as it's not a free-form string.
* Remove clang-include-fixer-query-mode. This option was apparently used to select between two different operation modes, which is not a typical use case for user options. Provide two separate commands instead.
* Add a face for the overlay highlighting so that users can customize it.
Move user commands to the front so that readers of the code aren't buried in internal functions.
* Make process calls asynchronous. This is possible here because clang-include-fixer doesn't change files in place. This means input is no longer blocked while clang-include-fixer is running.
* Factor out logic in helper functions to keep functions short.
* Add comments where appropriate.
* Provide an alternative buffer replacement strategy for the case that a single line was inserted (the normal case in the case of clang-include-fixer). This keeps point, markers, and other buffer information intact.
* Use let-alist and association lists instead of property lists to shorten the code.
* Instead of highlighting only the first occurrence of a symbol, highlight all occurrences and move point to the closest one.
* Detect qualified names at point.
* Use filepos-to-bufferpos if available.
* Formatting.

Patch by Philipp Stephani!

llvm-svn: 283306

7 years ago[ELF] make KEEP command recognize file patterns
Eugene Leviant [Wed, 5 Oct 2016 09:36:59 +0000 (09:36 +0000)]
[ELF] make KEEP command recognize file patterns

Differential revision: https://reviews.llvm.org/D25242

llvm-svn: 283305

7 years ago[Sema] Packed member warning: Use the typedef name for anonymous structures
Alex Lorenz [Wed, 5 Oct 2016 09:27:48 +0000 (09:27 +0000)]
[Sema] Packed member warning: Use the typedef name for anonymous structures

This commit improves the packed member warning by showing the name of the
anonymous structure/union when it was defined within a typedef declaration.

rdar://28498901

Differential Revision: https://reviews.llvm.org/D25106

llvm-svn: 283304

7 years ago[analyzer] Squash a compile error in r283301.
Artem Dergachev [Wed, 5 Oct 2016 08:47:31 +0000 (08:47 +0000)]
[analyzer] Squash a compile error in r283301.

The constexpr string literal trick isn't supported in MSVC2013.

llvm-svn: 283303

7 years ago[analyzer] Improve "Assuming..." diagnostic pieces for logical operators.
Artem Dergachev [Wed, 5 Oct 2016 08:28:25 +0000 (08:28 +0000)]
[analyzer] Improve "Assuming..." diagnostic pieces for logical operators.

Logical short-circuit operators now act like other branch conditions.

If the symbolic value of the left-hand side is not known to be true or false
(based on the previous execution path), the "Assuming" event piece is added
in order to explain that the analyzer is adding a new assumption.

Additionally, when the assumption is made against the right-hand side of
the logical operator (i.e. when the operator itself acts as a condition
in another CFG terminator), the "Assuming..." piece is written out for the
right-hand side of the operator rather than for the whole operator.
This allows expression-specific diagnostic message text to be constructed.

Differential Revision: https://reviews.llvm.org/D25092

llvm-svn: 283302

7 years ago[analyzer] Add "Assuming..." diagnostic pieces for unsupported conditions.
Artem Dergachev [Wed, 5 Oct 2016 08:19:49 +0000 (08:19 +0000)]
[analyzer] Add "Assuming..." diagnostic pieces for unsupported conditions.

In the analyzer's path-sensitive reports, when a report goes through a branch
and the branch condition cannot be decided to be definitely true or false
(based on the previous execution path), an event piece is added that tells the
user that a new assumption is added upon the symbolic value of the branch
condition. For example, "Assuming 'a' is equal to 3".

The text of the assumption is hand-crafted in various manners depending on
the AST expression. If the AST expression is too complex and the text of
the assumption fails to be constructed, the event piece is omitted.
This causes loss of information and misunderstanding of the report.

Do not omit the event piece even if the expression is too complex;
add a piece with a generic text instead.

Differential Revision: https://reviews.llvm.org/D23300

llvm-svn: 283301

7 years ago[ELF] Do not merge sections in case of relocatable object generation
Simon Atanasyan [Wed, 5 Oct 2016 07:49:18 +0000 (07:49 +0000)]
[ELF] Do not merge sections in case of relocatable object generation

Do not merge sections if generating a relocatable object. It makes
the code simpler because we do not need to update relocations addends
to reflect changes introduced by merging. Instead of that we write
such "merge" sections into separate OutputSections and keep SHF_MERGE
/ SHF_STRINGS flags and sh_entsize value to be able to perform merging
later during a final linking.

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

llvm-svn: 283300

7 years ago[sanitizers] Update sanitizers test to better match glibc internals
Diana Picus [Wed, 5 Oct 2016 07:13:42 +0000 (07:13 +0000)]
[sanitizers] Update sanitizers test to better match glibc internals

Reapply 282061.

One of the tests relying on sem_t's layout gets the wrong value for versions of
glibc newer than 2.21 on platforms that don't have 64-bit atomics (e.g. ARM).

This commit fixes the test to work with:
* versions of glibc >= 2.21 on platforms with 64-bit atomics: unchanged
* versions of glibc >= 2.21 on platforms without 64-bit atomics: the semaphore
value is shifted by SEM_VALUE_SHIFT (which is set to 1 in glibc's internal
headers)
* versions of glibc < 2.21: unchanged

The logic is complicated a bit by the fact that the sanitizers always pick the
oldest version of the symbol available in glibc, which creates discrepancies
between old platforms which contain several versions od the sem_init symbol, and
newer platforms which contain only one.

See the glibc 2.23 sources:
* sysdeps/nptl/internaltypes.h (struct new_sem for glibc >= 2.21 and
                                struct old_sem for glibc < 2.21)
* nptl/sem_getvalue.c

This was uncovered on one of the new buildbots that we are trying to move to
production.

Differential Revision: https://reviews.llvm.org/D24766

llvm-svn: 283299

7 years agoRe-commit "Use StringRef in Support/Darf APIs (NFC)"
Mehdi Amini [Wed, 5 Oct 2016 05:59:29 +0000 (05:59 +0000)]
Re-commit "Use StringRef in Support/Darf APIs (NFC)"

This reverts commit r283285 and re-commit r283275 with
a fix for format("%s", Str); where Str is a StringRef.

llvm-svn: 283298

7 years ago[AVR] Add the machine code backend
Dylan McKay [Wed, 5 Oct 2016 05:30:19 +0000 (05:30 +0000)]
[AVR] Add the machine code backend

Summary:
This adds the AVR machine code backend (`AVRAsmBackend.cpp`). This will
allow us to generate machine code from assembled AVR instructions.

Reviewers: arsenm, kparzysz

Subscribers: modocache, japaric, wdng, beanz, mgorny

Differential Revision: https://reviews.llvm.org/D25029

llvm-svn: 283297

7 years ago[Support][CommandLine] Add cl::getRegisteredSubcommands()
Dean Michael Berris [Wed, 5 Oct 2016 05:20:08 +0000 (05:20 +0000)]
[Support][CommandLine] Add cl::getRegisteredSubcommands()

This should allow users of the library to get a range to iterate through
all the subcommands that are registered to the global parser. This
allows users to define subcommands in libraries that self-register to
have dispatch done at a different stage (like main). It allows for
writing code like the following:

    for (auto *S : cl::getRegisteredSubcommands()) {
      if (*S) {
// Dispatch on S->getName().
      }
    }

This change also contains tests that show this usage pattern.

Reviewers: zturner, dblaikie, echristo

Subscribers: llvm-commits, mehdi_amini

Differential Revision: https://reviews.llvm.org/D24489

llvm-svn: 283296

7 years agoChange Platform::GetRemoteSharedModule so if it's given a ModuleSpec
Jason Molenda [Wed, 5 Oct 2016 02:29:13 +0000 (02:29 +0000)]
Change Platform::GetRemoteSharedModule so if it's given a ModuleSpec
which specifies a file path and UUID but not an architecture, open
the file at that path and try every one of the architectures in the
file to see if there is a UUID match.  Currently we'll pick the
first slice of a multi-architecture file and return that as the
match, and when the UUID doesn't match because it's the wrong
architecture, we'll end up ignoring the file.

<rdar://problem/28487804>

llvm-svn: 283295

7 years agoBlind attempt to fix windows build after r283290 - Use StringRef in StringSaver API...
Mehdi Amini [Wed, 5 Oct 2016 01:41:11 +0000 (01:41 +0000)]
Blind attempt to fix windows build after r283290 - Use StringRef in StringSaver API (NFC)

llvm-svn: 283294

7 years agoUse StringRef in ARMConstantPool APIs (NFC)
Mehdi Amini [Wed, 5 Oct 2016 01:41:06 +0000 (01:41 +0000)]
Use StringRef in ARMConstantPool APIs (NFC)

llvm-svn: 283293

7 years agoRevert "Codegen: Tail-duplicate during placement."
Kyle Butt [Wed, 5 Oct 2016 01:39:29 +0000 (01:39 +0000)]
Revert "Codegen: Tail-duplicate during placement."

This reverts commit 062ace9764953e9769142c1099281a345f9b6bdc.

Issue with loop info and block removal revealed by polly.
I have a fix for this issue already in another patch, I'll re-roll this
together with that fix, and a test case.

llvm-svn: 283292

7 years agoUse StringRef in FastISel API (NFC)
Mehdi Amini [Wed, 5 Oct 2016 01:37:29 +0000 (01:37 +0000)]
Use StringRef in FastISel API (NFC)

llvm-svn: 283291

7 years agoUse StringRef in StringSaver API (NFC)
Mehdi Amini [Wed, 5 Oct 2016 01:32:41 +0000 (01:32 +0000)]
Use StringRef in StringSaver API (NFC)

llvm-svn: 283290

7 years agoThe collision of class C and libsystem_c.dylib:C is a failure
Jim Ingham [Wed, 5 Oct 2016 01:19:15 +0000 (01:19 +0000)]
The collision of class C and libsystem_c.dylib:C is a failure
worth preserving, but not essential to the purpose of this test
so I broke it into a separate test.

llvm-svn: 283289

7 years agoUse StringRef in ARCRuntimeEntryPoints APIs (NFC)
Mehdi Amini [Wed, 5 Oct 2016 01:15:04 +0000 (01:15 +0000)]
Use StringRef in ARCRuntimeEntryPoints APIs (NFC)

llvm-svn: 283288

7 years agoThis test is failing because there's a global symbol "C" in libsystem_c.dylib,
Jim Ingham [Wed, 5 Oct 2016 01:09:43 +0000 (01:09 +0000)]
This test is failing because there's a global symbol "C" in libsystem_c.dylib,
and that is defeating the lookup of the "struct C" here.  Adding the bug for that.

llvm-svn: 283287

7 years ago[libFuzzer] add ShrinkValueProfileTest, move code around, NFC
Kostya Serebryany [Wed, 5 Oct 2016 01:09:40 +0000 (01:09 +0000)]
[libFuzzer] add ShrinkValueProfileTest, move code around, NFC

llvm-svn: 283286

7 years agoRevert "Re-commit "Use StringRef in Support/Darf APIs (NFC)""
Mehdi Amini [Wed, 5 Oct 2016 01:04:02 +0000 (01:04 +0000)]
Revert "Re-commit "Use StringRef in Support/Darf APIs (NFC)""

One test seems randomly broken: DebugInfo/X86/gnu-public-names.ll

llvm-svn: 283285

7 years agoUse StringRef in MCSectionMachO (NFC)
Mehdi Amini [Wed, 5 Oct 2016 01:02:34 +0000 (01:02 +0000)]
Use StringRef in MCSectionMachO (NFC)

llvm-svn: 283284

7 years agoUse StringRef in DarwinAsmParser (NFC)
Mehdi Amini [Wed, 5 Oct 2016 01:02:22 +0000 (01:02 +0000)]
Use StringRef in DarwinAsmParser (NFC)

llvm-svn: 283283

7 years ago[LoopDistribute] Fix a typo in the pass name.
Michael Zolotukhin [Wed, 5 Oct 2016 00:44:52 +0000 (00:44 +0000)]
[LoopDistribute] Fix a typo in the pass name.

llvm-svn: 283282

7 years agoRe-commit "Use StringRef in Support/Darf APIs (NFC)"
Mehdi Amini [Wed, 5 Oct 2016 00:37:18 +0000 (00:37 +0000)]
Re-commit "Use StringRef in Support/Darf APIs (NFC)"

This reverts commit r283278 and re-commit r283275 with
the update to fix the build on the LLDB side.

llvm-svn: 283281

7 years ago[CUDA] Add missing ':' to noexcept.cu test.
Justin Lebar [Wed, 5 Oct 2016 00:27:38 +0000 (00:27 +0000)]
[CUDA] Add missing ':' to noexcept.cu test.

llvm-svn: 283280

7 years ago[libFuzzer] clear the corpus elements if they are evicted (i.e. smaller elements...
Kostya Serebryany [Wed, 5 Oct 2016 00:25:17 +0000 (00:25 +0000)]
[libFuzzer] clear the corpus elements if they are evicted (i.e. smaller elements with proper coverage are found). Make sure we never try to mutate empty element. Print the corpus size in bytes in the status lines

llvm-svn: 283279

7 years agoRevert "Use StringRef in Support/Darf APIs (NFC)"
Mehdi Amini [Wed, 5 Oct 2016 00:21:14 +0000 (00:21 +0000)]
Revert "Use StringRef in Support/Darf APIs (NFC)"

This reverts commit r283275, it broke LLDB Android debug server.

llvm-svn: 283278

7 years agoUse StringRef instead of raw pointers in ARMBuildAttrs (NFC)
Mehdi Amini [Wed, 5 Oct 2016 00:15:18 +0000 (00:15 +0000)]
Use StringRef instead of raw pointers in ARMBuildAttrs (NFC)

llvm-svn: 283277

7 years agoAdd the new minidump files to the Xcode project.
Jim Ingham [Wed, 5 Oct 2016 00:07:01 +0000 (00:07 +0000)]
Add the new minidump files to the Xcode project.

llvm-svn: 283276

7 years agoUse StringRef in Support/Darf APIs (NFC)
Mehdi Amini [Tue, 4 Oct 2016 23:55:40 +0000 (23:55 +0000)]
Use StringRef in Support/Darf APIs (NFC)

llvm-svn: 283275

7 years agoCodegen: Tail-duplicate during placement.
Kyle Butt [Tue, 4 Oct 2016 23:54:18 +0000 (23:54 +0000)]
Codegen: Tail-duplicate during placement.

The tail duplication pass uses an assumed layout when making duplication
decisions. This is fine, but passes up duplication opportunities that
may arise when blocks are outlined. Because we want the updated CFG to
affect subsequent placement decisions, this change must occur during
placement.

In order to achieve this goal, TailDuplicationPass is split into a
utility class, TailDuplicator, and the pass itself. The pass delegates
nearly everything to the TailDuplicator object, except for looping over
the blocks in a function. This allows the same code to be used for tail
duplication in both places.

This change, in concert with outlining optional branches, allows
triangle shaped code to perform much better, esepecially when the
taken/untaken branches are correlated, as it creates a second spine when
the tests are small enough.

Issue from previous rollback fixed, and a new test was added for that
case as well.

Differential revision: https://reviews.llvm.org/D18226

llvm-svn: 283274

7 years agoUse StringRef in TableGen (NFC)
Mehdi Amini [Tue, 4 Oct 2016 23:47:33 +0000 (23:47 +0000)]
Use StringRef in TableGen (NFC)

llvm-svn: 283273

7 years ago[CUDA] Mark device functions as nounwind.
Justin Lebar [Tue, 4 Oct 2016 23:41:49 +0000 (23:41 +0000)]
[CUDA] Mark device functions as nounwind.

Summary:
This prevents clang from emitting 'invoke's and catch statements.

Things previously mostly worked thanks to TryToMarkNoThrow() in
CodeGenFunction.  But this is not a proper IPO, and it doesn't properly
handle cases like mutual recursion.

Fixes bug 30593.

Reviewers: tra

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D25166

llvm-svn: 283272

7 years ago[CUDA] Destroy deferred diagnostics before destroying the ASTContext's PartialDiagnos...
Justin Lebar [Tue, 4 Oct 2016 23:41:45 +0000 (23:41 +0000)]
[CUDA] Destroy deferred diagnostics before destroying the ASTContext's PartialDiagnostic allocator.

Summary:
This will let us (in a separate patch) allocate deferred diagnostics in
the ASTContext's PartialDiagnostic arena.

Reviewers: rnk

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D25260

llvm-svn: 283271

7 years ago[asan] When protect_shadow_gap=0, set up the shadow for the shadow gap. This is neede...
Kostya Serebryany [Tue, 4 Oct 2016 23:39:58 +0000 (23:39 +0000)]
[asan] When protect_shadow_gap=0, set up the shadow for the shadow gap. This is needed to support NVIDIA CUDA drivers. Unfortunately, I don't know how to test it properly with CUDA on a public build bot, so adding a test that emulates the CUDA behavior.

llvm-svn: 283270

7 years ago[C API] Add LLVMConstExactUDiv and LLVMBuildExactUDiv functions.
Manuel Jacob [Tue, 4 Oct 2016 23:32:42 +0000 (23:32 +0000)]
[C API] Add LLVMConstExactUDiv and LLVMBuildExactUDiv functions.

Summary:
These are analog to the existing LLVMConstExactSDiv and LLVMBuildExactSDiv
functions.

Reviewers: deadalnix, majnemer

Subscribers: majnemer, llvm-commits

Differential Revision: https://reviews.llvm.org/D25259

llvm-svn: 283269

7 years agoUse StringRef in TableGen emitted API for attribute (NFC)
Mehdi Amini [Tue, 4 Oct 2016 23:31:39 +0000 (23:31 +0000)]
Use StringRef in TableGen emitted API for attribute (NFC)

llvm-svn: 283268

7 years agoUpdate for llvm change.
Rafael Espindola [Tue, 4 Oct 2016 22:43:38 +0000 (22:43 +0000)]
Update for llvm change.

llvm-svn: 283267

7 years agoMisc improvements to StringTableBuilder.
Rafael Espindola [Tue, 4 Oct 2016 22:43:25 +0000 (22:43 +0000)]
Misc improvements to StringTableBuilder.

This patch adds write methods to StringTableBuilder so that it is
easier to change the underlying implementation.

Using the write methods, avoid creating a temporary buffer when using
mmaped output.

It also uses a more compact key in the DenseMap. Overall this produces
a slightly faster lld:

firefox
  master 6.853419709
  patch  6.841968912 1.00167361138x faster
chromium
  master 4.297280174
  patch  4.298712163 1.00033323147x slower
chromium fast
  master 1.802335952
  patch  1.806872459 1.00251701521x slower
the gold plugin
  master 0.3247149
  patch  0.321971644 1.00852017888x faster
clang
  master 0.551279945
  patch  0.543733194 1.01387951128x faster
llvm-as
  master 0.032743458
  patch  0.032143478 1.01866568391x faster
the gold plugin fsds
  master 0.350814247
  patch  0.348571741 1.00643341309x faster
clang fsds
  master 0.6281672
  patch  0.621130222 1.01132931187x faster
llvm-as fsds
  master 0.030168899
  patch  0.029797155 1.01247582194x faster
scylla
  master 3.104222518
  patch  3.059590248 1.01458766252x faster

llvm-svn: 283266

7 years ago[cpu-detection] Copy simplified version of get_cpuid_max to remove dependency to...
Alina Sbirlea [Tue, 4 Oct 2016 22:39:53 +0000 (22:39 +0000)]
[cpu-detection] Copy simplified version of get_cpuid_max to remove dependency to clang's implementation

Summary:
Attempting to fix PR30384.
Take the same approach as in compiler_rt and add a simplified version of __get_cpuid_max.
Including cpuid.h is no longer needed.

Reviewers: echristo, joerg

Subscribers: mehdi_amini, llvm-commits

Differential Revision: https://reviews.llvm.org/D24597

llvm-svn: 283265

7 years agoSeparate builtins for x84-64 and i386; implement __mulh and __umulh
Albert Gutowski [Tue, 4 Oct 2016 22:29:49 +0000 (22:29 +0000)]
Separate builtins for x84-64 and i386; implement __mulh and __umulh

Summary: We need x86-64-specific builtins if we want to implement some of the MS intrinsics - winnt.h contains definitions of some functions for i386, but not for x86-64 (for example _InterlockedOr64), which means that we cannot treat them as builtins for both i386 and x86-64, because then we have definitions of builtin functions in winnt.h on i386.

Reviewers: thakis, majnemer, hans, rnk

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D24598

llvm-svn: 283264

7 years agoxfailing tests for Minidump plugin
Dimitar Vlahovski [Tue, 4 Oct 2016 21:55:47 +0000 (21:55 +0000)]
xfailing tests for Minidump plugin

the tests are failing on the buildbot because there is an extra frame
(maybe) on the call stack.
Will investigate tomorrow.

llvm-svn: 283263

7 years agoFix the decorator of TestBreakpointCaseSensitivity
Tamas Berghammer [Tue, 4 Oct 2016 21:32:46 +0000 (21:32 +0000)]
Fix the decorator of TestBreakpointCaseSensitivity

llvm-svn: 283262

7 years agoMake building the clang-tidy VS extension less spammy.
Zachary Turner [Tue, 4 Oct 2016 21:27:09 +0000 (21:27 +0000)]
Make building the clang-tidy VS extension less spammy.

The package that strong name signs the 3rd party references
spams a ton of output to the log, making the build really ugly.
Make this quiet.

llvm-svn: 283261

7 years ago[libcxx] [test] Guard __has_include usage with a macro
Eric Fiselier [Tue, 4 Oct 2016 21:25:51 +0000 (21:25 +0000)]
[libcxx] [test] Guard __has_include usage with a macro

Summary: There's a macro scheme already being used for __has_feature etc. Use it for __has_include too, which makes MSVC happy (it doesn't support __has_include yet, and unguarded use explodes horribly).

Reviewers: mclow.lists, EricWF

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D25251

llvm-svn: 283260

7 years agoAdding a new Minidump post-mortem debugging plugin
Dimitar Vlahovski [Tue, 4 Oct 2016 21:02:13 +0000 (21:02 +0000)]
Adding a new Minidump post-mortem debugging plugin

Summary:
This plugin resembles the already existing Windows-only Minidump plugin.
The WinMinidumpPlugin uses the Windows API for parsing Minidumps
while this plugin is cross-platform because it includes a Minidump
parser (which is already commited)

It is able to produce a backtrace, to read the general puprose regiters,
inspect local variables, show image list, do memory reads, etc.

For now the only arch that this supports is x86 64 bit
This is because I have only written a register context for that arch.
Others will come in next CLs.

I copied the WinMinidump tests and adapted them a little bit for them to
work with the new plugin (and they pass)
I will add more tests, aiming for better code coverage.

There is still functionality to be added, see TODOs in code.

Reviewers: labath, zturner

Subscribers: beanz, mgorny, amccarth, lldb-commits, modocache

Differential Revision: https://reviews.llvm.org/D25196

llvm-svn: 283259

7 years agoclang-cl: Make /Fo apply also when using -flto
Hans Wennborg [Tue, 4 Oct 2016 21:01:04 +0000 (21:01 +0000)]
clang-cl: Make /Fo apply also when using -flto

llvm-svn: 283258

7 years agoclang-cl: Use the .obj file extension also in LTO mode
Hans Wennborg [Tue, 4 Oct 2016 21:01:02 +0000 (21:01 +0000)]
clang-cl: Use the .obj file extension also in LTO mode

llvm-svn: 283257

7 years agoclang-cl: expose the -fuse-ld option
Hans Wennborg [Tue, 4 Oct 2016 21:01:00 +0000 (21:01 +0000)]
clang-cl: expose the -fuse-ld option

llvm-svn: 283256

7 years agoclang-cl: Expose the -flto option
Hans Wennborg [Tue, 4 Oct 2016 21:00:57 +0000 (21:00 +0000)]
clang-cl: Expose the -flto option

We could hook up /GL as an alias for -flto, but that might be
confusing, as clang-cl in that mode would not be drop-in compatible
with cl.exe /GL, as it requires the linker to be lld.

Exposing -flto seems like a less confusing way to expose this
functionality.

llvm-svn: 283255

7 years agoRevert r283248. It caused failures in the hexagon buildbots.
David L Kreitzer [Tue, 4 Oct 2016 20:57:19 +0000 (20:57 +0000)]
Revert r283248. It caused failures in the hexagon buildbots.

llvm-svn: 283254

7 years ago[analyzer] Add PostStmt callback for ArraySubscriptExpr
Anna Zaks [Tue, 4 Oct 2016 20:49:31 +0000 (20:49 +0000)]
[analyzer] Add PostStmt callback for ArraySubscriptExpr

A patch by Jan Smets!

Differential Revision: https://reviews.llvm.org/D25009

llvm-svn: 283253

7 years ago[Target] move reciprocal estimate settings from TargetOptions to TargetLowering
Sanjay Patel [Tue, 4 Oct 2016 20:46:43 +0000 (20:46 +0000)]
[Target] move reciprocal estimate settings from TargetOptions to TargetLowering

The motivation for the change is that we can't have pseudo-global settings for
codegen living in TargetOptions because that doesn't work with LTO.

Ideally, these reciprocal attributes will be moved to the instruction-level via
FMF, metadata, or something else. But making them function attributes is at least
an improvement over the current state.

The ingredients of this patch are:

    Remove the reciprocal estimate command-line debug option.
    Add TargetRecip to TargetLowering.
    Remove TargetRecip from TargetOptions.
    Clean up the TargetRecip implementation to work with this new scheme.
    Set the default reciprocal settings in TargetLoweringBase (everything is off).
    Update the PowerPC defaults, users, and tests.
    Update the x86 defaults, users, and tests.

Note that if this patch needs to be reverted, the related clang patch checked in
at r283251 should be reverted too.

Differential Revision: https://reviews.llvm.org/D24816

llvm-svn: 283252