]> granicus.if.org Git - llvm/log
llvm
5 years ago[X86] SimplifyDemandedVectorElts - attempt to recombine target shuffle using Demanded...
Simon Pilgrim [Thu, 8 Aug 2019 15:54:20 +0000 (15:54 +0000)]
[X86] SimplifyDemandedVectorElts - attempt to recombine target shuffle using DemandedElts mask

If we don't demand all elements, then attempt to combine to a simpler shuffle.

At the moment we can only do this if Depth == 0 as combineX86ShufflesRecursively uses Depth to track whether the shuffle has really changed or not - we'll need to change this before we can properly start merging combineX86ShufflesRecursively into SimplifyDemandedVectorElts.

The insertps-combine.ll regression is because XFormVExtractWithShuffleIntoLoad can't see through shuffles of different widths - this will be fixed in a follow-up commit.

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

5 years agoEnable assembly output of local commons for AIX
David Tenty [Thu, 8 Aug 2019 15:40:35 +0000 (15:40 +0000)]
Enable assembly output of local commons for AIX

Summary:
This patch enable assembly output of local commons for AIX using .lcomm
directives. Adds a EmitXCOFFLocalCommonSymbol to MCStreamer so we can emit the
AIX version of .lcomm assembly directives which include a csect name. Handle the
case of BSS locals in PPCAIXAsmPrinter by using EmitXCOFFLocalCommonSymbol. Adds
a test for generating .lcomm on AIX Targets.

Reviewers: cebowleratibm, hubert.reinterpretcast, Xiangling_L, jasonliu, sfertile

Reviewed By: sfertile

Subscribers: wuzish, nemanjai, hiraditya, kbarton, MaskRay, jsji, llvm-commits

Tags: #llvm

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

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

5 years ago[ARM] Add support for MVE pre and post inc loads and stores
David Green [Thu, 8 Aug 2019 15:27:58 +0000 (15:27 +0000)]
[ARM] Add support for MVE pre and post inc loads and stores

This adds pre- and post- increment and decrements for MVE loads and stores. It
uses the builtin pre and post load/store detection, unlike Neon. Loads are
selected with the code in tryT2IndexedLoad, stores are selected with tablegen
patterns. The immediates have a +/-7bit range, multiplied by the size of the
element.

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

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

5 years ago[ARM] MVE big endian loads/stores
David Green [Thu, 8 Aug 2019 15:15:19 +0000 (15:15 +0000)]
[ARM] MVE big endian loads/stores

This adds some missing patterns for big endian loads/stores, allowing unaligned
loads/stores to also be selected with an extra VREV, which produces better code
than aligning through a stack. Also moves VLDR_P0 to not be LE only, and
adjusts some of the tests to show all that working.

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

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

5 years ago[RISCV] Allow ABI Names in Inline Assembly Constraints
Sam Elliott [Thu, 8 Aug 2019 14:59:16 +0000 (14:59 +0000)]
[RISCV] Allow ABI Names in Inline Assembly Constraints

Summary:
Clang will replace references to registers using ABI names in inline
assembly constraints with references to architecture names, but other
frontends do not. LLVM uses the regular assembly parser to parse inline asm,
so inline assembly strings can contain references to registers using their
ABI names.

This patch adds support for parsing constraints using either the ABI name or
the architectural register name. This means we do not need to implement the
ABI name replacement code in every single frontend, especially those like
Rust which are a very thin shim on top of LLVM IR's inline asm, and that
constraints can more closely match the assembly strings they refer to.

Reviewers: asb, simoncook

Reviewed By: simoncook

Subscribers: hiraditya, rbar, johnrusso, JDevlieghere, apazos, sabuasal, niosHD, kito-cheng, shiva0217, jrtc27, MaskRay, zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, rkruppe, PkmX, jocewei, psnobl, benna, Jim, s.egerton, llvm-commits

Tags: #llvm

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

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

5 years ago[RISCV] Minimal stack realignment support
Sam Elliott [Thu, 8 Aug 2019 14:40:54 +0000 (14:40 +0000)]
[RISCV] Minimal stack realignment support

Summary:
Currently the RISC-V backend does not realign the stack. This can be an issue even for the RV32I/RV64I ABIs (where the stack is 16-byte aligned), though is rare. It will be much more comment with RV32E (though the alignment requirements for common data types remain under-documented...).

This patch adds minimal support for stack realignment. It should cope with large realignments. It will error out if the stack needs realignment and variable sized objects are present.

It feels like a lot of the code like getFrameIndexReference and determineFrameLayout could be refactored somehow, as right now it feels fiddly and brittle. We also seem to allocate a lot more memory than GCC does for equivalent C code.

Reviewers: asb

Reviewed By: asb

Subscribers: wwei, jrtc27, s.egerton, MaskRay, Jim, lenary, hiraditya, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, kito-cheng, shiva0217, zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, rkruppe, PkmX, jocewei, psnobl, benna, llvm-commits

Tags: #llvm

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

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

5 years ago[FileCheck] Add missing includes in header
Thomas Preud'homme [Thu, 8 Aug 2019 13:56:59 +0000 (13:56 +0000)]
[FileCheck] Add missing includes in header

Reviewers: jhenderson, chandlerc, jdenny, probinson, grimar, arichardson, rnk

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

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

5 years agoAdd llvm.licm.disable metadata
Tim Corringham [Thu, 8 Aug 2019 13:46:17 +0000 (13:46 +0000)]
Add llvm.licm.disable metadata

For some targets the LICM pass can result in sub-optimal code in some
cases where it would be better not to run the pass, but it isn't
always possible to suppress the transformations heuristically.

Where the front-end has insight into such cases it is beneficial
to attach loop metadata to disable the pass - this change adds the
llvm.licm.disable metadata to enable that.

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

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

5 years ago[X86][SSE] matchBinaryPermuteShuffle - split INSERTPS combines
Simon Pilgrim [Thu, 8 Aug 2019 13:23:53 +0000 (13:23 +0000)]
[X86][SSE] matchBinaryPermuteShuffle - split INSERTPS combines

We need to prefer INSERTPS with zeros over SHUFPS, but fallback to INSERTPS if that fails.

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

5 years ago[Reassociate] add more tests with negative FP constants; NFC
Sanjay Patel [Thu, 8 Aug 2019 13:08:17 +0000 (13:08 +0000)]
[Reassociate] add more tests with negative FP constants; NFC

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

5 years agoFix check in tools/gold/X86/strip_names.ll regarding unnamed args
Bjorn Pettersson [Thu, 8 Aug 2019 12:11:13 +0000 (12:11 +0000)]
Fix check in tools/gold/X86/strip_names.ll regarding unnamed args

After r367755 value numbers are printed for unnamed
function arguments. The tools/gold/X86/strip_names.ll
was not updated in that commit, so this patch can be
seen as a follow up to r367755.

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

5 years ago[X86][SSE] Add x64 load use test case
Simon Pilgrim [Thu, 8 Aug 2019 11:24:23 +0000 (11:24 +0000)]
[X86][SSE] Add x64 load use test case

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

5 years ago[TargetLowering] SimplifyDemandedBits - call SimplifyMultipleUseDemandedBits for...
Simon Pilgrim [Thu, 8 Aug 2019 10:37:03 +0000 (10:37 +0000)]
[TargetLowering] SimplifyDemandedBits - call SimplifyMultipleUseDemandedBits for ISD::EXTRACT_VECTOR_ELT

This patch attempts to peek through vectors based on the demanded bits/elt of a particular ISD::EXTRACT_VECTOR_ELT node, allowing us to avoid dependencies on ops that have no impact on the extract.

In particular this helps remove some unnecessary scalar->vector->scalar patterns.

The wasm shift patterns are annoying - @tlively has indicated that the wasm vector shift codegen are to be refactored in the near-term and isn't considered a major issue.

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

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

5 years ago[MCA] Remove dependency from InstrBuilder in mca::Context. NFC
Andrea Di Biagio [Thu, 8 Aug 2019 10:30:58 +0000 (10:30 +0000)]
[MCA] Remove dependency from InstrBuilder in mca::Context. NFC

InstrBuilder is not required to construct the default pipeline.

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

5 years ago[MIPS GlobalISel] Select jump_table and brjt
Petar Avramovic [Thu, 8 Aug 2019 10:21:12 +0000 (10:21 +0000)]
[MIPS GlobalISel] Select jump_table and brjt

G_JUMP_TABLE and G_BRJT appear from translation of switch statement.
Select these two instructions for MIPS32, both pic and non-pic.

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

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

5 years ago[llcm-readobj] - Fix BB after t368272.
George Rimar [Thu, 8 Aug 2019 10:05:00 +0000 (10:05 +0000)]
[llcm-readobj] - Fix BB after t368272.

Seems I forgot to update this test case.

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

5 years ago[yaml2obj/obj2yaml] - Add a basic support for extended section indexes.
George Rimar [Thu, 8 Aug 2019 09:49:05 +0000 (09:49 +0000)]
[yaml2obj/obj2yaml] - Add a basic support for extended section indexes.

In some cases a symbol might have section index == SHN_XINDEX.
This is an escape value indicating that the actual section header index
is too large to fit in the containing field.
Then the SHT_SYMTAB_SHNDX section is used. It contains the 32bit values
that stores section indexes.

ELF gABI says that there can be multiple SHT_SYMTAB_SHNDX sections,
i.e. for example one for .symtab and one for .dynsym
(1) https://groups.google.com/forum/#!topic/generic-abi/-XJAV5d8PRg
(2) DT_SYMTAB_SHNDX: http://www.sco.com/developers/gabi/latest/ch5.dynamic.html

In this patch I am only supporting a single SHT_SYMTAB_SHNDX associated
with a .symtab. This is a more or less common case which is used a few tests I saw in LLVM.

I decided not to create the SHT_SYMTAB_SHNDX section as "implicit",
but implement is like a kind of regular section for now.
i.e. tools do not recreate this section or its content, like they do for
symbol table sections, for example. That should allow to write all kind of
possible broken test cases for our needs and keep the output closer to requested.

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

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

5 years ago[ARM] Select VFMA
Sam Tebbs [Thu, 8 Aug 2019 08:21:01 +0000 (08:21 +0000)]
[ARM] Select VFMA

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

5 years ago[ELF] - An attemp to fix builld bit after r368260
George Rimar [Thu, 8 Aug 2019 07:29:07 +0000 (07:29 +0000)]
[ELF] - An attemp to fix builld bit after r368260

BB: http://lab.llvm.org:8011/builders/lld-perf-testsuite/builds/17577/steps/build-bin%2Flld/logs/stdio

The error is:
/home/buildslave/slave_as-bldslv8/lld-perf-testsuite/llvm/include/llvm/Object/ELF.h:67:14:
error: 'static' function 'defaultWarningHandler' declared in header file should be declared 'static inline' [-Werror,-Wunneeded-internal-declaration]
static Error defaultWarningHandler(const Twine &Msg) { return createError(Msg); }
             ^

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

5 years ago[llvm-readobj/libObject] - Introduce a custom warning handler for `ELFFile<ELFT>...
George Rimar [Thu, 8 Aug 2019 07:17:35 +0000 (07:17 +0000)]
[llvm-readobj/libObject] - Introduce a custom warning handler for `ELFFile<ELFT>` methods.

Currently, we have a code duplication in llvm-readobj which was introduced in D63266.
The duplication was introduced to allow llvm-readobj to dump the partially
broken object. Methods in ELFFile<ELFT> perform a strict validation of the inputs,
what is itself good, but not for dumper tools, that might want to dump the information,
even if some pieces are broken/unexpected.

This patch introduces a warning handler which can be passed to ELFFile<ELFT> methods
and can allow skipping the non-critical errors when needed/possible.

For demonstration, I removed the duplication from llvm-readobj and implemented a warning using
the new custom warning handler. It also deduplicates the strings printed, making the output less verbose.

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

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

5 years ago[X86] Remove -x86-experimental-vector-widening-legalization command line option and...
Craig Topper [Thu, 8 Aug 2019 06:48:22 +0000 (06:48 +0000)]
[X86] Remove -x86-experimental-vector-widening-legalization command line option and all its uses.

This option is now defaulted to true and we don't want to support
turning it off so remove the option.

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

5 years ago[ARM] Tighten up VLDRH.32 with low alignments
David Green [Thu, 8 Aug 2019 06:22:03 +0000 (06:22 +0000)]
[ARM] Tighten up VLDRH.32 with low alignments

VLDRH needs to have an alignment of at least 2, including the
widening/narrowing versions. This tightens up the ISel patterns for it and
alters allowsMisalignedMemoryAccesses so that unaligned accesses are expanded
through the stack. It also fixed some incorrect shift amounts, which seemed to
be passing a multiple not a shift.

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

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

5 years ago[ARM] Rejig MVE load store tests. NFC
David Green [Thu, 8 Aug 2019 05:58:48 +0000 (05:58 +0000)]
[ARM] Rejig MVE load store tests. NFC

This adjusts the load/store tests for better testing of alignments. It also
adds some extra alignment 1 tests, useful for future commits.

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

5 years agoRevert "Temporarily bump minimum compiler version"
JF Bastien [Thu, 8 Aug 2019 05:47:59 +0000 (05:47 +0000)]
Revert "Temporarily bump minimum compiler version"

It's been in for more than 30 min and no bots have complained. Let's see if some
slow ones catch up. I'll do another manual pass on bots later (in case some that
were down are back up), and then turn this on permanently through a regular
review.

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

5 years agoTemporarily bump minimum compiler version
JF Bastien [Thu, 8 Aug 2019 05:12:20 +0000 (05:12 +0000)]
Temporarily bump minimum compiler version

It's pretty hard to find a reliable list of which bots use which compiler version... so I'm going to commit this change which allows us to mandate the compilers required for C++14. This bump is what we've already agreed to do, so I'll use the list of failures to figure out which bots need to bump their compiler version. I'll revert the change in a few minutes.

The last discussion of this is here: http://lists.llvm.org/pipermail/llvm-dev/2019-August/134360.html

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

5 years ago[X86] Add CMOV_FR32X and CMOV_FR64X to the isCMOVPseudo function.
Craig Topper [Thu, 8 Aug 2019 04:40:59 +0000 (04:40 +0000)]
[X86] Add CMOV_FR32X and CMOV_FR64X to the isCMOVPseudo function.

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

5 years ago[GISel][NFC]: Make members of CombinerHelper accessible in derived classes
Aditya Nandakumar [Thu, 8 Aug 2019 02:24:57 +0000 (02:24 +0000)]
[GISel][NFC]: Make members of CombinerHelper accessible in derived classes

https://reviews.llvm.org/D65842

Make some members protected to enable access in derived classes.

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

5 years ago[llvm-strip] Support --strip-sections
Wolfgang Pieb [Thu, 8 Aug 2019 00:35:16 +0000 (00:35 +0000)]
[llvm-strip] Support --strip-sections

llvm-objcopy already supports --strip-sections. It is a good fit for its alias llvm-strip
to support it as well.

Reviewers: rupprecht, jhenderson

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

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

5 years ago[llvm-lipo] Update llvm-lipo docs for -info -thin -create -replace -segalign flags
Anusha Basana [Wed, 7 Aug 2019 23:25:12 +0000 (23:25 +0000)]
[llvm-lipo] Update llvm-lipo docs for -info -thin -create -replace -segalign flags

Summary:
The information for -info -thin -create -replace and -segalign flags are added to llvm-lipo.rst

Test Plan:

Reviewers: smeenai, alexshap, compnerd, mtrent

Subscribers: llvm-commits

Tags: #llvm

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

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

5 years ago[ScalarizeMaskedMemIntrin] Add test case for expanding scatter.
Craig Topper [Wed, 7 Aug 2019 23:16:29 +0000 (23:16 +0000)]
[ScalarizeMaskedMemIntrin] Add test case for expanding scatter.

This pass expands 6 intrinsics, but we only had test for 5 of
them.

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

5 years agoRecommit "[MS] Emit S_HEAPALLOCSITE debug info in Selection DAG"
Amy Huang [Wed, 7 Aug 2019 22:49:40 +0000 (22:49 +0000)]
Recommit "[MS] Emit S_HEAPALLOCSITE debug info in Selection DAG"
with a fix to clear the SDNode map when SelectionDAG is cleared.

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

5 years ago[Attributor][NFC] remove leftover and format code
Johannes Doerfert [Wed, 7 Aug 2019 22:49:06 +0000 (22:49 +0000)]
[Attributor][NFC] remove leftover and format code

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

5 years ago[Attributor][Stats] Locate statistics tracking with the attributes
Johannes Doerfert [Wed, 7 Aug 2019 22:46:11 +0000 (22:46 +0000)]
[Attributor][Stats] Locate statistics tracking with the attributes

Summary:
The ever growing switch required Attribute::AttrKind values but they
might not be available for all abstract attributes we deduce. With the
new method we track statistics at the abstract attribute level. The
provided macros simplify the usage and make the messages uniform.

Reviewers: sstefan1, uenoku

Subscribers: hiraditya, bollu, llvm-commits

Tags: #llvm

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

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

5 years ago[Attributor][NFC] Code simplification and style normalization
Johannes Doerfert [Wed, 7 Aug 2019 22:36:15 +0000 (22:36 +0000)]
[Attributor][NFC] Code simplification and style normalization

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

5 years ago[Attributor] Introduce a state wrapper class
Johannes Doerfert [Wed, 7 Aug 2019 22:34:26 +0000 (22:34 +0000)]
[Attributor] Introduce a state wrapper class

Summary:
The wrapper reduces boilerplate code and also provide a nice way to
determine the state type used by an abstract attributes statically via
AAType::StateType.

This was already discussed as part of the review of D65711.

Reviewers: sstefan1, uenoku

Subscribers: hiraditya, bollu, llvm-commits

Tags: #llvm

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

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

5 years ago[Attributor][NFC] Avoid unnecessary liveness queries
Johannes Doerfert [Wed, 7 Aug 2019 22:32:38 +0000 (22:32 +0000)]
[Attributor][NFC] Avoid unnecessary liveness queries

If we know everything is live there is no need to query for liveness.
Indicating a pessimistic fixpoint will cause the state to be "invalid"
which will cause the Attributor to not return the AAIsDead on request,
which will prevent us from querying isAssumedDead().

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

5 years ago[Attributor] Provide easier checkForallReturnedValues functionality
Johannes Doerfert [Wed, 7 Aug 2019 22:27:24 +0000 (22:27 +0000)]
[Attributor] Provide easier checkForallReturnedValues functionality

Summary:
So far, whenever one wants to look at returned values, one had to deal
with the AAReturnedValues and potentially with the AAIsDead attribute.
In the same spirit as other checkForAllXXX methods, we add this
functionality now to the Attributor. By adopting the use sites we got
better results when return instructions were dead.

Reviewers: sstefan1, uenoku

Subscribers: hiraditya, bollu, llvm-commits

Tags: #llvm

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

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

5 years ago[llvm-readobj][test] Add baseline tests for FreeBSD/AMD/AMDGPU note printing
Jordan Rupprecht [Wed, 7 Aug 2019 22:21:49 +0000 (22:21 +0000)]
[llvm-readobj][test] Add baseline tests for FreeBSD/AMD/AMDGPU note printing

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

5 years agoRevert Added Delta IR Reduction Tool
Diego Trevino Ferrer [Wed, 7 Aug 2019 21:51:54 +0000 (21:51 +0000)]
Revert Added Delta IR Reduction Tool

This reverts r368071 (git commit a2584978f5bb41973d65a145b0d9459b81e3ac6d)

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

5 years ago[LoopVectorize][X86] Clamp interleave factor if we have a known constant trip count...
Craig Topper [Wed, 7 Aug 2019 21:44:14 +0000 (21:44 +0000)]
[LoopVectorize][X86] Clamp interleave factor if we have a known constant trip count that is less than VF*interleave

If we know the trip count, we should make sure the interleave factor won't cause the vectorized loop to exceed it.

Improves one of the cases from PR42674

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

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

5 years agoAdded Delta IR Reduction Tool
Diego Trevino Ferrer [Wed, 7 Aug 2019 21:37:11 +0000 (21:37 +0000)]
Added Delta IR Reduction Tool

Summary: Tool parses input IR file, and runs the delta debugging algorithm to reduce the functions inside the input file.

Reviewers: alexshap, chandlerc

Subscribers: mgorny, llvm-commits

Tags: #llvm

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

llvm-svn: 368071

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

5 years agoDebugInfo/DWARF: Remove unused return type from DWARFUnit::extractDIEsIfNeeded
David Blaikie [Wed, 7 Aug 2019 21:31:33 +0000 (21:31 +0000)]
DebugInfo/DWARF: Remove unused return type from DWARFUnit::extractDIEsIfNeeded

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

5 years ago[NFC][LICM] Pre-commit test for unary FNeg support in LICM.
Cameron McInally [Wed, 7 Aug 2019 21:30:00 +0000 (21:30 +0000)]
[NFC][LICM] Pre-commit test for unary FNeg support in LICM.

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

5 years ago[X86] Allow pack instructions to be used for 512->256 truncates when -mprefer-vector...
Craig Topper [Wed, 7 Aug 2019 21:16:10 +0000 (21:16 +0000)]
[X86] Allow pack instructions to be used for 512->256 truncates when -mprefer-vector-width=256 is causing 512-bit vectors to be split

If we're splitting the 512-bit vector anyway and we have zero/sign bits, then we might as well use pack instructions to concat and truncate at once.

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

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

5 years ago[X86] Add test cases for missed opportunities to use pack instructions for 512->256...
Craig Topper [Wed, 7 Aug 2019 20:54:46 +0000 (20:54 +0000)]
[X86] Add test cases for missed opportunities to use pack instructions for 512->256 truncates with prefer-vector-width=256

If the 512-bit vectors are going to be split anyway, then we are
better off using pack to implicitly concatenate the 256 bit pieces.

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

5 years agoRevert r367501 "Create unique, but identically-named ELF sections..."
Bob Haarman [Wed, 7 Aug 2019 20:45:23 +0000 (20:45 +0000)]
Revert r367501 "Create unique, but identically-named ELF sections..."

This reverts commit fbc563e2cb6c5f1d0200b390513506b6aca4d2e9 "Create
unique, but identically-named ELF sections for explicitly-sectioned
functions and globals when using -function-sections and
-data-sections."

Reason for revert: sections are created with potentially wrong
attributes.

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

5 years ago[NFC] Fixed newly added tests
David Bolvansky [Wed, 7 Aug 2019 19:36:46 +0000 (19:36 +0000)]
[NFC] Fixed newly added tests

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

5 years ago[NFC] Added tests for x/fabs(X) fold
David Bolvansky [Wed, 7 Aug 2019 19:35:25 +0000 (19:35 +0000)]
[NFC] Added tests for x/fabs(X) fold

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

5 years agoFix indentation
David Blaikie [Wed, 7 Aug 2019 19:09:31 +0000 (19:09 +0000)]
Fix indentation

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

5 years ago[LoopVectorize][X86] Add test case for missed vectorization from PR42674.
Craig Topper [Wed, 7 Aug 2019 19:07:10 +0000 (19:07 +0000)]
[LoopVectorize][X86] Add test case for missed vectorization from PR42674.

We do end vectorizing the code, but use an interleave factor that
is too high and causes the vector code to be dead.

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

5 years ago[ValueTracking] When calculating known bits for integer abs, make sure we're looking...
Craig Topper [Wed, 7 Aug 2019 18:28:16 +0000 (18:28 +0000)]
[ValueTracking] When calculating known bits for integer abs, make sure we're looking at a negate and not just any instruction with the nsw flag set.

The matchSelectPattern code can match patterns like (x >= 0) ? x : -x
for absolute value. But it can also match ((x-y) >= 0) ? (x-y) : (y-x).
If the latter form was matched we can only use the nsw flag if its
set on both subtracts.

This match makes sure we're looking at the former case only.

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

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

5 years ago[Attributor] Introduce checkForAllReadWriteInstructions(...).
Stefan Stipanovic [Wed, 7 Aug 2019 18:26:02 +0000 (18:26 +0000)]
[Attributor] Introduce checkForAllReadWriteInstructions(...).

Summary: Similarly to D65731 `Attributor::checkForAllReadWriteInstructions` is introduced.

Reviewers: jdoerfert, uenoku

Subscribers: hiraditya, jfb, llvm-commits

Tags: #llvm

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

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

5 years ago[SCEV] Return zero from computeConstantDifference(X, X)
Nikolai Bozhenov [Wed, 7 Aug 2019 17:38:38 +0000 (17:38 +0000)]
[SCEV] Return zero from computeConstantDifference(X, X)

Without this patch computeConstantDifference returns None for cases like
these:

  computeConstantDifference(%x, %x)
  computeConstantDifference({%x,+,16}, {%x,+,16})

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

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

5 years ago[DataLayout] Check StackNatural and FunctionPtr alignments.
Florian Hahn [Wed, 7 Aug 2019 17:20:55 +0000 (17:20 +0000)]
[DataLayout] Check StackNatural and FunctionPtr alignments.

MaybeAlignment asserts that the passed in value is == 0 or a power of 2.

Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=16272

Reviewers: michaelplatings, gchatelet, jakehehrlich, jfb

Reviewed By: gchatelet

Tags: #llvm

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

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

5 years agoDebugInfo/DWARF: Normalize DWARFObject members on the DWARF spec section names
David Blaikie [Wed, 7 Aug 2019 17:18:11 +0000 (17:18 +0000)]
DebugInfo/DWARF: Normalize DWARFObject members on the DWARF spec section names

Some of these names were abbreviated, some were not, some pluralised,
some not. Made the API difficult to use - since it's an exact 1:1
mapping to the DWARF sections - use those names (changing underscore
separation for camel casing).

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

5 years agoSupport: Remove needless allocation when getMainExecutable() calls readlink()
Nico Weber [Wed, 7 Aug 2019 17:00:19 +0000 (17:00 +0000)]
Support: Remove needless allocation when getMainExecutable() calls readlink()

We built a StringRef from a string literal which we then converted to a
std::string to call c_str().  Just use a pointer to the string literal
instead of a StringRef.

No behavior change.

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

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

5 years agoRecommit r368081 "[X86] Add more extract subvector cost model tests for smaller eleme...
Craig Topper [Wed, 7 Aug 2019 16:42:47 +0000 (16:42 +0000)]
Recommit r368081 "[X86] Add more extract subvector cost model tests for smaller element sizes and smaller than 128-bit vectors."

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

5 years agoRecommit r368079 "[X86] Remove uses of the -x86-experimental-vector-widening-legaliza...
Craig Topper [Wed, 7 Aug 2019 16:33:37 +0000 (16:33 +0000)]
Recommit r368079 "[X86] Remove uses of the -x86-experimental-vector-widening-legalization flag from test/CodeGen/X86/"

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

5 years agoRecommit r367901 "[X86] Enable -x86-experimental-vector-widening-legalization by...
Craig Topper [Wed, 7 Aug 2019 16:24:26 +0000 (16:24 +0000)]
Recommit r367901 "[X86] Enable -x86-experimental-vector-widening-legalization by default."

The assert that caused this to be reverted should be fixed now.

Original commit message:

This patch changes our defualt legalization behavior for 16, 32, and
64 bit vectors with i8/i16/i32/i64 scalar types from promotion to
widening. For example, v8i8 will now be widened to v16i8 instead of
promoted to v8i16. This keeps the elements widths the same and pads
with undef elements. We believe this is a better legalization strategy.
But it carries some issues due to the fragmented vector ISA. For
example, i8 shifts and multiplies get widened and then later have
to be promoted/split into vXi16 vectors.

This has the potential to cause regressions so we wanted to get
it in early in the 10.0 cycle so we have plenty of time to
address them.

Next steps will be to merge tests that explicitly test the command
line option. And then we can remove the option and its associated
code.

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

5 years ago[ARM] Expand CTPOP intrinsic for MVE
Oliver Cruickshank [Wed, 7 Aug 2019 15:47:45 +0000 (15:47 +0000)]
[ARM] Expand CTPOP intrinsic for MVE

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

5 years agogn build: Merge r368158
Nico Weber [Wed, 7 Aug 2019 15:30:44 +0000 (15:30 +0000)]
gn build: Merge r368158

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

5 years agogn build: Merge r368119
Nico Weber [Wed, 7 Aug 2019 15:29:01 +0000 (15:29 +0000)]
gn build: Merge r368119

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

5 years ago[InstCombine] Add a TODO comment
Jay Foad [Wed, 7 Aug 2019 15:18:34 +0000 (15:18 +0000)]
[InstCombine] Add a TODO comment

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

5 years ago[InstCombine] Propagate fast math flags through selects
Jay Foad [Wed, 7 Aug 2019 15:16:28 +0000 (15:16 +0000)]
[InstCombine] Propagate fast math flags through selects

Summary:
In SimplifySelectsFeedingBinaryOp, propagate fast math flags from the
outer op into both arms of the new select, to take advantage of
simplifications that require fast math flags.

Reviewers: mcberg2017, majnemer, spatel, arsenm, xbolva00

Subscribers: wdng, javed.absar, kristof.beyls, hiraditya, llvm-commits

Tags: #llvm

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

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

5 years ago[UpdateTestChecks] Update tests option
David Bolvansky [Wed, 7 Aug 2019 14:44:50 +0000 (14:44 +0000)]
[UpdateTestChecks] Update tests option

Summary:
Port of new feature introduced https://reviews.llvm.org/D65610 to other update scripts.

- update_*_checks.py: add an alias -u for --update-only
- port --update-only to other update_*_test_checks.py scripts
- update script aborts if the test file was generated by another update_*_test_checks.py utility

Reviewers: lebedev.ri, RKSimon, MaskRay, reames, gbedwell

Reviewed By: MaskRay

Subscribers: llvm-commits

Tags: #llvm

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

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

5 years ago[EarlyCSE] Add support for unary FNeg to EarlyCSE
Cameron McInally [Wed, 7 Aug 2019 14:34:41 +0000 (14:34 +0000)]
[EarlyCSE] Add support for unary FNeg to EarlyCSE

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

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

5 years ago[RISCV][NFC] Document RISC-V-specific assembly constraints
Sam Elliott [Wed, 7 Aug 2019 13:08:07 +0000 (13:08 +0000)]
[RISCV][NFC] Document RISC-V-specific assembly constraints

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

5 years agoGlobalISel: factor common code from translateCall and translateInvoke. NFC.
Tim Northover [Wed, 7 Aug 2019 12:43:53 +0000 (12:43 +0000)]
GlobalISel: factor common code from translateCall and translateInvoke. NFC.

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

5 years ago[X86] EltsFromConsecutiveLoads - early out for non-byte sized memory (PR42909)
Simon Pilgrim [Wed, 7 Aug 2019 12:41:59 +0000 (12:41 +0000)]
[X86] EltsFromConsecutiveLoads - early out for non-byte sized memory (PR42909)

Don't attempt to merge loads for types that aren't modulo 8-bits.

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

5 years ago[AArch64][WinCFI] Do not pair callee-save instructions in LoadStoreOptimizer
Sander de Smalen [Wed, 7 Aug 2019 12:41:38 +0000 (12:41 +0000)]
[AArch64][WinCFI] Do not pair callee-save instructions in LoadStoreOptimizer

Prevent the LoadStoreOptimizer from pairing any load/store instructions with
instructions from the prologue/epilogue if the CFI information has encoded the
operations as separate instructions.  This would otherwise lead to a mismatch
of the actual prologue size from the size as recorded in the Windows CFI.

Reviewers: efriedma, mstorsjo, ssijaric

Reviewed By: efriedma

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

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

5 years ago[mips] Make a couple of class methods plain static functions. NFC
Simon Atanasyan [Wed, 7 Aug 2019 12:21:41 +0000 (12:21 +0000)]
[mips] Make a couple of class methods plain static functions. NFC

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

5 years ago[mips] Use isMicroMips() function to check enabled feature flag. NFC
Simon Atanasyan [Wed, 7 Aug 2019 12:21:32 +0000 (12:21 +0000)]
[mips] Use isMicroMips() function to check enabled feature flag. NFC

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

5 years ago[Mips] Instruction `sc` now accepts symbol as an argument
Simon Atanasyan [Wed, 7 Aug 2019 12:21:26 +0000 (12:21 +0000)]
[Mips] Instruction `sc` now accepts symbol as an argument

Function MipsAsmParser::expandMemInst() did not properly handle
instruction `sc` with a symbol as an argument because first argument
would be counted twice. We add additional checks and handle this case
separately.

Patch by Mirko Brkusanin.

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

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

5 years ago[Support] Base SmartMutex on std::recursive_mutex
Benjamin Kramer [Wed, 7 Aug 2019 11:59:57 +0000 (11:59 +0000)]
[Support] Base SmartMutex on std::recursive_mutex

- Remove support for non-recursive mutexes. This was unused.
- The std::recursive_mutex is now created/destroyed unconditionally.
  Locking is still only done if threading is enabled.
- Alias SmartScopedLock to std::lock_guard.

This should make no semantic difference on the existing APIs.

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

5 years agoReplace non-recursive sys::Mutex users with std::mutex
Benjamin Kramer [Wed, 7 Aug 2019 11:59:44 +0000 (11:59 +0000)]
Replace non-recursive sys::Mutex users with std::mutex

Also remove a use of sys::MutexImpl, that's just evil. No functionality
change intended.

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

5 years agoRemove support for 32-bit offsets in utility classes (5/5)
Igor Kudrin [Wed, 7 Aug 2019 11:44:47 +0000 (11:44 +0000)]
Remove support for 32-bit offsets in utility classes (5/5)

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

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

5 years ago[TargetLowering] SimplifyDemandedBits - call SimplifyMultipleUseDemandedBits for...
Simon Pilgrim [Wed, 7 Aug 2019 11:43:13 +0000 (11:43 +0000)]
[TargetLowering] SimplifyDemandedBits - call SimplifyMultipleUseDemandedBits for ISD::VECTOR_SHUFFLE

In particular this helps the SSE vector shift cvttps2dq+add+shl pattern by avoiding the need for zeros in shuffle style extensions to vXi32 types as we'll be shifting out those bits anyway

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

5 years agoReplace llvm::MutexGuard/UniqueLock with their standard equivalents
Benjamin Kramer [Wed, 7 Aug 2019 10:57:25 +0000 (10:57 +0000)]
Replace llvm::MutexGuard/UniqueLock with their standard equivalents

All supported platforms have <mutex> now, so we don't need our own
copies any longer. No functionality change intended.

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

5 years ago[ARM] Generate MVE VHADDs/VHSUBs
Oliver Cruickshank [Wed, 7 Aug 2019 10:26:57 +0000 (10:26 +0000)]
[ARM] Generate MVE VHADDs/VHSUBs

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

5 years ago[InstCombine] Recommit: Shift amount reassociation: shl-trunc-shl pattern
Roman Lebedev [Wed, 7 Aug 2019 09:41:50 +0000 (09:41 +0000)]
[InstCombine] Recommit: Shift amount reassociation: shl-trunc-shl pattern

This was initially committed in r368059 but got reverted in r368084
because there was a faulty logic in how the shift amounts type mismatch
was being handled (it simply wasn't).

I've added an explicit bailout before we SimplifyAddInst() - i don't think
it's designed in general to handle differently-typed values, even though
the actual problem only comes from ConstantExpr's.

I have also changed the common type deduction, to not just blindly
look past zext, but try to do that so that in the end types match.

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

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

5 years ago[obj2yaml] - MIPS: move and improve testing of the e_flags
George Rimar [Wed, 7 Aug 2019 09:35:04 +0000 (09:35 +0000)]
[obj2yaml] - MIPS: move and improve testing of the e_flags

Mips/elf-flags.yaml and Mips/elf-abi.yaml are tests that intention was to
show that yaml2obj/obj2yaml are able to read/dump MIPS specific e_flags.

They were not complete, contained an excessive YAML parts and were placed
at a wrong location.

I removed them and created the obj2yaml/elf-mips-eflags.yaml instead.

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

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

5 years ago[ELF.h] - Check the case when e_shstrndx=SHN_XINDEX, but the corresponding sh_link...
George Rimar [Wed, 7 Aug 2019 09:29:42 +0000 (09:29 +0000)]
[ELF.h] - Check the case when e_shstrndx=SHN_XINDEX, but the corresponding sh_link is broken.

When e_shstrndx is equal to SHN_XINDEX,
the index of the section string table section should
be taken from the sh_link field of the section
header at index 0.

If sh_link is broken, e.g. contains an index that is
larger than number of sections, then error is reported.

This error message was untested before.

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

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

5 years ago[llvm-readelf] --notes: move 'Data size' column left by 1
Fangrui Song [Wed, 7 Aug 2019 09:13:11 +0000 (09:13 +0000)]
[llvm-readelf] --notes: move 'Data size' column left by 1

readelf -n:

```
// "Data size" is not left justified
  Owner                 Data size       Description
  GNU                  0x00000010       NT_GNU_ABI_TAG (ABI version tag)
```

llvm-readelf -n (before):
```
// "Data size" column shifted by 1
  Owner                 Data size        Description
  GNU                   0x00000010       NT_GNU_ABI_TAG (ABI version tag)
```

llvm-readelf -n (after):
```
  Owner                Data size        Description
  GNU                  0x00000010       NT_GNU_ABI_TAG (ABI version tag)
```

This change is made to reduce the diff with readelf -n, so that it is
slightly easier to check what features readelf implements but we don't.

Reviewed By: grimar, jhenderson

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

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

5 years ago[unittests] Mark private gmock headers with IWYU pragmas. NFC
Ilya Biryukov [Wed, 7 Aug 2019 08:45:38 +0000 (08:45 +0000)]
[unittests] Mark private gmock headers with IWYU pragmas. NFC

Summary: To prevent clangd from adding #include of those headers.

Reviewers: gribozavr

Reviewed By: gribozavr

Subscribers: kadircet, llvm-commits, cfe-commits

Tags: #llvm

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

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

5 years agoRe-submit r367649: Improve raw_ostream so that you can "write" colors using operator<<
Rui Ueyama [Wed, 7 Aug 2019 08:08:17 +0000 (08:08 +0000)]
Re-submit r367649: Improve raw_ostream so that you can "write" colors using operator<<

The original patch broke buildbots, perhaps because it changed the
default setting whether colors are enabled or not.

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

5 years ago[ARM][LowOverheadLoops] Revert after read/write
Sam Parker [Wed, 7 Aug 2019 07:39:19 +0000 (07:39 +0000)]
[ARM][LowOverheadLoops] Revert after read/write

Currently we check whether LR is stored/loaded to/from inbetween the
loop decrement and loop end pseudo instructions. There's two problems
here:
- It relies on all load/store instructions being labelled as such in
  tablegen.
- Actually any use of loop decrement is troublesome because the value
  doesn't exist!

So we need to check for any read/write of LR that occurs between the
two instructions and revert if we find anything.

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

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

5 years agoForce check prof branch_weights consistency in SwitchInstProfUpdateWrapper
Yevgeny Rouban [Wed, 7 Aug 2019 07:17:45 +0000 (07:17 +0000)]
Force check prof branch_weights consistency in SwitchInstProfUpdateWrapper

This patch turns on the prof branch_weights metadata consistency
check in SwitchInstProfUpdateWrapper.

If this patch causes a failure then please before reverting do report
the IR that hits the assertion and try identifying the pass that
introduces the inconsistency. We have to fix all such passes.

See also the upcoming change https://reviews.llvm.org/D61179
in the Verifier.

Reviewers: davidx, nikic, eraman, reames, chandlerc
Reviewed By: davidx
Differential Revision: https://reviews.llvm.org/D64061

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

5 years ago[X86] Allow any 8-bit immediate to be used with bt/btc/btr/bts memory aliases.
Craig Topper [Wed, 7 Aug 2019 06:17:58 +0000 (06:17 +0000)]
[X86] Allow any 8-bit immediate to be used with bt/btc/btr/bts memory aliases.

We have aliases that disambiguate memory forms of bt/btc/btr/bts
without suffixes to the 32-bit form. These aliases should have
been updated when the instructions were updated in r356413.

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

5 years ago[X86] Use isInt<8> to simplify some code. NFC
Craig Topper [Wed, 7 Aug 2019 06:17:55 +0000 (06:17 +0000)]
[X86] Use isInt<8> to simplify some code. NFC

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

5 years ago[MachineCSE][NFC] Use 'profitable' rather than 'beneficial' to name method.
Kai Luo [Wed, 7 Aug 2019 05:40:21 +0000 (05:40 +0000)]
[MachineCSE][NFC] Use 'profitable' rather than 'beneficial' to name method.

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

5 years ago[X86] Limit vpermil2pd/vpermil2ps immediates to 4 bits in the assembly parser.
Craig Topper [Wed, 7 Aug 2019 05:34:27 +0000 (05:34 +0000)]
[X86] Limit vpermil2pd/vpermil2ps immediates to 4 bits in the assembly parser.

The upper 4 bits of the immediate byte are used to encode a
register. We need to limit the explicit immediate to fit in the
remaining 4 bits.

Fixes PR42899.

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

5 years agoReverts commit r368117, r368115 and r368112
Petr Hosek [Wed, 7 Aug 2019 05:15:34 +0000 (05:15 +0000)]
Reverts commit r368117, r368115 and r368112

This reverts commits:

  "Added Delta IR Reduction Tool"
  "[Bugpoint redesign] Added Pass to Remove Global Variables"
  "Added Tool as Dependency to tests & fixed warnings"

Reduce/remove-funcs.ll is failing on bots.

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

5 years agoAppend an executable suffix to the toolchain tool paths on Windows platform.
Galina Kistanova [Wed, 7 Aug 2019 03:19:40 +0000 (03:19 +0000)]
Append an executable suffix to the toolchain tool paths on Windows platform.

Append a default CMake suffix (CMAKE_EXECUTABLE_SUFFIX) for the build host to the toolchain tool path when adding a LLVM external project.
The tool binary files should contain .exe suffix to run them properly on Windows platform when building the projects.

Patch by Vlad Vereschaka.

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

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

5 years agoFixes failing test cases on Windows for rL368119
Alex Brachet [Wed, 7 Aug 2019 03:18:23 +0000 (03:18 +0000)]
Fixes failing test cases on Windows for rL368119

Windows test cases were failing because the executable is called yaml2obj.exe
not just yaml2obj. I removed FileCheck patterns including yaml2obj so they
start matching at the error message not the program name.

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

5 years ago[yaml2obj] Move core yaml2obj code into lib and include for use in unit tests
Alex Brachet [Wed, 7 Aug 2019 02:44:49 +0000 (02:44 +0000)]
[yaml2obj] Move core yaml2obj code into lib and include for use in unit tests

Reviewers: jhenderson, rupprecht, MaskRay, grimar, labath

Reviewed By: rupprecht

Subscribers: gribozavr, mgrang, seiya, mgorny, sbc100, hiraditya, aheejin, jakehehrlich, llvm-commits

Tags: #llvm

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

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

5 years agoAdded Tool as Dependency to tests & fixed warnings
Diego Trevino Ferrer [Wed, 7 Aug 2019 01:51:56 +0000 (01:51 +0000)]
Added Tool as Dependency to tests & fixed warnings

Summary: Fixes http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap-msan/builds/14002 and http://lab.llvm.org:8011/builders/lld-x86_64-darwin13/builds/35392/steps/build_Lld/logs/stdio

Subscribers: mgorny, llvm-commits

Tags: #llvm

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

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

5 years ago[Bugpoint redesign] Added Pass to Remove Global Variables
Diego Trevino Ferrer [Wed, 7 Aug 2019 00:42:50 +0000 (00:42 +0000)]
[Bugpoint redesign] Added Pass to Remove Global Variables

Summary:
This pass tries to remove Global Variables, as well as their derived uses. For example if a variable `@x` is used by `%call1` and `%call2`, both these uses and the definition of `@x` are deleted. Moreover if `%call1` or `%call2` are used elsewhere those uses are also deleted, and so on recursively.

I'm still uncertain if this pass should remove derived uses, I'm open to suggestions.

Subscribers: mgorny, llvm-commits

Tags: #llvm

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

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

5 years agoTLI: darwin does not support _bcmp
Alex Lorenz [Wed, 7 Aug 2019 00:03:37 +0000 (00:03 +0000)]
TLI: darwin does not support _bcmp

Not all Darwin targets support _bcmp in all circumstances.

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

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

5 years agoAdded Delta IR Reduction Tool
Diego Trevino Ferrer [Wed, 7 Aug 2019 00:00:52 +0000 (00:00 +0000)]
Added Delta IR Reduction Tool

Summary: Tool parses input IR file, and runs the delta debugging algorithm to reduce the functions inside the input file.

Reviewers: alexshap, chandlerc

Subscribers: mgorny, llvm-commits

Tags: #llvm

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

llvm-svn: 368071

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

5 years agoRegenerate mmx-arith.ll.
Mitch Phillips [Tue, 6 Aug 2019 23:39:07 +0000 (23:39 +0000)]
Regenerate mmx-arith.ll.

This test golden file has become out of date since the rollback of
rL368081. Update the test to have the correct values.

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