OSDN Git Service

android-x86/external-llvm.git
5 years ago[NFC][InstSimplify] Precommit new unary fneg test
Cameron McInally [Fri, 17 May 2019 18:34:35 +0000 (18:34 +0000)]
[NFC][InstSimplify] Precommit new unary fneg test

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

5 years agoRevert r361033 "Add a Visit overload for DynTypedNode to ASTNodeTraverser"
Nico Weber [Fri, 17 May 2019 18:31:24 +0000 (18:31 +0000)]
Revert r361033 "Add a Visit overload for DynTypedNode to ASTNodeTraverser"

It fails to build on some bots.

Also revert follow-up r361055.

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

5 years ago[InstCombine] move bitcast after insertelement-with-bitcasted-operands
Sanjay Patel [Fri, 17 May 2019 18:06:12 +0000 (18:06 +0000)]
[InstCombine] move bitcast after insertelement-with-bitcasted-operands

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

5 years ago[NFC][InstSImplify] Fix flip-flopped comments and test names
Cameron McInally [Fri, 17 May 2019 17:59:17 +0000 (17:59 +0000)]
[NFC][InstSImplify] Fix flip-flopped comments and test names

In test/Transforms/InstSimplify/floating-point-arithmetic.ll

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

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

5 years ago[X86][SSE] Fold movmsk(not(x)) -> not(movmsk)
Simon Pilgrim [Fri, 17 May 2019 17:56:25 +0000 (17:56 +0000)]
[X86][SSE] Fold movmsk(not(x)) -> not(movmsk)

Helps to improve folding of comparisons with movmsk results.

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

5 years agogn build: Merge r361033
Nico Weber [Fri, 17 May 2019 17:36:06 +0000 (17:36 +0000)]
gn build: Merge r361033

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

5 years agogn build: Merge r360991
Nico Weber [Fri, 17 May 2019 17:32:00 +0000 (17:32 +0000)]
gn build: Merge r360991

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

5 years ago[X86][SSE] Match all-of bool scalar reductions into a bitcast/movmsk + cmp.
Simon Pilgrim [Fri, 17 May 2019 17:25:55 +0000 (17:25 +0000)]
[X86][SSE] Match all-of bool scalar reductions into a bitcast/movmsk + cmp.

Same as what we do for vector reductions in combineHorizontalPredicateResult, use movmsk+cmp for scalar (and(extract(x,0),extract(x,1)) reduction patterns.

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

5 years ago[InstCombine] add tests for insertelement with bitcasted operands; NFC
Sanjay Patel [Fri, 17 May 2019 17:23:13 +0000 (17:23 +0000)]
[InstCombine] add tests for insertelement with bitcasted operands; NFC

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

5 years ago[InstSimplify] Add unary fneg to `fsub 0.0, (fneg X) ==> X` transform
Cameron McInally [Fri, 17 May 2019 16:47:00 +0000 (16:47 +0000)]
[InstSimplify] Add unary fneg to `fsub 0.0, (fneg X) ==> X` transform

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

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

5 years ago[AMDGPU][MC] Corrected parsing of NAME:VALUE modifiers
Dmitry Preobrazhensky [Fri, 17 May 2019 16:04:17 +0000 (16:04 +0000)]
[AMDGPU][MC] Corrected parsing of NAME:VALUE modifiers

See bug 41298: https://bugs.llvm.org/show_bug.cgi?id=41298

Reviewers: artem.tamazov, arsenm

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

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

5 years ago[DAGCombiner] visitShiftByConstant(): drop bogus signbit check
Roman Lebedev [Fri, 17 May 2019 15:52:58 +0000 (15:52 +0000)]
[DAGCombiner] visitShiftByConstant(): drop bogus signbit check

Summary:
That check claims that the transform is illegal otherwise.
That isn't true:
1. For `ISD::ADD`, we only process `ISD::SHL` outer shift => sign bit does not matter
   https://rise4fun.com/Alive/K4A
2. For `ISD::AND`, there is no restriction on constants:
   https://rise4fun.com/Alive/Wy3
3. For `ISD::OR`, there is no restriction on constants:
   https://rise4fun.com/Alive/GOH
3. For `ISD::XOR`, there is no restriction on constants:
   https://rise4fun.com/Alive/ml6

So, why is it there then?

This changes the testcase that was touched by @spatel in rL347478,
but i'm not sure that test tests anything particular?

Reviewers: RKSimon, spatel, craig.topper, jojo, rengolin

Reviewed By: spatel

Subscribers: javed.absar, llvm-commits, spatel

Tags: #llvm

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

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

5 years ago[InstCombine] canShiftBinOpWithConstantRHS(): drop bogus signbit check
Roman Lebedev [Fri, 17 May 2019 15:52:49 +0000 (15:52 +0000)]
[InstCombine] canShiftBinOpWithConstantRHS(): drop bogus signbit check

Summary:
In D61918 i was looking at dropping it in DAGCombiner `visitShiftByConstant()`,
but as @craig.topper pointed out, it was copied from here.

That check claims that the transform is illegal otherwise.
That isn't true:
1. For `ISD::ADD`, we only process `ISD::SHL` outer shift => sign bit does not matter
   https://rise4fun.com/Alive/K4A
2. For `ISD::AND`, there is no restriction on constants:
   https://rise4fun.com/Alive/Wy3
3. For `ISD::OR`, there is no restriction on constants:
   https://rise4fun.com/Alive/GOH
3. For `ISD::XOR`, there is no restriction on constants:
   https://rise4fun.com/Alive/ml6

So, why is it there then?
As far as i can tell, it dates all the way back to original check-in rL7793.
I think we should just drop it.

Reviewers: spatel, craig.topper, efriedma, majnemer

Reviewed By: spatel

Subscribers: llvm-commits, craig.topper

Tags: #llvm

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

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

5 years ago[AMDGPU][MC] Enabled labels with s_call_b64 and s_cbranch_i_fork
Dmitry Preobrazhensky [Fri, 17 May 2019 14:57:04 +0000 (14:57 +0000)]
[AMDGPU][MC] Enabled labels with s_call_b64 and s_cbranch_i_fork

See https://bugs.llvm.org/show_bug.cgi?id=41888

Reviewers: artem.tamazov, arsenm

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

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

5 years ago[X86][AVX] Remove LowerCTTZ's AVX1 custom vector handling.
Simon Pilgrim [Fri, 17 May 2019 14:37:19 +0000 (14:37 +0000)]
[X86][AVX] Remove LowerCTTZ's AVX1 custom vector handling.

We can now rely on generic expansion to handle this.

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

5 years ago[X86][AVX] isNOT - add extract_subvector(xor X, -1) -> extract_subvector(X) fold.
Simon Pilgrim [Fri, 17 May 2019 14:04:56 +0000 (14:04 +0000)]
[X86][AVX] isNOT - add extract_subvector(xor X, -1) -> extract_subvector(X) fold.

Prep work for the removal of the remaining x86 CTTZ vector lowering.

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

5 years ago[AMDGPU][MC] Enabled expressions for most operands which accept integer values
Dmitry Preobrazhensky [Fri, 17 May 2019 13:17:48 +0000 (13:17 +0000)]
[AMDGPU][MC] Enabled expressions for most operands which accept integer values

See bug 40873: https://bugs.llvm.org/show_bug.cgi?id=40873

Reviewers: artem.tamazov, arsenm

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

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

5 years agoAMDGPU: Fix unused variable warnings in release builds
Matt Arsenault [Fri, 17 May 2019 12:59:27 +0000 (12:59 +0000)]
AMDGPU: Fix unused variable warnings in release builds

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

5 years agoAMDGPU/GlobalISel: Legalize G_FCEIL
Matt Arsenault [Fri, 17 May 2019 12:20:05 +0000 (12:20 +0000)]
AMDGPU/GlobalISel: Legalize G_FCEIL

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

5 years agoAMDGPU/GlobalISel: Legalize G_INTRINSIC_TRUNC
Matt Arsenault [Fri, 17 May 2019 12:20:01 +0000 (12:20 +0000)]
AMDGPU/GlobalISel: Legalize G_INTRINSIC_TRUNC

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

5 years agoAMDGPU/GlobalISel: Legalize G_FRINT
Matt Arsenault [Fri, 17 May 2019 12:19:57 +0000 (12:19 +0000)]
AMDGPU/GlobalISel: Legalize G_FRINT

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

5 years agoAMDGPU/GlobalISel: Legalize G_FCOPYSIGN
Matt Arsenault [Fri, 17 May 2019 12:19:52 +0000 (12:19 +0000)]
AMDGPU/GlobalISel: Legalize G_FCOPYSIGN

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

5 years ago[MergeICmps][NFC] Add more debug.
Clement Courbet [Fri, 17 May 2019 12:07:51 +0000 (12:07 +0000)]
[MergeICmps][NFC] Add more debug.

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

5 years agoAMDGPU/GlobalISel: RegBankSelect for llvm.amdgcn.s.buffer.load
Matt Arsenault [Fri, 17 May 2019 12:02:34 +0000 (12:02 +0000)]
AMDGPU/GlobalISel: RegBankSelect for llvm.amdgcn.s.buffer.load

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

5 years agoAMDGPU/GlobalISel: Use subreg index instead of extra unmerge
Matt Arsenault [Fri, 17 May 2019 12:02:31 +0000 (12:02 +0000)]
AMDGPU/GlobalISel: Use subreg index instead of extra unmerge

This saves instructions and extra steps, but I'm not sure about
introducing subregister indexes at this point.

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

5 years agoAMDGPU/GlobalISel: Use waterfall loop for buffer_load
Matt Arsenault [Fri, 17 May 2019 12:02:27 +0000 (12:02 +0000)]
AMDGPU/GlobalISel: Use waterfall loop for buffer_load

This adds support for more complex waterfall loops that need to handle
operands > 32-bits, and multiple operands.

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

5 years agoGlobalISel: Fix missing version of customFor
Matt Arsenault [Fri, 17 May 2019 11:49:41 +0000 (11:49 +0000)]
GlobalISel: Fix missing version of customFor

Add the list of pairs analagous, like legalFor and customFor has.

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

5 years agoGlobalISel: Add fp<->int casts to MachineIRBuilder
Matt Arsenault [Fri, 17 May 2019 11:49:39 +0000 (11:49 +0000)]
GlobalISel: Add fp<->int casts to MachineIRBuilder

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

5 years agoGlobalISel: Add MIRBuilder wrappers for bitcount instructions
Matt Arsenault [Fri, 17 May 2019 11:49:35 +0000 (11:49 +0000)]
GlobalISel: Add MIRBuilder wrappers for bitcount instructions

Various expansions use these.

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

5 years ago[X86] Pull out IsNOT helper. NFCI.
Simon Pilgrim [Fri, 17 May 2019 10:37:08 +0000 (10:37 +0000)]
[X86] Pull out IsNOT helper. NFCI.

Return the input value for the NOT pattern: (xor X, -1) -> X

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

5 years agoRe-land r360859: "[MergeICmps] Simplify the code."
Clement Courbet [Fri, 17 May 2019 09:43:45 +0000 (09:43 +0000)]
Re-land r360859: "[MergeICmps] Simplify  the code."

With a fix for PR41917: The predecessor list was changing under our feet.

-  for (BasicBlock *Pred : predecessors(EntryBlock_)) {
+  while (!pred_empty(EntryBlock_)) {
+    BasicBlock* const Pred = *pred_begin(EntryBlock_);

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

5 years ago[AMDGPU] detect WaW hazards when moving/merging load/store instructions
Rhys Perry [Fri, 17 May 2019 09:32:23 +0000 (09:32 +0000)]
[AMDGPU] detect WaW hazards when moving/merging load/store instructions

Summary:
    In order to combine memory operations efficiently, the load/store
    optimizer might move some instructions around. It's usually safe
    to move instructions down past the merged instruction because the
    pass checks if memory operations can be re-ordered.

    Though, the current logic doesn't handle Write-after-Write hazards.

    This fixes a reflection issue with Monster Hunter World and DXVK.

    v2: - rebased on top of master
        - clean up the test case
        - handle WaW hazards correctly

    Bugzilla: https://bugs.llvm.org/show_bug.cgi?id=40130

Original patch by Samuel Pitoiset.

Reviewers: tpr, arsenm, nhaehnle

Reviewed By: nhaehnle

Subscribers: ronlieb, arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye

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

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

5 years ago[AArch64][SVE2] Asm: add saturating multiply-add long instructions
Cullen Rhodes [Fri, 17 May 2019 09:29:43 +0000 (09:29 +0000)]
[AArch64][SVE2] Asm: add saturating multiply-add long instructions

Summary:
Patch adds support for indexed and unpredicated vectors forms of the
following instructions:

    * SQDMLALB, SQDMLALT, SQDMLSLB, SQDMLSLT

The specification can be found here:
https://developer.arm.com/docs/ddi0602/latest

Reviewed By: SjoerdMeijer

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

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

5 years ago[AArch64][SVE2] Asm: add integer multiply-add long instructions
Cullen Rhodes [Fri, 17 May 2019 09:19:41 +0000 (09:19 +0000)]
[AArch64][SVE2] Asm: add integer multiply-add long instructions

Summary:
Patch adds support for indexed and unpredicated vectors forms of the
following instructions:

    * SMLALB, SMLALT, UMLALB, UMLALT, SMLSLB, SMLSLT, UMLSLB, UMLSLT

The specification can be found here:
https://developer.arm.com/docs/ddi0602/latest

Reviewed By: rovka

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

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

5 years ago[AArch64][SVE2] Asm: add integer multiply long instructions
Cullen Rhodes [Fri, 17 May 2019 09:04:44 +0000 (09:04 +0000)]
[AArch64][SVE2] Asm: add integer multiply long instructions

Summary:
Patch adds support for indexed and unpredicated vectors forms of the
following instructions:

    * SMULLB, SMULLT, UMULLB, UMULLT, SQDMULLB, SQDMULLT

The specification can be found here:
https://developer.arm.com/docs/ddi0602/latest

Reviewed By: rovka

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

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

5 years ago[MergeICmps] Add test from PR41917.
Clement Courbet [Fri, 17 May 2019 08:52:25 +0000 (08:52 +0000)]
[MergeICmps] Add test from PR41917.

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

5 years ago[Bugpoint] Only run plugins tests if plugins are enabled
Petr Hosek [Fri, 17 May 2019 06:41:04 +0000 (06:41 +0000)]
[Bugpoint] Only run plugins tests if plugins are enabled

This is a followup to r360991 which applies the same logic to LLVM.

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

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

5 years ago[X86] Add FeatureFastScalarShiftMasks and FeatureFastVectorShiftMasks to the ignore...
Craig Topper [Fri, 17 May 2019 06:40:21 +0000 (06:40 +0000)]
[X86] Add FeatureFastScalarShiftMasks and FeatureFastVectorShiftMasks to the ignore list for inlining compatibility.

These are tuning flags and won't cause any codegen issue if we inline a function
with a different value.

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

5 years ago[Analysis] Only run plugins tests if plugins are actually enabled
Petr Hosek [Fri, 17 May 2019 06:07:37 +0000 (06:07 +0000)]
[Analysis] Only run plugins tests if plugins are actually enabled

When plugins aren't enabled, don't try to run plugins tests. Don't
enable plugins unconditionally based on the platform, instead check
if LLVM shared library is actually being built which may not be the
case for every host configuration, even if the host itself supports
plugins.

This addresses test failures introduced by r360891/D59464.

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

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

5 years ago[PowerPC] Support .reloc *, R_PPC{,64}_NONE, *
Fangrui Song [Fri, 17 May 2019 06:04:11 +0000 (06:04 +0000)]
[PowerPC] Support .reloc *, R_PPC{,64}_NONE, *

This can be used to create references among sections. When --gc-sections
is used, the referenced section will be retained if the origin section
is retained.

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

5 years ago[GlobalISel] Fix -Wsign-compare on 32-bit -DLLVM_ENABLE_ASSERTIONS=on builds
Fangrui Song [Fri, 17 May 2019 05:53:39 +0000 (05:53 +0000)]
[GlobalISel] Fix -Wsign-compare on 32-bit -DLLVM_ENABLE_ASSERTIONS=on builds

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

5 years ago[MC][PowerPC] Clean up PPCAsmBackend
Fangrui Song [Fri, 17 May 2019 05:44:26 +0000 (05:44 +0000)]
[MC][PowerPC] Clean up PPCAsmBackend

Replace the member variable Target with Triple
Use Triple instead of TheTarget.getName() to dispatch on 32-bit/64-bit.
Delete redundant parameters

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

5 years ago[ELF] Implement Dependent Libraries Feature
Ben Dunbobbin [Fri, 17 May 2019 03:44:15 +0000 (03:44 +0000)]
[ELF] Implement Dependent Libraries Feature

This patch implements a limited form of autolinking primarily designed to allow
either the --dependent-library compiler option, or "comment lib" pragmas (
https://docs.microsoft.com/en-us/cpp/preprocessor/comment-c-cpp?view=vs-2017) in
C/C++ e.g. #pragma comment(lib, "foo"), to cause an ELF linker to automatically
add the specified library to the link when processing the input file generated
by the compiler.

Currently this extension is unique to LLVM and LLD. However, care has been taken
to design this feature so that it could be supported by other ELF linkers.

The design goals were to provide:

- A simple linking model for developers to reason about.
- The ability to to override autolinking from the linker command line.
- Source code compatibility, where possible, with "comment lib" pragmas in other
  environments (MSVC in particular).

Dependent library support is implemented differently for ELF platforms than on
the other platforms. Primarily this difference is that on ELF we pass the
dependent library specifiers directly to the linker without manipulating them.
This is in contrast to other platforms where they are mapped to a specific
linker option by the compiler. This difference is a result of the greater
variety of ELF linkers and the fact that ELF linkers tend to handle libraries in
a more complicated fashion than on other platforms. This forces us to defer
handling the specifiers to the linker.

In order to achieve a level of source code compatibility with other platforms
we have restricted this feature to work with libraries that meet the following
"reasonable" requirements:

1. There are no competing defined symbols in a given set of libraries, or
   if they exist, the program owner doesn't care which is linked to their
   program.
2. There may be circular dependencies between libraries.

The binary representation is a mergeable string section (SHF_MERGE,
SHF_STRINGS), called .deplibs, with custom type SHT_LLVM_DEPENDENT_LIBRARIES
(0x6fff4c04). The compiler forms this section by concatenating the arguments of
the "comment lib" pragmas and --dependent-library options in the order they are
encountered. Partial (-r, -Ur) links are handled by concatenating .deplibs
sections with the normal mergeable string section rules. As an example, #pragma
comment(lib, "foo") would result in:

.section ".deplibs","MS",@llvm_dependent_libraries,1
         .asciz "foo"

For LTO, equivalent information to the contents of a the .deplibs section can be
retrieved by the LLD for bitcode input files.

LLD processes the dependent library specifiers in the following way:

1. Dependent libraries which are found from the specifiers in .deplibs sections
   of relocatable object files are added when the linker decides to include that
   file (which could itself be in a library) in the link. Dependent libraries
   behave as if they were appended to the command line after all other options. As
   a consequence the set of dependent libraries are searched last to resolve
   symbols.
2. It is an error if a file cannot be found for a given specifier.
3. Any command line options in effect at the end of the command line parsing apply
   to the dependent libraries, e.g. --whole-archive.
4. The linker tries to add a library or relocatable object file from each of the
   strings in a .deplibs section by; first, handling the string as if it was
   specified on the command line; second, by looking for the string in each of the
   library search paths in turn; third, by looking for a lib<string>.a or
   lib<string>.so (depending on the current mode of the linker) in each of the
   library search paths.
5. A new command line option --no-dependent-libraries tells LLD to ignore the
   dependent libraries.

Rationale for the above points:

1. Adding the dependent libraries last makes the process simple to understand
   from a developers perspective. All linkers are able to implement this scheme.
2. Error-ing for libraries that are not found seems like better behavior than
   failing the link during symbol resolution.
3. It seems useful for the user to be able to apply command line options which
   will affect all of the dependent libraries. There is a potential problem of
   surprise for developers, who might not realize that these options would apply
   to these "invisible" input files; however, despite the potential for surprise,
   this is easy for developers to reason about and gives developers the control
   that they may require.
4. This algorithm takes into account all of the different ways that ELF linkers
   find input files. The different search methods are tried by the linker in most
   obvious to least obvious order.
5. I considered adding finer grained control over which dependent libraries were
   ignored (e.g. MSVC has /nodefaultlib:<library>); however, I concluded that this
   is not necessary: if finer control is required developers can fall back to using
   the command line directly.

RFC thread: http://lists.llvm.org/pipermail/llvm-dev/2019-March/131004.html.

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

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

5 years ago[X86] Support .reloc *, R_{386,X86_64}_NONE, *
Fangrui Song [Fri, 17 May 2019 03:25:39 +0000 (03:25 +0000)]
[X86] Support .reloc *, R_{386,X86_64}_NONE, *

This can be used to create references among sections. When --gc-sections
is used, the referenced section will be retained if the origin section
is retained.

See R_MIPS_NONE (D13659), R_ARM_NONE (D61992), R_AARCH64_NONE (D61973) for similar changes.

Reviewed By: rnk

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

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

5 years ago[AArch64] Support .reloc *, R_AARCH64_NONE, *
Fangrui Song [Fri, 17 May 2019 03:05:07 +0000 (03:05 +0000)]
[AArch64] Support .reloc *, R_AARCH64_NONE, *

Summary:
This can be used to create references among sections. When --gc-sections
is used, the referenced section will be retained if the origin section
is retained.

Reviewed By: peter.smith

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

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

5 years ago[ARM] Support .reloc *, R_ARM_NONE, *
Fangrui Song [Fri, 17 May 2019 02:51:54 +0000 (02:51 +0000)]
[ARM] Support .reloc *, R_ARM_NONE, *

R_ARM_NONE can be used to create references among sections. When
--gc-sections is used, the referenced section will be retained if the
origin section is retained.

Add a generic MCFixupKind FK_NONE as this kind of no-op relocation is
ubiquitous on ELF and COFF, and probably available on many other binary
formats. See D62014.

Reviewed By: peter.smith

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

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

5 years ago[LFTR] Strengthen assertions in genLoopLimit [NFCI]
Philip Reames [Fri, 17 May 2019 02:18:03 +0000 (02:18 +0000)]
[LFTR] Strengthen assertions in genLoopLimit [NFCI]

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

5 years ago[IndVars] Don't reimplement Loop::isLoopInvariant [NFC]
Philip Reames [Fri, 17 May 2019 02:09:03 +0000 (02:09 +0000)]
[IndVars] Don't reimplement Loop::isLoopInvariant [NFC]

Using dominance vs a set membership check is indistinguishable from a compile time perspective, and the two queries return equivelent results.  Simplify code by using the existing function.

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

5 years ago[LFTR] Factor out a helper function for readability purpose [NFC]
Philip Reames [Fri, 17 May 2019 01:39:58 +0000 (01:39 +0000)]
[LFTR] Factor out a helper function for readability purpose [NFC]

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

5 years ago[CodeMetrics] Don't let extends of i1 be free.
Jonas Paulsson [Fri, 17 May 2019 01:26:35 +0000 (01:26 +0000)]
[CodeMetrics]  Don't let extends of i1 be free.

getUserCost() currently returns TCC_Free for any extend of a compare (i1)
result. It seems this is only true in a limited number of cases where for
example two compares are chained. Even in those types of cases it seems
unlikely that they are generally free, while they may be in some cases.

This patch therefore removes this special handling of cast of i1. No tests
are failing because of this.

If some target want the old behavior, it could override getUserCost().

Review: Hal Finkel, Chandler Carruth, Evgeny Astigeevich, Simon Pilgrim,
        Ulrich Weigand
https://reviews.llvm.org/D54742/new/

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

5 years agoFix broken test case.
Richard Trieu [Fri, 17 May 2019 01:17:32 +0000 (01:17 +0000)]
Fix broken test case.

EXPECT_EQ takes two arguments, not a single expression that evaluates to bool.

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

5 years agoClarify comments on helpers used by LFTR [NFC]
Philip Reames [Fri, 17 May 2019 01:12:02 +0000 (01:12 +0000)]
Clarify comments on helpers used by LFTR [NFC]

I'm slowly wrapping my head around this code, and am making comment improvements where I can.

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

5 years ago[SystemZ] Bugfix in SystemZTargetLowering::combineIntDIVREM()
Jonas Paulsson [Fri, 17 May 2019 00:50:35 +0000 (00:50 +0000)]
[SystemZ]  Bugfix in SystemZTargetLowering::combineIntDIVREM()

Make sure to not unroll a vector division/remainder (with a constant splat
divisor) after type legalization, since the scalar type may then be illegal.

Review: Ulrich Weigand
https://reviews.llvm.org/D62036

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

5 years agoRevert r360859: "Reland r360771 "[MergeICmps] Simplify the code.""
Nico Weber [Fri, 17 May 2019 00:43:53 +0000 (00:43 +0000)]
Revert r360859: "Reland r360771 "[MergeICmps] Simplify the code.""

It caused PR41917.

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

5 years agoConvert PointerUnion to a variadic template.
Richard Smith [Fri, 17 May 2019 00:39:38 +0000 (00:39 +0000)]
Convert PointerUnion to a variadic template.

Summary:
Rather than duplicating code between PointerUnion, PointerUnion3, and
PointerUnion4 (and missing things from the latter cases, such as some of the
DenseMap support and operator==), convert PointerUnion to a variadic template
that can be used as a union of any number of pointers.

(This doesn't support PointerUnion<> right now. Adding a special case for that
would be possible, and perhaps even useful in some situations, but it doesn't
seem worthwhile until we have a concrete use case.)

Reviewers: dblaikie

Subscribers: dexonsmith, kristina, llvm-commits

Tags: #llvm

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

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

5 years ago[Tests] Consolidate more lftr tests
Philip Reames [Fri, 17 May 2019 00:19:28 +0000 (00:19 +0000)]
[Tests] Consolidate more lftr tests

These are all of the ones involving the same data layout string.  Remainder take a bit more consideration, but at least everything can be auto-updated now.

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

5 years ago[X86][AsmParser] Add mnemonics missed in r360954.
David L. Jones [Fri, 17 May 2019 00:19:20 +0000 (00:19 +0000)]
[X86][AsmParser] Add mnemonics missed in r360954.

These are valid Jcc, but aren't based on the EFLAGS condition codes (Intel 64
and IA-32 Architetcures Software Developer's Manual Vol. 1, Appendix B). These
are covered in clang/test, but not llvm/test.

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

5 years agoHWASan exception support.
Evgeniy Stepanov [Thu, 16 May 2019 23:54:41 +0000 (23:54 +0000)]
HWASan exception support.

Summary:
Adds a call to __hwasan_handle_vfork(SP) at each landingpad entry.

Reusing __hwasan_handle_vfork instead of introducing a new runtime call
in order to be ABI-compatible with old runtime library.

Reviewers: pcc

Subscribers: kubamracek, hiraditya, #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

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

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

5 years ago[Tests] Expand basic lftr coverage
Philip Reames [Thu, 16 May 2019 23:41:28 +0000 (23:41 +0000)]
[Tests] Expand basic lftr coverage

Newly written tests to cover the simple cases.  We don't appear to have broad coverage of this transform anywhere.

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

5 years ago[X86][AsmParser] Ignore "short" even harder in Intel syntax ASM.
David L. Jones [Thu, 16 May 2019 23:27:07 +0000 (23:27 +0000)]
[X86][AsmParser] Ignore "short" even harder in Intel syntax ASM.

In Intel syntax, it's not uncommon to see a "short" modifier on Jcc conditional
jumps, which indicates the offset should be a "short jump" (8-bit immediate
offset from EIP, -128 to +127). This patch expands to all recognized Jcc
condition codes, and removes the inline restriction.

Clang already ignores "jmp short" in inline assembly. However, only "jmp" and a
couple of Jcc are actually checked, and only inline (i.e., not when using the
integrated assembler for asm sources). A quick search through asm-containing
libraries at hand shows a pretty broad range of Jcc conditions spelled with
"short."

GAS ignores the "short" modifier, and instead uses an encoding based on the
given immediate. MS inline seems to do the same, and I suspect MASM does, too.
NASM will yield an error if presented with an out-of-range immediate value.

Example of GCC 9.1 and MSVC v19.20, "jmp short" with offsets that do and do not
fit within 8 bits: https://gcc.godbolt.org/z/aFZmjY

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

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

5 years ago[X86][AsmParser] Rename "ConditionCode" variable to "ConditionPredicate".
David L. Jones [Thu, 16 May 2019 23:27:05 +0000 (23:27 +0000)]
[X86][AsmParser] Rename "ConditionCode" variable to "ConditionPredicate".

This better matches the verbiage in Intel documentation, and should help avoid
confusion between these two different kinds of values, both of which are parsed
from mnemonics.

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

5 years ago[X86] Deduplicate symbol lowering logic, NFC
Reid Kleckner [Thu, 16 May 2019 23:15:26 +0000 (23:15 +0000)]
[X86] Deduplicate symbol lowering logic, NFC

Summary:
This refactors four pieces of code that create SDNodes for references to
symbols:
- normal global address lowering (LEA, MOV, etc)
- callee global address lowering (CALL)
- external symbol address lowering (LEA, MOV, etc)
- external symbol address lowering (CALL)

Each of these pieces of code need to:
- classify the reference
- lower the symbol
- emit a RIP wrapper if needed
- emit a load if needed
- add offsets if needed

I think handling them all in one place will make the code easier to
maintain in the future.

Reviewers: craig.topper, RKSimon

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

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

5 years agoEmit global variables as S_CONSTANT records for codeview debug info.
Amy Huang [Thu, 16 May 2019 22:28:52 +0000 (22:28 +0000)]
Emit global variables as S_CONSTANT records for codeview debug info.

Summary:
This emits S_CONSTANT records for global variables.
Currently this emits records for the global variables already being tracked in the
LLVM IR metadata, which are just constant global variables; we'll also want S_CONSTANTs
for static data members and enums.

Related to https://bugs.llvm.org/show_bug.cgi?id=41615

Reviewers: rnk

Subscribers: aprantl, hiraditya, llvm-commits, thakis

Tags: #llvm

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

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

5 years ago[CodeGen] Fixed de-optimization of legalize subvector extract
Tim Renouf [Thu, 16 May 2019 21:49:06 +0000 (21:49 +0000)]
[CodeGen] Fixed de-optimization of legalize subvector extract

The recent introduction of v3i32 etc as an MVT, and its use in AMDGPU
3-dword memory instructions, caused a de-optimization problem for code
with such a load that then bitcasts via vector of i8, because v12i8 is
not an MVT so it legalizes the bitcast by widening it.

This commit adds the ability to widen a bitcast using extract_subvector
on the result, so the value does not need to go via memory.

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

Change-Id: Ie4abb7760547e54a2445961992eafc78e80d4b64

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

5 years ago[Tests] More consolidation of lftr tests
Philip Reames [Thu, 16 May 2019 20:42:00 +0000 (20:42 +0000)]
[Tests] More consolidation of lftr tests

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

5 years ago[Test] Remove a bunch of cruft from a test
Philip Reames [Thu, 16 May 2019 20:37:20 +0000 (20:37 +0000)]
[Test] Remove a bunch of cruft from a test

This test hadn't been fully reduced, so do so.

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

5 years ago[Tests] Start consolidating lftr tests into a single file
Philip Reames [Thu, 16 May 2019 20:33:41 +0000 (20:33 +0000)]
[Tests] Start consolidating lftr tests into a single file

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

5 years ago[Tests] Autogen the last lftr test
Philip Reames [Thu, 16 May 2019 20:24:57 +0000 (20:24 +0000)]
[Tests] Autogen the last lftr test

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

5 years ago[Tests] Autogen a few more lftr tests for readability
Philip Reames [Thu, 16 May 2019 20:19:02 +0000 (20:19 +0000)]
[Tests] Autogen a few more lftr tests for readability

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

5 years ago[Tests] Autogen a few lftr test in preparation for merging
Philip Reames [Thu, 16 May 2019 20:15:25 +0000 (20:15 +0000)]
[Tests] Autogen a few lftr test in preparation for merging

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

5 years ago[NFC][InstSimplify] Update fast-math.ll tests I botched in r360808.
Cameron McInally [Thu, 16 May 2019 19:00:57 +0000 (19:00 +0000)]
[NFC][InstSimplify] Update fast-math.ll tests I botched in r360808.

These were new tests I added in r360808. I made a mistake while converting the exisiting binary FNeg test into the new unary FNeg tests. Correct that.

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

5 years ago[ORC] Change handling for SymbolStringPtr tombstones and empty keys.
Lang Hames [Thu, 16 May 2019 18:29:34 +0000 (18:29 +0000)]
[ORC] Change handling for SymbolStringPtr tombstones and empty keys.

SymbolStringPtr used to use nullptr as its empty value and (since it performed
ref-count operations on any non-nullptr) a pointer to a special pool-entry
instance as its tombstone.

This commit changes the scheme to use two invalid pointer values as the empty
and tombstone values, and broadens the ref-count guard to prevent ref-counting
operations from being performed on these pointers. This should improve the
performance of SymbolStringPtrs used in DenseMaps/DenseSets, as ref counting
operations will no longer be performed on the tombstone.

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

5 years ago[InstCombine] add tests for shuffle of insert subvectors; NFC
Sanjay Patel [Thu, 16 May 2019 18:09:47 +0000 (18:09 +0000)]
[InstCombine] add tests for shuffle of insert subvectors; NFC

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

5 years agoFix typos in comment.
Joerg Sonnenberger [Thu, 16 May 2019 18:01:57 +0000 (18:01 +0000)]
Fix typos in comment.

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

5 years ago[ORC] Use inline friend definitions for SymbolStringPtr operators.
Lang Hames [Thu, 16 May 2019 17:20:17 +0000 (17:20 +0000)]
[ORC] Use inline friend definitions for SymbolStringPtr operators.

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

5 years ago[X86] Use 0x9 instead of 0x1 as the immediate in some masked floor pattern. Similarly...
Craig Topper [Thu, 16 May 2019 16:53:50 +0000 (16:53 +0000)]
[X86] Use 0x9 instead of 0x1 as the immediate in some masked floor pattern. Similarly change 0x2 to 0xA for ceil.

This suppresses exceptions which is what we should be doing for ceil and floor. We already use the correct immediate
in patterns without masking.

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

5 years ago[CommandLine] Don't allow duplicate categories.
Don Hinton [Thu, 16 May 2019 16:25:13 +0000 (16:25 +0000)]
[CommandLine] Don't allow duplicate categories.

Summary:
This is a fix to D61574, r360179, that allowed duplicate
OptionCategory's.  This change adds a check to make sure a category can
only be added once even if the user passes it twice.

Reviewed By: MaskRay

Tags: #llvm

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

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

5 years ago[llvm-objdump]Move test code missed in r360904
James Henderson [Thu, 16 May 2019 15:20:08 +0000 (15:20 +0000)]
[llvm-objdump]Move test code missed in r360904

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

5 years agoMinidump: Add support for the MemoryList stream
Pavel Labath [Thu, 16 May 2019 15:17:30 +0000 (15:17 +0000)]
Minidump: Add support for the MemoryList stream

Summary:
the stream format is exactly the same as for ThreadList and ModuleList
streams, only the entry types are slightly different, so the changes in
this patch are just straight-forward applications of established
patterns.

Reviewers: amccarth, jhenderson, clayborg

Subscribers: markmentovai, lldb-commits, llvm-commits

Tags: #llvm

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

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

5 years agoAMDGPU: Introduce TokenFactor for ABI register copies in call sequence
Matt Arsenault [Thu, 16 May 2019 15:10:27 +0000 (15:10 +0000)]
AMDGPU: Introduce TokenFactor for ABI register copies in call sequence

The call was missing chain dependencies on the pre-call copies. I
don't think this was causing any real issues however.

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

5 years ago[InstSimplify] add tests for fcmp of maxnum with constants; NFC
Sanjay Patel [Thu, 16 May 2019 15:00:11 +0000 (15:00 +0000)]
[InstSimplify] add tests for fcmp of maxnum with constants; NFC

Sibling tests for rL360899 (D61691).

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

5 years ago[llvm-objdump]Split section-filter.test in two to remove X86 dependency
James Henderson [Thu, 16 May 2019 14:49:10 +0000 (14:49 +0000)]
[llvm-objdump]Split section-filter.test in two to remove X86 dependency

This allows the generic parts of section-filter.test to be tested on all
targets. The X86-specific parts have been moved to another test.

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

5 years agoAMDGPU: Assume xnack is enabled by default
Matt Arsenault [Thu, 16 May 2019 14:48:34 +0000 (14:48 +0000)]
AMDGPU: Assume xnack is enabled by default

This is the conservatively correct default. It is always safe to
assume xnack is enabled, but not the converse.

Introduce a feature to blacklist targets where xnack can never be
meaningfully enabled. I'm not sure the targets this is applied to is
100% correct.

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

5 years agoResubmit: [Salvage] Change salvage debug info implementation to use DW_OP_LLVM_conver...
Stephen Tozer [Thu, 16 May 2019 14:41:01 +0000 (14:41 +0000)]
Resubmit: [Salvage] Change salvage debug info implementation to use DW_OP_LLVM_convert where needed

Fixes issue: https://bugs.llvm.org/show_bug.cgi?id=40645

Previously, LLVM had no functional way of performing casts inside of a
DIExpression(), which made salvaging cast instructions other than Noop casts
impossible. With the recent addition of DW_OP_LLVM_convert this salvaging is
now possible, and so can be used to fix the attached bug as well as any cases
where SExt instruction results are lost in the debugging metadata. This patch
introduces this fix by expanding the salvage debug info method to cover these
cases using the new operator.

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

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

5 years ago[llvm-objdump] Add "REQUIES: x86-registered-target" to section-filter.test after...
Fangrui Song [Thu, 16 May 2019 14:40:31 +0000 (14:40 +0000)]
[llvm-objdump] Add "REQUIES: x86-registered-target" to section-filter.test after rL360893

Appease the hexagon buildbot that doesn't build X86. Disassemblers
require Target/X86 support.

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

5 years ago[InstSimplify] fold fcmp (minnum, X, C1), C2
Sanjay Patel [Thu, 16 May 2019 14:03:10 +0000 (14:03 +0000)]
[InstSimplify] fold fcmp (minnum, X, C1), C2
   minnum(X, LesserC) == C --> false
   minnum(X, LesserC) >= C --> false
   minnum(X, LesserC) >  C --> false
   minnum(X, LesserC) != C --> true
   minnum(X, LesserC) <= C --> true
   minnum(X, LesserC) <  C --> true

maxnum siblings will follow if there are no problems here.

We should be able to perform some other combines when the constants
are equal or greater-than too, but that would go in instcombine.

We might also generalize this by creating an FP ConstantRange
(similar to what we do for integers).

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

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

5 years agoFixes for builds that require strict X/Open and POSIX compatiblity
Xing Xue [Thu, 16 May 2019 14:02:13 +0000 (14:02 +0000)]
Fixes for builds that require strict X/Open and POSIX compatiblity

Summary:
- Use alternative to MAP_ANONYMOUS for allocating mapped memory if it isn't available
- Use strtok_r instead of strsep as part of getting program path
- Don't try to find the width of a terminal using "struct winsize" and TIOCGWINSZ on POSIX builds. These aren't defined under POSIX (even though some platforms make them available when they shouldn't), so just check if we are doing a X/Open or POSIX compliant build first.

Author: daltenty

Reviewers: hubert.reinterpretcast, xingxue, andusy

Reviewed By: hubert.reinterpretcast

Subscribers: MaskRay, jsji, hiraditya, kristina, llvm-commits

Tags: #llvm

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

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

5 years ago[RISCV][NFC] Add nounwind attribute to functions missing it in test/CodeGen/RISCV
Alex Bradbury [Thu, 16 May 2019 13:56:23 +0000 (13:56 +0000)]
[RISCV][NFC] Add nounwind attribute to functions missing it in test/CodeGen/RISCV

This is in preparation for emitting CFI directives.

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

5 years ago[tests][go]Add -stdlib=libc++ to build GO test if LLVM is built with libc++
Xing Xue [Thu, 16 May 2019 13:32:55 +0000 (13:32 +0000)]
[tests][go]Add -stdlib=libc++ to build GO test if LLVM is built with libc++

When libc++ is used to build LLVM libraries, these libraries have dependencies on libc++ and C++ STL signatures in these libraries are corresponding to libc++ implementation. Therefore, -stdlib=libc++ is required on the C++ compiler command for building GO tests that link with these LLVM libraries.

Reviewers: hubert.reinterpretcast, sfertile, amyk, EricWF

Reviewed By: sfertile, hubert.reinterpretcast

Subscribers: jsji, llvm-commits

Tags: #llvm

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

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

5 years ago[AArch64] Handle ISD::LROUND and ISD::LLROUND
Adhemerval Zanella [Thu, 16 May 2019 13:30:18 +0000 (13:30 +0000)]
[AArch64] Handle ISD::LROUND and ISD::LLROUND

This patch optimizes ISD::LROUND and ISD::LLROUND to fcvtas
instruction. It currently only handles the scalar version.

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

5 years ago[llvm-objdump]Improve testing of some switches #1
James Henderson [Thu, 16 May 2019 13:28:36 +0000 (13:28 +0000)]
[llvm-objdump]Improve testing of some switches #1

This is the first in a set of patches I have to improve testing of
llvm-objdump. This patch targets --all-headers, --section, and
--full-contents. In the --section case, it deletes a pre-canned binary
which is only used by the one test and replaces it with yaml.

Reviewed by: grimar, MaskRay

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

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

5 years agoRecommit [Object] Change object::SectionRef::getContents() to return Expected<StringRef>
Fangrui Song [Thu, 16 May 2019 13:24:04 +0000 (13:24 +0000)]
Recommit [Object] Change object::SectionRef::getContents() to return Expected<StringRef>

r360876 didn't fix 2 call sites in clang.

Expected<ArrayRef<uint8_t>> may be better but use Expected<StringRef> for now.

Follow-up of D61781.

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

5 years ago[CodeGen] Add lround/llround builtins
Adhemerval Zanella [Thu, 16 May 2019 13:15:27 +0000 (13:15 +0000)]
[CodeGen] Add lround/llround builtins

This patch add the ISD::LROUND and ISD::LLROUND along with new
intrinsics.  The changes are straightforward as for other
floating-point rounding functions, with just some adjustments
required to handle the return value being an interger.

The idea is to optimize lround/llround generation for AArch64
in a subsequent patch.  Current semantic is just route it to libm
symbol.

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

5 years agoGlobalISel: Add buildFMA to MachineIRBuilder
Matt Arsenault [Thu, 16 May 2019 13:04:20 +0000 (13:04 +0000)]
GlobalISel: Add buildFMA to MachineIRBuilder

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

5 years agoRegAllocFast: Improve hinting heuristic
Matt Arsenault [Thu, 16 May 2019 12:50:39 +0000 (12:50 +0000)]
RegAllocFast: Improve hinting heuristic

Trace through multiple COPYs when looking for a physreg source. Add
hinting for vregs that will be copied into physregs (we only hinted
for vregs getting copied to a physreg previously).  Give hinted a
register a bonus when deciding which value to spill.  This is part of
my rewrite regallocfast series. In fact this one doesn't even have an
effect unless you also flip the allocation to happen from back to
front of a basic block. Nonetheless it helps to split this up to ease
review of D52010

Patch by Matthias Braun

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

5 years ago[DominatorTree] Print roots unconditionally in `print()`.
Clement Courbet [Thu, 16 May 2019 12:48:56 +0000 (12:48 +0000)]
[DominatorTree] Print roots unconditionally in `print()`.

Summary:
This came up in a debugging session. I was failing to update the root of
the tree, and got during verification:

```
DominatorTree is different than a freshly computed one!
        Current:
=============================--------------------------------
Inorder Dominator Tree: DFSNumbers invalid: 0 slow queries.
  [1] %"entry+land.rhs.i" {4294967295,4294967295} [0]
    [2] %opeq1.exit {4294967295,4294967295} [1]

        Freshly computed tree:
=============================--------------------------------
Inorder Dominator Tree: DFSNumbers invalid: 0 slow queries.
  [1] %"entry+land.rhs.i" {4294967295,4294967295} [0]
    [2] %opeq1.exit {4294967295,4294967295} [1]
```

We now print:

```
DominatorTree is different than a freshly computed one!
        Current:
=============================--------------------------------
Inorder Dominator Tree: DFSNumbers invalid: 0 slow queries.
  [1] %"entry+land.rhs.i" {4294967295,4294967295} [0]
    [2] %opeq1.exit {4294967295,4294967295} [1]
Roots: <badref>

        Freshly computed tree:
=============================--------------------------------
Inorder Dominator Tree: DFSNumbers invalid: 0 slow queries.
  [1] %"entry+land.rhs.i" {4294967295,4294967295} [0]
    [2] %opeq1.exit {4294967295,4294967295} [1]
Roots: %"entry+land.rhs.i"
```

Reviewers: kuhar, asbirlea

Subscribers: llvm-commits

Tags: #llvm

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

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

5 years ago[NFC] Fixup FileCheck option name in tests added in rL360881
Roman Lebedev [Thu, 16 May 2019 12:39:34 +0000 (12:39 +0000)]
[NFC] Fixup FileCheck option name in tests added in rL360881

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

5 years ago[NFC][CodeGen] Add some more tests for pulling binops through shifts
Roman Lebedev [Thu, 16 May 2019 12:26:53 +0000 (12:26 +0000)]
[NFC][CodeGen] Add some more tests for pulling binops through shifts

The ashr variant may see relaxation in https://reviews.llvm.org/D61918

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

5 years agoGlobalISel: Add buildXor/buildNot
Matt Arsenault [Thu, 16 May 2019 12:23:04 +0000 (12:23 +0000)]
GlobalISel: Add buildXor/buildNot

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

5 years agoGlobalISel: Add DstOp version of buildIntrinsic
Matt Arsenault [Thu, 16 May 2019 12:22:56 +0000 (12:22 +0000)]
GlobalISel: Add DstOp version of buildIntrinsic

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