]> granicus.if.org Git - llvm/log
llvm
6 years ago[MC] Add a separate flag for skipping comdat constant sections for MinGW. NFC.
Martin Storsjo [Mon, 23 Jul 2018 22:15:25 +0000 (22:15 +0000)]
[MC] Add a separate flag for skipping comdat constant sections for MinGW. NFC.

This actually has nothing to do with the associative comdat sections
that aren't supported by GNU binutils ld.

Clarify the comments from SVN r335918 and use a separate flag for it.

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

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

6 years ago[COFF] Fix assembly output of comdat sections without an attached symbol
Martin Storsjo [Mon, 23 Jul 2018 22:15:19 +0000 (22:15 +0000)]
[COFF] Fix assembly output of comdat sections without an attached symbol

Since SVN r335286, the .xdata sections are produced without an attached
symbol, which requires using a different syntax when printing assembly
output.

Instead of the usual syntax of '.section <name>,"dr",discard,<symbol>',
use '.section <name>,"dr"' + '.linkonce discard' (which is what GCC
uses for all assembly output).

This fixes PR38254.

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

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

6 years ago[AArch64] Use MCAsmInfoMicrosoft and MCAsmInfoGNUCOFF as base classes
Martin Storsjo [Mon, 23 Jul 2018 22:15:14 +0000 (22:15 +0000)]
[AArch64] Use MCAsmInfoMicrosoft and MCAsmInfoGNUCOFF as base classes

This matches the structure used on X86 and ARM. This requires
a little bit of duplication of the parts that are equal in both
AArch64 COFF variants though.

Before SVN r335286, these classes didn't add anything that MCAsmInfoCOFF
didn't, but now they do.

This makes AArch64 match X86 in how comdat is used for float constants
for MinGW.

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

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

6 years ago[utils] Fix the llvm::Optional data formatter
Vedant Kumar [Mon, 23 Jul 2018 21:59:06 +0000 (21:59 +0000)]
[utils] Fix the llvm::Optional data formatter

The llvm::Optional data formatter needs to look through the `Storage`
container if it's present.

Before:

   220    if (Op && Op->getOp() != dwarf::DW_OP_LLVM_fragment)
-> 221      HasComplexExpression = true;
   222
   223    // If the register can only be described by a complex expression (i.e.,
   224    // multiple subregisters) it doesn't safely compose with another complex
Target 0: (llc) stopped.
(lldb) p Op
(llvm::Optional<llvm::DIExpression::ExprOperand>) $0 = None

After:

(lldb) p Op
(llvm::Optional<llvm::DIExpression::ExprOperand>) $0 =
(llvm::DIExpression::ExprOperand) storage = {
  Op = 0x000000010603d460
}

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

6 years ago[SelectionDAG] Reduce DanglingDebugInfo memory traffic, NFC
Vedant Kumar [Mon, 23 Jul 2018 21:59:04 +0000 (21:59 +0000)]
[SelectionDAG] Reduce DanglingDebugInfo memory traffic, NFC

This avoids approx. 2 x 10^5 DenseMap insertions in both non-debug and
debug -O2 builds of the sqlite3 amalgamation.

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

6 years ago[ThinLTO] Ensure the TargetLibraryInfo is constructed early enough
Teresa Johnson [Mon, 23 Jul 2018 21:58:19 +0000 (21:58 +0000)]
[ThinLTO] Ensure the TargetLibraryInfo is constructed early enough

Summary:
Without this change, the WholeProgramDevirt pass, which requires the
TargetLibraryInfo, will construct one from the default triple.

Fixes PR38139.

Reviewers: pcc

Subscribers: mehdi_amini, inglorion, steven_wu, dexonsmith, llvm-commits

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

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

6 years ago[DebugCounters] Keep track of total counts
George Burgess IV [Mon, 23 Jul 2018 21:49:36 +0000 (21:49 +0000)]
[DebugCounters] Keep track of total counts

This patch makes debug counters keep track of the total number of times
we've called `shouldExecute` for each counter, so it's easier to build
automated tooling on top of these.

A patch to print these counts is coming soon.

Patch by Zhizhou Yang!

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

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

6 years ago[gdb] Fix SmallVector pretty printer after r337514
Fangrui Song [Mon, 23 Jul 2018 21:33:51 +0000 (21:33 +0000)]
[gdb] Fix SmallVector pretty printer after r337514

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

6 years agoConstantFolding: Avoid a crash.
Manoj Gupta [Mon, 23 Jul 2018 21:20:00 +0000 (21:20 +0000)]
ConstantFolding: Avoid a crash.

Summary:
Check if the parent basic block and caller exists
before calling CS.getCaller when constant folding
strip.invariant.group instrinsic.

This avoids a crash when the function containing the intrinsic
is being inlined. The instruction is checked for any simplifiction
but has not yet been added to a basic block.

Reviewers: Prazek, rsmith, efriedma

Reviewed By: efriedma

Subscribers: eraman, llvm-commits

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

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

6 years agoRe-land r335297 "[X86] Implement more of x86-64 large and medium PIC code models"
Reid Kleckner [Mon, 23 Jul 2018 21:14:35 +0000 (21:14 +0000)]
Re-land r335297 "[X86] Implement more of x86-64 large and medium PIC code models"

Don't try to generate large PIC code for non-ELF targets. Neither COFF
nor MachO have relocations for large position independent code, and
users have been using "large PIC" code models to JIT 64-bit code for a
while now. With this change, if they are generating ELF code, their
JITed code will truly be PIC, but if they target MachO or COFF, it will
contain 64-bit immediates that directly reference external symbols. For
a JIT, that's perfectly fine.

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

6 years ago[llvm-mca][docs] Define IPC where it is first mentioned. NFC.
Matt Davis [Mon, 23 Jul 2018 21:10:50 +0000 (21:10 +0000)]
[llvm-mca][docs] Define IPC where it is first mentioned. NFC.

Expand the abbreviation where it is first used, and use IPC elsewhere.

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

6 years agoFix RegScavenger::unprocess
David Greene [Mon, 23 Jul 2018 20:23:50 +0000 (20:23 +0000)]
Fix RegScavenger::unprocess

RegScavenger::unprocess walks backward, so it should undo the effects
of defs before undoing effects of kills. Previously it did things in
the opposite order, leaving a register apparently unused (dead) in the
case where an instruction both used (killed) and defined a register.

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

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

6 years agoAdd inline asm aliasing test.
Nirav Dave [Mon, 23 Jul 2018 20:19:10 +0000 (20:19 +0000)]
Add inline asm aliasing test.

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

6 years agoRevert "[docs] Add support for Markdown documentation in Sphinx"
Michael J. Spencer [Mon, 23 Jul 2018 20:00:32 +0000 (20:00 +0000)]
Revert "[docs] Add support for Markdown documentation in Sphinx"

Looks like this bot hasn't been updated yet.

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

6 years ago[docs] Add support for Markdown documentation in Sphinx
Michael J. Spencer [Mon, 23 Jul 2018 19:49:34 +0000 (19:49 +0000)]
[docs] Add support for Markdown documentation in Sphinx

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

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

6 years ago[yaml2obj] Add default sh_entsize for dynamic sections
Paul Semel [Mon, 23 Jul 2018 18:49:04 +0000 (18:49 +0000)]
[yaml2obj] Add default sh_entsize for dynamic sections

Dynamic section holds a table, so the sh_entsize might be set. As the
dynamic section entry size never changes, we can default it to the size
of a dynamic entry.

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

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

6 years ago[Hexagon] Handle unnamed globals in HexagonConstExpr
Krzysztof Parzyszek [Mon, 23 Jul 2018 18:30:17 +0000 (18:30 +0000)]
[Hexagon] Handle unnamed globals in HexagonConstExpr

Instead of comparing names, compare positions in the parent module.

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

6 years ago[Demangle] Attempt to fix arena memory leak
Reid Kleckner [Mon, 23 Jul 2018 18:21:43 +0000 (18:21 +0000)]
[Demangle] Attempt to fix arena memory leak

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

6 years agoFixing a typo; NFC.
Aaron Ballman [Mon, 23 Jul 2018 18:09:43 +0000 (18:09 +0000)]
Fixing a typo; NFC.

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

6 years ago[lit] Move the shtest-xunit-output check lines into shtest-format
Justin Bogner [Mon, 23 Jul 2018 18:08:36 +0000 (18:08 +0000)]
[lit] Move the shtest-xunit-output check lines into shtest-format

These two tests are operating on the same test suite, which causes
them to be racy about writing temporary files and can cause spurious
failures. Merge them into one test to avoid the issue.

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

6 years ago[ARM] Use unique_ptr to fix memory leak introduced in r337701
Fangrui Song [Mon, 23 Jul 2018 17:43:21 +0000 (17:43 +0000)]
[ARM] Use unique_ptr to fix memory leak introduced in r337701

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

6 years agoOpChain has subclasses, so add a virtual destructor.
Jordan Rupprecht [Mon, 23 Jul 2018 17:38:05 +0000 (17:38 +0000)]
OpChain has subclasses, so add a virtual destructor.

Summary:
OpChain has subclasses, so add a virtual destructor.

This fixes an issue when deleting subclasses of OpChain (see MatchSMLAD() specifically) in r337701.

Reviewers: javed.absar

Subscribers: llvm-commits, SjoerdMeijer, samparker

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

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

6 years ago[ARM] Follow-up to r337709.
Matt Morehouse [Mon, 23 Jul 2018 17:22:53 +0000 (17:22 +0000)]
[ARM] Follow-up to r337709.

Fix double-free.

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

6 years ago[ARM] Add doFinalization() to ARMCodeGenPrepare pass.
Matt Morehouse [Mon, 23 Jul 2018 17:00:45 +0000 (17:00 +0000)]
[ARM] Add doFinalization() to ARMCodeGenPrepare pass.

Attempt to fix the leak introduced in r337687 and make sanitizer
buildbots green again.

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

6 years ago[Legalize] Elide MERGE_VALUES created by scalarizeVectorLoad.
Nirav Dave [Mon, 23 Jul 2018 16:43:42 +0000 (16:43 +0000)]
[Legalize] Elide MERGE_VALUES created by scalarizeVectorLoad.

scalarizeVectorLoad creates MERGE_VALUES nodes which are immediately
decomposed in expandLoad. Elide the node in these cases.

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

6 years ago[mips] Add more checks to the tls.ll test case. NFC
Simon Atanasyan [Mon, 23 Jul 2018 16:05:44 +0000 (16:05 +0000)]
[mips] Add more checks to the tls.ll test case. NFC

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

6 years ago[ARM][NFC] ParallelDSP reorganisation
Sam Parker [Mon, 23 Jul 2018 15:25:59 +0000 (15:25 +0000)]
[ARM][NFC] ParallelDSP reorganisation

In preparing to allow ARMParallelDSP pass to parallelise more than
smlads, I've restructed some elements:

- The ParallelMAC struct has been renamed to BinOpChain.
- The BinOpChain struct holds two value lists: LHS and RHS, as well
  as inheriting from the OpChain base class.
- The OpChain struct holds all the values of the represented chain
  and has had the memory locations functionality inserted into it.
- ParallelMACList becomes OpChainList and it now holds pointers
  instead of objects.

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

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

6 years ago[SystemZ] Fix dumpSU() method in SystemZHazardRecognizer.
Jonas Paulsson [Mon, 23 Jul 2018 15:08:35 +0000 (15:08 +0000)]
[SystemZ]  Fix dumpSU() method in SystemZHazardRecognizer.

Two minor issues: The new MCD SchedWrite name does not contain "Unit" like
all the others, so a check is needed. Also, print "LSU" instead of "LS".

Review: Ulrich Weigand

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

6 years ago[FPEnv] Legalize double width StrictFP vector operations
Cameron McInally [Mon, 23 Jul 2018 14:40:17 +0000 (14:40 +0000)]
[FPEnv] Legalize double width StrictFP vector operations

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

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

6 years ago[Docs] Fix LLVM_YAML_IS_DOCUMENT_LIST_VECTOR
Jonas Devlieghere [Mon, 23 Jul 2018 14:17:43 +0000 (14:17 +0000)]
[Docs] Fix LLVM_YAML_IS_DOCUMENT_LIST_VECTOR

The docs incorrectly said to repeat std::vector inside
LLVM_YAML_IS_DOCUMENT_LIST_VECTOR.

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

7 years ago[ARM] ARMCodeGenPrepare backend pass
Sam Parker [Mon, 23 Jul 2018 12:27:47 +0000 (12:27 +0000)]
[ARM] ARMCodeGenPrepare backend pass

Arm specific codegen prepare is implemented to perform type promotion
on icmp operands, which can enable the removal of uxtb and uxth
(unsigned extend) instructions. This is possible because performing
type promotion before ISel alleviates this duty from the DAG builder
which has to perform legalisation, but has a limited view on data
ranges.

The pass visits any instruction operand of an icmp and creates a
worklist to traverse the use-def tree to determine whether the values
can simply be promoted. Our concern is values in the registers
overflowing the narrow (i8, i16) data range, so instructions marked
with nuw can be promoted easily. For add and sub instructions, we are
able to use the parallel dsp instructions to operate on scalar data
types and avoid overflowing bits. Underflowing adds and subs are also
permitted when the result is only used by an unsigned icmp.

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

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

7 years ago[GVN] Don't use the eliminated load as an available value in phi construction
John Brawn [Mon, 23 Jul 2018 12:14:45 +0000 (12:14 +0000)]
[GVN] Don't use the eliminated load as an available value in phi construction

In ConstructSSAForLoadSet if an available value is actually the load that we're
doing SSA construction to eliminate, then we can omit it as SSAUpdate will add
in the value for the phi that will be replacing it anyway. This can result in
simpler IR which can allow further optimisation.

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

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

7 years ago[MemorySSAUpdater] Update Phi operands after trivial Phi elimination
Alexandros Lamprineas [Mon, 23 Jul 2018 10:56:30 +0000 (10:56 +0000)]
[MemorySSAUpdater] Update Phi operands after trivial Phi elimination

Bug fix for PR37445. The underlying problem and its fix are similar to PR37808.
The bug lies in MemorySSAUpdater::getPreviousDefRecursive(), where PhiOps is
computed before the call to tryRemoveTrivialPhi() and it ends up being out of
date, pointing to stale data. We have now turned each of the PhiOps into a
TrackingVH<MemoryAccess>.

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

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

7 years ago[Support] Add a UniqueStringSaver: like StringSaver, but deduplicating.
Sam McCall [Mon, 23 Jul 2018 10:44:40 +0000 (10:44 +0000)]
[Support] Add a UniqueStringSaver: like StringSaver, but deduplicating.

Summary: Clarify contract of StringSaver (it null-terminates, callers rely on it).

Reviewers: hokein

Subscribers: llvm-commits

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

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

7 years ago[NFC][MCA] ZnVer1: Update RegisterFile to identify false dependencies on partially...
Roman Lebedev [Mon, 23 Jul 2018 10:10:13 +0000 (10:10 +0000)]
[NFC][MCA] ZnVer1: Update RegisterFile to identify false dependencies on partially written registers.

Summary:
Pretty mechanical follow-up for D49196.

As microarchitecture.pdf notes, "20 AMD Ryzen pipeline",
"20.8 Register renaming and out-of-order schedulers":
  The integer register file has 168 physical registers of 64 bits each.
  The floating point register file has 160 registers of 128 bits each.
"20.14 Partial register access":
  The processor always keeps the different parts of an integer register together.
  ...
  An instruction that writes to part of a register will therefore have a false dependence
  on any previous write to the same register or any part of it.

Reviewers: andreadb, courbet, RKSimon, craig.topper, GGanesh

Reviewed By: GGanesh

Subscribers: gbedwell, llvm-commits

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

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

7 years ago[NFC][MCA] ZnVer1: add partial-reg-update tests
Roman Lebedev [Mon, 23 Jul 2018 10:10:04 +0000 (10:10 +0000)]
[NFC][MCA] ZnVer1: add partial-reg-update tests

Reviewers: andreadb, courbet, RKSimon, craig.topper, GGanesh

Reviewed By: GGanesh

Subscribers: gbedwell, llvm-commits

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

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

7 years ago[GVNHoist] safeToHoistLdSt allows illegal hoisting
Alexandros Lamprineas [Mon, 23 Jul 2018 09:42:35 +0000 (09:42 +0000)]
[GVNHoist] safeToHoistLdSt allows illegal hoisting

Bug fix for PR36787. When reasoning if it's safe to hoist a load we
want to make sure that the defining memory access dominates the new
insertion point of the hoisted instruction. safeToHoistLdSt calls
firstInBB(InsertionPoint,DefiningAccess) which returns false if
InsertionPoint == DefiningAccess, and therefore it falsely thinks
it's safe to hoist.

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

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

7 years ago[x86/SLH] Fix a bug where we would harden tail calls twice -- once as
Chandler Carruth [Mon, 23 Jul 2018 07:56:15 +0000 (07:56 +0000)]
[x86/SLH] Fix a bug where we would harden tail calls twice -- once as
a call, and then again as a return.

Also added a comment to try and explain better why we would be doing
what we're doing when hardening the (non-call) returns.

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

7 years ago[x86/SLH] Add a test covering indirect forms of control flow. NFC.
Chandler Carruth [Mon, 23 Jul 2018 07:51:51 +0000 (07:51 +0000)]
[x86/SLH] Add a test covering indirect forms of control flow. NFC.

This specifically covers different ways of making indirect calls and
jumps. There are some bugs in SLH that I will be fixing in subsequent
patches where the diff in the generated instructions makes the bug fix
much more clear, so just checking in a baseline of this test to start.

I'm also going to be adding direct mitigation for variant 1.2 which this
file very specifically tests in the various forms it can arise on x86.
Again, the diff to the generated instructions should make the change for
that much more clear, so having the test as a baseline seems useful.

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

7 years ago[x86/SLH] Rename and comment the main hardening function. NFC.
Chandler Carruth [Mon, 23 Jul 2018 04:01:34 +0000 (04:01 +0000)]
[x86/SLH] Rename and comment the main hardening function. NFC.

This provides an overview of the algorithm used to harden specific
loads. It also brings this our terminology further in line with
hardening rather than checking.

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

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

7 years agoTest commit, fix a minor typo.
Jiading Gai [Sun, 22 Jul 2018 20:04:42 +0000 (20:04 +0000)]
Test commit, fix a minor typo.

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

7 years ago[X86] Remove the max vector width restriction from combineLoopMAddPattern and rely...
Craig Topper [Sun, 22 Jul 2018 19:44:35 +0000 (19:44 +0000)]
[X86] Remove the max vector width restriction from combineLoopMAddPattern and rely splitOpsAndApply to handle splitting.

This seems to be a net improvement. There's still an issue under avx512f where we have a 512-bit vpaddd, but not vpmaddwd so we end up doing two 256-bit vpmaddwds and inserting the results before a 512-bit vpaddd. It might be better to do two 512-bits paddds with zeros in the upper half. Same number of instructions, but breaks a dependency.

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

7 years ago[ORE] Move loop invariant ORE checks outside the PM loop.
Xin Tong [Sun, 22 Jul 2018 05:27:41 +0000 (05:27 +0000)]
[ORE] Move loop invariant ORE checks outside the PM loop.

Summary:
This takes 22ms out of ~20s compiling sqlite3.c because we call it
for every unit of compilation and every pass.

Reviewers: paquette, anemet

Subscribers: mehdi_amini, llvm-commits

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

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

7 years ago[SelectionDAGBuilder] Use APInt::isZero instead of comparing APInt::getZExtValue...
Craig Topper [Sun, 22 Jul 2018 05:16:50 +0000 (05:16 +0000)]
[SelectionDAGBuilder] Use APInt::isZero instead of comparing APInt::getZExtValue to 0 in a place where we can't be sure contents of the APInt fit in a uint64_t.

This is used on an extract vector element index which is most cases is going to be an i32 or i64 and the element will be a valid element number. But it is possible to construct IR with a larger type and large out of range value.

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

7 years ago[SelectionDAGBuilder] Restrict vector reduction check to types with a power of 2...
Craig Topper [Sun, 22 Jul 2018 05:16:49 +0000 (05:16 +0000)]
[SelectionDAGBuilder] Restrict vector reduction check to types with a power of 2 number of elements.

The check for the shuffles usages probably isn't correct for non power of 2 vectors.

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

7 years ago[X86] Add more MADD recurrence test cases with larger and narrower vector widths.
Craig Topper [Sun, 22 Jul 2018 05:16:47 +0000 (05:16 +0000)]
[X86] Add more MADD recurrence test cases with larger and narrower vector widths.

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

7 years ago[llvm-mca][docs] Add documentation for the statistic outputs from mca. NFC
Matt Davis [Sat, 21 Jul 2018 18:32:47 +0000 (18:32 +0000)]
[llvm-mca][docs] Add documentation for the statistic outputs from mca. NFC

Summary: The original text was lifted from the MCA README.  I re-ran the dot-product example and updated the output seen in the docs.  I also added a few paragraphs discussing the instruction issued and retired histograms, as well as discussing the register file stats.

Reviewers: andreadb, RKSimon, courbet, gbedwell, filcab

Reviewed By: andreadb

Subscribers: tschuett

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

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

7 years ago[mips] Factor out register class selection for global base register. NFC
Simon Atanasyan [Sat, 21 Jul 2018 16:16:08 +0000 (16:16 +0000)]
[mips] Factor out register class selection for global base register. NFC

Factor out register class selection for global base register into a
separate function to escape long chain of ternary operators.

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

7 years ago[mips] Move out the WrapperPat declaration from the NotInMicroMips predicate
Simon Atanasyan [Sat, 21 Jul 2018 16:16:03 +0000 (16:16 +0000)]
[mips] Move out the WrapperPat declaration from the NotInMicroMips predicate

This is a follow-up to the rL335185. Those commit adds some WrapperPat
patterns for microMIPS target. But declaration of the WrapperPat class
is under the NotInMicroMips predicate and microMIPS patterns cannot be
selected because predicate (Subtarget->inMicroMipsMode()) &&
(!Subtarget->inMicroMipsMode()) is always false.

This change move out the WrapperPat class declaration from the
NotInMicroMips predicate and enables microMIPS WrapperPat patterns.

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

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

7 years ago[llvm-undname] Flush output before demangling.
Zachary Turner [Sat, 21 Jul 2018 15:39:05 +0000 (15:39 +0000)]
[llvm-undname] Flush output before demangling.

If an error occurs and we write it to stderr, it could appear
before we wrote the mangled name which we're undecorating.
By flushing stdout first, we ensure that the messages are always
sequenced in the correct order.

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

7 years agoFix the MSVC Visualizers for SmallVector classes.
Zachary Turner [Sat, 21 Jul 2018 15:38:47 +0000 (15:38 +0000)]
Fix the MSVC Visualizers for SmallVector classes.

Recent changes to the internal structure of SmallVector<> broke
all of the MSVC visualizers.  This fixes them.

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

7 years agoEarly exit with cheaper checks
Aditya Kumar [Sat, 21 Jul 2018 14:13:44 +0000 (14:13 +0000)]
Early exit with cheaper checks

Reviewers: sebpop,davide,fhahn,trentxintong
Differential Revision: https://reviews.llvm.org/D49617

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

7 years ago[InstrSimplify] fold sdiv if two operands are negated and non-overflow
Chen Zheng [Sat, 21 Jul 2018 12:27:54 +0000 (12:27 +0000)]
[InstrSimplify] fold sdiv if two operands are negated and non-overflow

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

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

7 years ago[DebugInfo] Add a new DI flag to record if a C++ record is a trivial type
Aaron Smith [Sat, 21 Jul 2018 05:42:13 +0000 (05:42 +0000)]
[DebugInfo] Add a new DI flag to record if a C++ record is a trivial type

Summary:
This flag is used when emitting debug info and is needed to initialize subprogram and member function attributes (function options) for Codeview. These function options are used to create an accurate compiler type for UDT symbols (class/struct/union) from PDBs.

It is not easy to determine if a C++ record is trivial or not based on the current DICompositeType flags and other accessible debug information from Codeview. For example, without this flag the metadata for a non-trivial C++ record with user-defined ctor and a trivial one with a defaulted ctor are the same.

    struct S { S(); }
    struct S { S() = default; }

This change introduces a new DI flag and corresponding clang::CXXRecordDecl::isTrivial method to set the flag in the frontend.

Reviewers: rnk, zturner, llvm-commits, dblaikie, aleksandr.urakov, deadalnix

Reviewed By: rnk

Subscribers: asmith, probinson, aprantl, JDevlieghere

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

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

7 years ago[ORC] Re-apply r336760 with fixes.
Lang Hames [Sat, 21 Jul 2018 00:12:05 +0000 (00:12 +0000)]
[ORC] Re-apply r336760 with fixes.

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

7 years agoRe-apply r337595 with fix for LLVM_ENABLE_THREADS=Off.
Lang Hames [Fri, 20 Jul 2018 22:22:19 +0000 (22:22 +0000)]
Re-apply r337595 with fix for LLVM_ENABLE_THREADS=Off.

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

7 years ago[ADT] Only run death tests in !NDEBUG
Benjamin Kramer [Fri, 20 Jul 2018 22:15:09 +0000 (22:15 +0000)]
[ADT] Only run death tests in !NDEBUG

These invoke undefined behavior.

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

7 years ago[Hexagon] Disable packets in test to avoid ordering issues in checks
Krzysztof Parzyszek [Fri, 20 Jul 2018 21:55:55 +0000 (21:55 +0000)]
[Hexagon] Disable packets in test to avoid ordering issues in checks

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

7 years agoChange the cap on the amount of padding for each vtable to 32-byte (previously it...
Peter Collingbourne [Fri, 20 Jul 2018 21:43:20 +0000 (21:43 +0000)]
Change the cap on the amount of padding for each vtable to 32-byte (previously it was 128-byte)

We tested different cap values with a recent commit of Chromium. Our results show that the 32-byte cap yields the smallest binary and all the caps yield similar performance.
Based on the results, we propose to change the cap value to 32-byte.

Patch by Zhaomo Yang!

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

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

7 years agoAMDGPU: Use existing function to check for VGPRs
Matt Arsenault [Fri, 20 Jul 2018 21:20:36 +0000 (21:20 +0000)]
AMDGPU: Use existing function to check for VGPRs

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

7 years agoRevert "[X86][AVX] Convert X86ISD::VBROADCAST demanded elts combine to use SimplifyDe...
Benjamin Kramer [Fri, 20 Jul 2018 20:59:46 +0000 (20:59 +0000)]
Revert "[X86][AVX] Convert X86ISD::VBROADCAST demanded elts combine to use SimplifyDemandedVectorElts"

This reverts commit r337547. It triggers an infinite loop.

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

7 years ago[llvm-undname] Remove a superfluous semicolon. NFC.
Martin Storsjo [Fri, 20 Jul 2018 20:48:36 +0000 (20:48 +0000)]
[llvm-undname] Remove a superfluous semicolon. NFC.

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

7 years ago[COFF] Use symbolic constants instead of hardcoded numbers. NFCI.
Martin Storsjo [Fri, 20 Jul 2018 20:48:33 +0000 (20:48 +0000)]
[COFF] Use symbolic constants instead of hardcoded numbers. NFCI.

Patch by Martell Malone.

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

7 years ago[COFF] Adjust how we flag weak externals
Martin Storsjo [Fri, 20 Jul 2018 20:48:29 +0000 (20:48 +0000)]
[COFF] Adjust how we flag weak externals

This fixes PR36096.

Originally based on a patch by Martell Malone.

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

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

7 years ago[FileCheck] Provide an option for FileCheck to dump original input to stderr on failure
George Karpenkov [Fri, 20 Jul 2018 20:21:57 +0000 (20:21 +0000)]
[FileCheck] Provide an option for FileCheck to dump original input to stderr on failure

The option can be either set using environment variable (e.g. env
FILECHECK_DUMP_INPUT_ON_FAILURE=1 ninja check-fuzzer) or with a
FileCheck flag.

This can be extremely useful for debugging, cf.
https://groups.google.com/forum/#!topic/llvm-dev/kLrzg8OM_h8 for
discussion.

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

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

7 years agoRevert r337595 "[ORC] Add new symbol lookup methods to ExecutionSessionBase in prepar...
Reid Kleckner [Fri, 20 Jul 2018 20:20:45 +0000 (20:20 +0000)]
Revert r337595 "[ORC] Add new symbol lookup methods to ExecutionSessionBase in preparation for"

Breaks the build with LLVM_ENABLE_THREADS=OFF.

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

7 years agoReapply "[LSV] Refactoring + supporting bitcasts to a type of different size"
Roman Tereshin [Fri, 20 Jul 2018 20:10:04 +0000 (20:10 +0000)]
Reapply "[LSV] Refactoring + supporting bitcasts to a type of different size"

This reapplies commit r337489 reverted by r337541
Additionally, this commit contains a speculative fix to the issue reported in r337541
(the report does not contain an actionable reproducer, just a stack trace)

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

7 years ago[FileCheck] Fix search ranges for DAG-NOT-DAG
Joel E. Denny [Fri, 20 Jul 2018 20:09:56 +0000 (20:09 +0000)]
[FileCheck] Fix search ranges for DAG-NOT-DAG

A DAG-NOT-DAG is a CHECK-DAG group, X, followed by a CHECK-NOT group,
N, followed by a CHECK-DAG group, Y.  Let y be the initial directive
of Y.  This patch makes the following changes to the behavior:

    1. Directives in N can no longer match within part of Y's match
       range just because y happens not to be the earliest match from
       Y.  Specifically, this patch withdraws N's search range end
       from y's match range start to Y's match range start.

    2. y can no longer match within X's match range, where a y match
       produced a reordering complaint, which is thus no longer
       possible.  Specifically, this patch withdraws y's search range
       start from X's permitted range start to X's match range end,
       which was already the search range start for other members of
       Y.

Both of these changes can only increase the number of test passes: #1
constrains the ability of CHECK-NOTs to match, and #2 expands the
ability of CHECK-DAGs to match without complaints.

These changes are based on discussions at:

   <http://lists.llvm.org/pipermail/llvm-dev/2018-May/123550.html>
   <https://reviews.llvm.org/D47106>

which conclude that:

    1. These changes simplify the FileCheck conceptual model.  First,
       it makes search ranges for DAG-NOT-DAG more consistent with
       other cases.  Second, it was confusing that y was treated
       differently from the rest of Y.

    2. These changes add theoretical use cases for DAG-NOT-DAG that
       had no obvious means to be expressed otherwise.  We can justify
       the first half of this assertion with the observation that
       these changes can only increase the number of test passes.

    3. Reordering detection for DAG-NOT-DAG had no obvious real
       benefit.

We don't have evidence from real uses cases to help us debate
conclusions #2 and #3, but #1 at least seems intuitive.

Reviewed By: probinson

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

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

7 years ago[llvm-objcopy] Add basic support for --rename-section
Jordan Rupprecht [Fri, 20 Jul 2018 19:54:24 +0000 (19:54 +0000)]
[llvm-objcopy] Add basic support for --rename-section

Summary:
Add basic support for --rename-section=old=new to llvm-objcopy.

A full replacement for GNU objcopy requires also modifying flags (i.e. --rename-section=old=new,flag1,flag2); I'd like to keep that in a separate change to keep this simple.

Reviewers: jakehehrlich, alexshap

Subscribers: llvm-commits

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

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

7 years agoAnd add a lit substitution for llvm-undname, as the comment says to
Reid Kleckner [Fri, 20 Jul 2018 18:45:01 +0000 (18:45 +0000)]
And add a lit substitution for llvm-undname, as the comment says to

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

7 years agoRemove a superfluous semicolon
Martin Storsjo [Fri, 20 Jul 2018 18:43:42 +0000 (18:43 +0000)]
Remove a superfluous semicolon

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

7 years agoMake check-llvm depend on llvm-undname
Reid Kleckner [Fri, 20 Jul 2018 18:42:19 +0000 (18:42 +0000)]
Make check-llvm depend on llvm-undname

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

7 years ago[Demangler] Correctly factor in assignment when allocating.
Zachary Turner [Fri, 20 Jul 2018 18:35:06 +0000 (18:35 +0000)]
[Demangler] Correctly factor in assignment when allocating.

Incidentally all allocations that we currently perform were
properly aligned, but this was only an accident.

Thanks to Erik Pilkington for catching this.

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

7 years ago[ORC] Add new symbol lookup methods to ExecutionSessionBase in preparation for
Lang Hames [Fri, 20 Jul 2018 18:31:53 +0000 (18:31 +0000)]
[ORC] Add new symbol lookup methods to ExecutionSessionBase in preparation for
deprecating SymbolResolver and AsynchronousSymbolQuery.

Both lookup overloads take a VSO search order to perform the lookup. The first
overload is non-blocking and takes OnResolved and OnReady callbacks. The second
is blocking, takes a boolean flag to indicate whether to wait until all symbols
are ready, and returns a SymbolMap. Both overloads take a RegisterDependencies
function to register symbol dependencies (if any) on the query.

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

7 years ago[ORC] Simplify VSO::lookupFlags to return the flags map.
Lang Hames [Fri, 20 Jul 2018 18:31:52 +0000 (18:31 +0000)]
[ORC] Simplify VSO::lookupFlags to return the flags map.

This discards the unresolved symbols set and returns the flags map directly
(rather than mutating it via the first argument).

The unresolved symbols result made it easy to chain lookupFlags calls, but such
chaining should be rare to non-existant (especially now that symbol resolvers
are being deprecated) so the simpler method signature is preferable.

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

7 years ago[ORC] Replace SymbolResolvers in the new ORC layers with search orders on VSOs.
Lang Hames [Fri, 20 Jul 2018 18:31:50 +0000 (18:31 +0000)]
[ORC] Replace SymbolResolvers in the new ORC layers with search orders on VSOs.

A search order is a list of VSOs to be searched linearly to find symbols. Each
VSO now has a search order that will be used when fixing up definitions in that
VSO. Each VSO's search order defaults to just that VSO itself.

This is a first step towards removing symbol resolvers from ORC altogether. In
practice symbol resolvers tended to be used to implement a search order anyway,
sometimes with additional programatic generation of symbols. Now that VSOs
support programmatic generation of definitions via fallback generators, search
orders provide a cleaner way to achieve the desired effect (while removing a lot
of boilerplate).

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

7 years ago[Demangler] Add missing overrides
Benjamin Kramer [Fri, 20 Jul 2018 18:22:12 +0000 (18:22 +0000)]
[Demangler] Add missing overrides

-Winconsistent-missing-override complains about this.

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

7 years agoFix a few warnings and style issues in MS demangler.
Zachary Turner [Fri, 20 Jul 2018 18:07:33 +0000 (18:07 +0000)]
Fix a few warnings and style issues in MS demangler.

Also remove a broken test case.

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

7 years ago[X86] Remove isel patterns for MOVSS/MOVSD ISD opcodes with integer types.
Craig Topper [Fri, 20 Jul 2018 17:57:53 +0000 (17:57 +0000)]
[X86] Remove isel patterns for MOVSS/MOVSD ISD opcodes with integer types.

Ideally our ISD node types going into the isel table would have types consistent with their instruction domain. This prevents us having to duplicate patterns with different types for the same instruction.

Unfortunately, it seems our shuffle combining is currently relying on this a little remove some bitcasts. This seems to enable some switching between shufps and shufd. Hopefully there's some way we can address this in the combining.

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

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

7 years ago[X86] Remove what appear to be unnecessary uses of DCI.CombineTo
Craig Topper [Fri, 20 Jul 2018 17:57:42 +0000 (17:57 +0000)]
[X86] Remove what appear to be unnecessary uses of DCI.CombineTo

CombineTo is most useful when you need to replace multiple results, avoid the worklist management, or you need to something else after the combine, etc. Otherwise you should be able to just return the new node and let DAGCombiner go through its usual worklist code.

All of the places changed in this patch look to be standard cases where we should be able to use the more stand behavior of just returning the new node.

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

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

7 years agoFix linker failure with Any.
Zachary Turner [Fri, 20 Jul 2018 17:50:53 +0000 (17:50 +0000)]
Fix linker failure with Any.

This is due to a difference in MS ABI which is why I didn't see
it locally.  The included fix should work on all compilers.

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

7 years ago[llvm-mca][x86] Add movsx/movzx instructions to general x86_64 resource tests
Simon Pilgrim [Fri, 20 Jul 2018 17:43:42 +0000 (17:43 +0000)]
[llvm-mca][x86] Add movsx/movzx instructions to general x86_64 resource tests

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

7 years agoAdd a Microsoft Demangler.
Zachary Turner [Fri, 20 Jul 2018 17:27:48 +0000 (17:27 +0000)]
Add a Microsoft Demangler.

This adds initial support for a demangling library (LLVMDemangle)
and tool (llvm-undname) for demangling Microsoft names.  This
doesn't cover 100% of cases and there are some known limitations
which I intend to address in followup patches, at least until such
time that we have (near) 100% test coverage matching up with all
of the test cases in clang/test/CodeGenCXX/mangle-ms-*.

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

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

7 years ago[Any] Fix a typo: didn't use the correct argument
Philip Pfaffe [Fri, 20 Jul 2018 17:24:11 +0000 (17:24 +0000)]
[Any] Fix a typo: didn't use the correct argument

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

7 years ago[MemorySSA] Add API to update MemoryPhis, following CFG changes.
Alina Sbirlea [Fri, 20 Jul 2018 17:13:05 +0000 (17:13 +0000)]
[MemorySSA] Add API to update MemoryPhis, following CFG changes.

Summary:
When splitting predecessors in BasicBlockUtils, we create a new block as an immediate predecessor of the original BB, then we connect a given set of predecessors to the new block.
The API in this patch will be used to update MemoryPhis for this CFG change.
If all predecessors are being moved, we move the MemoryPhi directly. Otherwise we create a new MemoryPhi in the NewBB and populate its incoming values, while deleting them from BB's Phi.
[Split from D45299 for easier review]

Reviewers: george.burgess.iv

Subscribers: sanjoy, jlebar, Prazek, llvm-commits

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

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

7 years ago[X86][XOP] Fix SUB constant folding for VPSHA/VPSHL shift lowering
Simon Pilgrim [Fri, 20 Jul 2018 16:55:18 +0000 (16:55 +0000)]
[X86][XOP] Fix SUB constant folding for VPSHA/VPSHL shift lowering

We can safely use getConstant here as we're still lowering, which allows constant folding to kick in and simplify the vector shift codegen.

Noticed while working on D49562.

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

7 years ago[MSan] Hotfix compilation
Alexander Potapenko [Fri, 20 Jul 2018 16:52:12 +0000 (16:52 +0000)]
[MSan] Hotfix compilation

Make sure NewSI is used in materializeStores()

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

7 years agoChange bool_constant to integral_constant.
Zachary Turner [Fri, 20 Jul 2018 16:51:55 +0000 (16:51 +0000)]
Change bool_constant to integral_constant.

bool_constant is C++17.

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

7 years ago[ARM] Add new feature to enable optimizing the VFP registers
Evandro Menezes [Fri, 20 Jul 2018 16:49:28 +0000 (16:49 +0000)]
[ARM] Add new feature to enable optimizing the VFP registers

Enable the optimization of operations on DPR and SPR via a feature instead
of checking the target.

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

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

7 years agoAdd llvm::Any.
Zachary Turner [Fri, 20 Jul 2018 16:39:32 +0000 (16:39 +0000)]
Add llvm::Any.

This is analogous to std::any which is only available in C++17.

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

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

7 years agoRewrite the VS integration scripts.
Zachary Turner [Fri, 20 Jul 2018 16:30:02 +0000 (16:30 +0000)]
Rewrite the VS integration scripts.

This is a new modernized VS integration installer.  It adds a
Visual Studio .sln file which, when built, outputs a VSIX that can
be used to install ourselves as a "real" Visual Studio Extension.
We can even upload this extension to the visual studio marketplace.

This fixes a longstanding problem where we didn't support installing
into VS 2017 and higher.  In addition to supporting VS 2017, due
to the way this is written we now longer need to do anything special
to support future versions of VS as well.  Everything should
"just work".  This also fixes several bugs with our old integration,
such as MSBuild triggering full rebuilds when /Zi was used.

Finally, we add a new UI page called "LLVM" which becomes visible
when the LLVM toolchain is selected.  For now this only contains
one option which is the path to clang-cl.exe, but in the future
we can add more things here.

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

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

7 years ago[MSan] run materializeChecks() before materializeStores()
Alexander Potapenko [Fri, 20 Jul 2018 16:28:49 +0000 (16:28 +0000)]
[MSan] run materializeChecks() before materializeStores()

When pointer checking is enabled, it's important that every pointer is
checked before its value is used.
For stores MSan used to generate code that calculates shadow/origin
addresses from a pointer before checking it.
For userspace this isn't a problem, because the shadow calculation code
is quite simple and compiler is able to move it after the check on -O2.
But for KMSAN getShadowOriginPtr() creates a runtime call, so we want the
check to be performed strictly before that call.

Swapping materializeChecks() and materializeStores() resolves the issue:
both functions insert code before the given IR location, so the new
insertion order guarantees that the code calculating shadow address is
between the address check and the memory access.

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

7 years ago[X86][SSE] Use SplitOpsAndApply to improve HADD/HSUB lowering
Simon Pilgrim [Fri, 20 Jul 2018 16:20:45 +0000 (16:20 +0000)]
[X86][SSE] Use SplitOpsAndApply to improve HADD/HSUB lowering

Improve AVX1 256-bit vector HADD/HSUB matching by using SplitOpsAndApply to split into 128-bit instructions.

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

7 years ago[llvm-objcopy, tests] Fix several llvm-objcopy tests
Stella Stamenova [Fri, 20 Jul 2018 16:19:36 +0000 (16:19 +0000)]
[llvm-objcopy, tests] Fix several llvm-objcopy tests

Summary: In Python 3, sys.stdout.write expects a string rather than bytes. In order to be able to write the bytes to stdout, we need to use the buffer directly instead. This change is borrowing the implementation for writing to stdout that cat.py uses. Note that we cannot use cat.py directly because the file we are trying to open is a gzip file.

Reviewers: asmith, bkramer, alexshap, jakehehrlich

Reviewed By: alexshap, jakehehrlich

Subscribers: jakehehrlich, llvm-commits

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

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

7 years ago[X86][AVX] Add support for i16 256-bit vector horizontal op redundant shuffle removal
Simon Pilgrim [Fri, 20 Jul 2018 15:51:01 +0000 (15:51 +0000)]
[X86][AVX] Add support for i16 256-bit vector horizontal op redundant shuffle removal

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

7 years ago[X86][AVX] Add v16i16 horizontal op redundant shuffle tests
Simon Pilgrim [Fri, 20 Jul 2018 15:41:15 +0000 (15:41 +0000)]
[X86][AVX] Add v16i16 horizontal op redundant shuffle tests

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

7 years agoFix build breakage from r337562
Pavel Labath [Fri, 20 Jul 2018 15:40:24 +0000 (15:40 +0000)]
Fix build breakage from r337562

I changed a variable's type from pointer to reference, but forgot to
update the assert-only code.

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

7 years ago[DAG] Avoid Node Update assertion due to AND simplification
Nirav Dave [Fri, 20 Jul 2018 15:27:24 +0000 (15:27 +0000)]
[DAG] Avoid Node Update assertion due to AND simplification

Check for construction-time folding for incomplete AND nodes in
BackwardsPropagateMask.

Fixes PR38185.

Reviewers: RKSimon, samparker

Reviewed By: samparker

Subscribers: llvm-commits, hiraditya

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

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

7 years agoDwarfDebug: Reduce duplication in addAccel*** methods
Pavel Labath [Fri, 20 Jul 2018 15:24:13 +0000 (15:24 +0000)]
DwarfDebug: Reduce duplication in addAccel*** methods

Summary:
Each of the four methods had a dozen lines and was doing almost exactly
the same thing: get the appropriate accelerator table kind and insert an
entry into it. I move this common logic to a helper function and make
these methods delegate to it.

This came up in the context of D49493, where I've needed to make adding
a string to a string pool slightly more complicated, and it seemed to
make sense to do it in one place instead of five.

To make this work I've needed to unify the interface of the AccelTable
data types, as some used to store DIE& and others DIE*. I chose to unify
to a reference as that's what the caller uses.

This technically isn't NFC, because it changes the StringPool used for
apple tables in the DWO case (now it uses the main file like DWARF v5
instead of the DWO file). However, that shouldn't matter, as DWO is not
a thing on apple targets (clang frontend simply ignores -gsplit-dwarf).

Reviewers: JDevlieghere, aprantl, probinson

Subscribers: llvm-commits

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

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

7 years ago[X86][AVX] Add support for 32/64 bits 256-bit vector horizontal op redundant shuffle...
Simon Pilgrim [Fri, 20 Jul 2018 15:24:12 +0000 (15:24 +0000)]
[X86][AVX] Add support for 32/64 bits 256-bit vector horizontal op redundant shuffle removal

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