platform/upstream/llvm.git
8 years agoConvert various CommandInterpreter functions to StringRef.
Zachary Turner [Wed, 5 Oct 2016 20:03:37 +0000 (20:03 +0000)]
Convert various CommandInterpreter functions to StringRef.

llvm-svn: 283370

8 years agoAMDGPU: Do not re-use tmpreg in spill/restore lowering
Matthias Braun [Wed, 5 Oct 2016 20:02:51 +0000 (20:02 +0000)]
AMDGPU: Do not re-use tmpreg in spill/restore lowering

The register scavenging code does not support multiple definitions of
the same vreg.

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

llvm-svn: 283369

8 years ago[LV] Pass legality analysis in vectorizer constructor (NFC)
Matthew Simpson [Wed, 5 Oct 2016 19:53:20 +0000 (19:53 +0000)]
[LV] Pass legality analysis in vectorizer constructor (NFC)

The vectorizer already holds a pointer to the legality analysis in a member
variable, so it makes sense that we would pass it in the constructor.

llvm-svn: 283368

8 years agoStore the hash in SectionPiece.
Rafael Espindola [Wed, 5 Oct 2016 19:36:02 +0000 (19:36 +0000)]
Store the hash in SectionPiece.

This spreads out computing the hash and using it in a hash table. The
speedups are:

firefox
  master 6.811232891
  patch  6.559280249 1.03841162939x faster
chromium
  master 4.369323666
  patch  4.33171853 1.00868134338x faster
chromium fast
  master 1.856679971
  patch  1.850617741 1.00327578725x faster
the gold plugin
  master 0.32917962
  patch  0.325711944 1.01064645023x faster
clang
  master 0.558015452
  patch  0.550284165 1.01404962652x faster
llvm-as
  master 0.032563515
  patch  0.032152077 1.01279662275x faster
the gold plugin fsds
  master 0.356221362
  patch  0.352772162 1.00977741549x faster
clang fsds
  master 0.635096494
  patch  0.627249229 1.01251060127x faster
llvm-as fsds
  master 0.030183188
  patch  0.029889544 1.00982430511x faster
scylla
  master 3.071448906
  patch  2.938484138 1.04524944215x faster

This seems to be because we don't stall as much. When linking firefox
stalled-cycles-frontend goes from 57.56% to 55.55%.

With -O2 the difference is even more significant since we avoid
recomputing the hash. For firefox we go from 9.990295265 to
 9.149627521 seconds (1.09x faster).

llvm-svn: 283367

8 years agoFastISel: Remove unused/un-overridden entry points. NFCI.
Peter Collingbourne [Wed, 5 Oct 2016 19:25:20 +0000 (19:25 +0000)]
FastISel: Remove unused/un-overridden entry points. NFCI.

llvm-svn: 283366

8 years ago[LV] Remove obsolete comment (NFC)
Matthew Simpson [Wed, 5 Oct 2016 19:19:49 +0000 (19:19 +0000)]
[LV] Remove obsolete comment (NFC)

llvm-svn: 283365

8 years ago[LV] Use getScalarizationOverhead in memory instruction costs (NFC)
Matthew Simpson [Wed, 5 Oct 2016 19:11:54 +0000 (19:11 +0000)]
[LV] Use getScalarizationOverhead in memory instruction costs (NFC)

This patch refactors the cost estimation of scalarized loads and stores to
reuse getScalarizationOverhead for the cost of the extractelement and
insertelement instructions we might create. The existing code accounted for
this cost, but it was functionally equivalent to the helper function.

llvm-svn: 283364

8 years agoRemoving optimization from the RUN lines and adjusting the checks
Nemanja Ivanovic [Wed, 5 Oct 2016 19:11:36 +0000 (19:11 +0000)]
Removing optimization from the RUN lines and adjusting the checks
to not rely on optimization.

llvm-svn: 283363

8 years agoAdd the ability to set breakpoints on named RenderScript reductions
Luke Drummond [Wed, 5 Oct 2016 19:10:47 +0000 (19:10 +0000)]
Add the ability to set breakpoints on named RenderScript reductions

- Add new `lldb_private::lldb_renderscript::RSReduceBreakpointResolver`
class that can set breakpoints on kernels that are constituent
functions of named reduction groups. Also support debugging of subsets
of the the reduction group with the `-t, --function-role` flag which
takes a comma-separated list of reduction function types
outconverter,combiner,initializer,accumulator (defaults to all)

- Add 2 new helper methods to `RenderScriptRuntime`,
  1. `CreateReductionBreakpoint(name, types)`: instantiates a new
  RSReduceBreakpointResolver and inserts that resolver into the running
  process.
  2. `PlaceBreakpointOnReduction`: which is a public helper function.

- hook up the above functionality to the command-line with new
  `CommandObject*` classes that handle parsing of function roles and
  dispatch to the runtime. These are namespaced under the snappy
  `language renderscript reduction breakpoint ...` subcommand

- [incidental] Factor multiple common uses of
  `FindFirstSymbolWithNameAndType(ConstString(".rs.info")` into static
  `IsRenderScriptScriptModule(ModuleSP module)` function, and replace
  original uses.

llvm-svn: 283362

8 years agofix documentation comments; NFC
Sanjay Patel [Wed, 5 Oct 2016 18:51:12 +0000 (18:51 +0000)]
fix documentation comments; NFC

llvm-svn: 283361

8 years agoComment out failing test while I figure out who is at fault
Marshall Clow [Wed, 5 Oct 2016 18:47:18 +0000 (18:47 +0000)]
Comment out failing test while I figure out who is at fault

llvm-svn: 283360

8 years agoAllow the caller to pass in the hash.
Rafael Espindola [Wed, 5 Oct 2016 18:46:21 +0000 (18:46 +0000)]
Allow the caller to pass in the hash.

If the caller already has the hash we don't have to compute it. This
will be used in lld.

llvm-svn: 283359

8 years agoFix some test failures due to the recent Breakpoint patch.
Zachary Turner [Wed, 5 Oct 2016 18:40:51 +0000 (18:40 +0000)]
Fix some test failures due to the recent Breakpoint patch.

llvm-svn: 283358

8 years agoCompact SectionPiece.
Rafael Espindola [Wed, 5 Oct 2016 18:40:00 +0000 (18:40 +0000)]
Compact SectionPiece.

It is pretty easy to get the data from the InputSection, so we don't
have to store it.

This opens the way for storing the hash instead.

llvm-svn: 283357

8 years agoMark LWG#2679 as complete
Marshall Clow [Wed, 5 Oct 2016 18:36:24 +0000 (18:36 +0000)]
Mark LWG#2679 as complete

llvm-svn: 283356

8 years agoImprove DEBUG_VALUE assembly comments for spilled bitpieces
Reid Kleckner [Wed, 5 Oct 2016 18:36:02 +0000 (18:36 +0000)]
Improve DEBUG_VALUE assembly comments for spilled bitpieces

Previously we would give up when we saw the bitpiece DWARF expression
and print "[complex expression]" when actually we handled bitpiece
expressions outside the loop.

llvm-svn: 283355

8 years ago[LV] Add helper function for predicated block probability (NFC)
Matthew Simpson [Wed, 5 Oct 2016 18:30:36 +0000 (18:30 +0000)]
[LV] Add helper function for predicated block probability (NFC)

The cost model has to estimate the probability of executing predicated blocks.
However, we currently always assume predicated blocks have a 50% chance of
executing (this value is hardcoded in several places throughout the code).
Since we always use the same value, this patch adds a helper function for
getting this uniform probability. The function simplifies some comments and
makes our assumptions more clear. In the future, we may want to extend this
with actual block probability information if it's available.

llvm-svn: 283354

8 years ago[mips][ias] fix li macro when values are negated with ~
Simon Dardis [Wed, 5 Oct 2016 18:26:19 +0000 (18:26 +0000)]
[mips][ias] fix li macro when values are negated with ~

The integrated assembler evaluates the expressions such as ~0x80000000 to
0xffffffff7fffffff early in the parsing process. This patch adds compatibility
with gas so that li loads the expected value (0x7fffffff) in those cases. This
only occurs iff all the upper 32bits are set and maintains existing checks by
not truncating the result down to 32 bits if any of the the upper bits are not
set.

Reviewers: dsanders, zoran.jovanovic

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

llvm-svn: 283353

8 years agoRemoving the new Minidump plugin
Dimitar Vlahovski [Wed, 5 Oct 2016 18:11:45 +0000 (18:11 +0000)]
Removing the new Minidump plugin

Tests are failing and build is failing on windows and darwin.
Will fix and commit it later
-------------------------------------------------------------

Revert "xfailing minidump tests again ... :("
This reverts commit 97eade002c9e43c1e0d11475a4888083a8965044.

Revert "Fixing new Minidump plugin tests"
This reverts commit 0dd93b3ab39c8288696001dd50b9a093b813b09c.

Revert "Add the new minidump files to the Xcode project."
This reverts commit 2f638a1d046b8a88e61e212220edc40aecd2ce44.

Revert "xfailing tests for Minidump plugin"
This reverts commit 99311c0b22338a83e6a00c4fbddfd3577914c003.

Revert "Adding a new Minidump post-mortem debugging plugin"
This reverts commit b09a7e4dae231663095a84dac4be3da00b03a021.

llvm-svn: 283352

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

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

llvm-svn: 283319

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

llvm-svn: 283318

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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