platform/upstream/llvm.git
4 years ago[LV] Predicated reduction tests. NFC
David Green [Tue, 18 Aug 2020 15:02:21 +0000 (16:02 +0100)]
[LV] Predicated reduction tests. NFC

4 years ago[NFC][clang-tidy] Put abseil headers in alphabetical order
Nathan James [Tue, 18 Aug 2020 14:52:37 +0000 (15:52 +0100)]
[NFC][clang-tidy] Put abseil headers in alphabetical order

4 years ago[X86][AVX] lowerShuffleWithPERMV - pad 128/256-bit shuffles on non-VLX targets
Simon Pilgrim [Tue, 18 Aug 2020 14:46:02 +0000 (15:46 +0100)]
[X86][AVX] lowerShuffleWithPERMV - pad 128/256-bit shuffles on non-VLX targets

Allow non-VLX targets to use 512-bits VPERMV/VPERMV3 for 128/256-bit shuffles.

TBH I'm not sure these targets actually exist in the wild, but we're testing for them and its good test coverage for shuffle lowering/combines across different subvector widths.

4 years ago[X86][AVX] lowerShuffleWithVTRUNC - extend to support v16i16/v32i8 binary shuffles.
Simon Pilgrim [Tue, 18 Aug 2020 14:24:28 +0000 (15:24 +0100)]
[X86][AVX] lowerShuffleWithVTRUNC - extend to support v16i16/v32i8 binary shuffles.

This requires a few additional SrcVT vs DstVT padding cases in getAVX512TruncNode.

4 years ago[SLP] remove instcombine dependency from regression test; NFC
Sanjay Patel [Tue, 18 Aug 2020 14:14:07 +0000 (10:14 -0400)]
[SLP] remove instcombine dependency from regression test; NFC

InstCombine doesn't do that much here - sinks some instructions
and improves alignments - but that should not be part of the
SLP pass unit testing.

4 years ago[X86][AVX] lowerShuffleWithVTRUNC - pull out TRUNCATE/VTRUNC creation into helper...
Simon Pilgrim [Tue, 18 Aug 2020 13:52:23 +0000 (14:52 +0100)]
[X86][AVX] lowerShuffleWithVTRUNC - pull out TRUNCATE/VTRUNC creation into helper code. NFCI.

Prep work toward adding v16i16/v32i8 support for lowerShuffleWithVTRUNC and improving lowerShuffleWithVPMOV.

4 years agoAMDGPU/GlobalISel: Select llvm.amdgcn.groupstaticsize
Matt Arsenault [Sun, 26 Jul 2020 19:43:48 +0000 (15:43 -0400)]
AMDGPU/GlobalISel: Select llvm.amdgcn.groupstaticsize

Previously, it would successfully select and assert if not HSA or PAL
when expanding the pseudoinstruction. We don't need the
pseudoinstruction anymore since we know the total size after
legalization.

4 years agoAMDGPU/GlobalISel: Fix selection of s1/s16 G_[F]CONSTANT
Matt Arsenault [Sat, 25 Jul 2020 17:21:31 +0000 (13:21 -0400)]
AMDGPU/GlobalISel: Fix selection of s1/s16 G_[F]CONSTANT

The code to determine the value size was overcomplicated and only
correct in the case where the result register already had a register
class assigned. We can always take the size directly from the
register's type.

4 years ago[llvm-readobj/elf] - Refine testing of broken Android's packed relocation sections.
Georgii Rymar [Wed, 12 Aug 2020 13:54:49 +0000 (16:54 +0300)]
[llvm-readobj/elf] - Refine testing of broken Android's packed relocation sections.

This uses modern `split-file` tool to merge 5 `packed-relocs-error*.s` tests to a
new `packed-relocs-errors.s` and adds testing for GNU style.

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

4 years ago[InstCombine] fold fabs of select with negated operand
Sanjay Patel [Tue, 18 Aug 2020 13:19:03 +0000 (09:19 -0400)]
[InstCombine] fold fabs of select with negated operand

This is the FP example shown in:
https://bugs.llvm.org/PR39474

4 years ago[InstCombine] add tests for fneg+fabs; NFC
Sanjay Patel [Tue, 18 Aug 2020 12:24:37 +0000 (08:24 -0400)]
[InstCombine] add tests for fneg+fabs; NFC

4 years ago[yaml2obj] - Don't crash when `FileHeader` declares an empty `Flags` key in specific...
Georgii Rymar [Tue, 18 Aug 2020 12:52:09 +0000 (15:52 +0300)]
[yaml2obj] - Don't crash when `FileHeader` declares an empty `Flags` key in specific situations.

We currently call the `llvm_unreachable` for the following YAML:

```
--- !ELF
FileHeader:
  Class:   ELFCLASS32
  Data:    ELFDATA2LSB
  Type:    ET_REL
  Machine: EM_NONE
  Flags:   [ ]
```

it happens because the `Flags` key is present, though `EM_NONE` is a
machine type that has no known `EF_*` values and we call `llvm_unreachable` by mistake.

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

4 years ago[OPENMP]Do not capture base pointer by reference if it is used as a base for array...
Alexey Bataev [Wed, 5 Aug 2020 15:48:35 +0000 (11:48 -0400)]
[OPENMP]Do not capture base pointer by reference if it is used as a base for array-like reduction.

If the declaration is used in the reduction clause, it is captured by
reference by default. But if the declaration is a pointer and it is a
base for array-like reduction, this declaration can be captured by
value, since the pointee is reduced but not the original declaration.

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

4 years ago[SyntaxTree] Use Annotations based tests for expressions
Eduardo Caldas [Fri, 14 Aug 2020 09:53:45 +0000 (09:53 +0000)]
[SyntaxTree] Use Annotations based tests for expressions

In this process we also create some other tests, in order to not lose
coverage when focusing on the annotated code

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

4 years ago[SyntaxTree] Implement annotation-based test infrastructure
Eduardo Caldas [Fri, 14 Aug 2020 09:43:20 +0000 (09:43 +0000)]
[SyntaxTree] Implement annotation-based test infrastructure

We add the method `SyntaxTreeTest::treeDumpEqualOnAnnotations`, which
allows us to compare the treeDump of only annotated code. This will reduce a
lot of noise from our `BuildTreeTest` and make them short and easier to
read.

4 years ago[ELF] Hide target specific methods as private
Ronak Chauhan [Tue, 18 Aug 2020 12:42:41 +0000 (18:12 +0530)]
[ELF] Hide target specific methods as private

Reviewed By: jhenderson

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

4 years ago[X86][AVX] lowerShuffleWithVTRUNC - avoid unnecessary division in element counts...
Simon Pilgrim [Tue, 18 Aug 2020 12:38:10 +0000 (13:38 +0100)]
[X86][AVX] lowerShuffleWithVTRUNC - avoid unnecessary division in element counts. NFCI.

(256 / SrcEltBits) == ((2 * EltSizeInBits * NumElts) / (EltSizeInBits * Scale)) == (2 * (NumElts / Scale)) == NumSrcElts

4 years agoRevert "PR44685: DebugInfo: Handle address-use-invalid type units referencing non...
Nico Weber [Tue, 18 Aug 2020 12:40:36 +0000 (08:40 -0400)]
Revert "PR44685: DebugInfo: Handle address-use-invalid type units referencing non-type units"

This reverts commit be3ef93bf58aa5546c7baadfb21d43b75fbb4e24.
Test fails on macOS and Windows, e.g. http://45.33.8.238/win/22216/step_11.txt

4 years ago[llvm-objdump][AMDGPU] Detect CPU string
Ronak Chauhan [Fri, 24 Jul 2020 09:51:46 +0000 (15:21 +0530)]
[llvm-objdump][AMDGPU] Detect CPU string

AMDGPU ISA isn't backwards compatible and hence -mcpu must always be specified during disassembly.
However, the AMDGPU target CPU is stored in e_flags in the ELF object.

This patch allows targets to implement CPU string detection, and also implements it for AMDGPU by looking at e_flags.

Reviewed By: scott.linder

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

4 years ago[lldb][gui] use left/right in the source view to scroll
Luboš Luňák [Wed, 5 Aug 2020 11:00:37 +0000 (13:00 +0200)]
[lldb][gui] use left/right in the source view to scroll

I intentionally decided not to reset the column automatically
anywhere, because I don't know where and if at all that should happen.
There should be always an indication of being scrolled (too much)
to the right, so I'll leave this to whoever has an opinion.

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

4 years ago[mlir] expose standard types to C API
Alex Zinenko [Tue, 18 Aug 2020 08:26:30 +0000 (10:26 +0200)]
[mlir] expose standard types to C API

Provide C API for MLIR standard types. Since standard types live under lib/IR
in core MLIR, place the C APIs in the IR library as well (standard ops will go
into a separate library). This also defines a placeholder for affine maps that
are necessary to construct a memref, but are not yet exposed to the C API.

Reviewed By: stellaraccident

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

4 years ago[SVE] Fix shift-by-imm patterns used by asr, lsl & lsr intrinsics.
Paul Walker [Thu, 13 Aug 2020 14:52:00 +0000 (15:52 +0100)]
[SVE] Fix shift-by-imm patterns used by asr, lsl & lsr intrinsics.

Right shift patterns will no longer incorrectly accept a shift
amount of zero.  At the same time they will allow larger shift
amounts that are now saturated to their upper bound.

Patterns have been extended to enable immediate forms for shifts
taking an arbitrary predicate.

This patch also unifies the code path for immediate parsing so the
i64 based shifts are no longer treated specially.

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

4 years ago[NFC] Add some more Arm tests for IndVarSimplify
Sam Parker [Tue, 18 Aug 2020 10:21:03 +0000 (11:21 +0100)]
[NFC] Add some more Arm tests for IndVarSimplify

Copy some generic functions and apply minsize for arm.

4 years ago[SVE] Lower fixed length vector ISD::SPLAT_VECTOR operations.
Paul Walker [Mon, 17 Aug 2020 11:46:55 +0000 (12:46 +0100)]
[SVE] Lower fixed length vector ISD::SPLAT_VECTOR operations.

Also strengthens the CHECK lines for scalable vector splat tests.

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

4 years ago[X86][AVX] Lower v16i8/v8i16 binary shuffles using VTRUNC/TRUNCATE
Simon Pilgrim [Tue, 18 Aug 2020 10:11:58 +0000 (11:11 +0100)]
[X86][AVX] Lower v16i8/v8i16 binary shuffles using VTRUNC/TRUNCATE

This patch adds lowerShuffleWithVTRUNC to handle basic binary shuffles that can be lowered either as a pure ISD::TRUNCATE or a X86ISD::VTRUNC (with undef/zero values in the remaining upper elements).

We concat the binary sources together into a single 256-bit source vector. To avoid regressions we perform this after we've tried to lower with PACKS/PACKUS which typically does a cleaner job than a concat.

For non-AVX512VL cases we have to canonicalize VTRUNC cases to use a 512-bit source vectors (inserting undefs/zeros in the upper elements as necessary), truncate and then (possibly) extract the 128-bit result.

This should address the last regressions in D66004

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

4 years ago[Flang] Move markdown files(.MD) from documentation/ to docs/
sameeran joshi [Tue, 18 Aug 2020 09:35:51 +0000 (15:05 +0530)]
[Flang] Move markdown files(.MD) from documentation/ to docs/

Summary:
Other LLVM sub-projects use docs/ folder for documentation files.
Follow LLVM project policy.
Modify `documentation/` references in sources to `docs/`.
This patch doesn't modify files to reStructuredText(.rst) file format.

Reviewed By: DavidTruby, sscalpone

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

4 years ago[Test][NFC] Add a new test to verify if scheduler can cluster two ld/st
QingShan Zhang [Tue, 18 Aug 2020 09:40:37 +0000 (09:40 +0000)]
[Test][NFC] Add a new test to verify if scheduler can cluster two ld/st
even with different preds

4 years ago[compiler-rt][test] XFAIL two tests on 32-bit sparc
Rainer Orth [Tue, 18 Aug 2020 09:32:51 +0000 (11:32 +0200)]
[compiler-rt][test] XFAIL two tests on 32-bit sparc

Two tests `FAIL` on 32-bit sparc:

  Profile-sparc :: Posix/instrprof-gcov-parallel.test
  UBSan-Standalone-sparc :: TestCases/Float/cast-overflow.cpp

The failure mode is similar:

  Undefined                       first referenced
   symbol                             in file
  __atomic_store_4                    /var/tmp/instrprof-gcov-parallel-6afe8d.o
  __atomic_load_4                     /var/tmp/instrprof-gcov-parallel-6afe8d.o

  Undefined                       first referenced
   symbol                             in file
  __atomic_load_1                     /var/tmp/cast-overflow-72a808.o

This is a known bug: `clang` doesn't inline atomics on 32-bit sparc, unlike
`gcc`.

The patch therefore `XFAIL`s the tests.

Tested on `sparcv9-sun-solaris2.11` and `amd64-pc-solaris2.11`.

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

4 years ago[gn build] Port 00d7b7d014f
LLVM GN Syncbot [Tue, 18 Aug 2020 09:10:43 +0000 (09:10 +0000)]
[gn build] Port 00d7b7d014f

4 years ago[Attributor] Deduce noundef attribute
Shinji Okumura [Tue, 18 Aug 2020 09:04:47 +0000 (18:04 +0900)]
[Attributor] Deduce noundef attribute

This patch introduces a new abstract attribute `AANoUndef` which corresponds to `noundef` IR attribute and deduce them.

Reviewed By: jdoerfert

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

4 years ago[llvm-readobj/elf] - Refine the malformed-pt-dynamic.test.
Georgii Rymar [Mon, 17 Aug 2020 13:38:56 +0000 (16:38 +0300)]
[llvm-readobj/elf] - Refine the malformed-pt-dynamic.test.

This is splitted out from D85519, but significantly reworked.

Changes:
1) This test was changed to stop using python.
2) Use NoHeaders: true instead of `llvm-objcopy --strip-sections`.
3) Test llvm-readelf too (not just llvm-readobj).
4) Simplify the YAML used a bit (e.g. remove PT_LOAD).
5) Test 2 different cases: objects with section header table and without.

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

4 years ago[llvm-readobj/elf] - Merge mips-got-overlapped.test to mips-got.test and refine testing.
Georgii Rymar [Mon, 17 Aug 2020 14:58:14 +0000 (17:58 +0300)]
[llvm-readobj/elf] - Merge mips-got-overlapped.test to mips-got.test and refine testing.

The `mips-got-overlapped.test` was introduced in D16968 and its intention is
to check that when there is an empty section at the same address as `.got`,
then we are able to locate `.got` and dump it.

The issue is that this test does not test llvm-readelf and uses a precompiled
object. This path starts using YAML instead and merges
mips-got-overlapped.test to mips-got.test.

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

4 years ago[mlir] Fix printing of unranked memrefs in non-default memory space
Alex Zinenko [Mon, 17 Aug 2020 18:25:28 +0000 (20:25 +0200)]
[mlir] Fix printing of unranked memrefs in non-default memory space

The type printer was ignoring the memory space on unranked memrefs.

Reviewed By: rriddle

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

4 years ago[mlir] VectorToSCF bug in setAllocAtFunctionEntry fixed.
Jakub Lichman [Tue, 18 Aug 2020 07:11:52 +0000 (07:11 +0000)]
[mlir] VectorToSCF bug in setAllocAtFunctionEntry fixed.

The function makes too strong assumption regarding parent FuncOp
which gets broken when FuncOp is first lowered to llvm function.
In this fix we generalize the assumption to allocation scope and
add assertion to produce user friendly message in case our assumption
is broken.

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

4 years ago[clangd] Target member of dependent base made visible via a using-decl
Nathan Ridge [Thu, 12 Mar 2020 23:27:18 +0000 (19:27 -0400)]
[clangd] Target member of dependent base made visible via a using-decl

Fixes https://github.com/clangd/clangd/issues/307

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

4 years agoPR44685: DebugInfo: Handle address-use-invalid type units referencing non-type units
David Blaikie [Tue, 18 Aug 2020 04:27:19 +0000 (21:27 -0700)]
PR44685: DebugInfo: Handle address-use-invalid type units referencing non-type units

Theory was that we should never reach a non-type unit (eg: type in an
anonymous namespace) when we're already in the invalid "encountered an
address-use, so stop emitting types for now, until we throw out the
whole type tree to restart emitting in non-type unit" state. But that's
not the case (prior commit cleaned up one reason this wasn't exposed
sooner - but also makes it easier to test/demonstrate this issue)

4 years agoDebugInfo: Emit class template parameters first, before members
David Blaikie [Tue, 18 Aug 2020 01:17:38 +0000 (18:17 -0700)]
DebugInfo: Emit class template parameters first, before members

This reads more like what you'd expect the DWARF to look like (from the
lexical order of C++ - template parameters come before members, etc),
and also happens to make it easier to tickle (& thus test) a bug related
to type units and Split DWARF I'm about to fix.

4 years ago[Attributor] Bail early if AAMemoryLocation cannot derive anything
Johannes Doerfert [Sun, 2 Aug 2020 05:44:08 +0000 (00:44 -0500)]
[Attributor] Bail early if AAMemoryLocation cannot derive anything

Before this change we looked through all memory operations in a function
even if the first was an unknown call that could do anything. This did
cost a lot of time but there is little use to do so. We also avoid
creating AAs for things that we would have looked at in case no other AA
will; that is the reason for the test changes.

Running only the attributor-cgscc pass on a IR version of
`llvm-test-suite/MultiSource/Applications/SPASS/clause.c` reduced the
time we spend in `AAMemoryLocation::update` from 4% total to
0.9% (disclaimer: no accurate measurements).

4 years ago[Attributor] We (should) keep the CG updated so we can mark it as preserved
Johannes Doerfert [Sun, 2 Aug 2020 05:31:30 +0000 (00:31 -0500)]
[Attributor] We (should) keep the CG updated so we can mark it as preserved

4 years ago[Attributor][NFC] Directly return proper type to avoid casts
Johannes Doerfert [Sat, 1 Aug 2020 06:49:28 +0000 (01:49 -0500)]
[Attributor][NFC] Directly return proper type to avoid casts

4 years ago[Attributor][FIX] Handle function pointers properly in AANonNull
Johannes Doerfert [Tue, 18 Aug 2020 00:54:42 +0000 (19:54 -0500)]
[Attributor][FIX] Handle function pointers properly in AANonNull

Before we tired to create a dominator tree for a declaration when we
wanted to determine if the function pointer is `nonnull`. We now avoid
looking at global values if `Value::getPointerDereferenceableBytes` not
already determined `nonnull`.

4 years ago[clang] Fix visitation of ConceptSpecializationExpr in constrained-parameter
Nathan Ridge [Mon, 27 Jul 2020 02:45:24 +0000 (22:45 -0400)]
[clang] Fix visitation of ConceptSpecializationExpr in constrained-parameter

Summary: RecursiveASTVisitor needs to traverse TypeConstraint::ImmediatelyDeclaredConstraint

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits

Tags: #clang

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

4 years ago[clangd] Index refs to main-file symbols as well
Nathan Ridge [Sun, 16 Aug 2020 22:22:04 +0000 (18:22 -0400)]
[clangd] Index refs to main-file symbols as well

Summary: This will be needed to support call hierarchy

Reviewers: kadircet

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits

Tags: #clang

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

4 years agoUse find_library for ncurses
Harmen Stoppels [Tue, 18 Aug 2020 02:51:11 +0000 (19:51 -0700)]
Use find_library for ncurses

Currently it is hard to avoid having LLVM link to the system install of
ncurses, since it uses check_library_exists to find e.g. libtinfo and
not find_library or find_package.

With this change the ncurses lib is found with find_library, which also
considers CMAKE_PREFIX_PATH. This solves an issue for the spack package
manager, where we want to use the zlib installed by spack, and spack
provides the CMAKE_PREFIX_PATH for it.

This is a similar change as https://reviews.llvm.org/D79219, which just
landed in master.

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

4 years ago[PowerPC] Implement Vector Extract Mask builtins in LLVM/Clang
Amy Kwan [Wed, 12 Aug 2020 14:23:05 +0000 (09:23 -0500)]
[PowerPC] Implement Vector Extract Mask builtins in LLVM/Clang

This patch implements the vec_extractm function prototypes in altivec.h in
order to utilize the vector extract with mask instructions introduced in Power10.

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

4 years ago[NewPM] Pin various tests under Other/ to legacy PM
Arthur Eubanks [Tue, 18 Aug 2020 00:48:04 +0000 (17:48 -0700)]
[NewPM] Pin various tests under Other/ to legacy PM

These all are legacy PM-specific or have a corresponding NPM RUN line.

Reviewed By: ychen

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

4 years ago[OpenMPOpt][HideMemTransfersLatency] Split __tgt_target_data_begin_mapper into its...
Hamilton Tobon Mosquera [Tue, 18 Aug 2020 01:18:21 +0000 (20:18 -0500)]
[OpenMPOpt][HideMemTransfersLatency] Split __tgt_target_data_begin_mapper into its "issue" and "wait" counterparts.

WIP that tries to hide the latency of runtime calls that involve host to
device memory transfers by splitting them into their "issue" and "wait"
versions. The "issue" is moved upwards as much as possible. The "wait" is
moved downards as much as possible. The "issue" issues the memory transfer
asynchronously, returning a handle. The "wait" waits in the returned
handle for the memory transfer to finish. We still lack of the movement.

4 years agoRevert "[libc++] Use CMake interface targets to setup benchmark flags"
Leonard Chan [Tue, 18 Aug 2020 01:11:56 +0000 (18:11 -0700)]
Revert "[libc++] Use CMake interface targets to setup benchmark flags"

This reverts commit da0592e4c8df95efad4e42d63646f8a5336a7edc.

Reverting because this is incompatible with cmake 3.13.5, with the
minimum supported version being 3.13.4.

See https://luci-milo.appspot.com/p/fuchsia/builders/ci/clang-linux-x64/b8871967816877544224.

4 years ago[llvm-objdump] Attempt to fix html doc generation issue.
Hongtao Yu [Tue, 18 Aug 2020 00:41:49 +0000 (17:41 -0700)]
[llvm-objdump] Attempt to fix html doc generation issue.

https://reviews.llvm.org/D84191 caused a html doc build issue with the changes in `llvm-objdump.rst`. It looks like a blank line is missing from the `code-block` directives.

Test Plan:

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

4 years agoNFC: [GVNHoist] Outline functions from the class
Aditya Kumar [Sun, 16 Aug 2020 03:35:10 +0000 (20:35 -0700)]
NFC: [GVNHoist] Outline functions from the class

Reviewers: sebpop
Reviewed By: hiraditya

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

4 years ago[X86] When manually creating intrinsic nodes in X86ISelLowering, make sure we use...
Craig Topper [Mon, 17 Aug 2020 23:31:51 +0000 (16:31 -0700)]
[X86] When manually creating intrinsic nodes in X86ISelLowering, make sure we use getTargetConstant and pointer type for the intrinsic ID.

Doesn't really matter in practice but that's how the nodes are
normally created by SelectionDAGBuilder. So we should match.

Found by temporarily hacking type checks into isel table.

4 years ago[X86] Rename INTR_TYPE_4OP to INTR_TYPE_4OP_IMM8 and truncate immediates to MVT::i8
Craig Topper [Mon, 17 Aug 2020 22:52:13 +0000 (15:52 -0700)]
[X86] Rename INTR_TYPE_4OP to INTR_TYPE_4OP_IMM8 and truncate immediates to MVT::i8

This makes sure VPTERNLOG is generated with MVT::i8 immediate
as its SDNode declaration in X86InstrFragmentsSIMD.td declares.

4 years ago[X86] Truncate immediate to i8 for INTR_TYPE_3OP_IMM8
Craig Topper [Mon, 17 Aug 2020 22:59:32 +0000 (15:59 -0700)]
[X86] Truncate immediate to i8 for INTR_TYPE_3OP_IMM8

This is used for DBPSADBW which has a i32 immediate for its
intrinsic and an i8 immediate in tablegen isel patterns.

4 years ago[X86] Make PreprocessISelDAG create X86ISD::VRNDSCALE nodes with i32 constants instea...
Craig Topper [Mon, 17 Aug 2020 20:46:41 +0000 (13:46 -0700)]
[X86] Make PreprocessISelDAG create X86ISD::VRNDSCALE nodes with i32 constants instead of i8.

This is the type declared in X86InstrFragmentsSIMD.td. ISel pattern
matching doesn't check so it doesn't matter in practice. Maybe for
SelectionDAG CSE it would matter.

4 years agoFix method name to start with lower case to match style guide (NFC)
Mehdi Amini [Fri, 14 Aug 2020 09:38:37 +0000 (09:38 +0000)]
Fix method name to start with lower case to match style guide (NFC)

4 years ago[MLInliner] In development mode, obtain the output specs from a file
Mircea Trofin [Mon, 10 Aug 2020 16:36:18 +0000 (09:36 -0700)]
[MLInliner] In development mode, obtain the output specs from a file

Different training algorithms may produce models that, besides the main
policy output (i.e. inline/don't inline), produce additional outputs
that are necessary for the next training stage. To facilitate this, in
development mode, we require the training policy infrastructure produce
a description of the outputs that are interesting to it, in the form of
a JSON file. We special-case the first entry in the JSON file as the
inlining decision - we care about its value, so we can guide inlining
during training - but treat the rest as opaque data that we just copy
over to the training log.

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

4 years ago[llvm-objdump] Symbolize binary addresses for low-noisy asm diff.
Hongtao Yu [Mon, 20 Jul 2020 16:45:32 +0000 (09:45 -0700)]
[llvm-objdump] Symbolize binary addresses for low-noisy asm diff.

When diffing disassembly dump of two binaries, I see lots of noises from mismatched jump target addresses and global data references, which unnecessarily causes diffs on every function, making it impractical. I'm trying to symbolize the raw binary addresses to minimize the diff noise.
In this change, a local branch target is modeled as a label and the branch target operand will simply be printed as a label. Local labels are collected by a separate pre-decoding pass beforehand. A global data memory operand will be printed as a global symbol instead of the raw data address. Unfortunately, due to the way the disassembler is set up and to be less intrusive, a global symbol is always printed as the last operand of a memory access instruction. This is less than ideal but is probably acceptable from checking code quality point of view since on most targets an instruction can have at most one memory operand.

So far only the X86 disassemblers are supported.

Test Plan:

llvm-objdump -d  --x86-asm-syntax=intel --no-show-raw-insn --no-leading-addr :
```
Disassembly of section .text:

<_start>:
                push rax
                mov dword ptr [rsp + 4], 0
                mov dword ptr [rsp], 0
                mov eax, dword ptr [rsp]
                cmp eax, dword ptr [rip + 4112]  # 202182 <g>
                jge 0x20117e <_start+0x25>
                call 0x201158 <foo>
                inc dword ptr [rsp]
                jmp 0x201169 <_start+0x10>
                xor eax, eax
                pop rcx
                ret
```

llvm-objdump -d  **--symbolize-operands** --x86-asm-syntax=intel --no-show-raw-insn --no-leading-addr :
```
Disassembly of section .text:

<_start>:
                push rax
                mov dword ptr [rsp + 4], 0
                mov dword ptr [rsp], 0
<L1>:
                mov eax, dword ptr [rsp]
                cmp eax, dword ptr  <g>
                jge  <L0>
                call  <foo>
                inc dword ptr [rsp]
                jmp  <L1>
<L0>:
                xor eax, eax
                pop rcx
                ret
```

Note that the jump instructions like `jge 0x20117e <_start+0x25>` without this work is printed as a real target address and an offset from the leading symbol. With a change in the optimizer that adds/deletes an instruction, the address and offset may shift for targets placed after the instruction. This will be a problem when diffing the disassembly from two optimizers where there are unnecessary false positives due to such branch target address changes. With `--symbolize-operand`, a label is printed for a branch target instead to reduce the false positives. Similarly, the disassemble of PC-relative global variable references is also prone to instruction insertion/deletion.

Reviewed By: jhenderson, MaskRay

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

4 years ago[Attributor] Properly use the call site argument position
Johannes Doerfert [Mon, 17 Aug 2020 23:17:17 +0000 (18:17 -0500)]
[Attributor] Properly use the call site argument position

4 years ago[Attributor][FIX] Do not request an AANonNull for non-pointer types
Johannes Doerfert [Mon, 17 Aug 2020 23:16:08 +0000 (18:16 -0500)]
[Attributor][FIX] Do not request an AANonNull for non-pointer types

4 years ago[OpenMPOpt][HideMemTransfersLatency] Update regression test with new runtime calls.
Hamilton Tobon Mosquera [Mon, 17 Aug 2020 23:16:16 +0000 (18:16 -0500)]
[OpenMPOpt][HideMemTransfersLatency] Update regression test with new runtime calls.

4 years ago[VE] Modify ISelLoweirng following clang-tidy
Kazushi (Jam) Marukawa [Mon, 17 Aug 2020 14:02:24 +0000 (23:02 +0900)]
[VE] Modify ISelLoweirng following clang-tidy

Modify case style of function names following clang-tidy.

Reviewed By: simoll

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

4 years ago[NFC][clang] Adjust test/CodeGenCXX/nrvo.cpp after 03127f795b8244c1039c18d4391374707a...
Roman Lebedev [Mon, 17 Aug 2020 21:57:35 +0000 (00:57 +0300)]
[NFC][clang] Adjust test/CodeGenCXX/nrvo.cpp after 03127f795b8244c1039c18d4391374707a3dc75e

4 years ago[InstCombine] PHI-aware aggregate reconstruction: correctly detect "use" basic block
Roman Lebedev [Mon, 17 Aug 2020 20:15:30 +0000 (23:15 +0300)]
[InstCombine] PHI-aware aggregate reconstruction: correctly detect "use" basic block

While the original implementation added in D85787 / ae7f08812e0995481eb345cecc5dd4529829ba44
is not incorrect, it is known to be suboptimal.

In particular, it is not incorrect to use the basic block
in which the original `insertvalue` instruction is located
as the merge point, that is not necessarily optimal,
as `@test6` shows.

We should look at all the AggElts, and, if they are all defined
in the same basic block, then that is the basic block we should use.

On RawSpeed library, this catches +4% (+50) more cases.
On vanilla LLVM test-suits, this catches +12% (+92) more cases.

4 years ago[NFC][InstCombine] PHI-aware aggregate reconstruction: don't capture UseBB in lambdas...
Roman Lebedev [Mon, 17 Aug 2020 19:53:23 +0000 (22:53 +0300)]
[NFC][InstCombine] PHI-aware aggregate reconstruction: don't capture UseBB in lambdas, take it as argument

In a following patch, UseBB will be detected later,
so capturing it is potentially error-prone (capture by ref vs by val).

Also, parametrized UseBB will likely be needed
for multiple levels of PHI indirections later on anyways.

4 years ago[NFC][InstCombine] PHI-aware aggregate reconstruction: insert PHI node manually
Roman Lebedev [Mon, 17 Aug 2020 19:59:48 +0000 (22:59 +0300)]
[NFC][InstCombine] PHI-aware aggregate reconstruction: insert PHI node manually

This is NFC at the moment, because right now we always insert the PHI
into the same basic block in which the original `insertvalue` instruction
is, but that will change.

Also, fixes addition of the suffix to the value names.

4 years ago[NFC][InstCombine] Add more tests for aggregate reconstruction w/ PHI handling
Roman Lebedev [Mon, 17 Aug 2020 12:55:58 +0000 (15:55 +0300)]
[NFC][InstCombine] Add more tests for aggregate reconstruction w/ PHI handling

Even without handling several layers of PHI nodes,
we can handle more cases, as `@test6` shows.

4 years agoConvert to early exit (NFC)
Adrian Prantl [Mon, 17 Aug 2020 19:52:23 +0000 (12:52 -0700)]
Convert to early exit (NFC)

4 years agoSimplify error reporting (NFC)
Adrian Prantl [Mon, 17 Aug 2020 19:50:24 +0000 (12:50 -0700)]
Simplify error reporting (NFC)

4 years agoConvert if cascade to switch (NFC)
Adrian Prantl [Mon, 17 Aug 2020 19:30:36 +0000 (12:30 -0700)]
Convert if cascade to switch (NFC)

4 years agoConvert to early exit (NFC)
Adrian Prantl [Mon, 17 Aug 2020 19:27:36 +0000 (12:27 -0700)]
Convert to early exit (NFC)

4 years agoConvert to early exit (NFC)
Adrian Prantl [Mon, 17 Aug 2020 19:25:38 +0000 (12:25 -0700)]
Convert to early exit (NFC)

4 years agoFix another Wsign-comparison warning.
Eric Christopher [Mon, 17 Aug 2020 21:28:35 +0000 (14:28 -0700)]
Fix another Wsign-comparison warning.

4 years ago[libunwind] Remove compatibility support for macOS 10.6
Steven Wu [Mon, 17 Aug 2020 21:08:50 +0000 (14:08 -0700)]
[libunwind] Remove compatibility support for macOS 10.6

Remove `_dyld_find_unwind_sections` implementation for macOS that is
10.6 or previous. 10.6 is no longer supported for TOT libunwind after
removing its libkeymgr dependency.

Reviewed By: mstorsjo, pete, #libunwind

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

4 years agolibclc: Add Mesa/SPIR-V target
Dave Airlie [Mon, 17 Aug 2020 20:45:04 +0000 (13:45 -0700)]
libclc: Add Mesa/SPIR-V target

Add targets to emit SPIR-V targeted to Mesa's OpenCL support, using
SPIR-V 1.1.

Substantially based on Dave Airlie's earlier work.

libclc: spirv: remove step/smoothstep apis not defined for SPIR-V

libclc: disable inlines for SPIR-V builds

Reviewed By: jvesely, tstellar, jenatali

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

4 years agoFix Wsign-compare warnings in test.
Eric Christopher [Mon, 17 Aug 2020 20:59:40 +0000 (13:59 -0700)]
Fix Wsign-compare warnings in test.

4 years agolibclc: Make all built-ins overloadable
Daniel Stone [Mon, 17 Aug 2020 20:44:49 +0000 (13:44 -0700)]
libclc: Make all built-ins overloadable

The SPIR spec states that all OpenCL built-in functions should be
overloadable and mangled, to ensure consistency.

Add the overload attribute to functions which were missing them:
work dimensions, memory barriers and fences, and events.

Reviewed By: tstellar, jenatali

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

4 years agolibclc: Fix FP_ILOGBNAN definition
Boris Brezillon [Mon, 17 Aug 2020 20:44:01 +0000 (13:44 -0700)]
libclc: Fix FP_ILOGBNAN definition

Fix FP_ILOGBNAN definition to match the opencl-c-base.h one and
guarantee that FP_ILOGBNAN and FP_ILOGB0 are different. Doing that
implies fixing ilogb() implementation to return the right value.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed By: jvesely

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

4 years agoImprove error message when constructing a Tensor with an invalid element type (NFC)
Mehdi Amini [Mon, 17 Aug 2020 20:39:43 +0000 (20:39 +0000)]
Improve error message when constructing a Tensor with an invalid element type (NFC)

Reviewed By: ftynse

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

4 years ago[safe-stack] Fix typo in test command line
Vitaly Buka [Mon, 17 Aug 2020 20:38:15 +0000 (13:38 -0700)]
[safe-stack] Fix typo in test command line

4 years ago[gn build] Port 2f0d755d815
LLVM GN Syncbot [Mon, 17 Aug 2020 20:30:41 +0000 (20:30 +0000)]
[gn build] Port 2f0d755d815

4 years agoGlobalISel: Make type for lower action more consistently optional
Matt Arsenault [Wed, 15 Jul 2020 15:10:54 +0000 (11:10 -0400)]
GlobalISel: Make type for lower action more consistently optional

Some of the lower implementations were relying on this, however the
type was not set depending on which form .lower* helper form you were
using. For instance, if you used an unconditonal lower(), the type was
never set. Most of the lower actions do not benefit from a type
parameter, and just expand in terms of the original operation's types.

However, some lowerings could benefit from an additional type hint to
combine a promotion and an expansion. An example of this is for
add/sub sat. The DAG integer legalization tries to use smarter
expansions directly when promoting the integer type, and doesn't
always produce the same instruction with a wider type.

Treat this as an optional hint argument, that only means something for
specific lower actions. It may be useful to generalize this mechanism
to pass a full list of type indexes and desired types, but I haven't
run into a case like that yet.

4 years ago[AIX][XCOFF][Patch1] Provide decoding trace back table information API for xcoff...
diggerlin [Mon, 17 Aug 2020 20:23:47 +0000 (16:23 -0400)]
[AIX][XCOFF][Patch1] Provide decoding trace back table information API for xcoff object file for llvm-objdump -d

SUMMARY:

1. This patch provided API for decoding the traceback table info and unit test for the these API.

2. Another patchs will do the following things:
2.1 added a new option --traceback-table to decode the trace back table information for xcoff object file when
using llvm-objdump to disassemble the xcoff objfile.

2.2 print out the  traceback table information for llvm-objdump.

Reviewers:  Jason liu, Hubert Tong, James Henderson

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

4 years ago[NVPTX] Fix typo in lit test
Ellis Hoag [Mon, 17 Aug 2020 20:01:02 +0000 (16:01 -0400)]
[NVPTX] Fix typo in lit test

LBAEL => LABEL

I encountered this typo elsewhere and I decided to run a global search.
It probably was unnoticed because I think CHECK-LBAEL: is ignored by
lit.

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

4 years ago[DSE,MemorySSA] Skip access already dominated by a killing def.
Florian Hahn [Mon, 17 Aug 2020 17:52:57 +0000 (18:52 +0100)]
[DSE,MemorySSA] Skip access already dominated by a killing def.

If we already found a killing def (= a def that completely overwrites
the location) that dominates an access, we can skip processing it
further.

This does not help with compile-time, but increases the number of memory
accesses we can process with the same scan budget, leading to more
stores being eliminated.

Improvements with this change

Same hash: 203 (filtered out)
Remaining: 34
Metric: dse.NumFastStores

Program                                        base    dom     diff
 test-suite...rolangs-C++/family/family.test     2.00    4.00  100.0%
 test-suite...ProxyApps-C++/CLAMR/CLAMR.test   172.00  229.00  33.1%
 test-suite...ks/Prolangs-C/agrep/agrep.test    10.00   12.00  20.0%
 test-suite...oxyApps-C++/miniFE/miniFE.test    44.00   51.00  15.9%
 test-suite...marks/7zip/7zip-benchmark.test   1285.00 1474.00 14.7%
 test-suite...006/450.soplex/450.soplex.test   254.00  289.00  13.8%
 test-suite...006/447.dealII/447.dealII.test   2466.00 2798.00 13.5%
 test-suite...000/197.parser/197.parser.test     9.00   10.00  11.1%
 test-suite.../Benchmarks/nbench/nbench.test    85.00   91.00   7.1%
 test-suite...ce/Applications/siod/siod.test    68.00   72.00   5.9%
 test-suite...ications/JM/lencod/lencod.test   786.00  824.00   4.8%
 test-suite...6/464.h264ref/464.h264ref.test   765.00  798.00   4.3%
 test-suite.../Benchmarks/Ptrdist/bc/bc.test   105.00  109.00   3.8%
 test-suite...lications/obsequi/Obsequi.test    29.00   28.00  -3.4%
 test-suite...3.xalancbmk/483.xalancbmk.test   1322.00 1367.00  3.4%
 test-suite...chmarks/MallocBench/gs/gs.test   118.00  122.00   3.4%
 test-suite...T2006/401.bzip2/401.bzip2.test    60.00   62.00   3.3%
 test-suite...6/482.sphinx3/482.sphinx3.test    30.00   31.00   3.3%
 test-suite...rks/tramp3d-v4/tramp3d-v4.test   862.00  887.00   2.9%
 test-suite...telecomm-gsm/telecomm-gsm.test    78.00   80.00   2.6%
 test-suite...ediabench/gsm/toast/toast.test    78.00   80.00   2.6%
 test-suite.../Applications/SPASS/SPASS.test   163.00  167.00   2.5%
 test-suite...lications/ClamAV/clamscan.test   240.00  245.00   2.1%
 test-suite...006/453.povray/453.povray.test   1392.00 1419.00  1.9%
 test-suite...000/255.vortex/255.vortex.test   211.00  215.00   1.9%
 test-suite...:: External/Povray/povray.test   1295.00 1317.00  1.7%
 test-suite...lications/sqlite3/sqlite3.test   175.00  177.00   1.1%
 test-suite...T2000/256.bzip2/256.bzip2.test    99.00  100.00   1.0%
 test-suite...0/253.perlbmk/253.perlbmk.test   629.00  635.00   1.0%
 test-suite.../CINT2006/403.gcc/403.gcc.test   1183.00 1194.00  0.9%
 test-suite.../CINT2000/176.gcc/176.gcc.test   647.00  653.00   0.9%
 test-suite...ications/JM/ldecod/ldecod.test   512.00  516.00   0.8%
 test-suite...0.perlbench/400.perlbench.test   1026.00 1034.00  0.8%
 test-suite...-typeset/consumer-typeset.test   1876.00 1877.00  0.1%
 Geomean difference                                             7.3%

4 years agoRevert "Re-Re-land: [CodeView] Add full repro to LF_BUILDINFO record"
Alexandre Ganea [Mon, 17 Aug 2020 18:23:46 +0000 (14:23 -0400)]
Revert "Re-Re-land: [CodeView] Add full repro to LF_BUILDINFO record"

This reverts commit a3036b386383f1c1e9d32c2c8dba995087959da3.

As requested in: https://reviews.llvm.org/D80833#2221866
Bug report: https://crbug.com/1117026

4 years agoAMDGPU/GlobalISel: Match global saddr addressing mode
Matt Arsenault [Sun, 16 Aug 2020 15:18:52 +0000 (11:18 -0400)]
AMDGPU/GlobalISel: Match global saddr addressing mode

4 years ago[DAGCombiner] give magic number a name in getStoreMergeCandidates; NFC
Sanjay Patel [Mon, 17 Aug 2020 19:36:55 +0000 (15:36 -0400)]
[DAGCombiner] give magic number a name in getStoreMergeCandidates; NFC

4 years ago[DAGCombiner] reduce code duplication in getStoreMergeCandidates; NFC
Sanjay Patel [Mon, 17 Aug 2020 19:32:07 +0000 (15:32 -0400)]
[DAGCombiner] reduce code duplication in getStoreMergeCandidates; NFC

4 years ago[DAGCombiner] simplify bool return in getStoreMergeCandidates; NFC
Sanjay Patel [Mon, 17 Aug 2020 18:12:30 +0000 (14:12 -0400)]
[DAGCombiner] simplify bool return in getStoreMergeCandidates; NFC

4 years ago[DAGCombiner] clean up getStoreMergeCandidates(); NFC
Sanjay Patel [Mon, 17 Aug 2020 18:08:50 +0000 (14:08 -0400)]
[DAGCombiner] clean up getStoreMergeCandidates(); NFC
1. Move bailouts and local var declarations.
2. Convert if-chain to switch on StoreSource with unreachable default.

4 years ago[DAGCombiner] convert StoreSource if-chain to switch; NFC
Sanjay Patel [Mon, 17 Aug 2020 17:27:27 +0000 (13:27 -0400)]
[DAGCombiner] convert StoreSource if-chain to switch; NFC

The "isa" checks were less constrained because they allow
target constants, but the later matching code would bail
out on those anyway, so this should be slightly more
efficient.

4 years ago[AssumeBundles] Fix Bug in Assume Queries
Tyker [Mon, 17 Aug 2020 18:47:02 +0000 (20:47 +0200)]
[AssumeBundles] Fix Bug in Assume Queries

this bug was causing miscompile.
now clang cant properly selfhost with -mllvm --enable-knowledge-retention

Reviewed By: jdoerfert, lebedev.ri

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

4 years agoAMDGPU: Match global saddr addressing mode
Matt Arsenault [Thu, 13 Aug 2020 20:51:07 +0000 (16:51 -0400)]
AMDGPU: Match global saddr addressing mode

The previous implementation was incorrect, and based off incorrect
instruction definitions. Unfortunately we can't match natural
addressing in a lot of cases due to the shift/scale applied in
getelementptrs. This relies on reducing the 64-bit shift to 32-bits.

4 years agoAMDGPU: Add baseline tests for global saddr matching
Matt Arsenault [Sat, 15 Aug 2020 16:31:21 +0000 (12:31 -0400)]
AMDGPU: Add baseline tests for global saddr matching

4 years ago[AMDGPU] Define spill opcodes for all AGPR sizes
Stanislav Mekhanoshin [Mon, 17 Aug 2020 19:05:23 +0000 (12:05 -0700)]
[AMDGPU] Define spill opcodes for all AGPR sizes

Since we have defined all these sizes I believe we shall be
able to spill these as well.

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

4 years ago[lldb] Skip test_launch_simple with reproducers
Jonas Devlieghere [Mon, 17 Aug 2020 18:45:35 +0000 (11:45 -0700)]
[lldb] Skip test_launch_simple with reproducers

The test checks the inferior's output. During replay the binary doesn't
actually run and the output isn't captured by the reproducers.

4 years agoRevert "[BPI] Improve static heuristics for integer comparisons"
Dávid Bolvanský [Mon, 17 Aug 2020 18:42:57 +0000 (20:42 +0200)]
Revert "[BPI] Improve static heuristics for integer comparisons"

This reverts commit 50c743fa713002fe4e0c76d23043e6c1f9e9fe6f. Patch will be split to smaller ones.

4 years ago[lldb] Skip TestMultipleDebuggers on Windows
Jonas Devlieghere [Mon, 17 Aug 2020 18:34:24 +0000 (11:34 -0700)]
[lldb] Skip TestMultipleDebuggers on Windows

4 years ago[lldb] Skip the Apple Simulator tests with reproducers
Jonas Devlieghere [Mon, 17 Aug 2020 18:26:20 +0000 (11:26 -0700)]
[lldb] Skip the Apple Simulator tests with reproducers

4 years ago[ELF] Allow mixed SHF_LINK_ORDER & non-SHF_LINK_ORDER sections and sort within InputS...
Fangrui Song [Fri, 14 Aug 2020 17:23:45 +0000 (10:23 -0700)]
[ELF] Allow mixed SHF_LINK_ORDER & non-SHF_LINK_ORDER sections and sort within InputSectionDescription

LLD currently does not allow non-contiguous SHF_LINK_ORDER components in an
output section. This makes it infeasible to add SHF_LINK_ORDER to an existing
metadata section if backward compatibility with older object files are
concerned.

We did not allow mixed components (like GNU ld) and D77007 relaxed to allow
non-contiguous SHF_LINK_ORDER components. This patch allows arbitrary mix, with
sorting performed within an InputSectionDescription. For example,
`.rodata : {*(.rodata.foo) *(.rodata.bar)}`, has two InputSectionDescription's.
If there is at least one SHF_LINK_ORDER and at least one non-SHF_LINK_ORDER in
.rodata.foo, they are ordered within `*(.rodata.foo)`: we arbitrarily place
SHF_LINK_ORDER components before non-SHF_LINK_ORDER components (like Solaris ld).

`*(.rodata.bar)` is ordered similarly, but the two InputSectionDescription's
don't interact.  It can be argued that this is more reasonable than the previous
behavior where written order was not respected.

It would be nice if the two different semantics (ordering requirement & garbage
collection) were not overloaded on one section flag, however, it is probably
difficult to obtain a generic flag at this point
(https://groups.google.com/forum/#!topic/generic-abi/hgx_m1aXqUo
"SHF_LINK_ORDER's original semantics make upgrade difficult").

(Actually, without the GC semantics, SHF_LINK_ORDER would still have the
sh_link!=0 & sh_link=0 issue. It is just that people find the GC semantics more
useful and tend to use the feature more often.)

GNU ld feature request: https://sourceware.org/bugzilla/show_bug.cgi?id=16833

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