Commit Graph

151837 Commits

Author SHA1 Message Date
Dinar Temirbulatov
fa3d66c27c [SLPVectorizer] Revert change in cancelScheduling with referencing to FirstInBundle, NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307667 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-11 15:54:50 +00:00
Craig Topper
0495576a59 [IR] Remove unnecessary const_casts from ConstantDataSequential and it's subclasses.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307666 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-11 15:52:21 +00:00
Hiroshi Inoue
9733528a87 fix formatting; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307662 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-11 15:41:31 +00:00
Daniel Sanders
599e6ee1eb [globalisel][tablegen] Change method of squashing unused variable warnings following post-commit comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307659 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-11 14:23:14 +00:00
Jonas Paulsson
a589fce0aa [SystemZ] Minor fixing in SystemZScheduleZ13.td
Some minor corrections for the recently added instructions.

Review: Ulrich Weigand

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307658 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-11 14:07:55 +00:00
Diana Picus
85d38e084b [ARM] GlobalISel: Tighten G_FCMP selection test. NFC
Use CHECK-NEXT for the comparison sequence, to make sure we don't get
any unexpected instructions in the middle of our flag manipulation
efforts.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307656 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-11 12:34:33 +00:00
George Rimar
cd7355508d [DWARF] - Add testcase for checking message about broken relocations.
Addresses comments for r306677, which fixed error message itself.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307655 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-11 12:29:07 +00:00
Guy Blank
c0dfa22e1d [X86][AVX512] regenerate avx512-insert-extract.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307654 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-11 11:51:49 +00:00
Diana Picus
8ae39dc847 [ARM] GlobalISel: Add reg mapping for s64 G_FCMP
Map the result into GPR and the operands into FPR.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307653 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-11 11:47:45 +00:00
Philip Pfaffe
eb75f906da [PM] Another post-commit fix in NewPMDriver
There were two errors in the parsing of opt's command line options for
extension point pipelines. The EP callbacks are not supposed to return a
value. To check the pipeline text for correctness, I now try to parse it
into a temporary PM object, and print a message on failure. This solves
the compile time error for the lambda return type, as well as correctly
handles unparsable pipelines now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307649 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-11 11:17:44 +00:00
Diana Picus
301859ba89 [ARM] GlobalISel: Tighten legalizer tests. NFC
Make sure that all the legalizer tests where the original instruction
needs to be removed check for the removal. We do this by adding
CHECK-NOT lines before and after the replacement sequence. This won't
catch pathological cases where the instruction remains somewhere in the
middle of the instruction sequence that's supposed to replace it, but
hopefully that won't occur in practice (since ideally we'd be setting
the insert point for the new instruction sequence either before or after
the original instruction and not fiddle with it while building the
sequence).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307647 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-11 10:52:08 +00:00
Daniel Sanders
a216c3246b [globalisel][tablegen] Fix an multi-insn match bug where ComplexPattern is used on multiple insns.
In each rule, each use of ComplexPattern is assigned an element in the Renderers
array. The matcher then collects renderer functions in this array and they are
used to render instructions. This works well for a single instruction but a
bug in the allocation mechanism causes the elements to be assigned on a
per-instruction basis rather than a per-rule basis.

So in the case of:
  (set GPR32:$dst, (Op complex:$src1, complex:$src2))
tablegen currently assigns elements 0 and 1 to $src1 and $src2 respectively,
but for:
  (set GPR32:$dst, (Op complex:$src1, (Op complex:$src2)))
it currently assigned both $src1 and $src2 the same element (0). This results in
one complex operand being rendered twice and the other being forgotten.
This patch corrects the allocation such that $src1 and $src2 are still allocated
different elements in this case.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307646 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-11 10:40:18 +00:00
Peter Smith
6253ba4276 [ARM] ldr pc,=expression should be allowed in Thumb2
This change allows the pc to be used as a destination register for the
pseudo instruction LDR pc,=expression . The pseudo instruction must not be
transformed into a MOV, but it can use the Thumb2 LDR (literal) instruction
to a constant pool entry. See (A7.7.43 from ARMv7M ARM ARM).

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307640 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-11 09:47:12 +00:00
Diana Picus
f4f832c513 [ARM] GlobalISel: Fix oversight in G_FCMP legalization
We used to forget to erase the original instruction when replacing a
G_FCMP true/false. Fix this bug and make sure the tests check for it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307639 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-11 09:43:51 +00:00
Daniel Sanders
ec48fd1277 [globalisel][tablegen] Correct matching of intrinsic ID's.
TreePatternNode considers them to be plain integers but MachineInstr considers
them to be a distinct kind of operand.

The tweak to AArch64InstrInfo.td to produce a simple test case is a NFC for
everything except GlobalISelEmitter (confirmed by diffing the tablegenerated
files). GlobalISelEmitter is currently unable to infer the type of operands in
the Dst pattern from the operands in the Src pattern.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307634 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-11 08:57:29 +00:00
Diana Picus
6845427d1b [ARM] GlobalISel: Legalize s64 G_FCMP
Same as the s32 version, for both hard and soft float.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307633 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-11 08:50:01 +00:00
Serguei Katkov
a1602eb3fd Revert Revert [MBP] do not rotate loop if it creates extra branch
This is a second attempt to land this patch.

The first one resulted in a crash of clang sanitizer buildbot.
The fix is here and regression test is added.

This is a last fix for the corner case of PR32214. Actually this is not really corner case in general.

We should not do a loop rotation if we create an additional branch due to it.
Consider the case where we have a loop chain H, M, B, C , where
H is header with viable fallthrough from pre-header and exit from the loop
M - some middle block
B - backedge to Header but with exit from the loop also.
C - some cold block of the loop.

Let's H is determined as a best exit. If we do a loop rotation M, B, C, H we can introduce the extra branch.
Let's compute the change in number of branches:
+1 branch from pre-header to header
-1 branch from header to exit
+1 branch from header to middle block if there is such
-1 branch from cold bock to header if there is one

So if C is not a predecessor of H then we introduce extra branch.

This change actually prohibits rotation of the loop if both true
  Best Exit has next element in chain as successor.
  Last element in chain is not a predecessor of first element of chain.

Reviewers: iteratee, xur, sammccall, chandlerc	
Reviewed By: iteratee
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D34745


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307631 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-11 08:34:58 +00:00
Igor Breger
a66d0850ca [GlobalISel][X86] Use correct AND instructions.
AND8ri8 not supported in 64bit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307630 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-11 08:04:51 +00:00
Serguei Katkov
0c2ce7e21d [CGP] Relax a bit restriction for optimizeMemoryInst to extend scope
CodeGenPrepare::optimizeMemoryInst contains a check that we do nothing
if all instructions combining the address for memory instruction is in the same
block as memory instruction itself.

However if any of these instruction are placed after memory instruction then
address calculation will not be folded to memory instruction.

The added test case shows an example.

Reviewers: loladiro, spatel, efriedma
Reviewed By: efriedma
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D34862


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307628 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-11 06:24:44 +00:00
Hiroshi Inoue
0eb884f61d fix typos in comments; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307626 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-11 06:04:59 +00:00
Chandler Carruth
64a9b5d3e6 [PM/ThinLTO] Fix PR33536, a bug where the ThinLTO bitcode writer was
querying for analysis results on a function declaration rather than
a definition.

The only reason this worked previously is by chance -- because the way
we got alias analysis results with the legacy PM, we happened to not
compute a dominator tree and so we happened to not hit an assert even
though it didn't make any real sense. Now we bail out before trying to
compute alias analysis so that we don't hit these asserts.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307625 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-11 05:39:20 +00:00
Hiroshi Inoue
9c82670849 [PowerPC] fix latency for simple integer instructions in POWER9 scheduler
In the POWER9 instruction scheduler, SchedWriteRes for the simple integer instructions are misconfigured to use that of (costly) DFU instructions.
This results in surprisingly long instruction latency estimation and causes misbehavior in some optimizers such as if-conversion.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307624 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-11 05:37:16 +00:00
Hiroshi Inoue
2ff5ec7b05 [PowerPC] avoid redundant analysis while lowering an immediate; NFC
This patch reduces compilation time by avoiding redundant analysis while selecting instructions to create an immediate.
If the instruction count required to create the input number without rotate is 2, we do not need further analysis to find a shorter instruction sequence with rotate; rotate + load constant cannot be done by 1 instruction (i.e. getInt64CountDirectnever return 0).
This patch should not change functionality.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307623 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-11 05:28:26 +00:00
Dylan McKay
d2c491251a [AVR] Remove a few very old TODOs that don't have enough context to understand
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307622 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-11 05:14:40 +00:00
Craig Topper
7e53087f42 [InstCombine] Add test case for PR33721.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307621 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-11 05:12:52 +00:00
Dylan McKay
5475b99e46 [AVR] Rename 'ZREGS' to 'ZREG'
It will only ever contain one register.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307620 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-11 04:53:43 +00:00
Dylan McKay
29333f5cec [AVR] Rename 'AVRTiny' to 'Tiny'
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307619 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-11 04:45:15 +00:00
Dylan McKay
151ae814ed [AVR] Use the generic branch relaxer
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307617 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-11 04:17:13 +00:00
NAKAMURA Takumi
cc230b38ed Whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307614 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-11 02:31:54 +00:00
NAKAMURA Takumi
e582c6f55e Revert r307581, "Avoid doing conservative phi checks in aliasSameBasePointerGEPs() if no phis have been visited yet."
It broke stage2 tests in selfhosting.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307613 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-11 02:31:51 +00:00
Sam Clegg
0d72763a25 [WebAssembly] Fix use of cast vs dyn_cast
Differential Revision: https://reviews.llvm.org/D35233

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307612 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-11 02:21:57 +00:00
Vedant Kumar
8d7d203342 [llvm-cov] Disable threading in a test. NFC.
PR30735 reports an issue where llvm-cov hangs with a worker thread
waiting on a condition, and the main thread waiting to join() the
workers. While this doesn't appear to be a bug in llvm-cov or the
ThreadPool implementation, it would be helpful to disable the use of
threading in the llvm-cov tests where no test coverage is added.

More context: https://bugs.llvm.org/show_bug.cgi?id=30735

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307610 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-11 01:42:12 +00:00
Vedant Kumar
574c516223 [llvm-cov] Add a cl::opt to control the number of threads
When an output directory is specified, llvm-cov spawns some threads to
speed up the process of writing out file reports. Add an option which
allows users to control how many threads llvm-cov uses.

A CommandGuide.rst update + test is included.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307609 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-11 01:23:29 +00:00
David Blaikie
1b67e9a22a llvm-profdata: Improve memory usage by tuning SmallDenseMap size
This takes memory usage from 5.1GB to 970MB - it could go further by
using a small size of 2 instead of the default of 4, but given the
rather high cost of going over this limit by much, I figured a little
slosh would be worth the ~130MB of memory usage.

& this'll might not be such a big deal if we use a custom slab allocator
for the DenseMaps here anyway

While the vast majority (99.9%) of records use only 1 entry, the tuning
parameter to SmallDenseMap is the the number of buckets, not the number
of entries - so a small size of 1 wasn't useful, even for 1 element, it
would tip over into allocating (much, 64 slots worth) more space - none
of them ended up small.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307608 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-11 01:18:28 +00:00
Andrew Wilkins
2392628659 [cmake] Check for Haiku when setting LIB_NAMES for GNU ld
Haiku uses GNU ld for linking, but is not captured in the
conditional when setting LIB_NAMES. This causes a shared
library with no symbols on Haiku. This patch simply adds
a check for whether the CMake system name is Haiku in
addition to the existing checks.

Patch by Jérôme Duval.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307607 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-11 01:17:44 +00:00
George Karpenkov
3b0bb78b4e Remove circular dependency from runtimes/CMakeLists
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307605 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-11 00:48:00 +00:00
Zachary Turner
c1422a59e8 [lld/pdb] Create an empty public symbol record stream.
This is part of the continuing effort to increase parity between
LLD and MSVC PDBs.  link still doesn't like our PDBs, so the most
obvious thing to check was whether adding an empty publics stream
would get it to do something else.  It still fails in the same way
but at least this removes one more variable from the equation.
The next logical step would be to try creating an empty globals
stream.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307598 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-10 22:40:20 +00:00
Joel Jones
6ed70a89d6 Doxygen formatting. NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307597 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-10 22:11:50 +00:00
Vedant Kumar
cdcc59f9d0 InstrProf: Fix unit test which accidentally used a duplicate name
This unit test constructed some profile records incorrectly. One of the
records had a duplicate name: adding that record into the writer caused
an error unrelated to what needed to be tested.

Reported by David Blaikie!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307596 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-10 21:44:43 +00:00
Zachary Turner
8a3ff6431f [lld/pdb] Add some basic linker module symbols.
Differential Revision: https://reviews.llvm.org/D35152

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307590 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-10 21:01:37 +00:00
Matthias Braun
c364d94de8 Revert "[DAG] Improve Aliasing of operations to static alloca"
Reverting as it breaks tramp3d-v4 in the llvm test-suite. I added some
comments to https://reviews.llvm.org/D33345 about it.

This reverts commit r307546.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307589 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-10 20:51:30 +00:00
Sam Clegg
f3f79378e0 [WebAssembly] Add more details to llvm-readobj for wasm files
Differential Revision: https://reviews.llvm.org/D35208

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307588 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-10 20:47:12 +00:00
Leo Li
581e763cd4 [ConstantHoisting] Remove dupliate logic in constant hoisting
Summary:
As metioned in https://reviews.llvm.org/D34576, checkings in
`collectConstantCandidates` can be replaced by using
`llvm::canReplaceOperandWithVariable`.

The only special case is that `collectConstantCandidates` return false for
all `IntrinsicInst` but it is safe for us to collect constant candidates from
`IntrinsicInst`.

Reviewers: pirama, efriedma, srhines

Reviewed By: efriedma

Subscribers: llvm-commits, javed.absar

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307587 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-10 20:45:34 +00:00
Davide Italiano
063d8f6b0f [NewGVN] Simplify a lambda a little bit. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307586 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-10 20:45:00 +00:00
Sam Clegg
3ba6566741 [WebAssembly] Be consistent in generating trivial test input files
For each checked-in wasm file, make sure the there is
corresponding .ll file that can be used to regenerate it
if needed.

Add test/Object/Inputs/trivial-object-test.wasm to match other
formats and add some new wasm tests in test/Object.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307585 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-10 20:43:26 +00:00
Nirav Dave
c7acbe2ea6 Add DAG argument to canMergeStoresTo NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307583 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-10 20:25:54 +00:00
Krzysztof Parzyszek
7a9373cdbb [Hexagon] Convert typed ISD opcodes to generic ones, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307582 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-10 20:16:44 +00:00
Farhana Aleen
b0d5344402 Avoid doing conservative phi checks in aliasSameBasePointerGEPs() if no phis have been visited yet.
Reviewers: Daniel Berlin

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307581 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-10 20:15:40 +00:00
Krzysztof Parzyszek
d07ce5fb3f [Hexagon] Remove unused ISD opcodes, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307580 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-10 20:13:44 +00:00
Dehao Chen
a569cab404 Use DenseMap instead std::map for GVSummaryMapTy.
Summary: This speeds-up thin-link by ~47% for large programs.

Reviewers: tejohnson

Reviewed By: tejohnson

Subscribers: sanjoy, llvm-commits, mehdi_amini

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307578 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-10 20:12:54 +00:00