OSDN Git Service

android-x86/external-llvm.git
6 years ago[llvm-objcopy] Implement support for section groups
Alexander Shaposhnikov [Wed, 21 Mar 2018 19:53:44 +0000 (19:53 +0000)]
[llvm-objcopy] Implement support for section groups

This diff adds support for SHT_GROUP sections to llvm-objcopy.
Some sections are interrelated and comprise a group.
For example, a definition of an inline function might require,
in addition to the section containing its instructions,
a read-only data section containing literals referenced inside the function.
A section of the type SHT_GROUP contains the indices of the group members,
therefore, it needs to be updated whenever the indices change.
Similarly, the fields sh_link, sh_info should be recalculated as well.

[Resubmit r328012 with the proper handling of endianness]

Test plan: make check-all

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

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

6 years ago[TableGen] Hoist the code for copying InstRWs from an old scheduling class to a new...
Craig Topper [Wed, 21 Mar 2018 19:52:13 +0000 (19:52 +0000)]
[TableGen] Hoist the code for copying InstRWs from an old scheduling class to a new one out of the loop that assigns instructions to the new class. NFCI

We already know all the of instructions we're processing in the instruction loop belong to no class or all to the same class. So we only have to worry about remapping one class. So hoist it all out and remove the SmallPtrSet that tracked which class we'd already remapped.

I had to introduce new instruction loop inside this code to print an error message, but that only occurs on the error path.

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

6 years agotypo
Adrian Prantl [Wed, 21 Mar 2018 19:33:07 +0000 (19:33 +0000)]
typo

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

6 years ago[InstSimplify] fp_binop X, NaN --> NaN
Sanjay Patel [Wed, 21 Mar 2018 19:31:53 +0000 (19:31 +0000)]
[InstSimplify] fp_binop X, NaN --> NaN

We propagate the existing NaN value when possible.

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

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

6 years ago[TableGen] Remove unnecessary map lookup and shadowing of a variable. NFCI
Craig Topper [Wed, 21 Mar 2018 19:30:33 +0000 (19:30 +0000)]
[TableGen] Remove unnecessary map lookup and shadowing of a variable. NFCI

We already have an OldSCIdx variable in the outer loop here. And we already did the map lookup in the loop that populated ClassInstrs. And the outer OldSCIdx got it from ClassInstrs.

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

6 years ago[TableGen] Use range-based for loops. NFC
Craig Topper [Wed, 21 Mar 2018 19:30:31 +0000 (19:30 +0000)]
[TableGen] Use range-based for loops. NFC

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

6 years ago[TableGen] Use count_if instead of a manual loop. NFC
Craig Topper [Wed, 21 Mar 2018 19:30:30 +0000 (19:30 +0000)]
[TableGen] Use count_if instead of a manual loop. NFC

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

6 years ago[X86] Rewrite getOperandBias in X86BaseInfo.h to be a little more structured and...
Craig Topper [Wed, 21 Mar 2018 19:30:28 +0000 (19:30 +0000)]
[X86] Rewrite getOperandBias in X86BaseInfo.h to be a little more structured and update comments to be more clear about what it does. NFC

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

6 years agoSink Analysis/ObjectUtil(canBeOmittedFromSymbolTable) into IR so it can be legitimate...
David Blaikie [Wed, 21 Mar 2018 19:23:45 +0000 (19:23 +0000)]
Sink Analysis/ObjectUtil(canBeOmittedFromSymbolTable) into IR so it can be legitimately be used by Object/IRSymtab

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

6 years ago[SLP] Add test case for a gather sequence with multiple uses
Matthew Simpson [Wed, 21 Mar 2018 19:13:14 +0000 (19:13 +0000)]
[SLP] Add test case for a gather sequence with multiple uses

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

6 years ago[InstrProf] Support for external functions in text format.
Mircea Trofin [Wed, 21 Mar 2018 19:06:06 +0000 (19:06 +0000)]
[InstrProf] Support for external functions in text format.

Summary:
External functions appearing as indirect call targets could not be
found in the SymTab, and the value:counter record was represented,
in the text format, using an empty string for the name. This would
then cause a silent parsing error when reading.

This CL:
- adds explicit support for such functions
- fixes the places where we would not propagate errors when reading
- addresses a performance issue due to eager resorting of the SymTab.

Reviewers: xur, eraman, davidxl

Reviewed By: davidxl

Subscribers: llvm-commits

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

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

6 years agoEnsure that DataTypes.h is installed now that it's moved to llvm-c
David Blaikie [Wed, 21 Mar 2018 18:21:57 +0000 (18:21 +0000)]
Ensure that DataTypes.h is installed now that it's moved to llvm-c

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

6 years ago[llvm-mca] Move the logic that computes the register file usage to the BackendStatist...
Andrea Di Biagio [Wed, 21 Mar 2018 18:11:05 +0000 (18:11 +0000)]
[llvm-mca] Move the logic that computes the register file usage to the BackendStatistics view.

With this patch, the "instruction dispatched" event now provides information
related to the number of microarchitectural registers used in each register
file. Similarly, the "instruction retired" event is now able to tell how may
registers are freed in each register file.

Currently, the BackendStatistics view is the only consumer of register
usage/pressure information. BackendStatistics uses that info to print out a few
general statistics (i.e. max number of mappings used; total mapping created).
Before this patch, the BackendStatistics was forced to query the Backend to
obtain the register pressure information.

This helps removes that dependency. Now views are completely independent from
the Backend.  As a consequence, it should be easier to address PR36663 and
further modularize the pipeline.

Added a couple of test cases in the BtVer2 specific directory.

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

6 years ago[SchedModel] Use CodeGenSchedClass::getSchedClassIdx helper directly. NFCI.
Simon Pilgrim [Wed, 21 Mar 2018 18:09:34 +0000 (18:09 +0000)]
[SchedModel] Use CodeGenSchedClass::getSchedClassIdx helper directly. NFCI.

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

6 years ago[SchedModel] Use CodeGenSchedClass::isKeyEqual instead of duplicating code. NFCI.
Simon Pilgrim [Wed, 21 Mar 2018 17:57:21 +0000 (17:57 +0000)]
[SchedModel] Use CodeGenSchedClass::isKeyEqual instead of duplicating code. NFCI.

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

6 years ago[Docs] Remove some WIP X86 documentation I accidentally leaked into r328031.
Craig Topper [Wed, 21 Mar 2018 17:32:57 +0000 (17:32 +0000)]
[Docs] Remove some WIP X86 documentation I accidentally leaked into r328031.

I didn't mean to commit it, but I guess I failed to switch branches or stash it in my local tree.

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

6 years agoReapply Support layering fixes.
David Blaikie [Wed, 21 Mar 2018 17:31:49 +0000 (17:31 +0000)]
Reapply Support layering fixes.

Compiler.h is used by Demangle (which Support depends on) - so sink it
into Demangle to avoid a circular dependency

DataTypes.h is used by llvm-c (which Support depends on) - so sink it
into llvm-c.

DataTypes.h could probably be fixed the other way - making llvm-c depend
on Support instead of Support depending on llvm-c - if anyone feels
that's the better option, happy to work with them on that.

I /think/ this'll address the layering issues that previous attempts to
commit this have triggered in the Modules buildbot, but I haven't been
able to reproduce that build so can't say for sure. If anyone's having
trouble with this - it might be worth taking a look to see if there's a
quick fix/something small I missed rather than revert, but no worries.

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

6 years agoAdd missing #includes to Analysis/MustExecute.h
David Blaikie [Wed, 21 Mar 2018 17:31:45 +0000 (17:31 +0000)]
Add missing #includes to Analysis/MustExecute.h

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

6 years ago[Documentation] Fix markup problems in X86Usage.rst
Eugene Zelenko [Wed, 21 Mar 2018 17:24:04 +0000 (17:24 +0000)]
[Documentation] Fix markup problems in X86Usage.rst

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

6 years ago[Hexagon] Generalize DAG mutation for function calls
Krzysztof Parzyszek [Wed, 21 Mar 2018 17:23:32 +0000 (17:23 +0000)]
[Hexagon] Generalize DAG mutation for function calls

Add barrier edges to check for any physical register. The previous code
worked for the function return registers: r0/d0, v0/w0.

Patch by Brendon Cahoon.

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

6 years ago[InstCombine] add folds for xor-of-icmp signbit tests (PR36682)
Sanjay Patel [Wed, 21 Mar 2018 17:17:13 +0000 (17:17 +0000)]
[InstCombine] add folds for xor-of-icmp signbit tests (PR36682)

This is part of solving:
https://bugs.llvm.org/show_bug.cgi?id=36682

There's also a leftover improvement from the long-ago-closed:
https://bugs.llvm.org/show_bug.cgi?id=5438

https://rise4fun.com/Alive/dC1

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

6 years agoTableGen: Remove redundant loop in ListInit::resolveReferences
Nicolai Haehnle [Wed, 21 Mar 2018 17:13:10 +0000 (17:13 +0000)]
TableGen: Remove redundant loop in ListInit::resolveReferences

Summary:
Recursive lookups are handled by the Resolver, so the loop was purely
a waste of runtime.

Change-Id: I2bd23a68b478aea0bbac1a86ca7635adffa28688

Reviewers: arsenm, craig.topper, tra, MartinO

Subscribers: wdng, llvm-commits

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

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

6 years agoTableGen: Streamline how defs are instantiated
Nicolai Haehnle [Wed, 21 Mar 2018 17:12:53 +0000 (17:12 +0000)]
TableGen: Streamline how defs are instantiated

Summary:
Instantiating def's and defm's needs to perform the following steps:

- for defm's, clone multiclass def prototypes and subsitute template args
- for def's and defm's, add subclass definitions, substituting template
  args
- clone the record based on foreach loops and substitute loop iteration
  variables
- override record variables based on the global 'let' stack
- resolve the record name (this should be simple, but unfortunately it's
  not due to existing .td files relying on rather silly implementation
  details)
- for def(m)s in multiclasses, add the unresolved record as a multiclass
  prototype
- for top-level def(m)s, resolve all internal variable references and add
  them to the record keeper and any active defsets

This change streamlines how we go through these steps, by having both
def's and defm's feed into a single addDef() method that handles foreach,
final resolve, and routing the record to the right place.

This happens to make foreach inside of multiclasses work, as the new
test case demonstrates. Previously, foreach inside multiclasses was not
forbidden by the parser, but it was de facto broken.

Another side effect is that the order of "instantiated from" notes in error
messages is reversed, as the modified test case shows. This is arguably
clearer, since the initial error message ends up pointing directly to
whatever triggered the error, and subsequent notes will point to increasingly
outer layers of multiclasses. This is consistent with how C++ compilers
report nested #includes and nested template instantiations.

Change-Id: Ica146d0db2bc133dd7ed88054371becf24320447

Reviewers: arsenm, craig.topper, tra, MartinO

Subscribers: wdng, llvm-commits

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

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

6 years ago[Documentation] Fix markup problem in AMDGPUUsage.rst.
Eugene Zelenko [Wed, 21 Mar 2018 17:09:35 +0000 (17:09 +0000)]
[Documentation] Fix markup problem in AMDGPUUsage.rst.

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

6 years ago[Hexagon] Eliminate subregisters from PHI nodes before pipelining
Krzysztof Parzyszek [Wed, 21 Mar 2018 16:39:11 +0000 (16:39 +0000)]
[Hexagon] Eliminate subregisters from PHI nodes before pipelining

The pipeliner needs to remove instructions from the SlotIndexes
structure when they are deleted. Otherwise, the SlotIndexes map
has stale data, and an assert will occur when adding new
instructions.

This patch also changes the pipeliner to make the back-edge of
a loop carried dependence 1 cycle. The 1 cycle latency is added
to the anti-dependence that represents the back-edge. This
changes eliminates a couple of hacks added to the pipeliner to
handle the latency of the back-edge. It is needed to correctly
pipeline the test case for the sub-register elimination pass.

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

6 years ago[WebAssembly] Suppress unused function warning for register name matcher
Reid Kleckner [Wed, 21 Mar 2018 16:20:58 +0000 (16:20 +0000)]
[WebAssembly] Suppress unused function warning for register name matcher

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

6 years ago[X86][Haswell] Merge multiple InstrRW entries that map to the same SchedWriteRes...
Simon Pilgrim [Wed, 21 Mar 2018 16:19:03 +0000 (16:19 +0000)]
[X86][Haswell] Merge multiple InstrRW entries that map to the same SchedWriteRes group (NFCI) (PR35955)

I've also merged some VEX/non-VEX instregex strings with a (V?) prefix or (Y?) ymm variant - there are still a lot more of these to do.

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

6 years ago[X86][SandyBridge] Merge more VEX/non-VEX instregex patterns (NFCI) (PR35955)
Simon Pilgrim [Wed, 21 Mar 2018 16:05:58 +0000 (16:05 +0000)]
[X86][SandyBridge] Merge more VEX/non-VEX instregex patterns (NFCI) (PR35955)

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

6 years ago[InstCombine] move/add tests for xor-of-icmps (PR36682); NFC
Sanjay Patel [Wed, 21 Mar 2018 15:54:48 +0000 (15:54 +0000)]
[InstCombine] move/add tests for xor-of-icmps (PR36682); NFC

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

6 years ago[LangRef] add note about format of FP types
Sanjay Patel [Wed, 21 Mar 2018 15:22:09 +0000 (15:22 +0000)]
[LangRef] add note about format of FP types

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

6 years ago[RISCV] Codegen support for RV32F floating point comparison operations
Alex Bradbury [Wed, 21 Mar 2018 15:11:02 +0000 (15:11 +0000)]
[RISCV] Codegen support for RV32F floating point comparison operations

This patch also includes extensive tests targeted at select and br+fcmp IR
inputs. A sequence of br+fcmp required support for FPR32 registers to be added
to RISCVInstrInfo::storeRegToStackSlot and
RISCVInstrInfo::loadRegFromStackSlot.

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

6 years ago[RISCV] Add tests missed from r327979
Alex Bradbury [Wed, 21 Mar 2018 14:50:27 +0000 (14:50 +0000)]
[RISCV] Add tests missed from r327979

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

6 years agoChange DT_* value definitions to macros in a separate file
Alexander Richardson [Wed, 21 Mar 2018 14:17:50 +0000 (14:17 +0000)]
Change DT_* value definitions to macros in a separate file

Summary:
I recently added a new dynamic tag to our fork of LLVM and when adding it
to llvm-readobj I noticed that not all DT_ values were being handled there.

Using macros in a .def file that can be included by both ELFDumper.cpp and
the ELF.h header ensures that the two don't get out of sync when new values
are added.

Reviewers: grimar, pcc, davide, espindola

Reviewed By: grimar, espindola

Subscribers: srhines, llvm-commits

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

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

6 years ago[LangRef] more hyphens: always write "floating-point"
Sanjay Patel [Wed, 21 Mar 2018 14:15:33 +0000 (14:15 +0000)]
[LangRef] more hyphens: always write "floating-point"

We were inconsistent, sometimes even within a single sentence.
The consensus seems clear that the FP we're looking for is
spelled "floating-point". Without the hyphen, it's a
"surprisingly fine" jazz album.

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

6 years ago[MemCpyOpt] Update to new API for memory intrinsic alignment
Daniel Neilson [Wed, 21 Mar 2018 14:14:55 +0000 (14:14 +0000)]
[MemCpyOpt] Update to new API for memory intrinsic alignment

Summary:
This change is part of step five in the series of changes to remove alignment argument from
memcpy/memmove/memset in favour of alignment attributes. In particular, this changes the
MemCpyOpt pass to cease using:
1) The old getAlignment() API of MemoryIntrinsic in favour of getting source & dest specific
alignments through the new API.
2) The old IRBuilder CreateMemCpy/CreateMemMove single-alignment APIs in favour of the new
API that allows setting source and destination alignments independently.

We also add a few tests to fill gaps in the testing of this pass.

Steps:
Step 1) Remove alignment parameter and create alignment parameter attributes for
memcpy/memmove/memset. ( rL322965, rC322964, rL322963 )
Step 2) Expand the IRBuilder API to allow creation of memcpy/memmove with differing
source and dest alignments. ( rL323597 )
Step 3) Update Clang to use the new IRBuilder API. ( rC323617 )
Step 4) Update Polly to use the new IRBuilder API. ( rL323618 )
Step 5) Update LLVM passes that create memcpy/memmove calls to use the new IRBuilder API,
and those that use use MemIntrinsicInst::[get|set]Alignment() to use [get|set]DestAlignment()
and [get|set]SourceAlignment() instead. ( rL323886, rL323891, rL324148, rL324273, rL324278,
rL324384, rL324395, rL324402, rL324626, rL324642, rL324653, rL324654, rL324773, rL324774,
rL324781, rL324784, rL324955, rL324960, rL325816, rL327398, rL327421 )
Step 6) Remove the single-alignment IRBuilder API for memcpy/memmove, and the
MemIntrinsicInst::[get|set]Alignment() methods.

Reference
   http://lists.llvm.org/pipermail/llvm-dev/2015-August/089384.html
   http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20151109/312083.html

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

6 years agoRe-re-land: Teach CorrelatedValuePropagation to reduce the width of udiv/urem instruc...
Justin Lebar [Wed, 21 Mar 2018 14:08:21 +0000 (14:08 +0000)]
Re-re-land: Teach CorrelatedValuePropagation to reduce the width of udiv/urem instructions.

Summary:
If the operands of a udiv/urem can be proved to fit within a smaller
power-of-two-sized type, reduce the width of the udiv/urem.

Backed out for causing performance regressions.  Re-landing
because we've determined that these regressions were noise.

Original Differential Revision: https://reviews.llvm.org/D44102

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

6 years agoRevert "Move DataTypes.h from Support to llvm-c to fix layering."
Jonas Devlieghere [Wed, 21 Mar 2018 13:28:37 +0000 (13:28 +0000)]
Revert "Move DataTypes.h from Support to llvm-c to fix layering."

This reverts r328065.

I missed this one in r328085 and the bots were still failing.

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

6 years ago[llvm-mca] Clean up some code. NFC
Andrea Di Biagio [Wed, 21 Mar 2018 12:49:07 +0000 (12:49 +0000)]
[llvm-mca] Clean up some code. NFC

Removed a couple of methods from DispatchUnit.

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

6 years agoFix build broken by r328090
Pavel Labath [Wed, 21 Mar 2018 12:18:03 +0000 (12:18 +0000)]
Fix build broken by r328090

- constexpr is needed for out-of-class definition of the Type static
  member by some compilers
- MSVC is confused by the initialization of the static constexpr char[]
  member when it happens in a template specialization. Explicitly
  specifying the length of the array seems to be enough to help it
  figure things out.

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

6 years ago[dwarf] Unify unknown dwarf enum formatting code
Pavel Labath [Wed, 21 Mar 2018 11:46:37 +0000 (11:46 +0000)]
[dwarf] Unify unknown dwarf enum formatting code

Summary:
We have had at least three pieces of code (in DWARFAbbreviationDeclaration,
DWARFAcceleratorTable and DWARFDie) that have hand-rolled support for
dumping unknown dwarf enum values. While not terrible, they are a bit
distracting and enable small differences to creep in (Unknown_ffff vs.
Unknown_0xffff). I ended up needing to add a fourth place
(DWARFVerifier), so it seems it would be a good time to centralize.

This patch creates an alternative to the XXXString dumping functions in
the BinaryFormat library, which formats an unknown value as
DW_TYPE_unknown_1234, instead of just an empty string. It is based on
the formatv function, as that allows us to avoid materializing the
string for unknown values (and because this way I don't have to invent a
name for the new functions :P).

In this patch I add formatters for dwarf attributes, forms, tags, and
index attributes as these are the ones in use currently, but adding
other enums is straight-forward.

Reviewers: dblaikie, JDevlieghere, aprantl

Subscribers: llvm-commits

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

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

6 years agoRevert layering changes
Jonas Devlieghere [Wed, 21 Mar 2018 10:35:09 +0000 (10:35 +0000)]
Revert layering changes

This reverts:
  r328072 "Move Compiler.h from Support to Demangler to fix layering."
  r328073 "Fix the actual user of DataTypes.h in llvm-c to avoid the circular dependency"

Failing bots:
  http://green.lab.llvm.org/green/job/clang-stage2-coverage-R/
  http://green.lab.llvm.org/green/job/clang-stage2-configure-Rlto/

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

6 years ago[SelectionDAG] Support multiple dangling debug info for one value
Bjorn Pettersson [Wed, 21 Mar 2018 09:44:34 +0000 (09:44 +0000)]
[SelectionDAG] Support multiple dangling debug info for one value

Summary:
When building the selection DAG we sometimes need to postpone
the handling of a dbg.value until the value it should refer to
is created. This is done by using the DanglingDebugInfoMap.
In the past this map has been limited to hold one dangling
dbg.value per value. This patch removes that restriction.

Reviewers: aprantl, rnk, probinson, vsk

Reviewed By: aprantl

Subscribers: Ka-Ka, llvm-commits, JDevlieghere

Tags: #debug-info

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

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

6 years agoFix build bot after r328078 "llvm-readobj] - Teach llvm-readobj to dump .note.gnu...
George Rimar [Wed, 21 Mar 2018 08:48:44 +0000 (08:48 +0000)]
Fix build bot after r328078 "llvm-readobj] - Teach llvm-readobj to dump .note.gnu.property sections."

BB was: http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/27058/steps/test/logs/stdio

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

6 years ago[llvm-readobj] - Teach llvm-readobj to dump .note.gnu.property sections.
George Rimar [Wed, 21 Mar 2018 08:34:55 +0000 (08:34 +0000)]
[llvm-readobj] - Teach llvm-readobj to dump .note.gnu.property sections.

NT_GNU_PROPERTY_TYPE_0 is a recently added type of .note.gnu.property
section specified in Linux Extensions to gABI.
(https://github.com/hjl-tools/linux-abi/wiki/Linux-Extensions-to-gABI)

Patch teach tool to print such notes properly.

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

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

6 years ago[X86][Broadwell] Merge multiple InstrRW entries that map to the same SchedWriteRes...
Craig Topper [Wed, 21 Mar 2018 06:28:42 +0000 (06:28 +0000)]
[X86][Broadwell] Merge multiple InstrRW entries that map to the same SchedWriteRes group (NFCI) (PR35955)

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

6 years ago[TableGen] Remove a defaulted function argument that is never called with another...
Craig Topper [Wed, 21 Mar 2018 05:13:04 +0000 (05:13 +0000)]
[TableGen] Remove a defaulted function argument that is never called with another value. NFC

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

6 years ago[TableGen] Move a function from llvm namespace and make it a static function. NFC
Craig Topper [Wed, 21 Mar 2018 05:13:01 +0000 (05:13 +0000)]
[TableGen] Move a function from llvm namespace and make it a static function. NFC

It's only called from one place and is defined just above that use.

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

6 years agoFix the actual user of DataTypes.h in llvm-c to avoid the circular dependency
David Blaikie [Wed, 21 Mar 2018 04:07:07 +0000 (04:07 +0000)]
Fix the actual user of DataTypes.h in llvm-c to avoid the circular dependency

(follow-up to r328065)

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

6 years agoMove Compiler.h from Support to Demangler to fix layering.
David Blaikie [Wed, 21 Mar 2018 04:07:05 +0000 (04:07 +0000)]
Move Compiler.h from Support to Demangler to fix layering.

Support depends on Demangle (Support/Unix/Signals.inc), so Demangle
including Support/Compiler.h created a circular dependency.

Leave a forwarding shim of Compiler.h because it makes more sense for
users (a deeper fix might involve splitting Support into lower and upper
Support - but that also sounds a bit weird/awkward) than thinking about
the dependency on the Demangler.

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

6 years ago[X86] Fix the SchedRW for XOP vpcom register form instructions to not be marked as...
Craig Topper [Wed, 21 Mar 2018 03:41:33 +0000 (03:41 +0000)]
[X86] Fix the SchedRW for XOP vpcom register form instructions to not be marked as loads.

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

6 years ago[TableGen] Use SmallMapVector to simplify some code that was trying to keep a vector...
Craig Topper [Wed, 21 Mar 2018 02:48:34 +0000 (02:48 +0000)]
[TableGen] Use SmallMapVector to simplify some code that was trying to keep a vector unique

Summary:
This code previously had a SmallVector of std::pairs containing an unsigned and another SmallVector. The outer vector was using the unsigned effectively as a key to decide which SmallVector to add into. So each time something new needed to be added the out vector needed to be scanned. If it wasn't found a new entry needed to be added to be added. This sounds very much like a map, but the next loop iterates over the outer vector to get a deterministic order.

We can simplify this code greatly if use SmallMapVector instead. This uses more stack space since we now have a vector and a map, but the searching and creating new entries all happens behind the scenes. It should also make the search more efficient though usually there are only a few entries so that doesn't matter much.

We could probably get determinism by just using std::map which would iterate over the unsigned key, but that would generate different output from what we get with the current implementation.

Reviewers: RKSimon, dblaikie

Reviewed By: dblaikie

Subscribers: llvm-commits

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

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

6 years agoMove DataTypes.h from Support to llvm-c to fix layering.
David Blaikie [Wed, 21 Mar 2018 00:48:05 +0000 (00:48 +0000)]
Move DataTypes.h from Support to llvm-c to fix layering.

Support depends on llvm-c (a few typedefs, macros, etc - Types.h,
Disassembler.h, and TargetMachine.h.

This could be done the other way - those macros/typedefs/etc could be
moved into Support and used from llvm-c instead. If someone feels that's
a better direction to go, happy to discuss it/try it out/etc.

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

6 years ago[X86] Change PMULLD to 10 cycles on Skylake per Agner's tables and llvm-exegesis.
Craig Topper [Tue, 20 Mar 2018 23:39:48 +0000 (23:39 +0000)]
[X86] Change PMULLD to 10 cycles on Skylake per Agner's tables and llvm-exegesis.

Also restrict to port 0 and 1 for SkylakeClient. It looks like the scheduler models don't account for client not having a full vector ALU on port 5 like server.

Fixes PR36808.

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

6 years ago[MustExecute] Shwo the effect of using full loop info variant
Philip Reames [Tue, 20 Mar 2018 23:00:54 +0000 (23:00 +0000)]
[MustExecute] Shwo the effect of using full loop info variant

Most basic possible test for the logic used by LICM.

Also contains a speculative build fix for compiles which complain about a definition of a stuct K; followed by a declaration as class K;

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

6 years ago[WebAssembly] Update torture compile test expectations
Derek Schuff [Tue, 20 Mar 2018 23:00:13 +0000 (23:00 +0000)]
[WebAssembly] Update torture compile test expectations

The tests compile after r328049

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

6 years ago[MustExecute] Add simplest possible test for LoopSafetyOnfo
Philip Reames [Tue, 20 Mar 2018 22:55:20 +0000 (22:55 +0000)]
[MustExecute] Add simplest possible test for LoopSafetyOnfo

(Currently showing without, will enable and check in diff to show impact)

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

6 years ago[MustExecute] Move isGuaranteedToExecute and related rourtines to Analysis
Philip Reames [Tue, 20 Mar 2018 22:45:23 +0000 (22:45 +0000)]
[MustExecute] Move isGuaranteedToExecute and related rourtines to Analysis

Next step is to actually merge the implementations and get both implementations tested through the new printer.

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

6 years ago[SchedModel] Simplify InstRegexOp::apply. NFCI.
Simon Pilgrim [Tue, 20 Mar 2018 22:20:28 +0000 (22:20 +0000)]
[SchedModel] Simplify InstRegexOp::apply. NFCI.

As discussed on D44687, there was no need for 2 separate for loops for collecting the Regex and then matching against instructions.

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

6 years ago[WebAssembly] Strip threadlocal attribute from globals in single thread mode
Derek Schuff [Tue, 20 Mar 2018 22:01:32 +0000 (22:01 +0000)]
[WebAssembly] Strip threadlocal attribute from globals in single thread mode

The default thread model for wasm is single, and in this mode thread-local
global variables can be lowered identically to non-thread-local variables.

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

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

6 years ago[X86] Drop unnecessary InstRW overrides for WriteFMA
Simon Pilgrim [Tue, 20 Mar 2018 21:15:23 +0000 (21:15 +0000)]
[X86] Drop unnecessary InstRW overrides for WriteFMA

As noticed on D44687, these already match the WriteFMA def so can be removed.

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

6 years ago[ReachingDefAnalysis] Fix what I assume to be a typo ReachingDedDefaultVal->ReachingD...
Craig Topper [Tue, 20 Mar 2018 20:53:21 +0000 (20:53 +0000)]
[ReachingDefAnalysis] Fix what I assume to be a typo ReachingDedDefaultVal->ReachingDefDefaultVal.

Unless Ded has some many I don't know about.

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

6 years ago[ObjCARC] Add funclet token to ARC marker
Shoaib Meenai [Tue, 20 Mar 2018 20:45:41 +0000 (20:45 +0000)]
[ObjCARC] Add funclet token to ARC marker

The inline assembly generated for the ARC autorelease elision marker
must have a funclet token if it's emitted inside a funclet, otherwise
the inline assembly (and all subsequent code in the funclet) will be
marked unreachable by WinEHPrepare.

Note that this only applies for the non-O0 case, since at O0, clang
emits the autorelease elision marker itself rather than deferring to the
backend. The fix for clang is handled in a separate change.

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

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

6 years ago[X86] Don't use the MSVC stack protector names on mingw
Martin Storsjo [Tue, 20 Mar 2018 20:37:51 +0000 (20:37 +0000)]
[X86] Don't use the MSVC stack protector names on mingw

Mingw uses the same stack protector functions as GCC provides
on other platforms as well.

Patch by Valentin Churavy!

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

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

6 years agoFor llvm-objdump and Mach-O files, fix the printing of module init and
Kevin Enderby [Tue, 20 Mar 2018 20:29:52 +0000 (20:29 +0000)]
For llvm-objdump and Mach-O files, fix the printing of module init and
term sections from .o files to look to see if the pointers have a relocation
entry and if so print the symbol name from the relocation entry.  If not fall
back to the existing code and use the pointer value to look up that value
in the symbol table.

rdar://38337506

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

6 years ago[AArch64] Add vmulxh_lane fp16 vector intrinsic
Abderrazek Zaafrani [Tue, 20 Mar 2018 20:25:40 +0000 (20:25 +0000)]
[AArch64] Add vmulxh_lane fp16 vector intrinsic

https://reviews.llvm.org/D44591

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

6 years ago[TableGen] Use range based for loop. NFC
Craig Topper [Tue, 20 Mar 2018 20:24:16 +0000 (20:24 +0000)]
[TableGen] Use range based for loop. NFC

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

6 years ago[TableGen] Use vector::append instead of looping and calling push_back. NFC
Craig Topper [Tue, 20 Mar 2018 20:24:14 +0000 (20:24 +0000)]
[TableGen] Use vector::append instead of looping and calling push_back. NFC

Both vectors contain unsigned so we can just use append to do the copying. Not only is this shorter, but it should be able to predict the final size and only grow the vector once if needed.

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

6 years ago[TableGen] Use llvm::transform to simplify some loops. NFCI
Craig Topper [Tue, 20 Mar 2018 20:24:12 +0000 (20:24 +0000)]
[TableGen] Use llvm::transform to simplify some loops. NFCI

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

6 years ago[TableGen] Pass result of std::unique to vector::erase instead of calculating a size...
Craig Topper [Tue, 20 Mar 2018 20:24:10 +0000 (20:24 +0000)]
[TableGen] Pass result of std::unique to vector::erase instead of calculating a size and calling resize.

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

6 years ago[DEBUGINFO] Add -no-dwarf-debug-ranges option.
Alexey Bataev [Tue, 20 Mar 2018 20:21:38 +0000 (20:21 +0000)]
[DEBUGINFO] Add -no-dwarf-debug-ranges option.

Summary:
Added option -no-dwarf-debug-ranges option to disable emission of
.debug_ranges section.

Reviewers: probinson, echristo

Subscribers: aprantl, JDevlieghere, llvm-commits

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

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

6 years ago[llvm-mca] add keyword override to a couple of methods in BackendStatistics.
Andrea Di Biagio [Tue, 20 Mar 2018 20:18:36 +0000 (20:18 +0000)]
[llvm-mca] add keyword override to a couple of methods in BackendStatistics.

This should fix the buildbots after r328011.

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

6 years ago[WebAssembly] Added initial AsmParser implementation.
Derek Schuff [Tue, 20 Mar 2018 20:06:35 +0000 (20:06 +0000)]
[WebAssembly] Added initial AsmParser implementation.

It uses the MC framework and the tablegen matcher to do the
heavy lifting. Can handle both explicit and implicit locals
(-disable-wasm-explicit-locals). Comes with a small regression
test.

This is a first basic implementation that can parse most llvm .s
output and round-trips most instructions succesfully, but in order
to keep the commit small, does not address all issues.

There are a fair number of mismatches between what MC / assembly
matcher think a "CPU" should look like and what WASM provides,
some already have workarounds in this commit (e.g. the way it
deals with register operands) and some that require further work.
Some of that further work may involve changing what the
Disassembler outputs (and what s2wasm parses), so are probably
best left to followups.

Some known things missing:
- Many directives are ignored and not emitted.
- Vararg calls are parsed but extra args not emitted.
- Loop signatures are likely incorrect.
- $drop= is not emitted.
- Disassembler does not output SIMD types correctly, so assembler
  can't test them.

Patch by Wouter van Oortmerssen

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

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

6 years ago[AArch64] Adjust the cost model for Exynos M3
Evandro Menezes [Tue, 20 Mar 2018 20:00:29 +0000 (20:00 +0000)]
[AArch64] Adjust the cost model for Exynos M3

Fix typo in the number of integer dividers.

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

6 years ago[llvm-objcopy] Revert the tests from r328012
Alexander Shaposhnikov [Tue, 20 Mar 2018 19:50:14 +0000 (19:50 +0000)]
[llvm-objcopy] Revert the tests from r328012

Temporarily revert the tests from r328012 as well.

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

6 years ago[llvm-objcopy] Revert r328012
Alexander Shaposhnikov [Tue, 20 Mar 2018 19:46:00 +0000 (19:46 +0000)]
[llvm-objcopy] Revert r328012

Temporarily revert r328012 (since it broke down the big-endian bots),
will resubmit an updated version later.

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

6 years ago[Hexagon] Add a few more lit tests, NFC
Krzysztof Parzyszek [Tue, 20 Mar 2018 19:35:09 +0000 (19:35 +0000)]
[Hexagon] Add a few more lit tests, NFC

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

6 years ago[Hexagon] Add heuristic to exclude critical path cost for scheduling
Krzysztof Parzyszek [Tue, 20 Mar 2018 19:26:27 +0000 (19:26 +0000)]
[Hexagon] Add heuristic to exclude critical path cost for scheduling

Patch by Brendon Cahoon.

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

6 years ago[Hexagon] Fix fall-through warnings in HexagonMCDuplexInfo.cpp
Krzysztof Parzyszek [Tue, 20 Mar 2018 19:23:18 +0000 (19:23 +0000)]
[Hexagon] Fix fall-through warnings in HexagonMCDuplexInfo.cpp

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

6 years ago[MC,X86] Cleanup some X86 parser functions to use MCParser helpers. NFCI.
Nirav Dave [Tue, 20 Mar 2018 19:12:41 +0000 (19:12 +0000)]
[MC,X86] Cleanup some X86 parser functions to use MCParser helpers. NFCI.

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

6 years ago[llvm-mca] Remove const from a bunch of ArrayRef. NFC
Andrea Di Biagio [Tue, 20 Mar 2018 19:06:34 +0000 (19:06 +0000)]
[llvm-mca] Remove const from a bunch of ArrayRef. NFC

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

6 years ago[PowerPC][LegalizeFloatTypes] Move the PPC hacks for (i32 fp_to_sint/fp_to_uint ...
Craig Topper [Tue, 20 Mar 2018 18:49:28 +0000 (18:49 +0000)]
[PowerPC][LegalizeFloatTypes] Move the PPC hacks for (i32 fp_to_sint/fp_to_uint (ppcf128 X)) out of LegalizeFloatTypes and into PPC specific code

I'm not entirely sure these hacks are still needed. If you remove the hacks completely, the name of the library call that gets generated doesn't match the grep the test previously had. So the test wasn't really checking anything.

If the hack is still needed it belongs in PPC specific code. I believe the FP_TO_SINT code here is the only place in the tree where a FP_ROUND_INREG node is created today. And I don't think its even being used correctly because the legalization returned a BUILD_PAIR with the same value twice. That doesn't seem right to me. By moving the code entirely to PPC we can avoid creating the FP_ROUND_INREG at all.

I replaced the grep in the existing test with full checks generated by hacking update_llc_test_check.py to support ppc32 just long enough to generate it.

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

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

6 years ago[X86] Add phony registers for high halves of regs with low halves
Krzysztof Parzyszek [Tue, 20 Mar 2018 18:46:55 +0000 (18:46 +0000)]
[X86] Add phony registers for high halves of regs with low halves

Registers E[A-D]X, E[SD]I, E[BS]P, and EIP have 16-bit subregisters
that cover the low halves of these registers. This change adds artificial
subregisters for the high halves in order to differentiate (in terms of
register units) between the 32- and the low 16-bit registers.

This patch contains parts that aim to preserve the calculated register
pressure. This is in order to preserve the current codegen (minimize the
impact of this patch). The approach of having artificial subregisters
could be used to fix PR23423, but the pressure calculation would need
to be changed.

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

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

6 years ago[MustExecute] Use the annotation style printer
Philip Reames [Tue, 20 Mar 2018 18:43:44 +0000 (18:43 +0000)]
[MustExecute] Use the annotation style printer

As suggested in the original review (https://reviews.llvm.org/D44524), use an annotation style printer instead.

Note: The switch from -analyze to -disable-output in tests was driven by the fact that seems to be the idiomatic style used in annoation passes.  I tried to keep both working, but the old style pass API for printers really doesn't make this easy.  It invokes (runOnFunction, print(Module)) repeatedly.  I decided the extra state wasn't worth it given the old pass manager is going away soonish anyway.

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

6 years agoRevert "Resubmit "Support embedding natvis files in PDBs.""
Zachary Turner [Tue, 20 Mar 2018 18:37:03 +0000 (18:37 +0000)]
Revert "Resubmit "Support embedding natvis files in PDBs.""

This is still failing on a different bot this time due to some
issue related to hashing absolute paths.  Reverting until I can
figure it out.

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

6 years ago[llvm-objcopy] Implement support for section groups
Alexander Shaposhnikov [Tue, 20 Mar 2018 18:20:42 +0000 (18:20 +0000)]
[llvm-objcopy] Implement support for section groups

This diff adds support for SHT_GROUP sections to llvm-objcopy.
Some sections are interrelated and comprise a group.
For example, a definition of an inline function might require,
in addition to the section containing its instructions,
a read-only data section containing literals referenced inside the function.
A section of the type SHT_GROUP contains the indices of the group members,
therefore, it needs to be updated whenever the indices change.
Similarly, the fields sh_link, sh_info should be recalculated as well.

Test plan: make check-all

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

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

6 years ago[llvm-mca] Move the logic that computes the scheduler's queue usage to the BackendSta...
Andrea Di Biagio [Tue, 20 Mar 2018 18:20:39 +0000 (18:20 +0000)]
[llvm-mca] Move the logic that computes the scheduler's queue usage to the BackendStatistics view.

This patch introduces two new callbacks in the event listener interface to
handle the "buffered resource reserved" event and the "buffered resource
released" event. Every time a buffered resource is used, an event is generated.

Before this patch, the Scheduler (with the help of the ResourceManager) was
responsible for tracking the scheduler's queue usage. However, that design
forced the Scheduler to 'publish' scheduler's queue pressure information through
the Backend interface.

The goal of this patch is to break the dependency between the BackendStatistics
view, and the Backend. Now the Scheduler knows how to notify "buffer
reserved/released" events.  The scheduler's queue usage analysis has been moved
to the BackendStatistics.

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

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

6 years ago[NVPTX] Make tensor load/store intrinsics overloaded.
Artem Belevich [Tue, 20 Mar 2018 17:18:59 +0000 (17:18 +0000)]
[NVPTX] Make tensor load/store intrinsics overloaded.

This way we can support address-space specific variants without explicitly
encoding the space in the name of the intrinsic. Less intrinsics to deal with ->
less boilerplate.

Added a bit of tablegen magic to match/replace an intrinsics with a pointer
argument in particular address space with the space-specific instruction
variant.

Updated tests to use non-default address spaces.

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

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

6 years agoAdd an analysis printer for must execute reasoning
Philip Reames [Tue, 20 Mar 2018 17:09:21 +0000 (17:09 +0000)]
Add an analysis printer for must execute reasoning

Many of our loop passes make use of so called "must execute" or "guaranteed to execute" facts to prove the legality of code motion. The basic notion is that we know (by assumption) an instruction didn't fault at it's original location, so if the location we move it to is strictly post dominated by the original, then we can't have introduced a new fault.

At the moment, the testing for this logic is somewhat adhoc and done mostly through LICM. Since I'm working on that code, I want to improve the testing. This patch is the first step in that direction. It doesn't actually test the variant used by the loop passes - I need to move that to the Analysis library first - but instead exercises an alternate implementation used by SCEV. (I plan on merging both implementations.)

Note: I'll be replacing the printing logic within this with an annotation based version in the near future.  Anna suggested this in review, and it seems like a strictly better format.

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

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

6 years agoMC: fix layering violation introduced in r325139.
Rafael Espindola [Tue, 20 Mar 2018 17:07:25 +0000 (17:07 +0000)]
MC: fix layering violation introduced in r325139.

Move AsmToken from MC/MCParser/MCAsmLexer.h into MC/MCAsmMacro.h in
order to avoid MCAsmMacro definition depending on MCParser.

Patch by Roger Pau MonnĂ© <royger@freebsd.org>.

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

6 years agoResubmit "Support embedding natvis files in PDBs."
Zachary Turner [Tue, 20 Mar 2018 17:06:39 +0000 (17:06 +0000)]
Resubmit "Support embedding natvis files in PDBs."

The issue causing this to fail in certain configurations
should be fixed.

It was due to the fact that DIA apparently expects there to be
a null string at ID 1 in the string table.  I'm not sure why this
is important but it seems to make a difference, so set it.

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

6 years ago[LangRef] fix link formatting
Sanjay Patel [Tue, 20 Mar 2018 17:05:19 +0000 (17:05 +0000)]
[LangRef] fix link formatting

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

6 years ago[Hexagon] Correct the computation of TopReadyCycle and BotReadyCycle of SU
Krzysztof Parzyszek [Tue, 20 Mar 2018 17:03:27 +0000 (17:03 +0000)]
[Hexagon] Correct the computation of TopReadyCycle and BotReadyCycle of SU

TopReadyCycle and BotReadyCycle were off by one cycle when an SU is either
the first instruction or the last instruction in a packet.

Patch by Ikhlas Ajbar.

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

6 years ago[XRay] Lazily compute MachineLoopInfo instead of requiring it.
Michael Zolotukhin [Tue, 20 Mar 2018 17:02:29 +0000 (17:02 +0000)]
[XRay] Lazily compute MachineLoopInfo instead of requiring it.

Summary:
Currently X-Ray Instrumentation pass has a dependency on MachineLoopInfo
(and thus on MachineDominatorTree as well) and we have to compute them
even if X-Ray is not used. This patch changes it to a lazy computation
to save compile time by avoiding these redundant computations.

Reviewers: dberris, kubamracek

Subscribers: llvm-commits, hiraditya

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

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

6 years ago[LangRef] describe the default FP environment
Sanjay Patel [Tue, 20 Mar 2018 16:38:22 +0000 (16:38 +0000)]
[LangRef] describe the default FP environment

Follow-up for D44216: add a section and examples to describe the FP env.
Also, add pointers from the FP instructions to this new section to reduce
bloat.

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

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

6 years ago[Hexagon] Check weak dependences when only 1 instruction is available
Krzysztof Parzyszek [Tue, 20 Mar 2018 16:22:06 +0000 (16:22 +0000)]
[Hexagon] Check weak dependences when only 1 instruction is available

Patch by Brendon Cahoon.

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

6 years ago[AArch64] add fabs tests for PR36600; NFC
Sanjay Patel [Tue, 20 Mar 2018 16:08:47 +0000 (16:08 +0000)]
[AArch64] add fabs tests for PR36600; NFC

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

6 years ago[DEBUGINFO] Add flag -no-dwarf-pub-sections to disable pub sections.
Alexey Bataev [Tue, 20 Mar 2018 16:04:40 +0000 (16:04 +0000)]
[DEBUGINFO] Add flag -no-dwarf-pub-sections to disable pub sections.

Summary:
Added a flag -no-dwarf-pub-sections, which allows to disable
emission of DWARF public sections.

Reviewers: probinson, echristo

Subscribers: aprantl, JDevlieghere, llvm-commits

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

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

6 years ago[X86][Haswell][Znver1] Fix typo in fldl instregexs
Simon Pilgrim [Tue, 20 Mar 2018 15:44:47 +0000 (15:44 +0000)]
[X86][Haswell][Znver1] Fix typo in fldl instregexs

Missing comma was casing 2 instregex entries to be concatenated together by mistake.

Found while investigating PR35548

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

6 years ago[Kaleidoscope] doc fix
Sjoerd Meijer [Tue, 20 Mar 2018 15:37:15 +0000 (15:37 +0000)]
[Kaleidoscope] doc fix

This fixes the compile command of the example in Chapter 2.

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

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

6 years ago[Hexagon] Improve scheduling heuristic for large basic blocks
Krzysztof Parzyszek [Tue, 20 Mar 2018 14:54:01 +0000 (14:54 +0000)]
[Hexagon] Improve scheduling heuristic for large basic blocks

This patch changes the isLatencyBound heuristic to look at the
path length based upon the number of packets needed to schedule
a basic block. For small basic blocks, the heuristic uses a small
threshold for isLatencyBound. For large basic blocks, the
heuristic uses a large threshold.

The goal is to increase the priority of an instruction in a small
basic block that has a large height or depth relative to the code
size. For large functions, the height and depth are ignored
because it increases the live range of a register and causes more
spills. That is, for large functions, it is more important to
schedule instructions when available, and attempt to keep the defs
and uses closer together.

Patch by Brendon Cahoon.

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