platform/upstream/llvm.git
6 years agoFix typo in lib/Support/Path.cpp to test commit access
Vladimir Stefanovic [Tue, 3 Jul 2018 17:26:43 +0000 (17:26 +0000)]
Fix typo in lib/Support/Path.cpp to test commit access

llvm-svn: 336216

6 years ago[Constants] add identity constants for fadd/fmul
Sanjay Patel [Tue, 3 Jul 2018 17:12:59 +0000 (17:12 +0000)]
[Constants] add identity constants for fadd/fmul

As the test diffs show, the current users of getBinOpIdentity()
are InstCombine and Reassociate. SLP vectorizer is a candidate
for using this functionality too (D28907).

The InstCombine shuffle improvements are part of the planned
enhancements noted in D48830.

InstCombine actually has several other uses of getBinOpIdentity()
via SimplifyUsingDistributiveLaws(), but we don't call that for
any FP ops. Fixing that might be another part of removing the
custom reassociation in InstCombine that is only done for fadd+fmul.

llvm-svn: 336215

6 years ago[Reassociate] add tests for binop with identity constant; NFC
Sanjay Patel [Tue, 3 Jul 2018 16:44:18 +0000 (16:44 +0000)]
[Reassociate] add tests for binop with identity constant; NFC

llvm-svn: 336214

6 years ago[scudo] Enable Scudo on PPC64
Kostya Kortchinsky [Tue, 3 Jul 2018 16:09:18 +0000 (16:09 +0000)]
[scudo] Enable Scudo on PPC64

Summary:
In conjunction with the clang side change D48833, this will enable Scudo on
PPC64. I tested `check-scudo` on a powerpc64le box and everything passes.

Reviewers: eugenis, alekseyshl

Reviewed By: alekseyshl

Subscribers: mgorny, delcypher, #sanitizers, llvm-commits

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

llvm-svn: 336213

6 years agoFix MSVC2015 compilation failure after r336206 patch.
Alexander Polyakov [Tue, 3 Jul 2018 16:07:30 +0000 (16:07 +0000)]
Fix MSVC2015 compilation failure after r336206 patch.

Added missing headers.

llvm-svn: 336212

6 years ago[Reassociate] regenerate checks; NFC
Sanjay Patel [Tue, 3 Jul 2018 16:01:41 +0000 (16:01 +0000)]
[Reassociate] regenerate checks; NFC

llvm-svn: 336211

6 years ago[AArch64][SVE] Asm: Support for FP Complex ADD/MLA.
Sander de Smalen [Tue, 3 Jul 2018 16:01:27 +0000 (16:01 +0000)]
[AArch64][SVE] Asm: Support for FP Complex ADD/MLA.

The variants added in this patch are:

- Predicated Complex floating point ADD with rotate, e.g.

   fcadd   z0.h, p0/m, z0.h, z1.h, #90

- Predicated Complex floating point MLA with rotate, e.g.

   fcmla   z0.h, p0/m, z1.h, z2.h, #180

- Unpredicated Complex floating point MLA with rotate (indexed operand), e.g.

   fcmla   z0.h, p0/m, z1.h, z2.h[0], #180

Reviewers: rengolin, fhahn, SjoerdMeijer, samparker, javed.absar

Reviewed By: fhahn

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

llvm-svn: 336210

6 years ago[AArch64][GlobalISel] Fix fallbacks introduced in r336120 due to unselectable stores.
Amara Emerson [Tue, 3 Jul 2018 15:59:26 +0000 (15:59 +0000)]
[AArch64][GlobalISel] Fix fallbacks introduced in r336120 due to unselectable stores.

r336120 resulted in falling back to SelectionDAG more often due to the G_STORE
MMOs not matching the vreg size. This fixes that by explicitly any-extending the
value.

llvm-svn: 336209

6 years ago[Reassociate] add test for missing FP constant analysis; NFC
Sanjay Patel [Tue, 3 Jul 2018 15:56:04 +0000 (15:56 +0000)]
[Reassociate] add test for missing FP constant analysis; NFC

llvm-svn: 336208

6 years agoRename lazy initialization functions to reflect behavior (NFC)
Teresa Johnson [Tue, 3 Jul 2018 15:52:57 +0000 (15:52 +0000)]
Rename lazy initialization functions to reflect behavior (NFC)

Suggested in review for D48698.

llvm-svn: 336207

6 years ago[lldb-mi] Re-implement symbol-list-lines command.
Alexander Polyakov [Tue, 3 Jul 2018 15:40:20 +0000 (15:40 +0000)]
[lldb-mi] Re-implement symbol-list-lines command.

Summary: Now this command uses SB API instead of HandleCommand.

Reviewers: aprantl, clayborg

Reviewed By: aprantl, clayborg

Subscribers: ki.stfu, eraman, lldb-commits

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

llvm-svn: 336206

6 years ago[AArch64][SVE] Asm: Support for FMUL (indexed)
Sander de Smalen [Tue, 3 Jul 2018 15:31:04 +0000 (15:31 +0000)]
[AArch64][SVE] Asm: Support for FMUL (indexed)

Unpredicated FP-multiply of SVE vector with a vector-element given by
vector[index], for example:

  fmul z0.s, z1.s, z2.s[0]

which performs an unpredicated FP-multiply of all 32-bit elements in
'z1' with the first element from 'z2'.

This patch adds restricted register classes for SVE vectors:
  ZPR_3b (only z0..z7 are allowed)  - for indexed vector of 16/32-bit elements.
  ZPR_4b (only z0..z15 are allowed) - for indexed vector of 64-bit elements.

Reviewers: rengolin, fhahn, SjoerdMeijer, samparker, javed.absar

Reviewed By: fhahn

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

llvm-svn: 336205

6 years ago[AArch64][SVE] Asm: Support for predicated unary operations.
Sander de Smalen [Tue, 3 Jul 2018 14:57:48 +0000 (14:57 +0000)]
[AArch64][SVE] Asm: Support for predicated unary operations.

The patch includes support for the following instructions:

       ABS z0.h, p0/m, z0.h
       NEG z0.h, p0/m, z0.h

  (S|U)XTB z0.h, p0/m, z0.h
  (S|U)XTB z0.s, p0/m, z0.s
  (S|U)XTB z0.d, p0/m, z0.d

  (S|U)XTH z0.s, p0/m, z0.s
  (S|U)XTH z0.d, p0/m, z0.d

  (S|U)XTW z0.d, p0/m, z0.d

llvm-svn: 336204

6 years ago[clangd] Use default format style and fallback style. NFC
Eric Liu [Tue, 3 Jul 2018 14:51:23 +0000 (14:51 +0000)]
[clangd] Use default format style and fallback style. NFC

llvm-svn: 336203

6 years ago[Driver] Add PPC64 as supported for Scudo
Kostya Kortchinsky [Tue, 3 Jul 2018 14:39:29 +0000 (14:39 +0000)]
[Driver] Add PPC64 as supported for Scudo

Summary:
Scudo works on PPC64 as is, so mark the architecture as supported for it. This
will also require a change to config-ix.cmake on the compiler-rt side.

Update the tests accordingly.

Reviewers: eugenis, alekseyshl

Reviewed By: alekseyshl

Subscribers: cfe-commits

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

llvm-svn: 336202

6 years ago[ELF][MIPS] Use llvm-mc to generate test case input file. NFC
Simon Atanasyan [Tue, 3 Jul 2018 14:39:27 +0000 (14:39 +0000)]
[ELF][MIPS] Use llvm-mc to generate test case input file. NFC

llvm-svn: 336201

6 years agoAdd new API to SBTarget and SBModule classes.
Alexander Polyakov [Tue, 3 Jul 2018 14:22:44 +0000 (14:22 +0000)]
Add new API to SBTarget and SBModule classes.

Summary: The new API allows to find a list of compile units related to target/module.

Reviewers: aprantl, clayborg

Reviewed By: aprantl

Subscribers: jingham, lldb-commits

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

llvm-svn: 336200

6 years ago[ELF] - Add a comment. NFC.
George Rimar [Tue, 3 Jul 2018 14:16:19 +0000 (14:16 +0000)]
[ELF] - Add a comment. NFC.

Minor follow up for r336197
"[ELF] - Add support for '||' and '&&' in linker scripts."

llvm-svn: 336199

6 years ago[DAGCombiner] visitSDIV - Permit MIN_SIGNED_VALUE in pow2 vector codegen
Simon Pilgrim [Tue, 3 Jul 2018 14:11:32 +0000 (14:11 +0000)]
[DAGCombiner] visitSDIV - Permit MIN_SIGNED_VALUE in pow2 vector codegen

Now that D45806 has landed, we can re-enable support for MIN_SIGNED_VALUE in the sdiv by pow2-constant code

llvm-svn: 336198

6 years ago[ELF] - Add support for '||' and '&&' in linker scripts.
George Rimar [Tue, 3 Jul 2018 14:02:52 +0000 (14:02 +0000)]
[ELF] - Add support for '||' and '&&' in linker scripts.

This is https://bugs.llvm.org//show_bug.cgi?id=37976,
we had no support, but seems someone faced it.

llvm-svn: 336197

6 years ago[InstCombine] fold shuffle-with-binop and common value
Sanjay Patel [Tue, 3 Jul 2018 13:44:22 +0000 (13:44 +0000)]
[InstCombine] fold shuffle-with-binop and common value

This is the last significant change suggested in PR37806:
https://bugs.llvm.org/show_bug.cgi?id=37806#c5
...though there are several follow-ups noted in the code comments
in this patch to complete this transform.

It's possible that a binop feeding a select-shuffle has been eliminated
by earlier transforms (or the code was just written like this in the 1st
place), so we'll fail to match the patterns that have 2 binops from:
D48401,
D48678,
D48662,
D48485.

In that case, we can try to materialize identity constants for the remaining
binop to fill in the "ghost" lanes of the vector (where we just want to pass
through the original values of the source operand).

I added comments to ConstantExpr::getBinOpIdentity() to show planned follow-ups.
For now, we only handle the 5 commutative integer binops (add/mul/and/or/xor).

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

llvm-svn: 336196

6 years ago[ARM][NFC] Refactor sequential access for DSP
Sam Parker [Tue, 3 Jul 2018 12:44:16 +0000 (12:44 +0000)]
[ARM][NFC] Refactor sequential access for DSP

With a view to support parallel operations that have their results
stored to memory, refactor the consecutive access helper out so it
could support stores instructions.

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

llvm-svn: 336195

6 years ago[IR] Strip trailing whitespace. NFC
Bjorn Pettersson [Tue, 3 Jul 2018 12:39:52 +0000 (12:39 +0000)]
[IR] Strip trailing whitespace. NFC

llvm-svn: 336194

6 years ago[AArch64] Armv8.4-A: system registers
Sjoerd Meijer [Tue, 3 Jul 2018 12:09:20 +0000 (12:09 +0000)]
[AArch64] Armv8.4-A: system registers

This adds the following system registers:
- RAS registers,
- MPAM registers,
- Activitiy monitor registers,
- Trace Extension registers,
- Timing insensitivity of data processing instructions,
- Enhanced Support for Nested Virtualization.

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

llvm-svn: 336193

6 years agobuild_llvm_package.bat: Re-try the build steps
Hans Wennborg [Tue, 3 Jul 2018 11:30:01 +0000 (11:30 +0000)]
build_llvm_package.bat: Re-try the build steps

The build on Windows has been extra flaky recently; retrying helps.

llvm-svn: 336192

6 years ago[DebugInfo] Corrections for salvageDebugInfo
Bjorn Pettersson [Tue, 3 Jul 2018 11:29:00 +0000 (11:29 +0000)]
[DebugInfo] Corrections for salvageDebugInfo

Summary:
When salvaging a dbg.declare/dbg.addr we should not add
DW_OP_stack_value to the DIExpression
(see test/Transforms/InstCombine/salvage-dbg-declare.ll).

Consider this example
  %vla = alloca i32, i64 2
  call void @llvm.dbg.declare(metadata i32* %vla, metadata !1, metadata !DIExpression())

Instcombine will turn it into
  %vla1 = alloca [2 x i32]
  %vla1.sub = getelementptr inbounds [2 x i32], [2 x i32]* %vla, i64 0, i64 0
  call void @llvm.dbg.declare(metadata [2 x i32]* %vla1.sub, metadata !19, metadata !DIExpression())

If the GEP can be eliminated, then the dbg.declare will be salvaged
and we should get
  %vla1 = alloca [2 x i32]
  call void @llvm.dbg.declare(metadata [2 x i32]* %vla1, metadata !19, metadata !DIExpression())

The problem was that salvageDebugInfo did not recognize dbg.declare
as being indirect (%vla1 points to the value, it does not hold the
value), so we incorrectly got
  call void @llvm.dbg.declare(metadata [2 x i32]* %vla1, metadata !19, metadata !DIExpression(DW_OP_stack_value))

I also made sure that llvm::salvageDebugInfo and
DIExpression::prependOpcodes do not add DW_OP_stack_value to
the DIExpression in case no new operands are added to the
DIExpression. That way we avoid to, unneccessarily, turn a
register location expression into an implicit location expression
in some situations (see test11 in test/Transforms/LICM/sinking.ll).

Reviewers: aprantl, vsk

Reviewed By: aprantl, vsk

Subscribers: JDevlieghere, llvm-commits

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

llvm-svn: 336191

6 years agoRevert "[X86][SSE] Blend any v8i16/v4i32 shift with 2 shift unique values"
Benjamin Kramer [Tue, 3 Jul 2018 11:15:17 +0000 (11:15 +0000)]
Revert "[X86][SSE] Blend any v8i16/v4i32 shift with 2 shift unique values"

This reverts commit r336113. It causes crashes.

llvm-svn: 336189

6 years ago[llvm-exegesis] Adjust AArch64 unit test
John Brawn [Tue, 3 Jul 2018 10:52:20 +0000 (10:52 +0000)]
[llvm-exegesis] Adjust AArch64 unit test

The signature of setRegToConstant changed in r336171, so adjust the AArch64
unit test in a similar way to how the X86 unit test was changed in that commit.

llvm-svn: 336188

6 years ago[llvm-exegesis] Add an AArch64 target
John Brawn [Tue, 3 Jul 2018 10:10:29 +0000 (10:10 +0000)]
[llvm-exegesis] Add an AArch64 target

The target does just enough to be able to run llvm-exegesis in latency mode for
at least some opcodes.

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

llvm-svn: 336187

6 years ago[AArch64][SVE] Asm: Support for saturing ADD/SUB instructions.
Sander de Smalen [Tue, 3 Jul 2018 09:48:22 +0000 (09:48 +0000)]
[AArch64][SVE] Asm: Support for saturing ADD/SUB instructions.

The variants added are:
    signed Saturating ADD/SUB (immediate)  e.g. sqadd z0.h, z0.h, #42
  unsigned Saturating ADD/SUB (immediate)  e.g. uqadd z0.h, z0.h, #42
    signed Saturating ADD/SUB (vectors)    e.g. sqadd z0.h, z0.h, z1.h
  unsigned Saturating ADD/SUB (vectors)    e.g. uqadd z0.h, z0.h, z1.h

llvm-svn: 336186

6 years ago[MIPS GlobalISel] Lower arguments using stack
Petar Jovanovic [Tue, 3 Jul 2018 09:31:48 +0000 (09:31 +0000)]
[MIPS GlobalISel] Lower arguments using stack

Lower more than 4 arguments using stack. This patch targets MIPS32.
It supports only functions with arguments of type i32.

Patch by Petar Avramovic.

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

llvm-svn: 336185

6 years ago[ELF] Don't create empty output section for unreferenced PROVIDEs
James Henderson [Tue, 3 Jul 2018 09:23:25 +0000 (09:23 +0000)]
[ELF] Don't create empty output section for unreferenced PROVIDEs

LLD removes empty output sections otherwise specified in the linker
script. Prior to this change however, if section descriptions included
ANY kind of symbol assignment, then the consequent output section would
not be removed, even if the assignment was marked with PROVIDE and not
actually triggered (i.e. the symbol was never referenced). This change
modifies the isDiscarable function to ignore such directives when
determining whether a section should be discarded, in keeping with
bfd's behaviour. Symbol assignments that do result in a symbol
definition will continue to result in a kept section (this is not
actually the same as bfd's behaviour, but it is simpler, and probably
makes more sense).

Reviewed By: grimar

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

llvm-svn: 336184

6 years ago[PM/LoopUnswitch] Fix PR37651 by correctly invalidating SCEV when
Chandler Carruth [Tue, 3 Jul 2018 09:13:27 +0000 (09:13 +0000)]
[PM/LoopUnswitch] Fix PR37651 by correctly invalidating SCEV when
unswitching loops.

Original patch trying to address this was sent in D47624, but that
didn't quite handle things correctly. There are two key principles used
to select whether and how to invalidate SCEV-cached information about
loops:

1) We must invalidate any info SCEV has cached before unswitching as we
   may change (or destroy) the loop structure by the act of unswitching,
   and make it hard to recover everything we want to invalidate within
   SCEV.

2) We need to invalidate all of the loops whose CFGs are mutated by the
   unswitching. Notably, this isn't the *entire* loop nest, this is
   every loop contained by the outermost loop reached by an exit block
   relevant to the unswitch.

And we need to do this even when doing trivial unswitching.

I've added more focused tests that directly check that SCEV starts off
with imprecise information and after unswitching (and simplifying
instructions) re-querying SCEV will produce precise information. These
tests also specifically work to check that an *outer* loop's information
becomes precise.

However, the testing here is still a bit imperfect. Crafting test cases
that reliably fail to be analyzed by SCEV before unswitching and succeed
afterward proved ... very, very hard. It took me several hours and
careful work to build these, and I'm not optimistic about necessarily
coming up with more to cover more elaborate possibilities. Fortunately,
the code pattern we are testing here in the pass is really
straightforward and reliable.

Thanks to Max Kazantsev for the initial work on this as well as the
review, and to Hal Finkel for helping me talk through approaches to test
this stuff even if it didn't come to much.

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

llvm-svn: 336183

6 years ago[AArch64][SVE] Asm: Support for vector element FP compare.
Sander de Smalen [Tue, 3 Jul 2018 09:07:23 +0000 (09:07 +0000)]
[AArch64][SVE] Asm: Support for vector element FP compare.

Contains the following variants:

- Compare with (elements from) other vector
  instructions: fcmeq, fcmgt, fcmge, fcmne, fcmuo.
  aliases: fcmle, fcmlt.

  e.g. fcmle   p0.h, p0/z, z0.h, z1.h => fcmge p0.h, p0/z, z1.h, z0.h

- Compare absolute values with (absolute values from) other vector.
  instructions: facge, facgt.
  aliases: facle, faclt.

  e.g. facle   p0.h, p0/z, z0.h, z1.h => facge   p0.h, p0/z, z1.h, z0.h

- Compare vector elements with #0.0
  instructions: fcmeq, fcmgt, fcmge, fcmle, fcmlt, fcmne.

  e.g. fcmle   p0.h, p0/z, z0.h, #0.0

llvm-svn: 336182

6 years ago[ELF][AArch64] Add test case for load/store exclusive instructions [NFC]
Peter Smith [Tue, 3 Jul 2018 08:53:41 +0000 (08:53 +0000)]
[ELF][AArch64] Add test case for load/store exclusive instructions [NFC]

The AArch64 -fix-cortex-a53-843419 is missing a test case for the load and
store exclusive instructions. This was leading to a function not being
covered in the codebase. This change adds two new instruction sequences to
be recognised as an instance of the erratum, one with a load exclusive the
other with a store exclusive.

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

llvm-svn: 336181

6 years ago[ELF] - Revert mips-tls-64-pic-local-variable.s changed in r336129.
George Rimar [Tue, 3 Jul 2018 08:34:55 +0000 (08:34 +0000)]
[ELF] - Revert mips-tls-64-pic-local-variable.s changed in r336129.

This restores the original comment in the test case.

llvm-svn: 336180

6 years ago[ELF] - Revert huge-temporary-file.s changed in r336129
George Rimar [Tue, 3 Jul 2018 08:30:55 +0000 (08:30 +0000)]
[ELF] - Revert huge-temporary-file.s changed in r336129

Comment in the test case says that:

## This inputs previously created a 4gb temporarily file under 32 bit
## configuration. Issue was fixed. There is no clean way to check that from here.
## This testcase added for documentation purposes.

The intention of the test was to create such huge file
in case if our code will be broken again.
And currently it documents we do not create huge outputs.

r336129 changed -o to /dev/null and broke the intentions of the test case.

llvm-svn: 336179

6 years ago[ADT] Disable the single callback optimization on Windows.
Chandler Carruth [Tue, 3 Jul 2018 08:19:10 +0000 (08:19 +0000)]
[ADT] Disable the single callback optimization on Windows.

It appears that the function pointer we use there isn't reliably 4-byte
aligned. I have no idea why or how we could correct this, so for now we
just regress the Windows performance some.

Someone with access to Windows could try working on a fix. At the very
least we could use a double indirection rather than a table, but maybe
there is some way to fully restore this optimization. I don't want to
play too much with this when I don't have access to the platform and
this at least should restore the last bots.

llvm-svn: 336178

6 years ago[clangd] Incorporate transitive #includes into code complete proximity scoring.
Sam McCall [Tue, 3 Jul 2018 08:09:29 +0000 (08:09 +0000)]
[clangd] Incorporate transitive #includes into code complete proximity scoring.

Summary:
We now compute a distance from the main file to the symbol header, which
is a weighted count of:
 - some number of #include traversals from source file --> included file
 - some number of FS traversals from file --> parent directory
 - some number of FS traversals from parent directory --> child file/dir
This calculation is performed in the appropriate URI scheme.

This means we'll get some proximity boost from header files in main-file
contexts, even when these are in different directory trees.

This extended file proximity model is not yet incorporated in the index
interface/implementation.

Reviewers: ioeric

Subscribers: mgorny, ilya-biryukov, MaskRay, jkorous, cfe-commits

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

llvm-svn: 336177

6 years ago[DebugInfo] Fix PR37395.
Shiva Chen [Tue, 3 Jul 2018 07:56:04 +0000 (07:56 +0000)]
[DebugInfo] Fix PR37395.

DbgLabelInst has no address as its operands.

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

Patch by Hsiangkai Wang.

llvm-svn: 336176

6 years agoRevert r336021 "PR33924: merge local declarations that have linkage of some kind...
Hans Wennborg [Tue, 3 Jul 2018 07:51:41 +0000 (07:51 +0000)]
Revert r336021 "PR33924: merge local declarations that have linkage of some kind within"

This caused test failures in 32-bit builds (PR38015).

> merged function definitions; also merge functions with deduced return
> types.
>
> This seems like two independent fixes, but unfortunately they are hard
> to separate because it's challenging to reliably test either one of them
> without also testing the other.
>
> A complication arises with deduced return type support: we need the type
> of the function in order to know how to merge it, but we can't load the
> actual type of the function because it might reference an entity
> declared within the function (and we need to have already merged the
> function to correctly merge that entity, which we would need to do to
> determine if the function types match). So we instead compare the
> declared function type when merging functions, and defer loading the
> actual type of a function with a deduced type until we've finished
> loading and merging the function.

llvm-svn: 336175

6 years ago[Support] This sanity check in the test only works with certain versions
Chandler Carruth [Tue, 3 Jul 2018 07:51:01 +0000 (07:51 +0000)]
[Support] This sanity check in the test only works with certain versions
of libstdc++, not just certain versions of GCC. The original macros
broke when using Clang + libstdc++4.9 sadly.

Sadly, testing for versions of libstdc++ has been extremely problematic
in the past, so I'm just narrowing this down to Windows and when using
libc++ as that seems at least very unlikely to keep build bots broken.

llvm-svn: 336174

6 years ago[clangd] Remove CompletionItem::SymbolScope extension.
Sam McCall [Tue, 3 Jul 2018 07:21:15 +0000 (07:21 +0000)]
[clangd] Remove CompletionItem::SymbolScope extension.

This was never serialized, and embedders now have access to the
CodeCompletion API, which includes this information.

llvm-svn: 336173

6 years ago[InstCombine] Delay foldICmpUsingKnownBits until simple transforms are done
Max Kazantsev [Tue, 3 Jul 2018 06:23:57 +0000 (06:23 +0000)]
[InstCombine] Delay foldICmpUsingKnownBits until simple transforms are done

This patch changes order of transform in InstCombineCompares to avoid
performing transforms based on ranges which produce complex bit arithmetics
before more simple things (like folding with constants) are done. See PR37636
for the motivating example.

Differential Revision: https://reviews.llvm.org/D48584
Reviewed By: spatel, lebedev.ri

llvm-svn: 336172

6 years ago[llvm-exegesis] ExegisX86Target::setRegToConstant() should depend on the subtarget...
Clement Courbet [Tue, 3 Jul 2018 06:17:05 +0000 (06:17 +0000)]
[llvm-exegesis] ExegisX86Target::setRegToConstant() should depend on the subtarget features.

Summary: This fixes PR38008.

Reviewers: gchatelet, RKSimon

Subscribers: tschuett, craig.topper, llvm-commits

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

llvm-svn: 336171

6 years ago[ADT] Try to work around a crash in MSVC.
Chandler Carruth [Tue, 3 Jul 2018 05:46:20 +0000 (05:46 +0000)]
[ADT] Try to work around a crash in MSVC.

Putting `sizeof(T) <= 16` into the parameter of a `std::conditional`
causes every version of MSVC I've tried to crash:

  https://godbolt.org/g/eqVULL

Really frustrating, but an extra layer of indirection through an
instantiated type gives a working way to access this computed constant.

llvm-svn: 336170

6 years ago[X86] Add avx512vl command line to break-false-dep.ll
Craig Topper [Tue, 3 Jul 2018 04:43:49 +0000 (04:43 +0000)]
[X86] Add avx512vl command line to break-false-dep.ll

llvm-svn: 336169

6 years ago[Driver][Darwin] Use Host Triple to infer target os version
Steven Wu [Tue, 3 Jul 2018 04:15:49 +0000 (04:15 +0000)]
[Driver][Darwin] Use Host Triple to infer target os version

Summary:
When clang required to infer target os version from --target option and
the os version is not specified in targets, check the host triple. If the
host and target are both macOS, use host triple to infer target os
version.

rdar://problem/41651999

Reviewers: arphaman, dexonsmith

Reviewed By: arphaman

Subscribers: cfe-commits

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

llvm-svn: 336168

6 years ago[ADT] Switch another place to `llvm::is_trivially_move_constructible`.
Chandler Carruth [Tue, 3 Jul 2018 04:07:26 +0000 (04:07 +0000)]
[ADT] Switch another place to `llvm::is_trivially_move_constructible`.

I missed this the first time around, sorry.

llvm-svn: 336166

6 years ago[libc++] Install the missing header __errc
Zhihao Yuan [Tue, 3 Jul 2018 04:01:44 +0000 (04:01 +0000)]
[libc++] Install the missing header __errc

Summary: Omitted from D41347.

Reviewers: EricWF

Subscribers: mgorny, christof, ldionne, cfe-commits

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

llvm-svn: 336165

6 years ago[libc++] Lift std::errc into a separated header
Zhihao Yuan [Tue, 3 Jul 2018 03:25:10 +0000 (03:25 +0000)]
[libc++] Lift std::errc into a separated header

Summary: This is needed to implement `<charconv>`, otherwise `<charconv>` would need to include `<system_error>`, which pulls in `<string>` -- a header which the `<charconv>` proposal intends to keep away from.

Reviewers: mclow.lists, EricWF

Reviewed By: mclow.lists

Subscribers: christof, cfe-commits

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

llvm-svn: 336164

6 years agoReappl "[Dominators] Add the DomTreeUpdater class"
Jakub Kuderski [Tue, 3 Jul 2018 02:06:23 +0000 (02:06 +0000)]
Reappl "[Dominators] Add the DomTreeUpdater class"

Summary:
This patch is the first in a series of patches related to the [[ http://lists.llvm.org/pipermail/llvm-dev/2018-June/123883.html | RFC - A new dominator tree updater for LLVM ]].

This patch introduces the DomTreeUpdater class, which provides a cleaner API to perform updates on available dominator trees (none, only DomTree, only PostDomTree, both) using different update strategies (eagerly or lazily) to simplify the updating process.

—Prior to the patch—

   - Directly calling update functions of DominatorTree updates the data structure eagerly while DeferredDominance does updates lazily.
   - DeferredDominance class cannot be used when a PostDominatorTree also needs to be updated.
   - Functions receiving DT/DDT need to branch a lot which is currently necessary.
   - Functions using both DomTree and PostDomTree need to call the update function separately on both trees.
   - People need to construct an additional DeferredDominance class to use functions only receiving DDT.

—After the patch—

Patch by Chijun Sima <simachijun@gmail.com>.

Reviewers: kuhar, brzycki, dmgreen, grosser, davide

Reviewed By: kuhar, brzycki

Author: NutshellySima

Subscribers: vsk, mgorny, llvm-commits

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

llvm-svn: 336163

6 years agoRevert r336159, r336157. Some bots failed on qualified std::max_align_t, and other...
Erik Pilkington [Tue, 3 Jul 2018 01:30:53 +0000 (01:30 +0000)]
Revert r336159, r336157. Some bots failed on qualified std::max_align_t, and other on unqualified max_align_t.

I'll take another stab at this tomorrow. Any ideas for fixing this would be appreciated!

http://lab.llvm.org:8011/builders/lld-x86_64-darwin13/builds/23071/steps/build_Lld/logs/stdio
http://lab.llvm.org:8011/builders/clang-with-thin-lto-ubuntu/builds/11185/steps/build-stage1-compiler/logs/stdio

llvm-svn: 336162

6 years ago[Support] Fix llvm::unique_function when building with GCC 4.9 by
Chandler Carruth [Tue, 3 Jul 2018 01:18:21 +0000 (01:18 +0000)]
[Support] Fix llvm::unique_function when building with GCC 4.9 by
introducing llvm::trivially_{copy,move}_constructible type traits.

This uses a completely portable implementation of these traits provided
by Richard Smith. You can see it on compiler explorer in all its glory:

  https://godbolt.org/g/QEDZjW

I have transcribed it, clang-formatted it, added some comments, and made
the tests fit into a unittest file.

I have also switched llvm::unique_function over to use these new, much
more portable traits. =D

Hopefully this will fix the build bot breakage from my prior commit.

llvm-svn: 336161

6 years ago[ThinLTO] Fix printing of aliases for distributed backend indexes
Teresa Johnson [Tue, 3 Jul 2018 01:11:43 +0000 (01:11 +0000)]
[ThinLTO] Fix printing of aliases for distributed backend indexes

Summary:
When we import an alias (which will import a copy of the aliasee), but
aren't going to import the aliasee directly, the distributed backend
index will not contain the aliasee summary. Handle this in the summary
assembly printer by printing "null" as the aliasee.

Reviewers: davidxl, dexonsmith

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

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

llvm-svn: 336160

6 years agoSome buildbots were choking on std::max_align_t, try using the global alias.
Erik Pilkington [Tue, 3 Jul 2018 00:48:27 +0000 (00:48 +0000)]
Some buildbots were choking on std::max_align_t, try using the global alias.

llvm-svn: 336159

6 years agoRe-sort the lldb.xcodeproj project file and commit the script
Jason Molenda [Tue, 3 Jul 2018 00:43:57 +0000 (00:43 +0000)]
Re-sort the lldb.xcodeproj project file and commit the script
that I used to sort it to scripts/sort-pbxproj.rb.  It turns
out that Xcode will perturb the order of the file lists
every time we add a file, following its own logic, and unfortunately
we'll still end up with lots of merge conflicts when that tries
to merge to the github swift repositories.  We talked this over
and we're going to keep it in a canonical state by running this
script over it when Xcode tries to reorder it.

llvm-svn: 336158

6 years ago[demangler] Fix a MSVC alignment warning.
Erik Pilkington [Tue, 3 Jul 2018 00:23:18 +0000 (00:23 +0000)]
[demangler] Fix a MSVC alignment warning.

This should fix llvm.org/PR37944

llvm-svn: 336157

6 years ago[ADT] Add llvm::unique_function which is like std::function but
Chandler Carruth [Mon, 2 Jul 2018 23:57:29 +0000 (23:57 +0000)]
[ADT] Add llvm::unique_function which is like std::function but
supporting move-only closures.

Most of the core optimizations for std::function are here plus
a potentially novel one that detects trivially movable and destroyable
functors and implements those with fewer indirections.

This is especially useful as we start trying to add concurrency
primitives as those often end up with move-only types (futures,
promises, etc) and wanting them to work through lambdas.

As further work, we could add better support for things like const-qualified
operator()s to support more algorithms, and r-value ref qualified operator()s
to model call-once. None of that is here though.

We can also provide our own llvm::function that has some of the optimizations
used in this class, but with copy semantics instead of move semantics.

This is motivated by increasing usage of things like executors and the task
queue where it is useful to embed move-only types like a std::promise within
a type erased function. That isn't possible without this version of a type
erased function.

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

llvm-svn: 336156

6 years ago[lldb-mi] Re-implement a few MI commands.
Alexander Polyakov [Mon, 2 Jul 2018 23:54:06 +0000 (23:54 +0000)]
[lldb-mi] Re-implement a few MI commands.

Summary: This patch updates exec-next-instruction, exec-step-instruction,
exec-finish, exec-interrupt commands to use SB API instead of HandleCommand.

Reviewers: aprantl, clayborg

Reviewed By: aprantl

Subscribers: ki.stfu, lldb-commits

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

llvm-svn: 336155

6 years agoFIx XCode project files for lldb
Raphael Isemann [Mon, 2 Jul 2018 23:27:29 +0000 (23:27 +0000)]
FIx XCode project files for lldb

Summary:
Fixes the XCode builds that started failing when i added CompletionRequest.cpp/.h.

The patch is so large because XCode decided to write the lines back in its own order, but essentially we only added on e file.

Subscribers: srhines, lldb-commits

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

llvm-svn: 336154

6 years agoPer C++ [over.match.copy]p1, direct-initialization of a reference can
Richard Smith [Mon, 2 Jul 2018 23:25:22 +0000 (23:25 +0000)]
Per C++ [over.match.copy]p1, direct-initialization of a reference can
only invoke converting constructors of the reference's underlying type.

llvm-svn: 336153

6 years agoRemove absolute path in test
Teresa Johnson [Mon, 2 Jul 2018 23:02:07 +0000 (23:02 +0000)]
Remove absolute path in test

My test change in r336148 accidentally included an absolute path, clean
that up to fix bot failures.

llvm-svn: 336151

6 years ago[ORC] Verify modules when running LLLazyJIT in LLI, and deal with fallout.
Lang Hames [Mon, 2 Jul 2018 22:30:18 +0000 (22:30 +0000)]
[ORC] Verify modules when running LLLazyJIT in LLI, and deal with fallout.

The verifier identified several modules that were broken due to incorrect
linkage on declarations. To fix this, CompileOnDemandLayer2::extractFunction
has been updated to change decls to external linkage.

llvm-svn: 336150

6 years agoFixed compilation failure after the code completion refactor patch
Raphael Isemann [Mon, 2 Jul 2018 22:18:18 +0000 (22:18 +0000)]
Fixed compilation failure after the code completion refactor patch

Subscribers: lldb-commits

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

llvm-svn: 336149

6 years ago[ThinLTO] Fix printing of module paths for distributed backend indexes
Teresa Johnson [Mon, 2 Jul 2018 22:09:23 +0000 (22:09 +0000)]
[ThinLTO] Fix printing of module paths for distributed backend indexes

Summary:
In the individual index files emitted for distributed ThinLTO backends,
the module path ids are not contiguous. Assign slots to module paths in
order to handle this better and also to get contiguous numbering in the
summary assembly.

Reviewers: davidxl, dexonsmith

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

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

llvm-svn: 336148

6 years ago[lldbsuite, windows] Don't crash LLDB when we try to retrieve a register on Windows
Stella Stamenova [Mon, 2 Jul 2018 21:50:31 +0000 (21:50 +0000)]
[lldbsuite, windows] Don't crash LLDB when we try to retrieve a register on Windows

Summary:
1) When ReadRegister is called with a null register into on Windows, rather than crashing due to an access violation, simply return false. Not all registers and properties will be read or calculated correctly, but that is consistent with other platforms that also return false in that case
2) Update a couple of tests to reference pr37995 as their reason for failure since it is much more accurate. Support for floating point registers doesn't exist on Windows at all, rather than having issues.

Reviewers: asmith, labath, zturner

Subscribers: llvm-commits

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

llvm-svn: 336147

6 years agoRefactoring for for the internal command line completion API (NFC)
Raphael Isemann [Mon, 2 Jul 2018 21:29:56 +0000 (21:29 +0000)]
Refactoring for for the internal command line completion API (NFC)

Summary:
This patch refactors the internal completion API. It now takes (as far as possible) a single
CompletionRequest object instead o half a dozen in/out/in-out parameters. The CompletionRequest
contains a common superset of the different parameters as far as it makes sense. This includes
the raw command line string and raw cursor position, which should make the `expr` command
possible to implement (at least without hacks that reconstruct the command line from the args).

This patch is not intended to change the observable behavior of lldb in any way. It's also as
minimal as possible and doesn't attempt to fix all the problems the API has.

Some Q&A:

Q: Why is this not fixing all the problems in the completion API?
A: Because is a blocker for the expr command completion which I want to get in ASAP. This is the
smallest patch that unblocks the expr completion patch and which allows trivial refactoring in the future.
The patch also doesn't really change the internal information flow in the API, so that hopefully
saves us from ever having to revert and resubmit this humongous patch.

Q: Can we merge all the copy-pasted code in the completion methods
(like computing the current incomplete arg) into CompletionRequest class?
A: Yes, but it's out of scope for this patch.

Q: Why the `word_complete = request.GetWordComplete(); ... ` pattern?
A: I don't want to add a getter that returns a reference to the internal integer. So we have
to use a temporary variable and the Getter/Setter instead. We don't throw exceptions
from what I can tell, so the behavior doesn't change.

Q: Why are we not owning the list of matches?
A: Because that's how the previous API works. But that should be fixed too (in another patch).

Q: Can we make the constructor simpler and compute some of the values from the plain command?
A: I think this works, but I rather want to have this in a follow up commit. Especially when making nested
request it's a bit awkward that the parsed arguments behave as both input/output (as we should in theory
propagate the changes on the nested request back to the parent request if we don't want to change the
behavior too much).

Q: Can't we pass one const request object and then just return another result object instead of mixing
them together in one in/out parameter?
A: It's hard to get keep the same behavior with that pattern, but I think we can also get a nice API with just
a single request object. If we make all input parameters read-only, we have a clear separation between what
is actually an input and what an output parameter (and hopefully we get rid of the in-out parameters).

Q: Can we throw out the 'match' variables that are not implemented according to the comment?
A: We currently just forward them as in the old code to the different methods, even though I think
they are really not used. We can easily remove and readd them once every single completion method just
takes a CompletionRequest, but for now I prefer NFC behavior from the perspective of the API user.

Reviewers: davide, jingham, labath

Reviewed By: jingham

Subscribers: mgorny, friss, lldb-commits

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

llvm-svn: 336146

6 years ago[WebAssembly] Support for atomic stores
Heejin Ahn [Mon, 2 Jul 2018 21:22:59 +0000 (21:22 +0000)]
[WebAssembly] Support for atomic stores

Summary: Add support for atomic store instructions.

Reviewers: dschuff

Subscribers: sbc100, jgravelle-google, sunfish, llvm-commits

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

llvm-svn: 336145

6 years ago[ARM] Fix PR37382: Don't optimize mul.with.overflow on thumbv6m.
Vadzim Dambrouski [Mon, 2 Jul 2018 21:05:26 +0000 (21:05 +0000)]
[ARM] Fix PR37382: Don't optimize mul.with.overflow on thumbv6m.

Reviewers: efriedma, rogfer01, javed.absar

Reviewed By: efriedma, rogfer01

Subscribers: kristof.beyls, chrib, llvm-commits

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

llvm-svn: 336144

6 years ago[LTO] Errors in LLVM backend should manifest as lld errors
Sam Clegg [Mon, 2 Jul 2018 21:01:43 +0000 (21:01 +0000)]
[LTO] Errors in LLVM backend should manifest as lld errors

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

llvm-svn: 336143

6 years ago[llvm-mca] Clear the content of map VariantDescriptors in InstrBuilder before we...
Andrea Di Biagio [Mon, 2 Jul 2018 20:39:57 +0000 (20:39 +0000)]
[llvm-mca] Clear the content of map VariantDescriptors in InstrBuilder before we start analyzing a new CodeBlock. NFCI.

Different CodeBlocks don't overlap. The same MCInst cannot appear in more than
one code block because all blocks are instantiated before the simulation is run.

We should always clear the content of map VariantDescriptors before every
simulation, since VariantDescriptors cannot possibly store useful information
for the next blocks. It is also "safer" to clear its content because `MCInst*`
is used as the key type for map VariantDescriptors.

llvm-svn: 336142

6 years ago[Win32] Overload ==, != for locale_t and long long
Pirama Arumuga Nainar [Mon, 2 Jul 2018 20:11:15 +0000 (20:11 +0000)]
[Win32] Overload ==, != for locale_t and long long

Summary:
_is_chartype_l (needed for isxdigit_l) in MinGW compares locale_t and NULL.
NULL is 'long long' for 64-bit, and this results in ambiguous overloads when
compiled with Clang.  Define a concrete overload for the operators to fix the
ambiguity.

Reviewers: mstorsjo, EricWF, srhines, danalbert

Subscribers: christof, cfe-commits, ldionne

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

llvm-svn: 336141

6 years ago[SCEV] Strengthen StrengthenNoWrapFlags (reapply r334428).
Tim Shen [Mon, 2 Jul 2018 20:01:54 +0000 (20:01 +0000)]
[SCEV] Strengthen StrengthenNoWrapFlags (reapply r334428).

Summary:
Comment on Transforms/LoopVersioning/incorrect-phi.ll: With the change
SCEV is able to prove that the loop doesn't wrap-self (due to zext i16
to i64), disabling the entire loop versioning pass. Removed the zext and
just use i64.

Reviewers: sanjoy

Subscribers: jlebar, hiraditya, javed.absar, bixia, llvm-commits

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

llvm-svn: 336140

6 years ago[scudo] Enable Scudo memory hooks for Fuchsia.
Kostya Kortchinsky [Mon, 2 Jul 2018 19:48:01 +0000 (19:48 +0000)]
[scudo] Enable Scudo memory hooks for Fuchsia.

Summary:
    It would be useful for Flutter apps, especially, to be able to use
    malloc hooks to debug memory leaks on Fuchsia. They're not able to do
    this right now, so it'd be a nice bonus to throw in with the Scudo
    switchover.

Reviewers: cryptoad, alekseyshl

Reviewed By: cryptoad

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

llvm-svn: 336139

6 years ago[WebAssembly] Fix fast-isel optimization of branch conditions.
Dan Gohman [Mon, 2 Jul 2018 19:45:57 +0000 (19:45 +0000)]
[WebAssembly] Fix fast-isel optimization of branch conditions.

LLVM doesn't guarantee anything about the high bits of a register holding
an i1 value at the IR level, so don't translate LLVM IR i1 values directly
into WebAssembly conditional branch operands. WebAssembly's conditional
branches do demand all 32 bits be valid.

Fixes PR38019.

llvm-svn: 336138

6 years ago[CodeGenCXX] Emit strip.invariant.group with -fstrict-vtable-pointers
Piotr Padlewski [Mon, 2 Jul 2018 19:21:36 +0000 (19:21 +0000)]
[CodeGenCXX] Emit strip.invariant.group with -fstrict-vtable-pointers

Summary:
Emmiting new intrinsic that strips invariant.groups to make
devirtulization sound, as described in RFC: Devirtualization v2.

Reviewers: rjmccall, rsmith, amharc, kuhar

Subscribers: llvm-commits, cfe-commits

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

Co-authored-by: Krzysztof Pszeniczny <krzysztof.pszeniczny@gmail.com>
llvm-svn: 336137

6 years ago[ELF] Fix other tests after r336129
Fangrui Song [Mon, 2 Jul 2018 19:17:03 +0000 (19:17 +0000)]
[ELF] Fix other tests after r336129

llvm-svn: 336136

6 years ago[ELF] Fix just-symbols*.s after r336129
Fangrui Song [Mon, 2 Jul 2018 19:12:10 +0000 (19:12 +0000)]
[ELF] Fix just-symbols*.s after r336129

llvm-svn: 336135

6 years ago[X86] Add phony registers for high halves of regs with low halves
Krzysztof Parzyszek [Mon, 2 Jul 2018 19:05:09 +0000 (19:05 +0000)]
[X86] Add phony registers for high halves of regs with low halves

Add registers still missing after r328016 (D43353):
- for bits 15-8  of SI, DI, BP, SP (*H), and R8-R15 (*BH),
- for bits 31-16 of R8-R15 (*WH).

Thanks to Craig Topper for pointing it out.

llvm-svn: 336134

6 years agoReplace "Replacable" with "Replaceable". [NFC]
Alina Sbirlea [Mon, 2 Jul 2018 18:53:40 +0000 (18:53 +0000)]
Replace "Replacable" with "Replaceable". [NFC]

llvm-svn: 336133

6 years agoImplement LWG 2946, 3075 and 3076. Reviewed as https://reviews.llvm.org/D48616
Marshall Clow [Mon, 2 Jul 2018 18:41:15 +0000 (18:41 +0000)]
Implement LWG 2946, 3075 and 3076. Reviewed as https://reviews.llvm.org/D48616

llvm-svn: 336132

6 years agoReplace unused output filenames with /dev/null in tests
Fangrui Song [Mon, 2 Jul 2018 18:16:44 +0000 (18:16 +0000)]
Replace unused output filenames with /dev/null in tests

Similar to rLLD336129

llvm-svn: 336131

6 years ago[SLP] Recognize min/max pattern using instructions producing same values.
Farhana Aleen [Mon, 2 Jul 2018 17:55:31 +0000 (17:55 +0000)]
[SLP] Recognize min/max pattern using instructions producing same values.

Summary: It is common to have the following min/max pattern during the intermediate stages of SLP since we only optimize at the end. This patch tries to catch such patterns and allow more vectorization.

         %1 = extractelement <2 x i32> %a, i32 0
         %2 = extractelement <2 x i32> %a, i32 1
         %cond = icmp sgt i32 %1, %2
         %3 = extractelement <2 x i32> %a, i32 0
         %4 = extractelement <2 x i32> %a, i32 1
         %select = select i1 %cond, i32 %3, i32 %4

Author: FarhanaAleen

Reviewed By: ABataev, RKSimon, spatel

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

llvm-svn: 336130

6 years ago[ELF] Replace unused output filenames with /dev/null in tests
Fangrui Song [Mon, 2 Jul 2018 17:48:23 +0000 (17:48 +0000)]
[ELF] Replace unused output filenames with /dev/null in tests

Post commit review at rLLD335992

llvm-svn: 336129

6 years ago[InstCombine] reverse canonicalization of add --> or to allow more shuffle folding
Sanjay Patel [Mon, 2 Jul 2018 17:42:29 +0000 (17:42 +0000)]
[InstCombine] reverse canonicalization of add --> or to allow more shuffle folding

This extends D48485 to allow another pair of binops (add/or) to be combined either
with or without a leading shuffle:
or X, C --> add X, C (when X and C have no common bits set)

Here, we need value tracking to determine that the 'or' can be reversed into an 'add',
and we've added general infrastructure to allow extending to other opcodes or moving
to where other passes could use that functionality.

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

llvm-svn: 336128

6 years ago[MC] Error on a .zerofill directive in a non-virtual section
Francis Visoiu Mistrih [Mon, 2 Jul 2018 17:29:43 +0000 (17:29 +0000)]
[MC] Error on a .zerofill directive in a non-virtual section

On darwin, all virtual sections have zerofill type, and having a
.zerofill directive in a non-virtual section is not allowed. Instead of
asserting, show a nicer error.

In order to use the equivalent of .zerofill in a non-virtual section,
the usage of .zero of .space is required.

This patch replaces the assert with an error.

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

llvm-svn: 336127

6 years agonm: Add -no-weak flag for hiding weak symbols
Dave Lee [Mon, 2 Jul 2018 17:24:37 +0000 (17:24 +0000)]
nm: Add -no-weak flag for hiding weak symbols

Summary:
This adds a new -no-weak flag to nm to hide weak symbols in its output.
This also adds a -W alias for this which is analogous to -U.

Patch by Keith Smiley

Reviewers: kastiglione, enderby, compnerd

Reviewed By: kastiglione

Subscribers: llvm-commits

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

llvm-svn: 336126

6 years ago[SLPVectorizer][X86] Begin adding alternate tests for call operators
Simon Pilgrim [Mon, 2 Jul 2018 17:23:45 +0000 (17:23 +0000)]
[SLPVectorizer][X86] Begin adding alternate tests for call operators

Alternate opcode handling only supports binary operators, these tests demonstrate a missed opportunity to vectorize ceil/floor calls

llvm-svn: 336125

6 years ago[analyzer] [tests] Pass clang executable path to prefix-less executor scripts.
George Karpenkov [Mon, 2 Jul 2018 17:10:40 +0000 (17:10 +0000)]
[analyzer] [tests] Pass clang executable path to prefix-less executor scripts.

llvm-svn: 336124

6 years agoTighten up a test for -check-debugify, NFC
Vedant Kumar [Mon, 2 Jul 2018 17:08:36 +0000 (17:08 +0000)]
Tighten up a test for -check-debugify, NFC

Use an -implicit-check-not to make sure an error which should not occur
in fact does not occur before the first CHECK line.

Suggested by Paul Robinson in post-commit feedback for r335897.

llvm-svn: 336123

6 years ago[CostModel][X86] Add cost tests for fp rounding intrinsics
Simon Pilgrim [Mon, 2 Jul 2018 17:07:01 +0000 (17:07 +0000)]
[CostModel][X86] Add cost tests for fp rounding intrinsics

Add cost tests for fp ceil, floor, nearbyint, rint and trunc.

llvm-svn: 336122

6 years ago[X86] Don't use aligned load/store instructions for fp128 if the load/store isn't...
Craig Topper [Mon, 2 Jul 2018 17:01:54 +0000 (17:01 +0000)]
[X86] Don't use aligned load/store instructions for fp128 if the load/store isn't aligned.

Similarily, don't fold fp128 loads into SSE instructions if the load isn't aligned. Unless we're targeting an AMD CPU that doesn't check alignment on arithmetic instructions.

Should fix PR38001

llvm-svn: 336121

6 years ago[AArch64][GlobalISel] Any-extend vararg parameters to stack slot size on Darwin.
Amara Emerson [Mon, 2 Jul 2018 16:39:09 +0000 (16:39 +0000)]
[AArch64][GlobalISel] Any-extend vararg parameters to stack slot size on Darwin.

We currently don't any-extend vararg parameters before storing them to the stack
locations on Darwin. However, SelectionDAG however does this, and so user code
is in the wild which inadvertently relies on this extension. This can manifest
in cases where the value stored is (int)0, but the actual parameter is interpreted
by va_arg as a pointer, and so not extending to 64 bits causes the callee to
load additional undefined bits.

llvm-svn: 336120

6 years ago[clangd] Implement hover for "auto" and "decltype"
Marc-Andre Laperle [Mon, 2 Jul 2018 16:28:34 +0000 (16:28 +0000)]
[clangd] Implement hover for "auto" and "decltype"

Summary:
This allows hovering on keywords that refer to deduced types.
This should cover most useful cases. Not covered:
- auto template parameters: Since this can be instantiated with many types,
it would not be practical to show the types.
- Structured binding: This could be done later to show multiple deduced types
in the hover.
- auto:: (part of concepts): Outside the scope of this patch.

Signed-off-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, cfe-commits

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

llvm-svn: 336119

6 years ago[WebAssembly] Set threadmodel during LTO
Sam Clegg [Mon, 2 Jul 2018 16:27:50 +0000 (16:27 +0000)]
[WebAssembly] Set threadmodel during LTO

Subscribers: dschuff, mehdi_amini, inglorion, jgravelle-google, aheejin, sunfish, steven_wu, llvm-commits

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

llvm-svn: 336118

6 years agoRevert "[Dominators] Add the DomTreeUpdater class"
Jakub Kuderski [Mon, 2 Jul 2018 16:10:49 +0000 (16:10 +0000)]
Revert "[Dominators] Add the DomTreeUpdater class"

Temporary revert because of a failing test on some buildbots.

This reverts commit r336114.

llvm-svn: 336117

6 years ago[WebAssembly] Convert remaining tests from elf to wasm output format
Sam Clegg [Mon, 2 Jul 2018 16:03:49 +0000 (16:03 +0000)]
[WebAssembly] Convert remaining tests from elf to wasm output format

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

llvm-svn: 336116

6 years agoFollow up of r335953 - [ARM][AArch64] Armv8.4-A Enablement
Sjoerd Meijer [Mon, 2 Jul 2018 15:38:37 +0000 (15:38 +0000)]
Follow up of r335953 - [ARM][AArch64] Armv8.4-A Enablement

Imply dotprod for armv8.4-a, because it is mandatory from v8.4.

llvm-svn: 336115

6 years ago[Dominators] Add the DomTreeUpdater class
Jakub Kuderski [Mon, 2 Jul 2018 15:37:41 +0000 (15:37 +0000)]
[Dominators] Add the DomTreeUpdater class

Summary:
This patch is the first in a series of patches related to the [[ http://lists.llvm.org/pipermail/llvm-dev/2018-June/123883.html | RFC - A new dominator tree updater for LLVM ]].

This patch introduces the DomTreeUpdater class, which provides a cleaner API to perform updates on available dominator trees (none, only DomTree, only PostDomTree, both) using different update strategies (eagerly or lazily) to simplify the updating process.

—Prior to the patch—

   - Directly calling update functions of DominatorTree updates the data structure eagerly while DeferredDominance does updates lazily.
   - DeferredDominance class cannot be used when a PostDominatorTree also needs to be updated.
   - Functions receiving DT/DDT need to branch a lot which is currently necessary.
   - Functions using both DomTree and PostDomTree need to call the update function separately on both trees.
   - People need to construct an additional DeferredDominance class to use functions only receiving DDT.

—After the patch—

Patch by Chijun Sima <simachijun@gmail.com>.

Reviewers: kuhar, brzycki, dmgreen, grosser, davide

Reviewed By: kuhar, brzycki

Subscribers: vsk, mgorny, llvm-commits

Author: NutshellySima

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

llvm-svn: 336114