OSDN Git Service

android-x86/external-llvm.git
7 years agoSilence warning with assertions disabled.
Peter Collingbourne [Thu, 15 Jun 2017 17:41:32 +0000 (17:41 +0000)]
Silence warning with assertions disabled.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305485 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoISel: Fix FastISel of swifterror values
Arnold Schwaighofer [Thu, 15 Jun 2017 17:34:42 +0000 (17:34 +0000)]
ISel: Fix FastISel of swifterror values

The code assumed that we process instructions in basic block order.  FastISel
processes instructions in reverse basic block order. We need to pre-assign
virtual registers before selecting otherwise we get def-use relationships wrong.

This only affects code with swifterror registers.

rdar://32659327

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305484 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[BasicAA] Add test case that goes with r305481.
Craig Topper [Thu, 15 Jun 2017 17:27:56 +0000 (17:27 +0000)]
[BasicAA] Add test case that goes with r305481.

Forgot to 'git add' the file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305483 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoApply summary-based dead stripping to regular LTO modules with summaries.
Peter Collingbourne [Thu, 15 Jun 2017 17:26:13 +0000 (17:26 +0000)]
Apply summary-based dead stripping to regular LTO modules with summaries.

If a regular LTO module has a summary index, then instead of linking
it into the combined regular LTO module right away, add it to the
combined summary index and associate it with a special module that
represents the combined regular LTO module.

Any such modules are linked during LTO::run(), at which time we use
the results of summary-based dead stripping to control whether to
link prevailing symbols.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305482 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[BasicAA] Don't call isKnownNonEqual if we might be have gone through a PHINode.
Craig Topper [Thu, 15 Jun 2017 17:16:56 +0000 (17:16 +0000)]
[BasicAA] Don't call isKnownNonEqual if we might be have gone through a PHINode.

This is a fix for the test case in PR32314.

Basic Alias Analysis can ask if two nodes are known non-equal after looking through a phi node to find a GEP. isAddOfNonZero saw an add of a constant from the same phi and said that its output couldn't be equal. But Basic Alias Analysis was really asking about the value from the previous loop iteration.

This patch at least makes that case not happen anymore, I'm not sure if there were still other ways this can fail. As was discussed in the bug, it looks like fixing BasicAA would be difficult so this patch seemed like a possible workaround

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305481 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[PowerPC] fix potential verification errors on CFENCE8
Hiroshi Inoue [Thu, 15 Jun 2017 16:51:28 +0000 (16:51 +0000)]
[PowerPC] fix potential verification errors on CFENCE8

This patch fixes a potential verification error (64-bit register operands for cmpw) with -verify-machineinstrs.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305479 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[mips] Fix documentation of member variable. NFCI.
Simon Dardis [Thu, 15 Jun 2017 16:28:28 +0000 (16:28 +0000)]
[mips] Fix documentation of member variable. NFCI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305478 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[DAG] As StoreMerge now generates only legal nodes remove unecessary guard when run...
Nirav Dave [Thu, 15 Jun 2017 16:27:49 +0000 (16:27 +0000)]
[DAG] As StoreMerge now generates only legal nodes remove unecessary guard when run post-legalization NFCI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305477 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRemove trailing whitespace. NFCI.
Simon Pilgrim [Thu, 15 Jun 2017 16:20:27 +0000 (16:20 +0000)]
Remove trailing whitespace. NFCI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305476 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Doc] Document prof metadata in LangRef
Teresa Johnson [Thu, 15 Jun 2017 15:57:12 +0000 (15:57 +0000)]
[Doc] Document prof metadata in LangRef

Summary:
Points to existing documentation for branch_weights and
function_entry_count, and adds an example for VP value profile metadata.

Reviewers: davidxl, reames

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305475 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[InstCombine] auto-generate complete checks; NFC
Sanjay Patel [Thu, 15 Jun 2017 15:13:19 +0000 (15:13 +0000)]
[InstCombine] auto-generate complete checks; NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305474 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[DAG] Defer Pre/Post IndexStore merge to after mergestore. NFCI.
Nirav Dave [Thu, 15 Jun 2017 15:05:48 +0000 (15:05 +0000)]
[DAG] Defer Pre/Post IndexStore merge to after mergestore. NFCI.

In preparation for doing storemerge post-legalization, reorder
visitSTORE passes to move pre/post-index combining after store
merge. Reordered passes other than store merge are unaffected.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305473 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[X86][AVX2] Fix issue in lowerV8I16GeneralSingleInputVectorShuffle that was assuming...
Simon Pilgrim [Thu, 15 Jun 2017 14:52:30 +0000 (14:52 +0000)]
[X86][AVX2] Fix issue in lowerV8I16GeneralSingleInputVectorShuffle that was assuming v8i16 vectors

We can use this with v16i16/v32i16 as well.

Found during fuzz testing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305472 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[AArch64] Add indexed check to splitStores. NFC.
Nirav Dave [Thu, 15 Jun 2017 14:47:44 +0000 (14:47 +0000)]
[AArch64] Add indexed check to splitStores. NFC.

Add explicit check for unhandled cases in preparation for delaying
splitStores to post-legalization.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305471 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRevert r305465: [X86][AVX512] Improve lowering of AVX512 compare intrinsics (remove...
Simon Pilgrim [Thu, 15 Jun 2017 14:39:34 +0000 (14:39 +0000)]
Revert r305465: [X86][AVX512] Improve lowering of AVX512 compare intrinsics (remove redundant shift left+right instructions).

This is causing windows buildbot failures

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305470 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[DAG] Allow truncated and extend memory operations in Store Merge. NFCI.
Nirav Dave [Thu, 15 Jun 2017 14:04:07 +0000 (14:04 +0000)]
[DAG] Allow truncated and extend memory operations in Store Merge. NFCI.

As all store merges checks are based on the memory operation
performed, allow use of truncated stores and extended loads as valid
input candidates for merging.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305468 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[DAG] Make MergeStores generate legalized stores. NFCI.
Nirav Dave [Thu, 15 Jun 2017 13:34:54 +0000 (13:34 +0000)]
[DAG] Make MergeStores generate legalized stores. NFCI.

Realized merged stores as truncstores if store will be realized as
such by legalization.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305467 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[DAG] Use correct size for truncated store merge of load. NFCI.
Nirav Dave [Thu, 15 Jun 2017 13:28:06 +0000 (13:28 +0000)]
[DAG] Use correct size for truncated store merge of load. NFCI.

Avoid non-legal memory ops by checking correct size when merging
stores of loads into a extload-truncstore pair.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305466 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[X86][AVX512] Improve lowering of AVX512 compare intrinsics (remove redundant shift...
Ayman Musa [Thu, 15 Jun 2017 13:02:37 +0000 (13:02 +0000)]
[X86][AVX512] Improve lowering of AVX512 compare intrinsics (remove redundant shift left+right instructions).

AVX512 compare instructions return v*i1 types.
In cases where the number of elements in the returned value are less than 8, clang adds zeroes to get a mask of v8i1 type.
Later on it's replaced with CONCAT_VECTORS, which then is lowered to many DAG nodes including insert/extract element and shift right/left nodes.
The fact that AVX512 compare instructions put the result in a k register and zeroes all its upper bits allows us to remove the extra nodes simply by copying the result to the required register class.

When lowering, identify these cases and transform them into an INSERT_SUBVECTOR node (marked legal), then catch this pattern in instructions selection phase and transform it into one avx512 cmp instruction.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305465 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[ScalarEvolution] Apply Depth limit to getMulExpr
Max Kazantsev [Thu, 15 Jun 2017 11:48:21 +0000 (11:48 +0000)]
[ScalarEvolution] Apply Depth limit to getMulExpr

This is a fix for PR33292 that shows a case of extremely long compilation
of a single .c file with clang, with most time spent within SCEV.

We have a mechanism of limiting recursion depth for getAddExpr to avoid
long analysis in SCEV. However, there are calls from getAddExpr to getMulExpr
and back that do not propagate the info about depth. As result of this, a chain

  getAddExpr -> ... .> getAddExpr -> getMulExpr -> getAddExpr -> ... -> getAddExpr

can be extremely long, with every segment of getAddExpr's being up to max depth long.
This leads either to long compilation or crash by stack overflow. We face this situation while
analyzing big SCEVs in the test of PR33292.

This patch applies the same limit on max expression depth for getAddExpr and getMulExpr.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305463 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[ARM] GlobalISel: Add support for i32 modulo
Diana Picus [Thu, 15 Jun 2017 10:53:31 +0000 (10:53 +0000)]
[ARM] GlobalISel: Add support for i32 modulo

Add support for modulo for targets that have hardware division and for
those that don't. When hardware division is not available, we have to
choose the correct libcall to use. This is generally straightforward,
except for AEABI.

The AEABI variant is trickier than the other libcalls because it
returns { quotient, remainder }, instead of just one value like the
other libcalls that we've seen so far. Therefore, we need to use custom
lowering for it. However, we don't want to have too much special code,
so we refactor the target-independent code in the legalizer by adding a
helper for replacing an instruction with a libcall. This helper is used
by the legalizer itself when dealing with simple calls, and also by the
custom ARM legalization for the more complicated AEABI divmod calls.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305459 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[ARM] GlobalISel: Lower only homogeneous struct args
Diana Picus [Thu, 15 Jun 2017 09:42:02 +0000 (09:42 +0000)]
[ARM] GlobalISel: Lower only homogeneous struct args

Lowering mixed struct args, params and returns used G_INSERT, which is a
bit more convoluted to support through the entire pipeline. Since they
don't occur that often in practice, it's probably wiser to leave them
out until later.

Meanwhile, we can lower homogeneous structs using G_MERGE_VALUES, which
has good support in the legalizer. These occur e.g. as the return of
__aeabi_idivmod, so it's nice to be able to support them.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305458 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[AArch64] Enable FeatureFuseAES for the generic processor model.
Florian Hahn [Thu, 15 Jun 2017 09:31:23 +0000 (09:31 +0000)]
[AArch64] Enable FeatureFuseAES for the generic processor model.

Summary:
Scheduling AESE/AESMC and AESD/AESIMC instruction pairs back-to-back
gives a double digit speedup on benchmarks using those instructions on
Cortex-A processors. In GCC, this optimization is part of the generic
processor model as well.

This change should not have a major performance impact on processors
that do not optimize AES instruction pairs, although I only had access
to Cortex-A processors for benchmarking.

Reviewers: rengolin, kristof.beyls, javed.absar, evandro, silviu.baranga, MatzeB, mcrosier, joelkevinjones, joel_k_jones, bmakam, t.p.northover

Reviewed By: evandro

Subscribers: sbaranga, aemerson, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305457 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[mips][microMIPS] Extending size reduction pass with ADDIUSP and ADDIUR1SP
Zoran Jovanovic [Thu, 15 Jun 2017 09:14:33 +0000 (09:14 +0000)]
[mips][microMIPS] Extending size reduction pass with ADDIUSP and ADDIUR1SP
Author: milena.vujosevic.janicic
Reviewers: sdardis
The patch extends size reduction pass for MicroMIPS.
The following instructions are examined and transformed, if possible:
ADDIU instruction is transformed into 16-bit instruction ADDIUSP
ADDIU instruction is transformed into 16-bit instruction ADDIUR1SP
Differential Revision: https://reviews.llvm.org/D33887

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305455 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[formatv] Add the ability to specify a fill character when aligning.
Zachary Turner [Thu, 15 Jun 2017 03:06:38 +0000 (03:06 +0000)]
[formatv] Add the ability to specify a fill character when aligning.

Previously if you used fmt_align(7, Center) you would get the
output '   7   '.  It may be desirable for the user to specify
the fill character though, for example producing '---7---'.  This
patch adds that.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305449 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[InstCombine] Add a test case to show a case where don't handle a partially commuted...
Craig Topper [Thu, 15 Jun 2017 01:01:01 +0000 (01:01 +0000)]
[InstCombine] Add a test case to show a case where don't handle a partially commuted IR. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305438 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRemoval of accidental duplication in test assembly file. NFC.
Wolfgang Pieb [Wed, 14 Jun 2017 23:55:39 +0000 (23:55 +0000)]
Removal of accidental duplication in test assembly file. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305431 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[DWARF] Minor coding style modifications, no functionality change.
Spyridoula Gravani [Wed, 14 Jun 2017 23:40:26 +0000 (23:40 +0000)]
[DWARF] Minor coding style modifications, no functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305430 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoFixing section name for Darwin platforms for sanitizer coverage
George Karpenkov [Wed, 14 Jun 2017 23:40:25 +0000 (23:40 +0000)]
Fixing section name for Darwin platforms for sanitizer coverage

On Darwin, section names have a 16char length limit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305429 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoIR: Tweak the API around adding modules to the summary index.
Peter Collingbourne [Wed, 14 Jun 2017 22:35:27 +0000 (22:35 +0000)]
IR: Tweak the API around adding modules to the summary index.

The current name (addModulePath) and return value
(ModulePathStringTableTy::iterator) is a little confusing. This
API adds a module, not just a path. And the iterator is basically
just an implementation detail of the summary index. Address
both of those issues by renaming to addModule and introducing a
ModuleSummaryIndex::ModuleInfo type that the function returns.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305422 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoDon't include TestingSupport in LLVM_LINK_COMPONENTS.
Zachary Turner [Wed, 14 Jun 2017 22:33:43 +0000 (22:33 +0000)]
Don't include TestingSupport in LLVM_LINK_COMPONENTS.

Instead use target_link_libraries directly.  Thanks to
Juergen Ributzka for the suggestion, which fixes an issue
when llvm is configured with no targets.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305421 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[ADT] Partial re-commit of r303383. Fix some Clang-tidy modernize-use-using and Inclu...
Eugene Zelenko [Wed, 14 Jun 2017 21:42:24 +0000 (21:42 +0000)]
[ADT] Partial re-commit of r303383. Fix some Clang-tidy modernize-use-using and Include What You Use warnings; other minor fixes (NFC).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305419 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoPredicateInfo: Don't insert conditional info when a conditional branch jumps to the...
Daniel Berlin [Wed, 14 Jun 2017 21:19:52 +0000 (21:19 +0000)]
PredicateInfo: Don't insert conditional info when a conditional branch jumps to the same target regardless of condition

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305416 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoNewGVN: This is wrong by inspection, it will not cause an issue currently due to...
Daniel Berlin [Wed, 14 Jun 2017 21:19:28 +0000 (21:19 +0000)]
NewGVN: This is wrong by inspection, it will not cause an issue currently due to other limitations, i believe.  This also means i can't make a test for it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305415 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[x86] avoid unnecessary shuffle mask math in combineX86ShufflesRecursively()
Sanjay Patel [Wed, 14 Jun 2017 20:37:11 +0000 (20:37 +0000)]
[x86] avoid unnecessary shuffle mask math in combineX86ShufflesRecursively()

This is a follow-up to https://reviews.llvm.org/D34174 / https://reviews.llvm.org/rL305398.

We mentioned replacing the multiplies with shifts, but the real win seems to be in
bypassing the extra ops in the common case when the RootRatio and OpRatio are one.

This gives us another 1-2% overall win for the test in PR32037:
https://bugs.llvm.org/show_bug.cgi?id=32037

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305414 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoAllow -profile-guided-section-prefix more than once
David Callahan [Wed, 14 Jun 2017 20:35:33 +0000 (20:35 +0000)]
Allow -profile-guided-section-prefix more than once

Summary:
At present, `-profile-guided-section-prefix` is a `cl::Optional` option, which means it demands to be passed exactly zero or one times.  Our build system makes it pretty tricky to guarantee this.  We often accidentally pass the flag more than once (but always with the same "false" value) which results in an error, after which compilation fails:

```
clang (LLVM option parsing): for the -profile-guided-section-prefix option: may only occur zero or one times!
```

While we work on improving our build system, it also seems reasonable just to allow `-profile-guided-section-prefix` to be passed more than once, by to `cl::ZeroOrMore`.  Quoting [[ http://llvm.org/docs/CommandLine.html#controlling-the-number-of-occurrences-required-and-allowed | the documentation ]]:

> The cl::ZeroOrMore modifier ... indicates that your program will allow the option to be specified zero or more times.
> ...
> If an option is specified multiple times for an option of the cl::opt class, only the last value will be retained.

Reviewers: danielcdh

Reviewed By: danielcdh

Subscribers: twoh, david2050, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305413 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[StringExtras] overload toHex for ArrayRef<uint8_t>
Zachary Turner [Wed, 14 Jun 2017 20:11:46 +0000 (20:11 +0000)]
[StringExtras] overload toHex for ArrayRef<uint8_t>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305411 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[EarlyCSE] Make PhiToCheck in removeMSSA() a set.
Davide Italiano [Wed, 14 Jun 2017 19:29:53 +0000 (19:29 +0000)]
[EarlyCSE] Make PhiToCheck in removeMSSA() a set.

This way we end up not looking at PHI args already removed.
MemSSA now goes through the updater so we can prune
it to avoid having redundant MemoryPHI arguments, but that
doesn't quite work for the general case.

Discussed with Daniel Berlin, fixes PR33406.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305409 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoHide dbgs() stream for when built with -fmodules.
Frederich Munch [Wed, 14 Jun 2017 19:16:22 +0000 (19:16 +0000)]
Hide dbgs() stream for when built with -fmodules.

Summary: Make DebugCounter::print and dump methods to be const correct.

Reviewers: aprantl

Reviewed By: aprantl

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305408 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoMC, Object: Reserve a section type, SHT_LLVM_ODRTAB, for the ODR table.
Peter Collingbourne [Wed, 14 Jun 2017 18:52:12 +0000 (18:52 +0000)]
MC, Object: Reserve a section type, SHT_LLVM_ODRTAB, for the ODR table.

This is part of the ODR checker proposal:
http://lists.llvm.org/pipermail/llvm-dev/2017-June/113820.html

Per discussion on the gnu-gabi mailing list [1] the section type range
0x6fff4c00..0x6fff4cff is reserved for LLVM.

[1] https://sourceware.org/ml/gnu-gabi/2017-q2/msg00030.html

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305407 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoSpecified ReportError as noreturn friendly to old compilers.
Galina Kistanova [Wed, 14 Jun 2017 17:32:53 +0000 (17:32 +0000)]
Specified ReportError as noreturn friendly to old compilers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305405 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoSupressed warning: declared ‘static’ but never defined.
Galina Kistanova [Wed, 14 Jun 2017 17:30:35 +0000 (17:30 +0000)]
Supressed warning: declared ‘static’ but never defined.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305403 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoTest commit - NFC.
Lei Huang [Wed, 14 Jun 2017 17:25:55 +0000 (17:25 +0000)]
Test commit - NFC.

Modified a comment to confirm commit access functionality.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305402 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[ValueTracking] Correct early out in computeKnownBitsFromOperator to work with non...
Craig Topper [Wed, 14 Jun 2017 17:04:59 +0000 (17:04 +0000)]
[ValueTracking] Correct early out in computeKnownBitsFromOperator to work with non power of 2 bit widths

There's an early out that's trying to detect when we don't know any bits that make up the legal range of a shift. The code subtracts one from BitWidth which creates a mask in the lower bits for power of 2 bit widths. This is then ANDed with the known bits to see if any of those bits are known. If the bit width isn't a power of 2 this creates a non-sensical mask.

This patch corrects this by rounding up to a power of 2 before doing the subtract and mask.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305400 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[x86] replace div/rem with shift/mask for better shuffle combining perf
Sanjay Patel [Wed, 14 Jun 2017 17:00:57 +0000 (17:00 +0000)]
[x86] replace div/rem with shift/mask for better shuffle combining perf

We know that shuffle masks are power-of-2 sizes, but there's no way (?) for LLVM to know that,
so hack combineX86ShufflesRecursively() to be much faster by replacing div/rem with shift/mask.

This makes the motivating compile-time bug in PR32037 ( https://bugs.llvm.org/show_bug.cgi?id=32037 )
about 9% faster overall.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305398 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoAdd an include of gtest-printers.h to appease the buildbots.
Zachary Turner [Wed, 14 Jun 2017 16:49:38 +0000 (16:49 +0000)]
Add an include of gtest-printers.h to appease the buildbots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305396 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[gtest] Create a shared include directory for gtest utilities.
Zachary Turner [Wed, 14 Jun 2017 16:41:50 +0000 (16:41 +0000)]
[gtest] Create a shared include directory for gtest utilities.

Many times unit tests for different libraries would like to use
the same helper functions for checking common types of errors.

This patch adds a common library with helpers for testing things
in Support, and introduces helpers in here for integrating the
llvm::Error and llvm::Expected<T> classes with gtest and gmock.

Normally, we would just be able to write:

   EXPECT_THAT(someFunction(), succeeded());

but due to some quirks in llvm::Error's move semantics, gmock
doesn't make this easy, so two macros EXPECT_THAT_ERROR() and
EXPECT_THAT_EXPECTED() are introduced to gloss over the difficulties.
Consider this an exception, and possibly only temporary as we
look for ways to improve this.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305395 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoResubmit "[codeview] Make obj2yaml/yaml2obj support .debug$S..."
Zachary Turner [Wed, 14 Jun 2017 15:59:27 +0000 (15:59 +0000)]
Resubmit "[codeview] Make obj2yaml/yaml2obj support .debug$S..."

This was originally reverted because of some non-deterministic
failures on certain buildbots.  Luckily ASAN eventually caught
this as a stack-use-after-scope, so the fix is included in
this patch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305393 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRevert "[ARM] Support constant pools in data when generating execute-only code."
Alexandros Lamprineas [Wed, 14 Jun 2017 15:00:08 +0000 (15:00 +0000)]
Revert "[ARM] Support constant pools in data when generating execute-only code."

This reverts commit 3a204faa093c681a1e96c5e0622f50649b761ee0.

I've upset a buildbot which runs the address sanitizer:
ERROR: AddressSanitizer: stack-use-after-scope
lib/Target/ARM/ARMISelLowering.cpp:2690
That Twine variable is used illegally.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305390 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[mips] Fix multiprecision arithmetic.
Simon Dardis [Wed, 14 Jun 2017 14:46:30 +0000 (14:46 +0000)]
[mips] Fix multiprecision arithmetic.

For multiprecision arithmetic on MIPS, rather than using ISD::ADDE / ISD::ADDC,
get SelectionDAG to break down the operation into ISD::ADDs and ISD::SETCCs.

For MIPS, only the DSP ASE has a carry flag, so in the general case it is not
useful to directly support ISD::{ADDE, ADDC, SUBE, SUBC} nodes.

Also improve the generation code in such cases for targets with
TargetLoweringBase::ZeroOrOneBooleanContent by directly using the result of the
comparison node rather than using it in selects. Similarly for ISD::SUBE /
ISD::SUBC.

Address optimization breakage by moving the generation of MIPS specific integer
multiply-accumulate nodes to before legalization.

This revolves PR32713 and PR33424.

Thanks to Simonas Kazlauskas and Pirama Arumuga Nainar for reporting the issue!

Reviewers: slthakur

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305389 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[MathExtras] fix documentation comments; NFC
Sanjay Patel [Wed, 14 Jun 2017 14:28:24 +0000 (14:28 +0000)]
[MathExtras] fix documentation comments; NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305388 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[ARM] Support constant pools in data when generating execute-only code.
Alexandros Lamprineas [Wed, 14 Jun 2017 13:22:41 +0000 (13:22 +0000)]
[ARM] Support constant pools in data when generating execute-only code.

The ARM backend asserts against constant pool lowering when it generates
execute-only code in order to prevent the generation of constant pools in
the text section. It appears that target independent optimizations might
generate DAG nodes that represent constant pools. By lowering such nodes
as global addresses we don't violate the semantics of execute-only code
and also it is guaranteed that execute-only behaves correct with the
position-independent addressing modes that support execute-only code.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305387 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoAlign definition of DW_OP_plus with DWARF spec [3/3]
Florian Hahn [Wed, 14 Jun 2017 13:14:38 +0000 (13:14 +0000)]
Align definition of DW_OP_plus with DWARF spec [3/3]

Summary:
This patch is part of 3 patches that together form a single patch, but must be introduced in stages in order not to break things.

The way that LLVM interprets DW_OP_plus in DIExpression nodes is basically that of the DW_OP_plus_uconst operator since LLVM expects an unsigned constant operand. This unnecessarily restricts the DW_OP_plus operator, preventing it from being used to describe the evaluation of runtime values on the expression stack. These patches try to align the semantics of DW_OP_plus and DW_OP_minus with that of the DWARF definition, which pops two elements off the expression stack, performs the operation and pushes the result back on the stack.

This is done in three stages:
• The first patch (LLVM) adds support for DW_OP_plus_uconst.
• The second patch (Clang) contains changes all its uses from DW_OP_plus to DW_OP_plus_uconst.
• The third patch (LLVM) changes the semantics of DW_OP_plus and DW_OP_minus to be in line with its DWARF meaning. This patch includes the bitcode upgrade from legacy DIExpressions.

Patch by Sander de Smalen.

Reviewers: echristo, pcc, aprantl

Reviewed By: aprantl

Subscribers: fhahn, javed.absar, aprantl, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305386 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[mips] Fix machine verifier errors in the long branch pass
Simon Dardis [Wed, 14 Jun 2017 12:16:47 +0000 (12:16 +0000)]
[mips] Fix machine verifier errors in the long branch pass

This patch fixes two systemic machine verifier errors in the long
branch pass. The first is the incorrect basic block successors
and the second was the incorrect construction of several jump
instructions.

This partially resolves PR27458 and the associated PR32146.

Reviewers: slthakur

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305382 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRevert r304907 as it is causing some failures that I cannot reproduce.
Nemanja Ivanovic [Wed, 14 Jun 2017 07:05:42 +0000 (07:05 +0000)]
Revert r304907 as it is causing some failures that I cannot reproduce.

Reverting this until a test case can be provided to aid the investigation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305372 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRevert "[codeview] Make obj2yaml/yaml2obj support .debug$S..."
Zachary Turner [Wed, 14 Jun 2017 06:24:24 +0000 (06:24 +0000)]
Revert "[codeview] Make obj2yaml/yaml2obj support .debug$S..."

This is causing failures on linux bots with an invalid stream
read.  It doesn't repro in any configuration on Windows, so
reverting until I have a chance to investigate on Linux.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305371 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoUse make_shared instead of make_unique.
Zachary Turner [Wed, 14 Jun 2017 05:48:33 +0000 (05:48 +0000)]
Use make_shared instead of make_unique.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305369 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoFix some more errors.
Zachary Turner [Wed, 14 Jun 2017 05:44:38 +0000 (05:44 +0000)]
Fix some more errors.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305368 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoAdd some #includes to appease the build.
Zachary Turner [Wed, 14 Jun 2017 05:38:34 +0000 (05:38 +0000)]
Add some #includes to appease the build.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305367 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[codeview] Make obj2yaml/yaml2obj support .debug$S/T sections.
Zachary Turner [Wed, 14 Jun 2017 05:31:00 +0000 (05:31 +0000)]
[codeview] Make obj2yaml/yaml2obj support .debug$S/T sections.

This allows us to use yaml2obj and obj2yaml to round-trip CodeView
symbol and type information without having to manually specify the bytes
of the section. This makes for much easier to maintain tests. See the
tests under lld/COFF in this patch for example. Before they just said
SectionData: <blob> whereas now we can use meaningful record
descriptions. Note that it still supports the SectionData yaml field,
which could be useful for initializing a section to invalid bytes for
testing, for example.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305366 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoSupport: Remove MSVC 2013 workarounds in ThreadPool class.
Peter Collingbourne [Wed, 14 Jun 2017 00:36:21 +0000 (00:36 +0000)]
Support: Remove MSVC 2013 workarounds in ThreadPool class.

I have confirmed that these are no longer needed with MSVC 2015.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305347 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[libFuzzer] really restrict the new test to Linux (fails on Mac/Windows currently)
Kostya Serebryany [Wed, 14 Jun 2017 00:34:42 +0000 (00:34 +0000)]
[libFuzzer] really restrict the new test to Linux (fails on Mac/Windows currently)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305346 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRe-enable tests on power pc since the bug has been fixed.
Eric Beckmann [Wed, 14 Jun 2017 00:22:43 +0000 (00:22 +0000)]
Re-enable tests on power pc since the bug has been fixed.

Summary: just flip them on.

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305345 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoAdded partial verification for .apple_names accelerator table in llvm-dwarfdump output.
Spyridoula Gravani [Wed, 14 Jun 2017 00:17:55 +0000 (00:17 +0000)]
Added partial verification for .apple_names accelerator table in llvm-dwarfdump output.

This patch adds code which verifies that each bucket in the .apple_names
accelerator table is either empty or has a valid hash index.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305344 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoReverted r305339 as MSVC is not happy with noreturn in lambda.
Galina Kistanova [Tue, 13 Jun 2017 23:57:51 +0000 (23:57 +0000)]
Reverted r305339 as MSVC is not happy with noreturn in lambda.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305343 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[globalisel][legalizer] G_LOAD/G_STORE NarrowScalar should not emit G_GEP x, 0.
Daniel Sanders [Tue, 13 Jun 2017 23:42:32 +0000 (23:42 +0000)]
[globalisel][legalizer] G_LOAD/G_STORE NarrowScalar should not emit G_GEP x, 0.

Summary:
When legalizing G_LOAD/G_STORE using NarrowScalar, we should avoid emitting
%0 = G_CONSTANT ty 0
%1 = G_GEP %x, %0
since it's cheaper to not emit the redundant instructions than it is to fold them
away later.

Reviewers: qcolombet, t.p.northover, ab, rovka, aditya_nandakumar, kristof.beyls

Reviewed By: qcolombet

Subscribers: javed.absar, llvm-commits, igorb

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305340 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoSpecified LLVM_ATTRIBUTE_NORETURN for ReportError.
Galina Kistanova [Tue, 13 Jun 2017 23:39:42 +0000 (23:39 +0000)]
Specified LLVM_ATTRIBUTE_NORETURN for ReportError.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305339 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[InstCombine] Add test cases demonstrating failure to handle (select (icmp eq (and...
Craig Topper [Tue, 13 Jun 2017 23:30:41 +0000 (23:30 +0000)]
[InstCombine] Add test cases demonstrating failure to handle (select (icmp eq (and X, C1), 0), Y, (or Y, C2)) when the icmp portion gets turned into a truncate and a signed compare with 0.

InstCombine has an optimization that recognizes an and with the sign bit of legal type size and turns it into a truncate and compare that checks the sign bit. But the select handling code doesn't recognize this idiom.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305338 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[libFuzzer] restrict the new test to Linux (fails on Mac currently)
Kostya Serebryany [Tue, 13 Jun 2017 23:09:11 +0000 (23:09 +0000)]
[libFuzzer] restrict the new test to Linux (fails on Mac currently)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305335 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[ADT] Revert r305326 changes in BitVector.h to fix broken builds.
Eugene Zelenko [Tue, 13 Jun 2017 22:32:38 +0000 (22:32 +0000)]
[ADT] Revert r305326 changes in BitVector.h to fix broken builds.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305332 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[libFuzzer] initial support of -fsanitize-coverage=inline-8bit-counters in libFuzzer...
Kostya Serebryany [Tue, 13 Jun 2017 22:31:21 +0000 (22:31 +0000)]
[libFuzzer] initial support of -fsanitize-coverage=inline-8bit-counters in libFuzzer. This is not fully functional yet, but simple tests work

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305331 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[AMDGPU] Remove now dead defaultOffsetS13(). NFCI.
Davide Italiano [Tue, 13 Jun 2017 22:24:24 +0000 (22:24 +0000)]
[AMDGPU] Remove now dead defaultOffsetS13(). NFCI.

Fixes the GCC7 build with -Werror.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305329 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[InstrProf] Don't take the address of alwaysinline available_externally functions
Vedant Kumar [Tue, 13 Jun 2017 22:12:35 +0000 (22:12 +0000)]
[InstrProf] Don't take the address of alwaysinline available_externally functions

Doing so breaks compilation of the following C program
(under -fprofile-instr-generate):

 __attribute__((always_inline)) inline int foo() { return 0; }

 int main() { return foo(); }

At link time, we fail because taking the address of an
available_externally function creates an undefined external reference,
which the TU cannot provide.

Emitting the function definition into the object file at all appears to
be a violation of the langref: "Globals with 'available_externally'
linkage are never emitted into the object file corresponding to the LLVM
module."

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305327 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[ADT] Fix some Clang-tidy modernize-use-using and Include What You Use warnings;...
Eugene Zelenko [Tue, 13 Jun 2017 22:11:49 +0000 (22:11 +0000)]
[ADT] Fix some Clang-tidy modernize-use-using and Include What You Use warnings; other minor fixes (NFC).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305326 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoUse reference to iterate through string table instead of copying.
Eric Beckmann [Tue, 13 Jun 2017 21:05:42 +0000 (21:05 +0000)]
Use reference to iterate through string table instead of copying.

Summary: just a quick patch

Subscribers: ruiu, llvm-commits, hiraditya

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305324 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoFix a bug introduced in r305092 on big-endian systems.
Eric Beckmann [Tue, 13 Jun 2017 20:53:31 +0000 (20:53 +0000)]
Fix a bug introduced in r305092 on big-endian systems.

Summary:
We were writing the length of the string based on system-endianness, and
not universally little-endian.  This fixes that.

Reviewers: zturner

Subscribers: hiraditya, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305322 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[PGO] Update VP metadata after memory intrinsic optimization
Teresa Johnson [Tue, 13 Jun 2017 20:44:08 +0000 (20:44 +0000)]
[PGO] Update VP metadata after memory intrinsic optimization

Summary:
Leave an updated VP metadata on the fallback memcpy intrinsic after
specialization. This can be used for later possible expansion based on
the average of the remaining values.

Reviewers: davidxl

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305321 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoFix alignment complaint.
Eric Beckmann [Tue, 13 Jun 2017 20:36:19 +0000 (20:36 +0000)]
Fix alignment complaint.

Summary: Apparently we need to write using a void* pointer on some architectures, or else alignment error is caused.

Subscribers: hiraditya, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305320 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[ADT] PointerUnion::getAddrOfPtr1(): fix/silence -Wcast-qual warning.
Roman Lebedev [Tue, 13 Jun 2017 20:33:51 +0000 (20:33 +0000)]
[ADT] PointerUnion::getAddrOfPtr1(): fix/silence -Wcast-qual warning.

Summary:
Previously, when D33102 landed, this broke -Werror buildbots.

http://lab.llvm.org:8011/builders/clang-with-lto-ubuntu/builds/3249
```
FAILED: /home/buildbot/Buildbot/Slave1a/clang-with-lto-ubuntu/install/stage1/bin/clang++   -DGTEST_HAS_RTTI=0 -DLLVM_BUILD_GLOBAL_ISEL -D_DEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Ilib/CodeGen/AsmPrinter -I/home/buildbot/Buildbot/Slave1a/clang-with-lto-ubuntu/llvm.src/lib/CodeGen/AsmPrinter -Iinclude -I/home/buildbot/Buildbot/Slave1a/clang-with-lto-ubuntu/llvm.src/include -fPIC -fvisibility-inlines-hidden -Werror -Werror=date-time -std=c++11 -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wcovered-switch-default -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wstring-conversion -fcolor-diagnostics -ffunction-sections -fdata-sections -O3    -UNDEBUG  -fno-exceptions -fno-rtti -MMD -MT lib/CodeGen/AsmPrinter/CMakeFiles/LLVMAsmPrinter.dir/CodeViewDebug.cpp.o -MF lib/CodeGen/AsmPrinter/CMakeFiles/LLVMAsmPrinter.dir/CodeViewDebug.cpp.o.d -o lib/CodeGen/AsmPrinter/CMakeFiles/LLVMAsmPrinter.dir/CodeViewDebug.cpp.o -c /home/buildbot/Buildbot/Slave1a/clang-with-lto-ubuntu/llvm.src/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
In file included from /home/buildbot/Buildbot/Slave1a/clang-with-lto-ubuntu/llvm.src/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp:14:
In file included from /home/buildbot/Buildbot/Slave1a/clang-with-lto-ubuntu/llvm.src/lib/CodeGen/AsmPrinter/CodeViewDebug.h:17:
In file included from /home/buildbot/Buildbot/Slave1a/clang-with-lto-ubuntu/llvm.src/lib/CodeGen/AsmPrinter/DbgValueHistoryCalculator.h:15:
In file included from /home/buildbot/Buildbot/Slave1a/clang-with-lto-ubuntu/llvm.src/include/llvm/IR/DebugInfoMetadata.h:26:
In file included from /home/buildbot/Buildbot/Slave1a/clang-with-lto-ubuntu/llvm.src/include/llvm/IR/Metadata.h:23:
/home/buildbot/Buildbot/Slave1a/clang-with-lto-ubuntu/llvm.src/include/llvm/ADT/PointerUnion.h:161:19: error: cast from 'void **' to 'const llvm::DISubprogram **' must have all intermediate pointers const qualified to be safe [-Werror,-Wcast-qual]
    return (PT1 *)Val.getAddrOfPointer();
                  ^
/home/buildbot/Buildbot/Slave1a/clang-with-lto-ubuntu/llvm.src/include/llvm/ADT/TinyPtrVector.h:177:18: note: in instantiation of member function 'llvm::PointerUnion<const llvm::DISubprogram *, llvm::SmallVector<const llvm::DISubprogram *, 4> *>::getAddrOfPtr1' requested here
      return Val.getAddrOfPtr1();
                 ^
/home/buildbot/Buildbot/Slave1a/clang-with-lto-ubuntu/llvm.src/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp:1885:33: note: in instantiation of member function 'llvm::TinyPtrVector<const llvm::DISubprogram *>::begin' requested here
    for (const DISubprogram *SP : MethodItr.second) {
                                ^
1 error generated.
```

Reviewers: dblaikie, akyrtzi

Reviewed By: dblaikie

Subscribers: joerg, mehdi_amini, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305319 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRevert r305313 & r305303, self-hosting build-bot isn’t liking it.
Frederich Munch [Tue, 13 Jun 2017 19:05:24 +0000 (19:05 +0000)]
Revert r305313 & r305303, self-hosting build-bot isn’t liking it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305318 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[powerpc] deactivate tests combined.test and object.test on powerpc64 be
Bill Seurer [Tue, 13 Jun 2017 18:52:41 +0000 (18:52 +0000)]
[powerpc] deactivate tests combined.test and object.test on powerpc64 be

These tests fail on powerpc64 BE (only, not LE) and are thus intefering with
the running of 3 of the powerpc buildbots.  The author of the tests has been
notified and is working on fixing them but in the meantime I am disabling
them to get the bots working again.

See https://bugs.llvm.org//show_bug.cgi?id=33429

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305317 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[WebAssembly] Cleanup WebAssemblyWasmObjectWriter
Sam Clegg [Tue, 13 Jun 2017 18:51:50 +0000 (18:51 +0000)]
[WebAssembly] Cleanup WebAssemblyWasmObjectWriter

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305316 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoImprove error messages in order to help with fixing a big-endian bug.
Eric Beckmann [Tue, 13 Jun 2017 18:17:36 +0000 (18:17 +0000)]
Improve error messages in order to help with fixing a big-endian bug.

Summary: Added output to stderr so that we can actually see what is happening when the test fails on big endian.

Reviewers: zturner

Subscribers: llvm-commits, hiraditya

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305314 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoFix self hosting build-bot failure from r305303 by adjusting DynamicLibraryTests...
Frederich Munch [Tue, 13 Jun 2017 18:12:11 +0000 (18:12 +0000)]
Fix self hosting build-bot failure from r305303 by adjusting DynamicLibraryTests compile flags.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305313 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[IR] Remove a couple explicitly deleted default constructors on classes that have...
Craig Topper [Tue, 13 Jun 2017 17:58:59 +0000 (17:58 +0000)]
[IR] Remove a couple explicitly deleted default constructors on classes that have a non-default constructor. NFC

The non-default constructor will implicitly delete the default constructor.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305311 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[AArch64][Falkor] Fix sched details for FDIV, FSQRT, SDIV, UDIV
Geoff Berry [Tue, 13 Jun 2017 17:43:39 +0000 (17:43 +0000)]
[AArch64][Falkor] Fix sched details for FDIV, FSQRT, SDIV, UDIV

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305310 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoTest commit - NFC.
Kit Barton [Tue, 13 Jun 2017 17:35:29 +0000 (17:35 +0000)]
Test commit - NFC.

Modified a comment to confirm commit access functionality.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305309 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoFix m_[Ord|Unord][FMin|FMax] matchers to correctly match ordering.
Craig Topper [Tue, 13 Jun 2017 17:18:45 +0000 (17:18 +0000)]
Fix m_[Ord|Unord][FMin|FMax] matchers to correctly match ordering.

Previously, the matching was done incorrectly for the case where
operands for FCmpInst and SelectInst were in opposite order.

Patch by Andrei Elovikov.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305308 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Hexagon] Generate store-immediate instructions for stack objects
Krzysztof Parzyszek [Tue, 13 Jun 2017 17:10:16 +0000 (17:10 +0000)]
[Hexagon] Generate store-immediate instructions for stack objects

Store-immediate instructions have a non-extendable offset. Since the
actual offset for a stack object is not known until much later, only
generate these stores when the stack size (at the time of instruction
selection) is small.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305305 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoAlign definition of DW_OP_plus with DWARF spec [1/3]
Florian Hahn [Tue, 13 Jun 2017 16:54:44 +0000 (16:54 +0000)]
Align definition of DW_OP_plus with DWARF spec [1/3]

Summary:
This patch is part of 3 patches that together form a single patch, but must be introduced in stages in order not to break things.

The way that LLVM interprets DW_OP_plus in DIExpression nodes is basically that of the DW_OP_plus_uconst operator since LLVM expects an unsigned constant operand. This unnecessarily restricts the DW_OP_plus operator, preventing it from being used to describe the evaluation of runtime values on the expression stack. These patches try to align the semantics of DW_OP_plus and DW_OP_minus with that of the DWARF definition, which pops two elements off the expression stack, performs the operation and pushes the result back on the stack.

This is done in three stages:
• The first patch (LLVM) adds support for DW_OP_plus_uconst.
• The second patch (Clang) contains changes all its uses from DW_OP_plus to DW_OP_plus_uconst.
• The third patch (LLVM) changes the semantics of DW_OP_plus and DW_OP_minus to be in line with its DWARF meaning. This patch includes the bitcode upgrade from legacy DIExpressions.

Patch by Sander de Smalen.

Reviewers: pcc, echristo, aprantl

Reviewed By: aprantl

Subscribers: fhahn, aprantl, javed.absar, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305304 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoForce RegisterStandardPasses to construct std::function in the IPO library.
Frederich Munch [Tue, 13 Jun 2017 16:48:41 +0000 (16:48 +0000)]
Force RegisterStandardPasses to construct std::function in the IPO library.

Summary: Fixes an issue using RegisterStandardPasses from a statically linked object before PassManagerBuilder::addGlobalExtension is called from a dynamic library.

Reviewers: efriedma, theraven

Reviewed By: efriedma

Subscribers: mehdi_amini, mgorny, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305303 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Hexagon] Generate multiply-high instruction in isel
Krzysztof Parzyszek [Tue, 13 Jun 2017 16:21:57 +0000 (16:21 +0000)]
[Hexagon] Generate multiply-high instruction in isel

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305302 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agobpf: clang-format on BPFAsmPrinter.cpp
Yonghong Song [Tue, 13 Jun 2017 16:17:20 +0000 (16:17 +0000)]
bpf: clang-format on BPFAsmPrinter.cpp

Signed-off-by: Yonghong Song <yhs@fb.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305301 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Hexagon] Don't kill live registers when creating mux out of tfr
Krzysztof Parzyszek [Tue, 13 Jun 2017 16:07:36 +0000 (16:07 +0000)]
[Hexagon] Don't kill live registers when creating mux out of tfr

When a mux instruction is created from a pair of complementary conditional
transfers, it can be placed at the location of either the earlier or the
later of the transfers. Since it will use the operands of the original
transfers, putting it in the earlier location may hoist a kill of a source
register that was originally further down. Make sure the kill flag is
removed if the register is still used afterwards.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305300 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[PDB] Add a module descriptor for every object file
Reid Kleckner [Tue, 13 Jun 2017 15:49:13 +0000 (15:49 +0000)]
[PDB] Add a module descriptor for every object file

Summary:
Expose the module descriptor index and fill it in for section
contributions.

Reviewers: zturner

Subscribers: llvm-commits, ruiu, hiraditya

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305296 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[MIPS] BuildCondBr should preserve MO flags
Simon Dardis [Tue, 13 Jun 2017 14:11:29 +0000 (14:11 +0000)]
[MIPS] BuildCondBr should preserve MO flags

While simplifying branches in the MachineInstr representation, the
routine BuildCondBr must preserve flags on register MachineOperands. In
particular, it must preserve the <undef> flag.

This fixes a bug that is unlikely to occur in any real scenario, but
which bugpoint is likely to introduce.

Patch By Nick Johnson!

Reviewers: ahatanak, sdardis

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305290 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Hexagon] Stop pmpy recognition when shift conversion fails
Krzysztof Parzyszek [Tue, 13 Jun 2017 13:51:49 +0000 (13:51 +0000)]
[Hexagon] Stop pmpy recognition when shift conversion fails

The conversion of shifts from right shifts to left shifts may fail.
In such case, the pmpy recognition cannot proceed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305289 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[ARM] Add scheduling classes for VFNM[AS]
Oliver Stannard [Tue, 13 Jun 2017 13:04:32 +0000 (13:04 +0000)]
[ARM] Add scheduling classes for VFNM[AS]

The VFNM[AS] instructions did not have scheduling information attached, which
was causing assertion failures with the Cortex-A57 scheduling model and
-fp-contract=fast, because the Cortex-A57 sched model claims to be complete.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305288 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoStrip UTF8 BOM that got added in rL305091
Simon Pilgrim [Tue, 13 Jun 2017 10:17:57 +0000 (10:17 +0000)]
Strip UTF8 BOM that got added in rL305091

Seems my recent move to VS2017 has resulted in a few text editor issues.....

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305285 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[X86][SSE] Refactor getTargetConstantBitsFromNode to avoid large APInts (PR32037)
Simon Pilgrim [Tue, 13 Jun 2017 10:13:48 +0000 (10:13 +0000)]
[X86][SSE] Refactor getTargetConstantBitsFromNode to avoid large APInts (PR32037)

Much of PR32037's compile time regression is due to getTargetConstantBitsFromNode always creating large (>64bit) APInts during the bitcasting from the source data to the destination bitwidth.

This commit avoids this bitcast stage if the data is already the correct bitwidth.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305284 91177308-0d34-0410-b5e6-96231b3b80d8