]> granicus.if.org Git - llvm/log
llvm
5 years ago[SafeStack] Insert the deref before remaining elements
Petr Hosek [Wed, 24 Jul 2019 00:16:23 +0000 (00:16 +0000)]
[SafeStack] Insert the deref before remaining elements

This is a follow up to D64971. While we need to insert the deref after
the offset, it needs to come before the remaining elements in the
original expression since the deref needs to happen before the LLVM
fragment if present.

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

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

5 years ago[Remarks] String tables should be move-only
Francis Visoiu Mistrih [Tue, 23 Jul 2019 22:50:08 +0000 (22:50 +0000)]
[Remarks] String tables should be move-only

Copying them is expensive. This allows the tables to be moved around at
lower cost, and allows a remarks::StringTable to be constructed from
a remarks::ParsedStringTable.

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

5 years ago[FileCheck] Use ASSERT for fatal unit tests
Thomas Preud'homme [Tue, 23 Jul 2019 22:41:51 +0000 (22:41 +0000)]
[FileCheck] Use ASSERT for fatal unit tests

Summary:
A number of EXPECT statements in FileCheck's unit tests are dependent
from results of other values being tested. This commit changes those
earlier test to use ASSERT instead of EXPECT to avoid cascade errors
when they are all related to the same issue.

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

Subscribers: JonChesterfield, rogfer01, hfinkel, kristina, rnk, tra, arichardson, grimar, dblaikie, probinson, llvm-commits, hiraditya

Tags: #llvm

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

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

5 years ago[FileCheck]] Canonicalize caret location testing
Thomas Preud'homme [Tue, 23 Jul 2019 22:41:46 +0000 (22:41 +0000)]
[FileCheck]] Canonicalize caret location testing

Summary:
Testing of caret location in diagnostic message is currently made with
CHECK directive with the following general format:
CHECK: {{^         \^$}}

James Henderson suggested the following would be more readable:
CHECK: {{^}}         ^{{$}}

and when whole lines can be matched (as is the case for command-line
testing where error messages do not include path):
CHECK:         ^
using the option --match-full-lines.

This commit implements these 2 changes on all existing caret position
tests. It also aligns the caret to the character it is trying to match
in the above line.

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

Subscribers: JonChesterfield, rogfer01, hfinkel, kristina, rnk, tra, arichardson, grimar, dblaikie, probinson, llvm-commits, hiraditya

Tags: #llvm

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

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

5 years agoFileCheck [8/12]: Define numeric var from expr
Thomas Preud'homme [Tue, 23 Jul 2019 22:41:38 +0000 (22:41 +0000)]
FileCheck [8/12]: Define numeric var from expr

Summary:
This patch is part of a patch series to add support for FileCheck
numeric expressions. This specific patch lift the restriction for a
numeric expression to either be a variable definition or a numeric
expression to try to match.

This commit allows a numeric variable to be set to the result of the
evaluation of a numeric expression after it has been matched
successfully. When it happens, the variable is allowed to be used on
the same line since its value is known at match time.

It also makes use of this possibility to reuse the parsing code to
parse a command-line definition by crafting a mirror string of the
-D option with the equal sign replaced by a colon sign, e.g. for option
'-D#NUMVAL=10' it creates the string
'-D#NUMVAL=10 (parsed as [[#NUMVAL:10]])' where the numeric expression
is parsed to define NUMVAL. This result in a few tests needing updating
for the location diagnostics on top of the tests for the new feature.

It also enables empty numeric expression which match any number without
defining a variable. This is done here rather than in commit #5 of the
patch series because it requires to dissociate automatic regex insertion
in RegExStr from variable definition which would make commit #5 even
bigger than it already is.

Copyright:
    - Linaro (changes up to diff 183612 of revision D55940)
    - GraphCore (changes in later versions of revision D55940 and
                 in new revision created off D55940)

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

Subscribers: hiraditya, llvm-commits, probinson, dblaikie, grimar, arichardson, tra, rnk, kristina, hfinkel, rogfer01, JonChesterfield

Tags: #llvm

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

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

5 years ago[DWARF] Use 32-bit format specifier for offset
Jonas Devlieghere [Tue, 23 Jul 2019 22:34:21 +0000 (22:34 +0000)]
[DWARF] Use 32-bit format specifier for offset

This should fix PR42730.

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

5 years ago[AArch64][GlobalISel] Add support for s128 loads, stores, extracts, truncs.
Amara Emerson [Tue, 23 Jul 2019 22:05:13 +0000 (22:05 +0000)]
[AArch64][GlobalISel] Add support for s128 loads, stores, extracts, truncs.

We need to be able to load and store s128 for memcpy inlining, where we want to
generate Q register mem ops. Making these legal also requires that we add some
support in other instructions. Regbankselect should also know about these since
they have no GPR register class that can hold them, so need special handling to
live on the FPR bank.

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

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

5 years agoFix "control reaches end of non-void function" warning. NFCI.
Simon Pilgrim [Tue, 23 Jul 2019 21:59:48 +0000 (21:59 +0000)]
Fix "control reaches end of non-void function" warning. NFCI.

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

5 years ago[docs] Clarify where the indirect UB due to write-write races comes from
Eli Friedman [Tue, 23 Jul 2019 21:51:26 +0000 (21:51 +0000)]
[docs] Clarify where the indirect UB due to write-write races comes from

This is based on https://bugs.llvm.org/show_bug.cgi?id=42435#c3.

Patch by Ralf Jung.

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

5 years ago[GlobalISel][AArch64] Save a copy on G_SELECT by fixing condition to GPR
Jessica Paquette [Tue, 23 Jul 2019 21:39:50 +0000 (21:39 +0000)]
[GlobalISel][AArch64] Save a copy on G_SELECT by fixing condition to GPR

The condition can never be fed by FPRs, so it should always be on a GPR.

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

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

5 years ago[ARM] Add opt-bisect support to ARMParallelDSP.
Eli Friedman [Tue, 23 Jul 2019 20:48:46 +0000 (20:48 +0000)]
[ARM] Add opt-bisect support to ARMParallelDSP.

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

5 years ago[Remarks] Introduce a new format: yaml-strtab
Francis Visoiu Mistrih [Tue, 23 Jul 2019 20:42:46 +0000 (20:42 +0000)]
[Remarks] Introduce a new format: yaml-strtab

This exposes better support to use a string table with a format through
an actual new remark::Format, called yaml-strtab.

This can now be used with -fsave-optimization-record=yaml-strtab.

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

5 years ago[Remarks][NFC] Move the YAML serializer to its own header
Francis Visoiu Mistrih [Tue, 23 Jul 2019 19:28:03 +0000 (19:28 +0000)]
[Remarks][NFC] Move the YAML serializer to its own header

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

5 years ago[PowerPC] Remove redundant load immediate instructions
Yi-Hong Lyu [Tue, 23 Jul 2019 19:11:07 +0000 (19:11 +0000)]
[PowerPC] Remove redundant load immediate instructions

Currently PowerPC backend emits code like this:

  r3 = li 0
  std r3, 264(r1)
  r3 = li 0
  std r3, 272(r1)

This patch fixes that and other cases where a register already contains a value that is loaded so we will get:

  r3 = li 0
  std r3, 264(r1)
  std r3, 272(r1)

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

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

5 years agogn build: Merge r366832
Nico Weber [Tue, 23 Jul 2019 19:02:47 +0000 (19:02 +0000)]
gn build: Merge r366832

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

5 years ago[X86] In lowerVectorShuffle, instead of creating a new node to canonicalize the shuff...
Craig Topper [Tue, 23 Jul 2019 18:46:15 +0000 (18:46 +0000)]
[X86] In lowerVectorShuffle, instead of creating a new node to canonicalize the shuffle mask by commuting, just commute the mask and swap V1/V2.

LegalizeDAG tries to legal the DAG by legalizing nodes before
their operands.

If we create a new node, we end up legalizing it after its operands.
This prevents some of the optimizations that can be done when the
operand is a build_vector since the build_vector will have been
legalized to something else.

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

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

5 years ago[Remarks] Add unit tests for YAML serialization
Francis Visoiu Mistrih [Tue, 23 Jul 2019 18:09:12 +0000 (18:09 +0000)]
[Remarks] Add unit tests for YAML serialization

Add tests for both the string table and non string table case.

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

5 years ago[IndVars] Fix a subtle bug in optimizeLoopExits
Philip Reames [Tue, 23 Jul 2019 17:45:11 +0000 (17:45 +0000)]
[IndVars] Fix a subtle bug in optimizeLoopExits

The original code failed to account for the fact that one exit can have a pointer exit count without all of them having pointer exit counts.  This could cause two separate bugs:
1) We might exit the loop early, and leave optimizations undone.  This is what triggered the assertion failure in the reported test case.
2) We might optimize one exit, then exit without indicating a change.  This could result in an analysis invalidaton bug if no other transform is done by the rest of indvars.

Note that the pointer exit counts are a really fragile concept.  They show up only when we have a pointer IV w/o a datalayout to provide their size.  It's really questionable to me whether the complexity implied is worth it.

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

5 years ago[IR][Verifier] Allow IntToPtrInst to be !dereferenceable
Ryan Taylor [Tue, 23 Jul 2019 17:19:56 +0000 (17:19 +0000)]
[IR][Verifier] Allow IntToPtrInst to be !dereferenceable

Summary:
Allow IntToPtrInst to carry !dereferenceable metadata tag.
This is valid since !dereferenceable can be only be applied to
pointer type values.

Change-Id: If8a6e3c616f073d51eaff52ab74535c29ed497b4

Subscribers: llvm-commits

Tags: #llvm

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

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

5 years ago[RISCV][NFC] Correct RUN in rvi-pseudos-invalid.s
Sam Elliott [Tue, 23 Jul 2019 17:14:42 +0000 (17:14 +0000)]
[RISCV][NFC] Correct RUN in rvi-pseudos-invalid.s

This test should test both riscv32 and riscv64.

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

5 years ago[CMake] Add -z defs on Solaris
Rainer Orth [Tue, 23 Jul 2019 16:27:34 +0000 (16:27 +0000)]
[CMake] Add -z defs on Solaris

Like other ELF targets, shared objects should be linked with -z defs on Solaris.

Tested on x86_64-pc-solaris2.11 and sparcv9-sun-solaris2.11.

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

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

5 years ago[GlobalISel][AArch64] Teach GISel to handle shifts in load addressing modes
Jessica Paquette [Tue, 23 Jul 2019 16:09:42 +0000 (16:09 +0000)]
[GlobalISel][AArch64] Teach GISel to handle shifts in load addressing modes

When we select the XRO variants of loads, we can pull in very specific shifts
(of the size of an element). E.g.

```
ldr x1, [x2, x3, lsl #3]
```

This teaches GISel to handle these when they're coming from shifts
specifically.

This adds a new addressing mode function, `selectAddrModeShiftedExtendXReg`
which recognizes this pattern.

This also packs this up with `selectAddrModeRegisterOffset` into
`selectAddrModeXRO`. This is intended to be equivalent to `selectAddrModeXRO`
in AArch64ISelDAGtoDAG.

Also update load-addressing-modes to show that all of the cases here work.

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

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

5 years ago[TargetLowering] SimplifyMultipleUseDemandedBits - add VECTOR_SHUFFLE support.
Simon Pilgrim [Tue, 23 Jul 2019 15:35:55 +0000 (15:35 +0000)]
[TargetLowering] SimplifyMultipleUseDemandedBits - add VECTOR_SHUFFLE support.

If all the demanded elts are from one operand and are inline, then we can use the operand directly.

The changes are mainly from SSE41 targets which has blendvpd but not cmpgtq, allowing the v2i64 comparison to be simplified as we only need the signbit from alternate v4i32 elements.

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

5 years agoRevert "[Object/ELF.h] - Improve testing of the fields in ELFFile<ELFT>::sections()."
Vlad Tsyrklevich [Tue, 23 Jul 2019 15:02:13 +0000 (15:02 +0000)]
Revert "[Object/ELF.h] - Improve testing of the fields in ELFFile<ELFT>::sections()."

This reverts commit r366796 because it was causing ubsan buildbot
failures.

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

5 years ago[llvm-ar] Fix support for archives with members larger than 4GB
Owen Reynolds [Tue, 23 Jul 2019 14:44:21 +0000 (14:44 +0000)]
[llvm-ar] Fix support for archives with members larger than 4GB

llvm-ar outputs a strange error message when handling archives with
members larger than 4GB due to not checking file size when passing the
value as an unsigned 32 bit integer. This overflow issue caused
malformed archives to be created.:

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

This change allows for members above 4GB and will error in a case that
is over the formats size limit, a 10 digit decimal integer.

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

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

5 years ago[ARM][LowOverheadLoops] Fix branch target codegen
Sam Parker [Tue, 23 Jul 2019 14:08:46 +0000 (14:08 +0000)]
[ARM][LowOverheadLoops] Fix branch target codegen

While lowering test.set.loop.iterations, it wasn't checked how the
brcond was using the result and so the wls could branch to the loop
preheader instead of not entering it. The same was true for
loop.decrement.reg.

So brcond and br_cc and now lowered manually when using the hwloop
intrinsics. During this we now check whether the result has been
negated and whether we're using SETEQ or SETNE and 0 or 1. We can
then figure out which basic block the WLS and LE should be targeting.

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

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

5 years agoFix MSVC warning about extending a uint32_t shift result to uint64_t. NFCI.
Simon Pilgrim [Tue, 23 Jul 2019 14:04:54 +0000 (14:04 +0000)]
Fix MSVC warning about extending a uint32_t shift result to uint64_t. NFCI.

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

5 years ago[SLPVectorizer] Revert local change that got accidently got committed in rL366799
Simon Pilgrim [Tue, 23 Jul 2019 13:42:01 +0000 (13:42 +0000)]
[SLPVectorizer] Revert local change that got accidently got committed in rL366799

This wasn't part of D63281

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

5 years agoRevert [RISCV] Re-enable rv32i-aliases-invalid.s test
Sam Elliott [Tue, 23 Jul 2019 13:30:56 +0000 (13:30 +0000)]
Revert [RISCV] Re-enable rv32i-aliases-invalid.s test

This reverts r366797 (git commit 53f9fec8e8b58f5a904bbfb4a1d648cde65aa860)

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

5 years ago[NFC][InstCombine] Fixup commutative/negative tests with icmp preds in @llvm.umul...
Roman Lebedev [Tue, 23 Jul 2019 12:42:57 +0000 (12:42 +0000)]
[NFC][InstCombine] Fixup commutative/negative tests with icmp preds in @llvm.umul.with.overflow tests

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

5 years ago[InstSimplify][NFC] Tests for skipping 'div-by-0' checks before inverted @llvm.umul...
Roman Lebedev [Tue, 23 Jul 2019 12:42:49 +0000 (12:42 +0000)]
[InstSimplify][NFC] Tests for skipping 'div-by-0' checks before inverted @llvm.umul.with.overflow

It would be already handled by the non-inverted case if we were hoisting
the `not` in InstCombine, but we don't (granted, we don't sink it
in this case either), so this is a separate case.

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

5 years ago[NFC][PhaseOredering][SimplifyCFG] Add more runlines to umul.with.overflow tests
Roman Lebedev [Tue, 23 Jul 2019 12:42:41 +0000 (12:42 +0000)]
[NFC][PhaseOredering][SimplifyCFG] Add more runlines to umul.with.overflow tests

This way it will be more obvious that the problem is both
in cost threshold and in hardcoded benefit check,
plus will show how the instsimplify cleans this all in the end.

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

5 years ago[TargetLowering] Add SimplifyMultipleUseDemandedBits
Simon Pilgrim [Tue, 23 Jul 2019 12:39:08 +0000 (12:39 +0000)]
[TargetLowering] Add SimplifyMultipleUseDemandedBits

This patch introduces the DAG version of SimplifyMultipleUseDemandedBits, which attempts to peek through ops (mainly and/or/xor so far) that don't contribute to the demandedbits/elts of a node - which means we can do this even in cases where we have multiple uses of an op, which normally requires us to demanded all bits/elts. The intention is to remove a similar instruction - SelectionDAG::GetDemandedBits - once SimplifyMultipleUseDemandedBits has matured.

The InstCombine version of SimplifyMultipleUseDemandedBits can constant fold which I haven't added here yet, and so far I've only wired this up to some basic binops (and/or/xor/add/sub/mul) to demonstrate its use.

We do see a couple of regressions that need to be addressed:

    AMDGPU unsigned dot product codegen retains an AND mask (for ZERO_EXTEND) that it previously removed (but otherwise the dotproduct codegen is a lot better).

    X86/AVX2 has poor handling of vector ANY_EXTEND/ANY_EXTEND_VECTOR_INREG - it prematurely gets converted to ZERO_EXTEND_VECTOR_INREG.

The code owners have confirmed its ok for these cases to fixed up in future patches.

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

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

5 years ago[RISCV] Re-enable rv32i-aliases-invalid.s test
Sam Elliott [Tue, 23 Jul 2019 11:40:55 +0000 (11:40 +0000)]
[RISCV] Re-enable rv32i-aliases-invalid.s test

We were getting test failures on some builders, which pointed to @LINE
being an undefined variable. I think that these failures should have
been fixed by https://reviews.llvm.org/rL366434, so I'm re-enabling the
test.

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

5 years ago[Object/ELF.h] - Improve testing of the fields in ELFFile<ELFT>::sections().
George Rimar [Tue, 23 Jul 2019 11:37:14 +0000 (11:37 +0000)]
[Object/ELF.h] - Improve testing of the fields in ELFFile<ELFT>::sections().

This eliminates a one error untested and
also introduces a error for one more possible case
which lead to crash previously.

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

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

5 years ago[yaml2obj] - Add a support for defining null sections in YAMLs.
George Rimar [Tue, 23 Jul 2019 11:03:37 +0000 (11:03 +0000)]
[yaml2obj] - Add a support for defining null sections in YAMLs.

ELF spec shows (Figure 4-10: Section Header Table Entry:Index 0,
http://www.sco.com/developers/gabi/latest/ch4.sheader.html)
that section header at index 0 (null section) can have sh_size and
sh_link fields set to non-zero values.

It says (https://docs.oracle.com/cd/E19683-01/817-3677/6mj8mbtc9/index.html):

"If the number of sections is greater than or equal to SHN_LORESERVE (0xff00),
this member has the value zero and the actual number of section header table
entries is contained in the sh_size field of the section header at index 0.
Otherwise, the sh_size member of the initial entry contains 0."

and:

"If the section name string table section index is greater than or equal to SHN_LORESERVE
(0xff00), this member has the value SHN_XINDEX (0xffff) and the actual index of the section
name string table section is contained in the sh_link field of the section header at index 0.
Otherwise, the sh_link member of the initial entry contains 0."

At this moment it is not possible to create custom section headers at index 0 using yaml2obj.

This patch implements this.

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

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

5 years ago[SLPVectorizer] Remove null-pointer test. NFCI.
Simon Pilgrim [Tue, 23 Jul 2019 10:51:43 +0000 (10:51 +0000)]
[SLPVectorizer] Remove null-pointer test. NFCI.

cast<CallInst> shouldn't return null and we dereference the pointer in a lot of other places, causing both MSVC + cppcheck to warn about dereferenced null pointers

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

5 years ago[ARM] Rename NEONModImm to VMOVModImm. NFC
David Green [Tue, 23 Jul 2019 09:19:24 +0000 (09:19 +0000)]
[ARM] Rename NEONModImm to VMOVModImm. NFC

Rename NEONModImm to VMOVModImm as it is used in both NEON and MVE.

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

5 years ago[Attributor][NFC] Re-run clang-format on the Attributor.cpp
Hideto Ueno [Tue, 23 Jul 2019 08:29:22 +0000 (08:29 +0000)]
[Attributor][NFC] Re-run clang-format on the Attributor.cpp

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

5 years ago[Attributor] Deduce "dereferenceable" attribute
Hideto Ueno [Tue, 23 Jul 2019 08:16:17 +0000 (08:16 +0000)]
[Attributor] Deduce "dereferenceable" attribute

Summary:
Deduce dereferenceable attribute in Attributor.

These will be added in a later patch.
* dereferenceable(_or_null)_globally (D61652)
* Deduction based on load instruction (similar to D64258)

Reviewers: jdoerfert, sstefan1

Reviewed By: jdoerfert

Subscribers: hiraditya, jfb, llvm-commits

Tags: #llvm

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

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

5 years ago[llvm-objcopy] Allow strip symtab in executables and DSOs
Eugene Leviant [Tue, 23 Jul 2019 08:03:30 +0000 (08:03 +0000)]
[llvm-objcopy] Allow strip symtab in executables and DSOs

Re-commit of the patch after addressing -Wl,--emit-relocs case.
Differential revision: https://reviews.llvm.org/D61672

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

5 years agoFix gold-plugin Windows build
Yi Kong [Tue, 23 Jul 2019 07:41:17 +0000 (07:41 +0000)]
Fix gold-plugin Windows build

r365588 missed one instance of integer file descriptor use in
gold-plugin.cpp.

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

5 years ago[yaml2elf] - Treat the SHN_UNDEF section as kind of regular section.
George Rimar [Tue, 23 Jul 2019 07:38:44 +0000 (07:38 +0000)]
[yaml2elf] - Treat the SHN_UNDEF section as kind of regular section.

We have a logic that adds a few sections implicitly.
Though the SHT_NULL section with section number 0
is an exception.

In D64913 I want to teach yaml2obj to redefine the null section.
And in this patch I add it to the sections list,
to make it kind of a regular section.

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

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

5 years ago[AMDGPU][NFC] Simplify test file for amdgcn intrinsics
Hideto Ueno [Tue, 23 Jul 2019 06:48:47 +0000 (06:48 +0000)]
[AMDGPU][NFC] Simplify test file for amdgcn intrinsics

Summary: Remove unchecked attribute in the call site and use FileCheck String Substitution for `convergent` check.

Reviewers: nhaehnle

Reviewed By: nhaehnle

Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, llvm-commits

Tags: #llvm

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

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

5 years ago[DAGCombiner] Make ShrinkLoadReplaceStoreWithStore return an SDValue instead of an...
Craig Topper [Tue, 23 Jul 2019 05:13:39 +0000 (05:13 +0000)]
[DAGCombiner] Make ShrinkLoadReplaceStoreWithStore return an SDValue instead of an SDNode*. NFCI

The function was calling getNode() on an SDValue to return and the
caller turned the result back into a SDValue. So just return the
original SDValue to avoid this.

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

5 years ago[DAGCombiner] Use SDNode::isOperandOf to simplify some code. NFCI
Craig Topper [Tue, 23 Jul 2019 05:13:35 +0000 (05:13 +0000)]
[DAGCombiner] Use SDNode::isOperandOf to simplify some code. NFCI

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

5 years ago[LLVM-C] Improve Bindings to The Internalize Pass
Robert Widmann [Tue, 23 Jul 2019 04:56:44 +0000 (04:56 +0000)]
[LLVM-C] Improve Bindings to The Internalize Pass

Summary: Adds a binding to the internalize pass that allows the caller to pass a function pointer that acts as the visibility-preservation predicate.  Previously, one could only pass an unsigned value (not LLVMBool?) that directed the pass to consider "main" or not.

Reviewers: whitequark, deadalnix, harlanhaskins

Reviewed By: whitequark, harlanhaskins

Subscribers: kren1, hiraditya, llvm-commits, harlanhaskins

Tags: #llvm

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

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

5 years ago[PowerPC] Replace float load/store pair with integer load/store pair when it's only...
Zi Xuan Wu [Tue, 23 Jul 2019 03:34:40 +0000 (03:34 +0000)]
[PowerPC] Replace float load/store pair with integer load/store pair when it's only used in load/store

Replace float load/store pair with integer load/store pair when it's only used in load/store,
because float load/store instructions cost more cycles then integer load/store.

A typical scenario is when there is a call with more than 13 float arguments passing, we need pass them by stack.
So we need a load/store pair to do such memory operation if the variable is global variable.

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

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

5 years agoInline function call into assert to fix unused variable warning.
Richard Trieu [Tue, 23 Jul 2019 03:10:06 +0000 (03:10 +0000)]
Inline function call into assert to fix unused variable warning.

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

5 years agoMove variable out from debug only section.
Richard Trieu [Tue, 23 Jul 2019 02:59:15 +0000 (02:59 +0000)]
Move variable out from debug only section.

MFI is no longer just needed for an assert.  Move it out of the debug only
section to allow non-assert builds to be able to find it.

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

5 years ago[llvm-lipo] Implement -info
Shoaib Meenai [Tue, 23 Jul 2019 00:42:03 +0000 (00:42 +0000)]
[llvm-lipo] Implement -info

Prints architecture type of all input files.

Patch by Anusha Basana <anusha.basana@gmail.com>

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

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

5 years agoFixing build error from commit 95cbc3d
Stefan Stipanovic [Mon, 22 Jul 2019 23:58:23 +0000 (23:58 +0000)]
Fixing build error from commit 95cbc3d

[Attributor] Liveness analysis.

Liveness analysis abstract attribute used to indicate which BasicBlocks are dead and can therefore be ignored.
Right now we are only looking at noreturn calls.

Reviewers: jdoerfert, uenoku

Subscribers: hiraditya, llvm-commits

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

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

5 years ago[Statepoints] Fix a bug in statepoint lowering for functions w/no-realign-stack
Philip Reames [Mon, 22 Jul 2019 23:33:18 +0000 (23:33 +0000)]
[Statepoints] Fix a bug in statepoint lowering for functions w/no-realign-stack

We were silently using the ABI alignment for all of the stores generated for deopt and gc values.  We'd gotten the alignment of the stack slot itself properly reduced (via MachineFrameInfo's clamping), but having the MMO on the store incorrect was enough for us to generate an aligned store to a unaligned location.

The simplest fix would have been to just pass the alignment to the helper function, but once we do that, the helper function doesn't really help.  So, inline it and directly call the MMO version of DAG.getStore with a properly constructed MMO.

Note that there's a separate performance possibility here.  Even if we *can* realign stacks, we probably don't *want to* if all of the stores are in slowpaths.  But that's a later patch, if at all.  :)

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

5 years agoFix pointer width in test from r366754.
Peter Collingbourne [Mon, 22 Jul 2019 23:32:41 +0000 (23:32 +0000)]
Fix pointer width in test from r366754.

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

5 years agogn build: Wrap two comments to 80 columns
Nico Weber [Mon, 22 Jul 2019 23:23:38 +0000 (23:23 +0000)]
gn build: Wrap two comments to 80 columns

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

5 years ago[DWARF] Add more error handling to debug line parser.
Jonas Devlieghere [Mon, 22 Jul 2019 23:23:34 +0000 (23:23 +0000)]
[DWARF] Add more error handling to debug line parser.

This patch exnteds the error handling in the debug line parser to get
rid of the existing MD5 assertion. I want to reuse the debug line parser
from LLVM in LLDB where we cannot crash on invalid input.

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

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

5 years ago[Statepoints] Add a test which shows a miscompile with no-realign-stacks
Philip Reames [Mon, 22 Jul 2019 23:08:56 +0000 (23:08 +0000)]
[Statepoints] Add a test which shows a miscompile with no-realign-stacks

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

5 years agoRevert "Fixing build error from commit 9285295."
Stefan Stipanovic [Mon, 22 Jul 2019 22:55:05 +0000 (22:55 +0000)]
Revert "Fixing build error from commit 9285295."

This reverts commit 95cbc3da8871f43c1ce2b2926afaedcd826202b1.

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

5 years agollvm-objcopy/test: add REQUIRES: shell for use of umask
David Blaikie [Mon, 22 Jul 2019 22:23:52 +0000 (22:23 +0000)]
llvm-objcopy/test: add REQUIRES: shell for use of umask

(follow-up to r365162)

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

5 years agoAnalysis: Don't look through aliases when simplifying GEPs.
Peter Collingbourne [Mon, 22 Jul 2019 22:13:46 +0000 (22:13 +0000)]
Analysis: Don't look through aliases when simplifying GEPs.

It is not safe in general to replace an alias in a GEP with its aliasee
if the alias can be replaced with another definition (i.e. via strong/weak
resolution (linkonce_odr) or via symbol interposition (default visibility
in ELF)) while the aliasee cannot. An example of how this can go wrong is
in the included test case.

I was concerned that this might be a load-bearing misoptimization (it's
possible for us to use aliases to share vtables between base and derived
classes, and on Windows, vtable symbols will always be aliases in RTTI
mode, so this change could theoretically inhibit trivial devirtualization
in some cases), so I built Chromium for Linux and Windows with and without
this change. The file sizes of the resulting binaries were identical, so it
doesn't look like this is going to be a problem.

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

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

5 years agoFixing build error from commit 9285295.
Stefan Stipanovic [Mon, 22 Jul 2019 22:10:59 +0000 (22:10 +0000)]
Fixing build error from commit 9285295.

[Attributor] Liveness analysis.

Liveness analysis abstract attribute used to indicate which BasicBlocks are dead and can therefore be ignored.
Right now we are only looking at noreturn calls.

Reviewers: jdoerfert, uenoku

Subscribers: hiraditya, llvm-commits

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

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

5 years ago[NFC][PatternMatch] Refactor code into a proper "matcher for any integral constant"
Roman Lebedev [Mon, 22 Jul 2019 22:09:24 +0000 (22:09 +0000)]
[NFC][PatternMatch] Refactor code into a proper "matcher for any integral constant"

Having it as a proper matcher is better for reusability elsewhere
(in a follow-up patch.)

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

5 years ago[InstSimplify][NFC] Tests for skipping 'div-by-0' checks before @llvm.umul.with.overflow
Roman Lebedev [Mon, 22 Jul 2019 22:09:11 +0000 (22:09 +0000)]
[InstSimplify][NFC] Tests for skipping 'div-by-0' checks before @llvm.umul.with.overflow

These may remain after @llvm.umul.with.overflow was canonicalized
from the code that was originally doing the check via division.

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

5 years ago[SimplifyCFG][NFC] Test that we fail to flatten CFG in JPEG "sign" value extend pattern
Roman Lebedev [Mon, 22 Jul 2019 22:09:02 +0000 (22:09 +0000)]
[SimplifyCFG][NFC] Test that we fail to flatten CFG in JPEG "sign" value extend pattern

This comes up in JPEG decoding, see e.g.
Figure F.12 – Extending the sign bit of a decoded value in V
of ITU T.81 (JPEG specification).

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

5 years ago[SimplifyCFG][NFC] Test that we fail to flatten CFG after forming @llvm.umul.with...
Roman Lebedev [Mon, 22 Jul 2019 22:08:55 +0000 (22:08 +0000)]
[SimplifyCFG][NFC] Test that we fail to flatten CFG after forming @llvm.umul.with.overflow

Even if we formed @llvm.umul.with.overflow, we are still stuck
with that guard against div-by-zero, which is no longer needed,
because we didn't flatten the CFG.

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

5 years ago[InstCombine][NFC] Tests for canonicalization of unsigned multiply overflow check
Roman Lebedev [Mon, 22 Jul 2019 22:08:45 +0000 (22:08 +0000)]
[InstCombine][NFC] Tests for canonicalization of unsigned multiply overflow check

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

5 years ago[NFC][PhaseOrdering] Add tests showcasing the problems of unsigned multiply overflow...
Roman Lebedev [Mon, 22 Jul 2019 22:08:35 +0000 (22:08 +0000)]
[NFC][PhaseOrdering] Add tests showcasing the problems of unsigned multiply overflow check

While we can form the @llvm.mul.with.overflow easily,
we are still left with that check that was guarding against div-by-0.
And in the second case we won't even flatten the CFG.

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

5 years ago[IndVarSimplify][NFC] Autogenerate check lines in loop_evaluate_1.ll
Roman Lebedev [Mon, 22 Jul 2019 22:08:27 +0000 (22:08 +0000)]
[IndVarSimplify][NFC] Autogenerate check lines in loop_evaluate_1.ll

Being affected by upcoming patch.

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

5 years agoAMDGPU: Don't use SDNodeXForm for DS offset output
Matt Arsenault [Mon, 22 Jul 2019 21:38:11 +0000 (21:38 +0000)]
AMDGPU: Don't use SDNodeXForm for DS offset output

The xform has no real valuewhen it's using out of a complex pattern
output. The complex pattern was already creating TargetConstants with
i16, so this was just unnecessary machinery.

This allows global isel to import the simple cases once the complex
pattern is implemented.

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

5 years agoTemporarily Revert "[Attributor] Liveness analysis." as it's breaking the build.
Eric Christopher [Mon, 22 Jul 2019 21:04:23 +0000 (21:04 +0000)]
Temporarily Revert "[Attributor] Liveness analysis." as it's breaking the build.

This reverts commit 9285295f75a231dc446fa7cbc10a0a391b3434a5.

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

5 years ago[Attributor] Liveness analysis.
Stefan Stipanovic [Mon, 22 Jul 2019 20:54:30 +0000 (20:54 +0000)]
[Attributor] Liveness analysis.

Liveness analysis abstract attribute used to indicate which BasicBlocks are dead and can therefore be ignored.
Right now we are only looking at noreturn calls.

Reviewers: jdoerfert, uenoku

Subscribers: hiraditya, llvm-commits

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

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

5 years ago[X86] When using AND+PACKUS in lowerV16I8Shuffle, generate the build vector directly...
Craig Topper [Mon, 22 Jul 2019 19:58:49 +0000 (19:58 +0000)]
[X86] When using AND+PACKUS in lowerV16I8Shuffle, generate the build vector directly in v16i8 with the correct 0x00 or 0xFF elements rather than using another VT and bitcasting it.

The build_vector will become a constant pool load. By using the
desired type initially, it ensures we don't generate a bitcast
of the constant pool load which will need to be folded with
the load.

While experimenting with another patch, I noticed that when the
load type and the constant pool type don't match, then
SimplifyDemandedBits can't handle it. While we should probably
fix that, this was a simple way to fix the issue I saw.

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

5 years ago[NFC][PowerPC]Change ADDIStocHA to ADDIStocHA8 to follow 64-bit naming convention
Jason Liu [Mon, 22 Jul 2019 19:55:33 +0000 (19:55 +0000)]
[NFC][PowerPC]Change ADDIStocHA to ADDIStocHA8 to follow 64-bit naming convention

Summary:

Since we are planning to add ADDIStocHA for 32bit in later patch, we decided
 to change 64bit one first to follow naming convention with 8 behind opcode.

Patch by: Xiangling_L

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

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

5 years ago[Attributor] NoAlias on return values.
Stefan Stipanovic [Mon, 22 Jul 2019 19:36:27 +0000 (19:36 +0000)]
[Attributor] NoAlias on return values.

Porting function return value attribute noalias to attributor.
This will be followed with a patch for callsite and function argumets.

Reviewers: jdoerfert

Subscribers: lebedev.ri, hiraditya, llvm-commits

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

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

5 years agoStubs out TLOF for AIX and add support for common vars in assembly output.
Sean Fertile [Mon, 22 Jul 2019 19:15:29 +0000 (19:15 +0000)]
Stubs out TLOF for AIX and add support for common vars in assembly output.

Stubs out a TargetLoweringObjectFileXCOFF class, implementing only
SelectSectionForGlobal for common symbols. Also adds an override of
EmitGlobalVariable in PPCAIXAsmPrinter which adds a number of defensive errors
and adds support for emitting common globals.

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

5 years ago[SafeStack] Insert the deref after the offset
Petr Hosek [Mon, 22 Jul 2019 18:52:42 +0000 (18:52 +0000)]
[SafeStack] Insert the deref after the offset

While debugging code that uses SafeStack, we've noticed that LLVM
produces an invalid DWARF. Concretely, in the following example:

  int main(int argc, char* argv[]) {
    std::string value = "";
    printf("%s\n", value.c_str());
    return 0;
  }

DWARF would describe the value variable as being located at:

  DW_OP_breg14 R14+0, DW_OP_deref, DW_OP_constu 0x20, DW_OP_minus

The assembly to get this variable is:

  leaq    -32(%r14), %rbx

The order of operations in the DWARF symbols is incorrect in this case.
Specifically, the deref is incorrect; this appears to be incorrectly
re-inserted in repalceOneDbgValueForAlloca.

With this change which inserts the deref after the offset instead of
before it, LLVM produces correct DWARF:

  DW_OP_breg14 R14-32

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

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

5 years agoWholeProgramDevirt: Teach the pass to respect the global's alignment.
Peter Collingbourne [Mon, 22 Jul 2019 18:50:45 +0000 (18:50 +0000)]
WholeProgramDevirt: Teach the pass to respect the global's alignment.

The bytes inserted before an overaligned global need to be padded according
to the alignment set on the original global in order for the initializer
to meet the global's alignment requirements. The previous implementation
that padded to the pointer width happened to be correct for vtables on most
platforms but may do the wrong thing if the vtable has a larger alignment.

This issue is visible with a prototype implementation of HWASAN for globals,
which will overalign all globals including vtables to 16 bytes.

There is also no padding requirement for the bytes inserted after the global
because they are never read from nor are they significant for alignment
purposes, so stop inserting padding there.

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

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

5 years ago[PowerPC] Fix comment on MO_PLT Target Operand Flag. [NFC]
Sean Fertile [Mon, 22 Jul 2019 18:47:59 +0000 (18:47 +0000)]
[PowerPC] Fix comment on MO_PLT Target Operand Flag. [NFC]

Patch by Xiangling Liao.

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

5 years ago[Object][XCOFF] Remove extra includes from XCOFF related files. [NFC]
Sean Fertile [Mon, 22 Jul 2019 18:47:55 +0000 (18:47 +0000)]
[Object][XCOFF] Remove extra includes from XCOFF related files. [NFC]

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

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

5 years agoLowerTypeTests: Teach the pass to respect global alignments.
Peter Collingbourne [Mon, 22 Jul 2019 18:47:03 +0000 (18:47 +0000)]
LowerTypeTests: Teach the pass to respect global alignments.

We were previously ignoring alignment entirely when combining globals
together in this pass. There are two main things that we need to do here:
add additional padding before each global to meet the alignment requirements,
and set the combined global's alignment to the maximum of all of the original
globals' alignments.

Since we now need to calculate layout as we go anyway, use the calculated
layout to produce GlobalLayout instead of using StructLayout.

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

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

5 years agoChanges to emit CodeView debug info nested type records properly using MCStreamer...
Nilanjana Basu [Mon, 22 Jul 2019 18:22:55 +0000 (18:22 +0000)]
Changes to emit CodeView debug info nested type records properly using MCStreamer directives

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

5 years ago[AMDGPU] Test update. NFC.
Stanislav Mekhanoshin [Mon, 22 Jul 2019 18:08:53 +0000 (18:08 +0000)]
[AMDGPU] Test update. NFC.

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

5 years ago[SLPVectorizer] Fix some MSVC/cppcheck uninitialized variable warnings. NFCI.
Simon Pilgrim [Mon, 22 Jul 2019 17:57:36 +0000 (17:57 +0000)]
[SLPVectorizer] Fix some MSVC/cppcheck uninitialized variable warnings. NFCI.

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

5 years agoRevert "Reland [ELF] Loose a condition for relocation with a symbol"
Vlad Tsyrklevich [Mon, 22 Jul 2019 17:48:53 +0000 (17:48 +0000)]
Revert "Reland [ELF] Loose a condition for relocation with a symbol"

This reverts commit r366686 as it appears to be causing buildbot
failures on sanitizer-x86_64-linux-android and sanitizer-x86_64-linux.

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

5 years agoTableGen: Support physical register inputs > 255
Matt Arsenault [Mon, 22 Jul 2019 15:02:34 +0000 (15:02 +0000)]
TableGen: Support physical register inputs > 255

This was truncating register value that didn't fit in unsigned char.
Switch AMDGPU sendmsg intrinsics to using a tablegen pattern.

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

5 years ago[ARM][LowOverheadLoops] Revert remaining pseudos
Sam Parker [Mon, 22 Jul 2019 14:16:40 +0000 (14:16 +0000)]
[ARM][LowOverheadLoops] Revert remaining pseudos

ARMLowOverheadLoops would assert a failure if it did not find all the
pseudo instructions that comprise the hardware loop. Instead of doing
this, iterate through all the instructions of the function and revert
any remaining pseudo instructions that haven't been converted.

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

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

5 years agoAMDGPU/GlobalISel: Fix broken tests
Matt Arsenault [Mon, 22 Jul 2019 13:33:11 +0000 (13:33 +0000)]
AMDGPU/GlobalISel: Fix broken tests

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

5 years agoReland [ELF] Loose a condition for relocation with a symbol
Nikola Prica [Mon, 22 Jul 2019 13:07:01 +0000 (13:07 +0000)]
Reland [ELF] Loose a condition for relocation with a symbol

This patch was not the reason of the buildbot failure.

Deleted code was introduced as a work around for a bug in the gold linker
(http://sourceware.org/PR16794). Test case that was given as a reason for
this part of code, the one on previous link, now works for the gold.
This condition is too strict and when a code is compiled with debug info
it forces generation of numerous relocations with symbol for architectures
that do not have relocation addend.

Reviewers: arsenm, espindola

Reviewed By: MaskRay

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

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

5 years agoAMDGPU/GlobalISel: Remove unnecessary code
Matt Arsenault [Mon, 22 Jul 2019 13:05:25 +0000 (13:05 +0000)]
AMDGPU/GlobalISel: Remove unnecessary code

The minnum/maxnum case are dead, and the cvt is handled by the
default.

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

5 years ago[ARM] Fix for MVE VPT block pass
David Green [Mon, 22 Jul 2019 12:51:38 +0000 (12:51 +0000)]
[ARM] Fix for MVE VPT block pass

We need to ensure that the number of T's is correct when adding multiple
instructions into the same VPT block.

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

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

5 years ago[X86] EltsFromConsecutiveLoads - support common source loads (REAPPLIED)
Simon Pilgrim [Mon, 22 Jul 2019 12:44:10 +0000 (12:44 +0000)]
[X86] EltsFromConsecutiveLoads - support common source loads (REAPPLIED)

This patch enables us to find the source loads for each element, splitting them into a Load and ByteOffset, and attempts to recognise consecutive loads that are in fact from the same source load.

A helper function, findEltLoadSrc, recurses to find a LoadSDNode and determines the element's byte offset within it. When attempting to match consecutive loads, byte offsetted loads then attempt to matched against a previous load that has already been confirmed to be a consecutive match.

Next step towards PR16739 - after this we just need to account for shuffling/repeated elements to create a vector load + shuffle.

Fixed out of bounds load assert identified in rL366501

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

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

5 years agoAMDGPU/GlobalISel: Fix tests without asserts
Matt Arsenault [Mon, 22 Jul 2019 12:43:41 +0000 (12:43 +0000)]
AMDGPU/GlobalISel: Fix tests without asserts

The legality check is only done under NDEBUG, so the failure cases are
different in a release build.

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

5 years agoAdded address-space mangling for stack related intrinsics
Christudasan Devadasan [Mon, 22 Jul 2019 12:42:48 +0000 (12:42 +0000)]
Added address-space mangling for stack related intrinsics

Modified the following 3 intrinsics:
int_addressofreturnaddress,
int_frameaddress & int_sponentry.

Reviewed By: arsenm

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

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

5 years ago[X86][SSE] Add EltsFromConsecutiveLoads test case identified in rL366501
Simon Pilgrim [Mon, 22 Jul 2019 12:17:56 +0000 (12:17 +0000)]
[X86][SSE] Add EltsFromConsecutiveLoads test case identified in rL366501

Test case that led to rL366441 being reverted at rL366501

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

5 years ago[yaml2obj] - Change how we handle implicit sections.
George Rimar [Mon, 22 Jul 2019 12:01:52 +0000 (12:01 +0000)]
[yaml2obj] - Change how we handle implicit sections.

Instead of having the special list of implicit sections,
that are mixed with the sections read from YAML on late
stages, I just create the placeholders and add them to
the main sections list early.

That allows to significantly simplify the code.

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

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

5 years agoAdd location of SVN staging dir to git-llvm error output
Stefan Granitz [Mon, 22 Jul 2019 09:47:40 +0000 (09:47 +0000)]
Add location of SVN staging dir to git-llvm error output

Summary:
In pre-monorepo times the svn staging directory was `.git/svn`. The below error message wasn't mentioning the new name yet.

Example before:
```
Can't push git rev 104cfa289d9 because svn status is not empty:
!     llvm/trunk/include/llvm
```

Example after:
```
Can't push git rev 104cfa289d9 because status in svn staging dir (.git/llvm-upstream-svn) is not empty:
!     llvm/trunk/include/llvm
```

Reviewers: mehdi_amini, jlebar, teemperor

Reviewed By: mehdi_amini

Subscribers: llvm-commits, #llvm

Tags: #llvm

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

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

5 years ago[IPRA][ARM] Make use of the "returned" parameter attribute
Oliver Stannard [Mon, 22 Jul 2019 08:44:36 +0000 (08:44 +0000)]
[IPRA][ARM] Make use of the "returned" parameter attribute

ARM has code to recognise uses of the "returned" function parameter
attribute which guarantee that the value passed to the function in r0
will be returned in r0 unmodified. IPRA replaces the regmask on call
instructions, so needs to be told about this to avoid reverting the
optimisation.

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

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

5 years ago[llvm-readobj] - Stop using precompiled objects in file-headers.test
George Rimar [Mon, 22 Jul 2019 08:10:02 +0000 (08:10 +0000)]
[llvm-readobj] - Stop using precompiled objects in file-headers.test

This converts all sub-tests except one to YAML instead of precompiled inputs.

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

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

5 years ago[AMDGPU] Save some work when an atomic op has no uses
Jay Foad [Mon, 22 Jul 2019 07:19:44 +0000 (07:19 +0000)]
[AMDGPU] Save some work when an atomic op has no uses

Summary:
In the atomic optimizer, save doing a bunch of work and generating a
bunch of dead IR in the fairly common case where the result of an
atomic op (i.e. the value that was in memory before the atomic op was
performed) is not used. NFC.

Reviewers: arsenm, dstuttard, tpr

Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, t-tye, hiraditya, jfb, llvm-commits

Tags: #llvm

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

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

5 years ago[PowerPC][NFC] Precommit a test case where ppc-mi-peepholes miscompiles extswsli
Kai Luo [Mon, 22 Jul 2019 05:32:20 +0000 (05:32 +0000)]
[PowerPC][NFC] Precommit a test case where ppc-mi-peepholes miscompiles extswsli

Added a test case to show codegen differences.

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