150456 Commits

Author SHA1 Message Date
Kostya Serebryany
93a987eb3e [libFuzzer] change the default max_len from 64 to 4096. This will affect cases where libFuzzer is run w/o initial corpus or with a corpus of very small items.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305521 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-15 22:43:40 +00:00
Matthias Braun
9b53419507 UnitTests: Replace some if(x)report_fatal_error() with EXPECT_TRUE(!x)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305519 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-15 22:31:08 +00:00
Zachary Turner
7e5d31edd7 Resubmit "[llvm-pdbutil] rewrite the "raw" output style."
This resubmits commit c0c249e9f2ef83e1d1e5f166b50673d92f3579d7.

It was broken due to some weird template issues, which have
since been fixed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305517 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-15 22:24:24 +00:00
Matthias Braun
02688b00ef RegScavenging: Add scavengeRegisterBackwards()
Re-apply r276044/r279124. Trying to reproduce or disprove the ppc64
problems reported in the stage2 build last time, which I cannot
reproduce right now.

This is a variant of scavengeRegister() that works for
enterBasicBlockEnd()/backward(). The benefit of the backward mode is
that it is not affected by incomplete kill flags.

This patch also changes
PrologEpilogInserter::doScavengeFrameVirtualRegs() to use the register
scavenger in backwards mode.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305516 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-15 22:14:55 +00:00
Matthias Braun
c82adde7b9 docs/Phabricator: Better git examples to produce full context patches
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305515 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-15 22:09:30 +00:00
Craig Topper
240b649837 [InstCombine] Add two FIXMEs for bad single use checks. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305510 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-15 21:38:48 +00:00
Craig Topper
66f76f7576 [InstCombine] Add test cases to demonstrate instcombine increasing instruction count when trying to fold (select (icmp eq (and X, C1), 0), Y, (or Y, C2))->(or (shl (and X, C1), C3), y) when the pieces have multiple uses.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305509 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-15 21:38:44 +00:00
Galina Kistanova
7438bc918d Added braces to work around gcc warning in googletest: suggest explicit braces to avoid ambiguous 'else'. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305506 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-15 21:00:40 +00:00
Zachary Turner
48370ee21f Revert "[llvm-pdbutil] rewrite the "raw" output style."
This reverts commit 83ea17ebf2106859a51fbc2a86031b44d33696ad.

This is failing due to some strange template problems, so reverting
until it can be straightened out.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305505 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-15 20:55:51 +00:00
Spyridoula Gravani
312d0db061 [DWARF] Removed dead code. The verifier functionality is provided by
the DWARFVerifier class (as it should).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305503 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-15 20:40:08 +00:00
Teresa Johnson
93981f885e Split PGO memory intrinsic optimization into its own source file
Summary:
Split the PGOMemOPSizeOpt pass out from IndirectCallPromotion.cpp into
its own file.

Reviewers: davidxl

Subscribers: mgorny, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305501 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-15 20:23:57 +00:00
Zachary Turner
cc81e8dc82 Fix some more warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305499 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-15 20:03:57 +00:00
Zachary Turner
1031e14fb0 Fix some -Wreorder issues.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305497 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-15 19:45:25 +00:00
Zachary Turner
0f6dce0526 [llvm-pdbutil] rewrite the "raw" output style.
After some internal discussions, we agreed that the raw output style had
outlived its usefulness. It was originally created before we had even
thought of dumping to YAML, and it was intended to give us some insight
into the internals of a PDB file. Now we have YAML mode which does
almost exactly this but is more powerful in that it can round-trip back
to a PDB, which the raw mode could not do. So the raw mode had become
purely a maintenance burden.

One option was to just delete it. However, its original goal was to be
as readable as possible while staying close to the "metal" - i.e.
presenting the output in a way that maps directly to the underlying file
format. We don't actually need that last requirement anymore since it's
covered by the yaml mode, so we could repurpose "raw" mode to actually
just be as readable as possible.

This patch implements about 80% of the functionality previously in raw
mode, but in a completely different style that is more akin to what
cvdump outputs. Records are very compressed, often times appearing on
just one line. One nice thing about this is that it makes full record
matching easier, because you can grep for indices, names, and leaf types
on a single line often.

See the tests for some examples of what the new output looks like.

Note that this patch actually regresses the functionality of raw mode in
a few areas, but only because the patch was already unreasonably large
and going 100% would have been even worse. Specifically, this patch is
missing:

The ability to dump module debug subsections (checksums, lines, etc)
The ability to dump section headers
Aside from that everything is here. While goign through the tests fixing
them all up, I found many duplicate tests. They've been deleted. In
subsequent patches I will go through and re-add the missing
functionality.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305495 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-15 19:34:41 +00:00
Alexander Timofeev
7807f69e9b DivergencyAnalysis patch for review
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305494 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-15 19:33:10 +00:00
Craig Topper
f82d26a17d [InstCombine] Make the context instruction parameter of foldOrOfICmps a reference to discourage passing nullptr and to remove the '&' from all of the call sites. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305493 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-15 19:09:51 +00:00
Craig Topper
ccc684d065 [InstCombine] Pre-commit test cases for the transform proposed in D34244.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305492 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-15 18:56:05 +00:00
Lei Huang
edd54f82b6 [MachineLICM] Hoist TOC-based address instructions
Add condition for MachineLICM to safely hoist instructions that utilize
non constant registers that are reserved.

On PPC, global variable access is done through the table of contents (TOC)
which is always in register X2.  The ABI reserves this register in any
functions that have calls or access global variables.

A call through a function pointer involves saving, changing and restoring
this register around the call and thus MachineLICM does not consider it to
be invariant. We can however guarantee the register is preserved across the
call and thus is invariant.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305490 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-15 18:29:59 +00:00
Benjamin Kramer
e4a39516a0 Fold variable into assert.
Silences an unused variable warning in Release builds.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305488 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-15 17:58:24 +00:00
Craig Topper
a14f1bc634 [InstCombine] Handle (iszero(A & K1) | iszero(A & K2)) -> (A & (K1 | K2)) != (K1 | K2) when the one of the Ands is commuted relative to the other
Currently we expect A to be on the same side in both Ands but nothing guarantees that.

While there also switch to using matchers for some of the code.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305487 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-15 17:55:20 +00:00
Peter Collingbourne
b9ff4ba719 Silence warning with assertions disabled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305485 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-15 17:41:32 +00:00
Arnold Schwaighofer
00cc11273b 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
2017-06-15 17:34:42 +00:00
Craig Topper
c9069cd453 [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
2017-06-15 17:27:56 +00:00
Peter Collingbourne
95d9f1b4f9 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
2017-06-15 17:26:13 +00:00
Craig Topper
52ffcca2b5 [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
2017-06-15 17:16:56 +00:00
Hiroshi Inoue
1a33599c52 [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
2017-06-15 16:51:28 +00:00
Simon Dardis
b0fa17fec7 [mips] Fix documentation of member variable. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305478 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-15 16:28:28 +00:00
Nirav Dave
cb6adbc9fa [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
2017-06-15 16:27:49 +00:00
Simon Pilgrim
136a0c2037 Remove trailing whitespace. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305476 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-15 16:20:27 +00:00
Teresa Johnson
e39601862c [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
2017-06-15 15:57:12 +00:00
Sanjay Patel
92b196b1b6 [InstCombine] auto-generate complete checks; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305474 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-15 15:13:19 +00:00
Nirav Dave
41a776f240 [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
2017-06-15 15:05:48 +00:00
Simon Pilgrim
d62e545b2b [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
2017-06-15 14:52:30 +00:00
Nirav Dave
18ca0f5b74 [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
2017-06-15 14:47:44 +00:00
Simon Pilgrim
81f6df5c35 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
2017-06-15 14:39:34 +00:00
Nirav Dave
bc639bb598 [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
2017-06-15 14:04:07 +00:00
Nirav Dave
ca8e28bea8 [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
2017-06-15 13:34:54 +00:00
Nirav Dave
258320134e [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
2017-06-15 13:28:06 +00:00
Ayman Musa
1abb66152a [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
2017-06-15 13:02:37 +00:00
Max Kazantsev
670bbd6f43 [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
2017-06-15 11:48:21 +00:00
Diana Picus
39c5686a1f [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
2017-06-15 10:53:31 +00:00
Diana Picus
f39ec45e29 [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
2017-06-15 09:42:02 +00:00
Florian Hahn
4127960e35 [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
2017-06-15 09:31:23 +00:00
Zoran Jovanovic
952d4e50f5 [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
2017-06-15 09:14:33 +00:00
Zachary Turner
ba503556ac [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
2017-06-15 03:06:38 +00:00
Craig Topper
46d1553fcd [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
2017-06-15 01:01:01 +00:00
Wolfgang Pieb
4d4fb1daf4 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
2017-06-14 23:55:39 +00:00
Spyridoula Gravani
d40b2ddde6 [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
2017-06-14 23:40:26 +00:00
George Karpenkov
4cbdf0eab2 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
2017-06-14 23:40:25 +00:00
Peter Collingbourne
ff3e8e2cee 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
2017-06-14 22:35:27 +00:00