OSDN Git Service

android-x86/external-llvm.git
4 years agoMerging r368477:
Hans Wennborg [Tue, 13 Aug 2019 12:07:33 +0000 (12:07 +0000)]
Merging r368477:
------------------------------------------------------------------------
r368477 | void | 2019-08-09 22:16:31 +0200 (Fri, 09 Aug 2019) | 22 lines

[MC] Don't recreate a label if it's already used

Summary:
This patch keeps track of MCSymbols created for blocks that were
referenced in inline asm. It prevents creating a new symbol which
doesn't refer to the block.

Inline asm may have a reference to a label. The asm parser however
doesn't recognize it as a label and tries to create a new symbol. The
result being that instead of the original symbol (e.g. ".Ltmp0") the
parser replaces it in the inline asm with the new one (e.g. ".Ltmp00")
without updating it in the symbol table. So the machine basic block
retains the "old" symbol (".Ltmp0"), but the inline asm uses the new one
(".Ltmp00").

Reviewers: nickdesaulniers, craig.topper

Subscribers: nathanchance, javed.absar, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D65304
------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_90@368676 91177308-0d34-0410-b5e6-96231b3b80d8

4 years agoMerging r368572:
Hans Wennborg [Tue, 13 Aug 2019 12:00:39 +0000 (12:00 +0000)]
Merging r368572:
------------------------------------------------------------------------
r368572 | lenary | 2019-08-12 15:51:00 +0200 (Mon, 12 Aug 2019) | 18 lines

[RISCV] Fix ICE in isDesirableToCommuteWithShift

Summary:
Ana Pazos reported a bug where we were not checking that an APInt would
fit into 64-bits before calling `getSExtValue()`. This caused asserts when
compiling large constants, such as i128s, as happens when compiling compiler-rt.

This patch adds a testcase and makes the callback less error-prone.

Reviewers: apazos, asb, luismarques

Reviewed By: luismarques

Subscribers: hiraditya, rbar, johnrusso, simoncook, 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/D66081
------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_90@368674 91177308-0d34-0410-b5e6-96231b3b80d8

4 years agoMerging r368517, r368518, r368519, and r368554:
Hans Wennborg [Tue, 13 Aug 2019 11:56:03 +0000 (11:56 +0000)]
Merging r368517, r368518, r368519, and r368554:

------------------------------------------------------------------------
r368517 | lebedevri | 2019-08-10 21:28:12 +0200 (Sat, 10 Aug 2019) | 1 line

[NFC][InstCombine] Tests for shift amount reassociation in bittest with shift of const
------------------------------------------------------------------------

------------------------------------------------------------------------
r368518 | lebedevri | 2019-08-10 21:28:44 +0200 (Sat, 10 Aug 2019) | 5 lines

[InstCombine] Shift amount reassociation in bittest: drop pointless one-use restriction

That one-use restriction is not needed for correctness - we have already
ensured that one of the shifts will go away, so we know we won't increase
the instruction count. So there is no need for that restriction.
------------------------------------------------------------------------

------------------------------------------------------------------------
r368519 | lebedevri | 2019-08-10 21:28:54 +0200 (Sat, 10 Aug 2019) | 5 lines

[InstCombine] Shift amount reassociation in bittest: relax one-use check when shifting constant

If one of the values being shifted is a constant, since the new shift
amount is known-constant, the new shift will end up being constant-folded
so, we don't need that one-use restriction then.
------------------------------------------------------------------------

------------------------------------------------------------------------
r368554 | lebedevri | 2019-08-12 13:28:02 +0200 (Mon, 12 Aug 2019) | 6 lines

[InstCombine] foldShiftIntoShiftInAnotherHandOfAndInICmp(): avoid constantexpr pitfail (PR42962)

Instead of matching value and then blindly casting to BinaryOperator
just to get the opcode, just match instruction and do no cast.

Fixes https://bugs.llvm.org/show_bug.cgi?id=42962
------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_90@368673 91177308-0d34-0410-b5e6-96231b3b80d8

4 years agoMerging r368230:
Hans Wennborg [Mon, 12 Aug 2019 13:49:27 +0000 (13:49 +0000)]
Merging r368230:
------------------------------------------------------------------------
r368230 | akhuang | 2019-08-08 00:49:40 +0200 (Thu, 08 Aug 2019) | 2 lines

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/branches/release_90@368571 91177308-0d34-0410-b5e6-96231b3b80d8

4 years agoMerging r368324:
Hans Wennborg [Fri, 9 Aug 2019 09:56:27 +0000 (09:56 +0000)]
Merging r368324:
------------------------------------------------------------------------
r368324 | ctopper | 2019-08-08 20:11:17 +0200 (Thu, 08 Aug 2019) | 7 lines

[X86] Make CMPXCHG16B feature imply CMPXCHG8B feature.

This fixes znver1 so that it properly enables CMPXHG8B. We can
probably remove explicit CMPXCHG8B from CPUs that also have
CMPXCHG16B, but keeping this simple to allow cherry pick to 9.0.

Fixes PR42935.
------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_90@368423 91177308-0d34-0410-b5e6-96231b3b80d8

4 years agoMerging r367750:
Hans Wennborg [Fri, 9 Aug 2019 09:45:06 +0000 (09:45 +0000)]
Merging r367750:
------------------------------------------------------------------------
r367750 | void | 2019-08-03 07:52:47 +0200 (Sat, 03 Aug 2019) | 15 lines

Emit diagnostic if an inline asm constraint requires an immediate

Summary:
An inline asm call can result in an immediate after inlining. Therefore emit a
diagnostic here if constraint requires an immediate but one isn't supplied.

Reviewers: joerg, mgorny, efriedma, rsmith

Reviewed By: joerg

Subscribers: asb, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, PkmX, jocewei, s.egerton, MaskRay, jyknight, dylanmckay, javed.absar, fedor.sergeev, jrtc27, Jim, krytarowski, eraman, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D60942
------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_90@368421 91177308-0d34-0410-b5e6-96231b3b80d8

4 years agoMerging r367403:
Hans Wennborg [Fri, 9 Aug 2019 09:39:44 +0000 (09:39 +0000)]
Merging r367403:
------------------------------------------------------------------------
r367403 | lenary | 2019-07-31 11:45:55 +0200 (Wed, 31 Jul 2019) | 20 lines

[RISCV] Support 'f' Inline Assembly Constraint

Summary:
This adds the 'f' inline assembly constraint, as supported by GCC. An
'f'-constrained operand is passed in a floating point register. Exactly
which kind of floating-point register (32-bit or 64-bit) is decided
based on the operand type and the available standard extensions (-f and
-d, respectively).

This patch adds support in both the clang frontend, and LLVM itself.

Reviewers: asb, lewis-revill

Reviewed By: asb

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

Tags: #clang, #llvm

Differential Revision: https://reviews.llvm.org/D65500
------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_90@368419 91177308-0d34-0410-b5e6-96231b3b80d8

4 years agoMerging r368315:
Hans Wennborg [Fri, 9 Aug 2019 08:53:00 +0000 (08:53 +0000)]
Merging r368315:
------------------------------------------------------------------------
r368315 | tstellar | 2019-08-08 19:23:33 +0200 (Thu, 08 Aug 2019) | 21 lines

lit: Use a License classifier that pypi will accept

Summary:
'OSI Approved :: Apache-2.0 with LLVM exception' is not a valid
classifier.  'OSI Approved :: Apache Software License' is the closest
fit for the new license, so we've decided to use this one.

The classifiers seem to only be used for searching on the pypi website,
so this does not actually change the license of the code.
We still pass 'Apache-2.0 with LLVM exception' as the license to setup(),
and this appears alongside the classifier on the pypi webpage for lit.

Reviewers: chandlerc, ddunbar, joerg

Reviewed By: joerg

Subscribers: delcypher, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D65762
------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_90@368414 91177308-0d34-0410-b5e6-96231b3b80d8

4 years ago[docs][mips] 9.0 Release notes
Hans Wennborg [Fri, 9 Aug 2019 08:35:17 +0000 (08:35 +0000)]
[docs][mips] 9.0 Release notes

By Simon Atanasyan!

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_90@368411 91177308-0d34-0410-b5e6-96231b3b80d8

4 years agoReleaseNotes: LLVM_ENABLE_Z3_SOLVER (PR42921)
Hans Wennborg [Thu, 8 Aug 2019 08:52:26 +0000 (08:52 +0000)]
ReleaseNotes: LLVM_ENABLE_Z3_SOLVER (PR42921)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_90@368269 91177308-0d34-0410-b5e6-96231b3b80d8

4 years agoMerging r367898:
Hans Wennborg [Tue, 6 Aug 2019 11:04:11 +0000 (11:04 +0000)]
Merging r367898:
------------------------------------------------------------------------
r367898 | evandro | 2019-08-05 20:09:14 +0200 (Mon, 05 Aug 2019) | 22 lines

[AArch64] Expand bcmp() for small block lengths

Patch D56593 by @courbet results in calls to `bcmp()` in some cases, should
the target support the it.  Unless `TTI::MemCmpExpansionOptions()`
is overridden by the target.

In a proprietary benchmark we see a performance drop of about 12% on PNG
compression before this patch, though it passes all tests.

This patch mirrors X86 for AArch64 and initializes
`TTI::MemCmpExpansionOptions()` to then expand calls to `bcmp()` when
appropriate.  No tuning of the parameters was performed, but, at this point,
it's enough to recover the performance drop above.

This problem also exists on ARM.  Once a consensus is reached for AArch64, we
can work to fix ARM as well.

Authors:
- Evandro Menezes (@evandro) <e.menezes@samsung.com>
- Brian Rzycki (@brzycki) <b.rzycki@samsung.com>

Differential revision: https://reviews.llvm.org/D64805
------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_90@368017 91177308-0d34-0410-b5e6-96231b3b80d8

4 years agoMerging r368004:
Hans Wennborg [Tue, 6 Aug 2019 09:30:53 +0000 (09:30 +0000)]
Merging r368004:
------------------------------------------------------------------------
r368004 | hans | 2019-08-06 11:30:10 +0200 (Tue, 06 Aug 2019) | 1 line

test-release.sh: Reorder sed commands for the binary comparison
------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_90@368005 91177308-0d34-0410-b5e6-96231b3b80d8

4 years agoMerging r367941:
Hans Wennborg [Tue, 6 Aug 2019 08:30:56 +0000 (08:30 +0000)]
Merging r367941:
------------------------------------------------------------------------
r367941 | reames | 2019-08-06 00:34:59 +0200 (Tue, 06 Aug 2019) | 5 lines

Add a note to the release not about a potentially breaking optimization

This has come up twice already (once in pr42763 and once in the commit thread), so give warning of a new way in which UB can result in unexpected program behavior.

------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_90@367997 91177308-0d34-0410-b5e6-96231b3b80d8

4 years agoMerge r367730 for PR42812
Hans Wennborg [Tue, 6 Aug 2019 08:18:29 +0000 (08:18 +0000)]
Merge r367730 for PR42812

> [lit] Fix 42812: lit test suite can no longer be run stand-alone
>
> Summary:
> This change updates the lit.cfg file to use llvm_config when it is available, but when it is not, it directly modifies the config object. This makes it possible to run the lit tests standalone without having built llvm (as long as the correct binaries are present in the path such as FileCheck and not).
>
> Because the lit tests don't take a hard dependency on llvm_config, some features such as system-windows have to have definitions in lit's cfg file as well. This is a potential issue as the os features sometimes change names (for example, we went from windows to system-windows, etc.). This can cause drift between lit's tests and the rest of the llvm tests.
>
> Reviewers: probinson, mgorny
>
> Reviewed By: mgorny
>
> Subscribers: delcypher, llvm-commits, asmith
>
> Tags: #llvm
>
> Differential Revision: https://reviews.llvm.org/D65674

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_90@367993 91177308-0d34-0410-b5e6-96231b3b80d8

4 years agolit: Bump version to 0.9.0
Hans Wennborg [Tue, 6 Aug 2019 08:11:14 +0000 (08:11 +0000)]
lit: Bump version to 0.9.0

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_90@367992 91177308-0d34-0410-b5e6-96231b3b80d8

4 years agoMerging r366660 and r367306:
Hans Wennborg [Tue, 6 Aug 2019 08:08:11 +0000 (08:08 +0000)]
Merging r366660 and r367306:

------------------------------------------------------------------------
r366660 | rksimon | 2019-07-21 21:04:44 +0200 (Sun, 21 Jul 2019) | 3 lines

[X86] SimplifyDemandedVectorEltsForTargetNode - Move SUBV_BROADCAST narrowing handling. NFCI.

Move the narrowing of SUBV_BROADCAST to where we handle all the other opcodes.
------------------------------------------------------------------------

------------------------------------------------------------------------
r367306 | rksimon | 2019-07-30 13:35:13 +0200 (Tue, 30 Jul 2019) | 5 lines

[X86][AVX] SimplifyDemandedVectorElts - handle extraction from X86ISD::SUBV_BROADCAST source (PR42819)

PR42819 showed an issue that we couldn't handle the case where we demanded a 'sub-sub-vector' of the SUBV_BROADCAST 'sub-vector' source.

This patch recognizes these cases and extracts the sub-sub-vector instead of trying to broadcast to a type smaller than the 'sub-vector' source.
------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_90@367991 91177308-0d34-0410-b5e6-96231b3b80d8

4 years agoMerging r367846 and r367847:
Hans Wennborg [Mon, 5 Aug 2019 13:10:20 +0000 (13:10 +0000)]
Merging r367846 and r367847:

------------------------------------------------------------------------
r367846 | hans | 2019-08-05 15:04:07 +0200 (Mon, 05 Aug 2019) | 1 line

Write the RequiredLibraries for 'all' in LibraryDependencies.inc in a deterministic order (PR42739)
------------------------------------------------------------------------

------------------------------------------------------------------------
r367847 | hans | 2019-08-05 15:04:12 +0200 (Mon, 05 Aug 2019) | 8 lines

test-release.sh: Perform the sed substitution on both files (PR42739)

The comparison would otherwise fail if Phase2 occurrs naturally in the
object file. It would get replaced with Phase3 in the one .o, but not
in the other.

We were already running both files through sed to have them processed in
this same way; this is a logical extension of that.
------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_90@367848 91177308-0d34-0410-b5e6-96231b3b80d8

4 years agoMerging r367662:
Hans Wennborg [Mon, 5 Aug 2019 09:02:29 +0000 (09:02 +0000)]
Merging r367662:
------------------------------------------------------------------------
r367662 | psmith | 2019-08-02 10:05:14 +0200 (Fri, 02 Aug 2019) | 17 lines

[AliasAnalysis] Initialize a member variable that may be used by unit test.

The unit tests in BasicAliasAnalysisTest use the alias analysis API
directly and do not call setAAResults to initalize AAR. This gives a
valgrind error "Conditional Jump depends on unitialized variable".

On most buildbots the variable is nullptr, but in some cases it can be
non nullptr leading to seemingly random failures.

These tests were disabled in r366986. With the initialization they can be
enabled again.

Fixes PR42719

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

------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_90@367818 91177308-0d34-0410-b5e6-96231b3b80d8

4 years agoMerging r366868:
Hans Wennborg [Mon, 5 Aug 2019 08:10:53 +0000 (08:10 +0000)]
Merging r366868:
------------------------------------------------------------------------
r366868 | rogfer01 | 2019-07-24 07:33:46 +0200 (Wed, 24 Jul 2019) | 6 lines

[RISCV] Implement benchmark::cycleclock::Now

This is a cherrypick of D64237 onto llvm/utils/benchmark and
libcxx/utils/google-benchmark.

Differential Revision: https://reviews.llvm.org/D65142
------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_90@367810 91177308-0d34-0410-b5e6-96231b3b80d8

4 years agoMerging r367753:
Hans Wennborg [Mon, 5 Aug 2019 07:49:21 +0000 (07:49 +0000)]
Merging r367753:
------------------------------------------------------------------------
r367753 | nikic | 2019-08-03 08:47:23 +0200 (Sat, 03 Aug 2019) | 12 lines

[Thumb] Fix invalid symbol redefinition due to duplicated jumptable (PR42760)

Fix for https://bugs.llvm.org/show_bug.cgi?id=42760. A tBR_JTr
instruction is duplicated by tail duplication, which results in
the same jumptable with the same label being emitted twice.

Fix this by marking tBR_JTr as not duplicable. The corresponding
ARM/Thumb instructions are already marked as not duplicable.
Additionally also mark tTBB_JT and tTBH_JT to be consistent with
Thumb2, even though this shouldn't be strictly necessary.

Differential Revision: https://reviews.llvm.org/D65606
------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_90@367808 91177308-0d34-0410-b5e6-96231b3b80d8

4 years agoUpdate release notes for things I've done since the last release
Martin Storsjo [Thu, 1 Aug 2019 20:43:59 +0000 (20:43 +0000)]
Update release notes for things I've done since the last release

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_90@367609 91177308-0d34-0410-b5e6-96231b3b80d8

4 years agoMerging r367417:
Hans Wennborg [Thu, 1 Aug 2019 09:11:01 +0000 (09:11 +0000)]
Merging r367417:
------------------------------------------------------------------------
r367417 | lebedevri | 2019-07-31 14:06:38 +0200 (Wed, 31 Jul 2019) | 38 lines

[DivRemPairs] Avoid RAUW pitfalls (PR42823)

Summary:
`DivRemPairs` internally creates two maps:
* {sign, divident, divisor} -> div instruction
* {sign, divident, divisor} -> rem instruction
Then it iterates over rem map, and looks if there is an entry
in div map with the same key. Then depending on some internal logic
it may RAUW rem instruction with something else.

But if that rem instruction is an input to other div/rem,
then it was used as a key in these maps, so the old value (used in key)
is now dandling, because RAUW didn't update those maps.
And we can't even RAUW map keys in general, there's `ValueMap`,
but we don't have a single `Value` as key...

The bug was discovered via D65298, and the test there exists.
Now, i'm not sure how to expose this issue in trunk.
The bug is clearly there if i change the map keys to be `AssertingVH`/`PoisoningVH`,
but i guess this didn't miscompiled anything thus far?
I really don't think this is benin without that patch.

The fix is actually rather straight-forward - instead of trying to somehow
shoe-horn `ValueMap` here (doesn't fit, key isn't just `Value`), or writing a new
`ValueMap` with key being a struct of `Value`s, we can just have an intermediate
data structure - a vector, each entry containing matching `Div, Rem` pair,
and pre-filling it before doing any modifications.
This way we won't need to query map after doing RAUW, so no bug is possible.

Reviewers: spatel, bogner, RKSimon, craig.topper

Reviewed By: spatel

Subscribers: hiraditya, hans, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D65451
------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_90@367531 91177308-0d34-0410-b5e6-96231b3b80d8

4 years agoMerging r367304:
Hans Wennborg [Thu, 1 Aug 2019 08:47:45 +0000 (08:47 +0000)]
Merging r367304:
------------------------------------------------------------------------
r367304 | ro | 2019-07-30 12:33:20 +0200 (Tue, 30 Jul 2019) | 10 lines

[CMake] Define _FILE_OFFSET_BITS=64 on Solaris

This is the compantion patch to https://reviews.llvm.org/D64482, needed to ensure
that builds with host compilers that don't yet predefine _FILE_OFFSET_BITS=64 on
Solaris succeed by always making the host and freshly built clang consistent.

Tested on x86_64-pc-solaris2.11.

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

------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_90@367526 91177308-0d34-0410-b5e6-96231b3b80d8

4 years agoMerging r367124, r367292, r367394, r367396, and r367398.
Hans Wennborg [Wed, 31 Jul 2019 14:27:24 +0000 (14:27 +0000)]
Merging r367124, r367292, r367394, r367396, and r367398.

------------------------------------------------------------------------
r367124 | c-rhodes | 2019-07-26 17:57:50 +0200 (Fri, 26 Jul 2019) | 14 lines

[AArch64][SVE2] Rename bitperm feature to sve2-bitperm

Summary:
The bitperm feature flag is now prefixed with SVE2, as it is for all other SVE2
extensions

Patch by Maciej Gabka.

Reviewers: sdesmalen, rovka, chill, SjoerdMeijer, rengolin

Reviewed By: SjoerdMeijer, rengolin

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

------------------------------------------------------------------------

------------------------------------------------------------------------
r367292 | c-rhodes | 2019-07-30 09:47:48 +0200 (Tue, 30 Jul 2019) | 10 lines

[AArch64][AsmParser] Remove SVE and SVE2 from ARMTargetParser

Summary:
Patch removes SVE and SVE2 features from ARMTargetParser as these
features are not supported on ARM.

Reviewed By: rengolin

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

------------------------------------------------------------------------

------------------------------------------------------------------------
r367394 | c-rhodes | 2019-07-31 10:45:57 +0200 (Wed, 31 Jul 2019) | 25 lines

[AArch64][SVE2] Use destination register as source register

Summary:
This patch fixes a bug in the following instructions that should have been
implemented as destructive. A destructive instruction is an instruction where
one of the source registers also acts as the destination register. Therefore,
the contents of the source register, when the instruction begins execution, are
replaced by the result of the instruction when the instruction completes
execution [1]:

  * SRI/SLI
  * EORBT/EORTB
  * TBX
  * Narrowing top instructions
  * FP convert precision instructions

These changes are non-functional from the assembler/diassembler point-of-view
but are necessary for correct codegen.

[1] https://static.docs.arm.com/ddi0584/ae/DDI0584A_e_SVE_supp_armv8A.pdf

Reviewed By: sdesmalen

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

------------------------------------------------------------------------

------------------------------------------------------------------------
r367396 | c-rhodes | 2019-07-31 10:58:16 +0200 (Wed, 31 Jul 2019) | 15 lines

[AArch64][SVE2] Minor refactoring and cleanup

Summary:
* Clarify comment with SVE2 for predicated shifts and move next to other
  shift instructions.
* Clarify comments for various instructions.
* Move FCVTX instruction next to other fp conversions.
* Move FLOGB to next to other fp instructions and fix description.
* Remove "cons" from non-constructive multiclass for bitwise shift-right
  and accumulate instructions.

Reviewed By: sdesmalen

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

------------------------------------------------------------------------

------------------------------------------------------------------------
r367398 | c-rhodes | 2019-07-31 11:10:36 +0200 (Wed, 31 Jul 2019) | 14 lines

[AArch64][SVE2] Load/store instruction fixes

Summary:
* Loads and stores in SVE2 are gather/scatter not contiguous, fixed by
  renaming multiclasses to reflect this and also updated comments.
* Remove aliases from load/store multiclasses that reflect the behaviour
  of the original form.
* Fix bug in scatter store implementation, vector list should be used as
  input, not output.

Reviewed By: sdesmalen

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

------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_90@367434 91177308-0d34-0410-b5e6-96231b3b80d8

4 years agoMerging r367340 and r367341:
Hans Wennborg [Wed, 31 Jul 2019 07:42:31 +0000 (07:42 +0000)]
Merging r367340 and r367341:

(Minus the linuxkernel part, which is not present on the branch.)

------------------------------------------------------------------------
r367340 | nico | 2019-07-30 20:16:55 +0200 (Tue, 30 Jul 2019) | 6 lines

gn build: Fix check-clang-tools after r362702.

r362702 added a test that requires clang-tidy to be linked
into libclang, so add that to the gn build.

Differential Revision: https://reviews.llvm.org/D65462
------------------------------------------------------------------------

------------------------------------------------------------------------
r367341 | nico | 2019-07-30 20:19:13 +0200 (Tue, 30 Jul 2019) | 1 line

gn build: Update comment I failed to update in r367340 / D65462
------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_90@367390 91177308-0d34-0410-b5e6-96231b3b80d8

4 years agoMerging r366487:
Hans Wennborg [Tue, 30 Jul 2019 14:39:19 +0000 (14:39 +0000)]
Merging r366487:
------------------------------------------------------------------------
r366487 | pcc | 2019-07-18 22:14:16 +0200 (Thu, 18 Jul 2019) | 1 line

gn build: Merge r366458.
------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_90@367317 91177308-0d34-0410-b5e6-96231b3b80d8

4 years agoMerging r367314:
Hans Wennborg [Tue, 30 Jul 2019 14:18:50 +0000 (14:18 +0000)]
Merging r367314:
------------------------------------------------------------------------
r367314 | hans | 2019-07-30 16:17:58 +0200 (Tue, 30 Jul 2019) | 16 lines

gn build: Use rebase_path on filename args to libcxx/utils/gen_link_script.py

  $ ninja -j800
  [1/5] ACTION //libcxx/src:cxx_linker_script(//llvm/utils/gn/build/toolchain:stage2_unix)
  FAILED: lib/libc++.so
  python ../libcxx/utils/gen_link_script.py --input //build.gn/lib/libc++.so.0 --output //build.gn/lib/libc++.so c++abi unwind
  GENERATING SCRIPT: 'INPUT(libc++.so.0 -lc++abi -lunwind)' as file //build.gn/lib/libc++.so
  Traceback (most recent call last):
    File "../libcxx/utils/gen_link_script.py", line 57, in <module>
      sys.exit(main())
    File "../libcxx/utils/gen_link_script.py", line 50, in main
      with open(args.output, 'w') as f:
  IOError: [Errno 2] No such file or directory: '//build.gn/lib/libc++.so'
  ninja: build stopped: subcommand failed.

Differential revision: https://reviews.llvm.org/D65449
------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_90@367315 91177308-0d34-0410-b5e6-96231b3b80d8

4 years agoMerging r367215:
Hans Wennborg [Mon, 29 Jul 2019 09:51:02 +0000 (09:51 +0000)]
Merging r367215:
------------------------------------------------------------------------
r367215 | hans | 2019-07-29 11:49:04 +0200 (Mon, 29 Jul 2019) | 66 lines

Mark test/MC/RISCV/rv{32,64}i-aliases-invalid.s unsupported also on Windows

Because they fail there too.

FAIL: LLVM :: MC/RISCV/rv32i-aliases-invalid.s (24397 of 32659)
******************** TEST 'LLVM :: MC/RISCV/rv32i-aliases-invalid.s' FAILED ********************
Script:
--
: 'RUN: at line 2';   not c:\src\llvm.monorepo\build.release2\bin\llvm-mc.exe C:\src\llvm.monorepo\llvm\test\MC\RISCV\rv32i-aliases-invalid.s -triple=riscv32 -riscv-no-aliases 2>&1 | c:\src\llvm.monorepo\build.release2\bin\filecheck.exe C:\src\llvm.monorepo\llvm\test\MC\RISCV\rv32i-aliases-invalid.s
: 'RUN: at line 3';   not c:\src\llvm.monorepo\build.release2\bin\llvm-mc.exe C:\src\llvm.monorepo\llvm\test\MC\RISCV\rv32i-aliases-invalid.s -triple=riscv32 2>&1 | c:\src\llvm.monorepo\build.release2\bin\filecheck.exe C:\src\llvm.monorepo\llvm\test\MC\RISCV\rv32i-aliases-invalid.s
--
Exit Code: 1

Command Output (stdout):
--
$ ":" "RUN: at line 2"
$ "not" "c:\src\llvm.monorepo\build.release2\bin\llvm-mc.exe" "C:\src\llvm.monorepo\llvm\test\MC\RISCV\rv32i-aliases-invalid.s" "-triple=riscv32" "-riscv-no-aliases"
$ "c:\src\llvm.monorepo\build.release2\bin\filecheck.exe" "C:\src\llvm.monorepo\llvm\test\MC\RISCV\rv32i-aliases-invalid.s"
C:\src\llvm.monorepo\llvm\test\MC\RISCV\rv32i-aliases-invalid.s:10:21: error: CHECK: expected string not found in input
li t4, foo # CHECK: :[[@LINE]]:8: error: immediate must be an integer in the range [-21474836484294967295]
                    ^
<stdin>:5:1: note: scanning from here
li x0, -2147483649 # CHECK: :[[@LINE]]:8: error: immediate must be an integer in the range [-21474836484294967295]
^
<stdin>:5:1: note: with "@LINE" equal to "10"
li x0, -2147483649 # CHECK: :[[@LINE]]:8: error: immediate must be an integer in the range [-21474836484294967295]
^
<stdin>:5:38: note: possible intended match here
li x0, -2147483649 # CHECK: :[[@LINE]]:8: error: immediate must be an integer in the range [-21474836484294967295]
                                     ^

error: command failed with exit status: 1

--

--
********************
Testing: 0 .. 10.. 20.. 30.. 40.. 50.. 60.. 70
FAIL: LLVM :: MC/RISCV/rv64i-aliases-invalid.s (24416 of 32659)
******************** TEST 'LLVM :: MC/RISCV/rv64i-aliases-invalid.s' FAILED ********************
Script:
--
: 'RUN: at line 2';   not c:\src\llvm.monorepo\build.release2\bin\llvm-mc.exe C:\src\llvm.monorepo\llvm\test\MC\RISCV\rv64i-aliases-invalid.s -triple=riscv64 -riscv-no-aliases 2>&1 | c:\src\llvm.monorepo\build.release2\bin\filecheck.exe C:\src\llvm.monorepo\llvm\test\MC\RISCV\rv64i-aliases-invalid.s
: 'RUN: at line 3';   not c:\src\llvm.monorepo\build.release2\bin\llvm-mc.exe C:\src\llvm.monorepo\llvm\test\MC\RISCV\rv64i-aliases-invalid.s -triple=riscv64 2>&1 | c:\src\llvm.monorepo\build.release2\bin\filecheck.exe C:\src\llvm.monorepo\llvm\test\MC\RISCV\rv64i-aliases-invalid.s
--
Exit Code: 1

Command Output (stdout):
--
$ ":" "RUN: at line 2"
$ "not" "c:\src\llvm.monorepo\build.release2\bin\llvm-mc.exe" "C:\src\llvm.monorepo\llvm\test\MC\RISCV\rv64i-aliases-invalid.s" "-triple=riscv64" "-riscv-no-aliases"
$ "c:\src\llvm.monorepo\build.release2\bin\filecheck.exe" "C:\src\llvm.monorepo\llvm\test\MC\RISCV\rv64i-aliases-invalid.s"
C:\src\llvm.monorepo\llvm\test\MC\RISCV\rv64i-aliases-invalid.s:6:21: error: CHECK: expected string not found in input
li t4, foo # CHECK: :[[@LINE]]:8: error: operand must be a constant 64-bit integer
                    ^
<stdin>:2:1: note: scanning from here
li t5, 0x10000000000000000 # CHECK: :[[@LINE]]:8: error: unknown operand
^
<stdin>:2:1: note: with "@LINE" equal to "6"
li t5, 0x10000000000000000 # CHECK: :[[@LINE]]:8: error: unknown operand
^
<stdin>:13:67: note: possible intended match here
C:\src\llvm.monorepo\llvm\test\MC\RISCV\rv64i-aliases-invalid.s:12:13: error: immediate must be an integer in the range [0, 63]
                                                                  ^

error: command failed with exit status: 1
------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_90@367217 91177308-0d34-0410-b5e6-96231b3b80d8

4 years agoMerging r367062:
Hans Wennborg [Mon, 29 Jul 2019 09:01:42 +0000 (09:01 +0000)]
Merging r367062:
------------------------------------------------------------------------
r367062 | yhs | 2019-07-25 23:47:27 +0200 (Thu, 25 Jul 2019) | 30 lines

[BPF] fix typedef issue for offset relocation

Currently, the CO-RE offset relocation does not work
if any struct/union member or array element is a typedef.
For example,
  typedef const int arr_t[7];
  struct input {
      arr_t a;
  };
  func(...) {
       struct input *in = ...;
       ... __builtin_preserve_access_index(&in->a[1]) ...
  }
The BPF backend calculated default offset is 0 while
4 is the correct answer. Similar issues exist for struct/union
typedef's.

When getting struct/union member or array element type,
we should trace down to the type by skipping typedef
and qualifiers const/volatile as this is what clang did
to generate getelementptr instructions.
(const/volatile member type qualifiers are already
ignored by clang.)

This patch fixed this issue, for each access index,
skipping typedef and const/volatile/restrict BTF types.

Signed-off-by: Yonghong Song <yhs@fb.com>
Differential Revision: https://reviews.llvm.org/D65259
------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_90@367211 91177308-0d34-0410-b5e6-96231b3b80d8

4 years agoMerging r367030:
Hans Wennborg [Mon, 29 Jul 2019 08:59:09 +0000 (08:59 +0000)]
Merging r367030:
------------------------------------------------------------------------
r367030 | yhs | 2019-07-25 18:01:26 +0200 (Thu, 25 Jul 2019) | 38 lines

[BPF] fix CO-RE incorrect index access string

Currently, we expect the CO-RE offset relocation records
a string encoding the original getelementptr access index,
so kernel bpf loader can decode it correctly.

For example,
  struct s { int a; int b; };
  struct t { int c; int d; };
  #define _(x) (__builtin_preserve_access_index(x))
  int get_value(const void *addr1, const void *addr2);
  int test(struct s *arg1, struct t *arg2) {
    return get_value(_(&arg1->b), _(&arg2->d));
  }

We expect two offset relocations:
  reloc 1: type s, access index 0, 1
  reloc 2: type t, access index 0, 1

Two globals are created to retain access indexes for the
above two relocations with global variable names.
The first global has a name "0:1:". Unfortunately,
the second global has the name "0:1:.1" as the llvm
internals automatically add suffix ".1" to a global
with the same name. Later on, the BPF peels the last
character and record "0:1" and "0:1:." in the
relocation table.

This is not desirable. BPF backend could use the global
variable suffix knowledge to generate correct access str.
This patch rather took an approach not relying on
that knowledge. It generates "s:0:1:" and "t:0:1:" to
avoid global variable suffixes and later on generate
correct index access string "0:1" for both records.

Signed-off-by: Yonghong Song <yhs@fb.com>
Differential Revision: https://reviews.llvm.org/D65258
------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_90@367210 91177308-0d34-0410-b5e6-96231b3b80d8

4 years agoMerging r366925:
Hans Wennborg [Wed, 24 Jul 2019 20:03:13 +0000 (20:03 +0000)]
Merging r366925:
------------------------------------------------------------------------
r366925 | xbolva00 | 2019-07-24 19:01:20 +0200 (Wed, 24 Jul 2019) | 13 lines

[InstCombine] Adjusted pow-exp tests for Windows [NFC]

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

Reviewers: efriedma, hans

Reviewed By: hans

Subscribers: spatel, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D65220
------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_90@366940 91177308-0d34-0410-b5e6-96231b3b80d8

4 years agoMerging r366527:
Hans Wennborg [Mon, 22 Jul 2019 22:33:29 +0000 (22:33 +0000)]
Merging r366527:
------------------------------------------------------------------------
r366527 | abrachet | 2019-07-19 04:31:21 +0200 (Fri, 19 Jul 2019) | 13 lines

[test] [llvm-objcopy] Fix broken test case

Summary: The test case added in D62718 did not work unless the user was root because write bits were not set for the output file. This change uses only permissions with user write (0200) to ensure tests pass regardless of the users permissions.

Reviewers: jhenderson, rupprecht, MaskRay, espindola, alexshap

Reviewed By: MaskRay

Subscribers: emaste, arichardson, jakehehrlich, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D64302
------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_90@366758 91177308-0d34-0410-b5e6-96231b3b80d8

4 years agoMerging r366481:
Hans Wennborg [Mon, 22 Jul 2019 22:30:21 +0000 (22:30 +0000)]
Merging r366481:
------------------------------------------------------------------------
r366481 | teemperor | 2019-07-18 20:33:40 +0200 (Thu, 18 Jul 2019) | 4 lines

Fix C++ modules build

llvm-svn: 366344 missed an include that broke the LLVM_ENABLE_MODULES
build.
------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_90@366757 91177308-0d34-0410-b5e6-96231b3b80d8

4 years agoMerging r366570:
Hans Wennborg [Mon, 22 Jul 2019 19:54:33 +0000 (19:54 +0000)]
Merging r366570:
------------------------------------------------------------------------
r366570 | lkail | 2019-07-19 14:58:16 +0200 (Fri, 19 Jul 2019) | 9 lines

[MachineCSE][MachinePRE] Avoid hoisting code from code regions into hot BBs.

Summary:
Current PRE hoists common computations into
CMBB = DT->findNearestCommonDominator(MBB, MBB1).
However, if CMBB is in a hot loop body, we might get performance
degradation.

Differential Revision: https://reviews.llvm.org/D64394
------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_90@366729 91177308-0d34-0410-b5e6-96231b3b80d8

4 years agoMerging r366431:
Hans Wennborg [Mon, 22 Jul 2019 17:32:32 +0000 (17:32 +0000)]
Merging r366431:
------------------------------------------------------------------------
r366431 | spatel | 2019-07-18 14:48:01 +0200 (Thu, 18 Jul 2019) | 13 lines

[x86] try harder to form LEA from ADD to avoid flag conflicts (PR40483)

LEA doesn't affect flags, so use it more liberally to replace an ADD when
we know that the ADD operands affect flags.

In the motivating example from PR40483:
https://bugs.llvm.org/show_bug.cgi?id=40483
...this lets us avoid duplicating a math op just to avoid flag conflict.

As mentioned in the TODO comments, this heuristic can be extended to
fire more often if that leads to more improvements.

Differential Revision: https://reviews.llvm.org/D64707
------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_90@366704 91177308-0d34-0410-b5e6-96231b3b80d8

4 years ago[SystemZ] Add release notes on the LLVM 9 branch
Ulrich Weigand [Mon, 22 Jul 2019 14:39:02 +0000 (14:39 +0000)]
[SystemZ] Add release notes on the LLVM 9 branch

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_90@366693 91177308-0d34-0410-b5e6-96231b3b80d8

4 years agoDrop svn version suffix.
Hans Wennborg [Fri, 19 Jul 2019 09:23:25 +0000 (09:23 +0000)]
Drop svn version suffix.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_90@366550 91177308-0d34-0410-b5e6-96231b3b80d8

4 years agoCreating release_90 branch off revision 366426
Hans Wennborg [Thu, 18 Jul 2019 11:53:54 +0000 (11:53 +0000)]
Creating release_90 branch off revision 366426

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_90@366428 91177308-0d34-0410-b5e6-96231b3b80d8

4 years ago[ARM][DAGCOMBINE][FIX] PerformVMOVRRDCombine
Diogo N. Sampaio [Thu, 18 Jul 2019 10:05:56 +0000 (10:05 +0000)]
[ARM][DAGCOMBINE][FIX] PerformVMOVRRDCombine

Summary:
PerformVMOVRRDCombine ommits adding a offset
of 4 to the PointerInfo, when converting a
f64 = load[M]
to
{i32, i32} = {load[M], load[M + 4]}

Which would allow the machine scheduller
to break dependencies with the second load.

 - pr42638

Reviewers: eli.friedman, dmgreen, ostannard

Reviewed By: ostannard

Subscribers: ostannard, javed.absar, kristof.beyls, llvm-commits

Tags: #llvm

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

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

4 years ago[SCEV] add no wrap flag for SCEVAddExpr.
Chen Zheng [Thu, 18 Jul 2019 09:23:19 +0000 (09:23 +0000)]
[SCEV] add no wrap flag for SCEVAddExpr.
Differential Revision: https://reviews.llvm.org/D64868

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

4 years ago[RISCV] Reset NoPHIS MachineFunctionProperty in emitSelectPseudo
Alex Bradbury [Thu, 18 Jul 2019 07:52:41 +0000 (07:52 +0000)]
[RISCV] Reset NoPHIS MachineFunctionProperty in emitSelectPseudo

We insered PHIS were there were none before, so the property must be
reset. This error was found on an EXPENSIVE_CHECKS build.

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

4 years ago[LoopInfo] Use early return in branch weight update functions. NFC.
Serguei Katkov [Thu, 18 Jul 2019 07:36:20 +0000 (07:36 +0000)]
[LoopInfo] Use early return in branch weight update functions. NFC.

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

4 years ago[RISCV][DebugInfo] Fix dwarf-riscv-relocs.ll test on Windows
Alex Bradbury [Thu, 18 Jul 2019 07:25:56 +0000 (07:25 +0000)]
[RISCV][DebugInfo] Fix dwarf-riscv-relocs.ll test on Windows

Windows sees DW_AT_decl_file (".\dwarf-riscv-relocs.c") while Linux sees
DW_AT_decl_file ("./dwarf-riscv-relocs.c").

This fixes a failure introduced in rL366402.

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

4 years ago[NFC][PowerPC] Add the test to test the pass block-placement
Kang Zhang [Thu, 18 Jul 2019 06:56:49 +0000 (06:56 +0000)]
[NFC][PowerPC] Add the test to test the pass block-placement

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

4 years ago[X86] Disable combineConcatVectors for vXi1 vectors.
Craig Topper [Thu, 18 Jul 2019 06:18:06 +0000 (06:18 +0000)]
[X86] Disable combineConcatVectors for vXi1 vectors.

I'm not convinced the code this calls is properly vetted for
vXi1 vectors. Experimental vector widening legalization testing
for D55251 is now hitting an assertion failure inside
EltsFromConsecutiveLoads. This is occurring from a v2i1 load
having a store size different than its VT size. Hopefully
this commit will keep such issues from happening.

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

4 years agoFix typo in programmer's manual cantFile -> cantFail
Nathan Lanza [Thu, 18 Jul 2019 05:24:22 +0000 (05:24 +0000)]
Fix typo in programmer's manual cantFile -> cantFail

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

4 years ago[DWARF][RISCV] Add support for RISC-V relocations needed for debug info
Alex Bradbury [Thu, 18 Jul 2019 05:22:55 +0000 (05:22 +0000)]
[DWARF][RISCV] Add support for RISC-V relocations needed for debug info

When code relaxation is enabled many RISC-V fixups are not resolved but
instead relocations are emitted. This happens even for DWARF debug
sections. Therefore, to properly support the parsing of DWARF debug info
we need to be able to resolve RISC-V relocations. This patch adds:

* Support for RISC-V relocations in RelocationResolver
* DWARF support for two relocations per object file offset
* DWARF changes to support relocations in more DIE fields

The two relocations per offset change is needed because some RISC-V
relocations (used for label differences) come in pairs.

Relocations can also be emitted for DWARF fields where relocations were
not yet evaluated. Adding relocation support for some of these fields is
essencial. On the other hand, LLVM currently emits RISC-V relocations
for fixups that could be safely evaluated, since they can never be
affected by code relaxations. This patch also adds relocation support
for the fields affected by those extraneous relocations (the DWARF unit
entry Length, and the DWARF debug line entry TotalLength and
PrologueLength), for testing purposes.

Differential Revision: https://reviews.llvm.org/D62062
Patch by Luís Marques.

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

4 years ago[RISCV] Re-land r366331 d RISCV to LLVM_ALL_TARGETS
Alex Bradbury [Thu, 18 Jul 2019 04:05:18 +0000 (04:05 +0000)]
[RISCV] Re-land r366331 d RISCV to LLVM_ALL_TARGETS

*San flagged issues should be now be addressed.

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

4 years ago[RISCV] Avoid signed integer overflow UB in RISCVMatInt::generateInstSeq
Alex Bradbury [Thu, 18 Jul 2019 04:02:58 +0000 (04:02 +0000)]
[RISCV] Avoid signed integer overflow UB in RISCVMatInt::generateInstSeq

Found by UBSan.

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

4 years ago[RISCV] Don't acccess an invalidated iterator in RISCVInstrInfo::removeBranch
Alex Bradbury [Thu, 18 Jul 2019 03:23:47 +0000 (03:23 +0000)]
[RISCV] Don't acccess an invalidated iterator in RISCVInstrInfo::removeBranch

Issue found by ASan.

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

4 years ago[AArch64] Add dependency from AArch64CodeGen to TransformUtils to fix -DBUILD_SHARED_...
Fangrui Song [Thu, 18 Jul 2019 01:53:08 +0000 (01:53 +0000)]
[AArch64] Add dependency from AArch64CodeGen to TransformUtils to fix -DBUILD_SHARED_LIBS=on link error after D64173/r366361

This fixes:

ld.lld: error: undefined symbol: llvm::findAllocaForValue(llvm::Value*, llvm::DenseMap<llvm::Value*, llvm::Alloc aInst*, llvm::DenseMapInfo<llvm::Value*>, llvm::detail::DenseMapPair<llvm::Value*, llvm::AllocaInst*> >&)
>>> referenced by AArch64StackTagging.cpp

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

4 years ago[Tests] Add a test showing how we handle overaligned allocas w/ no-realign-stack
Philip Reames [Thu, 18 Jul 2019 00:26:03 +0000 (00:26 +0000)]
[Tests] Add a test showing how we handle overaligned allocas w/ no-realign-stack

(At the moment, we ignore the alignment requirement.)

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

4 years agoChanges to display code view debug info type records in hex format
Nilanjana Basu [Wed, 17 Jul 2019 23:43:58 +0000 (23:43 +0000)]
Changes to display code view debug info type records in hex format

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

4 years agoMake DT a transitive dependency of LI.
Evgeniy Stepanov [Wed, 17 Jul 2019 23:31:59 +0000 (23:31 +0000)]
Make DT a transitive dependency of LI.

Summary:
LoopInfoWrapperPass::verify uses DT, which means DT must be alive
even if it has no direct users.

Fixes a crash in expensive checks mode.

Reviewers: pcc, leonardchan

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

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

4 years ago[llvm-bcanalyzer] Fixed error 'Expected<T> must be checked before access or destruction'
Denis Bakhvalov [Wed, 17 Jul 2019 23:28:39 +0000 (23:28 +0000)]
[llvm-bcanalyzer] Fixed error 'Expected<T> must be checked before access or destruction'

After rL365286 I had failing test:
  LLVM :: tools/gold/X86/v1.12/thinlto_emit_linked_objects.ll

It was failing with the output:
$ llvm-bcanalyzer --dump llvm/test/tools/gold/X86/v1.12/Output/thinlto_emit_linked_objects.ll.tmp3.o.thinlto.bc
Expected<T> must be checked before access or destruction.
Unchecked Expected<T> contained error:
Unexpected end of file reading 0 of 0 bytesStack dump:

Change-Id: I07e03262074ea5e0aae7a8d787d5487c87f914a2

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

4 years agollvm-pdbdump: Fix several smaller issues with injected source compression handling
Nico Weber [Wed, 17 Jul 2019 22:59:52 +0000 (22:59 +0000)]
llvm-pdbdump: Fix several smaller issues with injected source compression handling

- getCompression() used to return a PDB_SourceCompression even though
  the docs for IDiaInjectedSource are explicit about the return value
  being compiler-dependent. Return an uint32_t instead, and make the
  printing code handle unknown values better by printing "Unknown" and
  the int value instead of not printing any compression.

- Print compressed contents as hex dump, not as string.

- Add compression type "DotNet", which is used (at least) by csc.exe,
  the C# compiler. Also add a lengthy comment describing the stream
  contents (derived from looking at the raw hex contents long enough
  to see the GUIDs, which led me to the roslyn and mono implementations
  for handling this).

- The native injected source dumper was dumping the contents of the
  whole data stream -- but csc.exe writes a stream that's padded with
  zero bytes to the next 512 boundary, and the dia api doesn't display
  those padding bytes. So make NativeInjectedSource::getCode() do the
  same thing.

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

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

4 years ago[AMDGPU] Simplify AMDGPUInstPrinter::printRegOperand()
Stanislav Mekhanoshin [Wed, 17 Jul 2019 22:58:43 +0000 (22:58 +0000)]
[AMDGPU] Simplify AMDGPUInstPrinter::printRegOperand()

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

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

4 years agoAMDGPU: Set inaccessiblememonly on sendmsg intrinsics
Matt Arsenault [Wed, 17 Jul 2019 22:41:53 +0000 (22:41 +0000)]
AMDGPU: Set inaccessiblememonly on sendmsg intrinsics

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

4 years ago[X86] Make sure we mark 128/256 MLOAD as Legal with VLX when min-legal-vector-width...
Craig Topper [Wed, 17 Jul 2019 22:26:00 +0000 (22:26 +0000)]
[X86] Make sure we mark 128/256 MLOAD as Legal with VLX when min-legal-vector-width=256 is in effect.

This started triggering an assertion after r364718 when we made
these Custom under AVX2.

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

4 years agogn build: Merge r366361.
Peter Collingbourne [Wed, 17 Jul 2019 21:45:34 +0000 (21:45 +0000)]
gn build: Merge r366361.

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

4 years agohwasan: Initialize the pass only once.
Peter Collingbourne [Wed, 17 Jul 2019 21:45:19 +0000 (21:45 +0000)]
hwasan: Initialize the pass only once.

This will let us instrument globals during initialization. This required
making the new PM pass a module pass, which should still provide access to
analyses via the ModuleAnalysisManager.

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

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

4 years ago[AMDGPU] Stop special casing flat_scratch for register name
Stanislav Mekhanoshin [Wed, 17 Jul 2019 21:35:11 +0000 (21:35 +0000)]
[AMDGPU] Stop special casing flat_scratch for register name

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

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

4 years agoSpeculative fix for stack-tagging.ll failure.
Evgeniy Stepanov [Wed, 17 Jul 2019 21:27:44 +0000 (21:27 +0000)]
Speculative fix for stack-tagging.ll failure.

Depending on the evaluation order of function call arguments,
the current code may insert a use before def.

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

4 years ago[Attributor][NFC] Remove unnecessary debug output
Hideto Ueno [Wed, 17 Jul 2019 21:11:02 +0000 (21:11 +0000)]
[Attributor][NFC] Remove unnecessary debug output

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

4 years agoAdding inline comments to code view type record directives for better readability
Nilanjana Basu [Wed, 17 Jul 2019 21:01:12 +0000 (21:01 +0000)]
Adding inline comments to code view type record directives for better readability

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

4 years ago[PEI] Don't re-allocate a pre-allocated stack protector slot
Francis Visoiu Mistrih [Wed, 17 Jul 2019 20:46:19 +0000 (20:46 +0000)]
[PEI] Don't re-allocate a pre-allocated stack protector slot

The LocalStackSlotPass pre-allocates a stack protector and makes sure
that it comes before the local variables on the stack.

We need to make sure that later during PEI we don't re-allocate a new
stack protector slot. If that happens, the new stack protector slot will
end up being **after** the local variables that it should be protecting.

Therefore, we would have two slots assigned for two different stack
protectors, one at the top of the stack, and one at the bottom. Since
PEI will overwrite the assigned slot for the stack protector, the load
that is used to compare the value of the stack protector will use the
slot assigned by PEI, which is wrong.

For this, we need to check if the object is pre-allocated, and re-use
that pre-allocated slot.

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

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

4 years ago[CodeGen] Add stack protector tests where the guard gets re-assigned
Francis Visoiu Mistrih [Wed, 17 Jul 2019 20:46:16 +0000 (20:46 +0000)]
[CodeGen] Add stack protector tests where the guard gets re-assigned

In preparation of a fix, add tests for multiple backends.

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

4 years ago[CodeGen][NFC] Simplify checks for stack protector index checking
Francis Visoiu Mistrih [Wed, 17 Jul 2019 20:46:09 +0000 (20:46 +0000)]
[CodeGen][NFC] Simplify checks for stack protector index checking

Use `hasStackProtectorIndex()` instead of `getStackProtectorIndex() >=
0`.

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

4 years agoGlobalISel: Handle widenScalar of arbitrary G_MERGE_VALUES sources
Matt Arsenault [Wed, 17 Jul 2019 20:22:44 +0000 (20:22 +0000)]
GlobalISel: Handle widenScalar of arbitrary G_MERGE_VALUES sources

Extract the sources to the GCD of the original size and target size,
padding with implicit_def as necessary.

Also fix the case where the requested source type is wider than the
original result type. This was ignoring the type, and just using the
destination. Do the operation in the requested type and truncate back.

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

4 years agoGlobalISel: Handle more cases for widenScalar of G_MERGE_VALUES
Matt Arsenault [Wed, 17 Jul 2019 20:22:38 +0000 (20:22 +0000)]
GlobalISel: Handle more cases for widenScalar of G_MERGE_VALUES

Use an anyext to the requested type for the leftover operand to
produce a slightly wider type, and then truncate the final merge.

I have another implementation almost ready which handles arbitrary
widens, but I think it produces worse code in this example (which I
think is 90% due to not folding redundant copies or folding out
implicit_def users), so I wanted to add this as a baseline first.

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

4 years agoBasic MTE stack tagging instrumentation.
Evgeniy Stepanov [Wed, 17 Jul 2019 19:24:12 +0000 (19:24 +0000)]
Basic MTE stack tagging instrumentation.

Summary:
Use MTE intrinsics to tag stack variables in functions with
sanitize_memtag attribute.

Reviewers: pcc, vitalybuka, hctim, ostannard

Subscribers: srhines, mgorny, javed.absar, hiraditya, llvm-commits

Tags: #llvm

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

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

4 years agoBasic codegen for MTE stack tagging.
Evgeniy Stepanov [Wed, 17 Jul 2019 19:24:02 +0000 (19:24 +0000)]
Basic codegen for MTE stack tagging.

Implement IR intrinsics for stack tagging. Generated code is very
unoptimized for now.

Two special intrinsics, llvm.aarch64.irg.sp and llvm.aarch64.tagp are
used to implement a tagged stack frame pointer in a virtual register.

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

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

4 years agoRevert [AArch64] Add support for Transactional Memory Extension (TME)
Momchil Velikov [Wed, 17 Jul 2019 17:43:32 +0000 (17:43 +0000)]
Revert [AArch64] Add support for Transactional Memory Extension (TME)

This reverts r366322 (git commit 4b8da3a503e434ddbc08ecf66582475765f449bc)

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

4 years ago[AMDGPU] Tune inlining parameters for AMDGPU target
Daniil Fukalov [Wed, 17 Jul 2019 16:51:29 +0000 (16:51 +0000)]
[AMDGPU] Tune inlining parameters for AMDGPU target

Summary:
Since the target has no significant advantage of vectorization,
vector instructions bous threshold bonus should be optional.

amdgpu-inline-arg-alloca-cost parameter default value and the target
InliningThresholdMultiplier value tuned then respectively.

Reviewers: arsenm, rampitec

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

Tags: #llvm

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

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

4 years ago[ORC] Add deprecation warnings to ORCv1 layers and utilities.
Lang Hames [Wed, 17 Jul 2019 16:40:52 +0000 (16:40 +0000)]
[ORC] Add deprecation warnings to ORCv1 layers and utilities.

Summary:
ORCv1 is deprecated. The current aim is to remove it before the LLVM 10.0
release. This patch adds deprecation attributes to the ORCv1 layers and
utilities to warn clients of the change.

Reviewers: dblaikie, sgraenitz, AlexDenisov

Subscribers: llvm-commits

Tags: #llvm

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

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

4 years ago[RISCV] Revert r366331 as it exposed some sanitizer failures
Alex Bradbury [Wed, 17 Jul 2019 16:14:52 +0000 (16:14 +0000)]
[RISCV] Revert r366331 as it exposed some sanitizer failures

See <http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/33612>.

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

4 years agoAMDGPU: Use getTargetConstant
Matt Arsenault [Wed, 17 Jul 2019 15:35:36 +0000 (15:35 +0000)]
AMDGPU: Use getTargetConstant

Avoids creating an extra intermediate mov.

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

4 years ago[Attributor] Deduce "willreturn" function attribute
Hideto Ueno [Wed, 17 Jul 2019 15:15:43 +0000 (15:15 +0000)]
[Attributor] Deduce "willreturn" function attribute

Summary:
Deduce the "willreturn" attribute for functions.

For now, intrinsics are not willreturn. More annotation will be done in another patch.

Reviewers: jdoerfert

Subscribers: jvesely, nhaehnle, nicholas, hiraditya, llvm-commits

Tags: #llvm

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

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

4 years ago[llvm-ar][test] Add tests failing on Darwin
Owen Reynolds [Wed, 17 Jul 2019 15:10:02 +0000 (15:10 +0000)]
[llvm-ar][test] Add tests failing on Darwin

These tests that failed on Darwin but passed on other machines due to the default archive format differing
on a Darwin machine, and what looks to be bugs in the output of this format.
I can not investigate these issue further so the tests are considered expected failures on Darwin.

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

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

4 years ago[RISCV] Add RISCV to LLVM_ALL_TARGETS so it s built by default
Alex Bradbury [Wed, 17 Jul 2019 14:32:25 +0000 (14:32 +0000)]
[RISCV] Add RISCV to LLVM_ALL_TARGETS so it s built by default

This follows the RFC <http://lists.llvm.org/pipermail/llvm-dev/2019-July/133724.html>.

Follow-on commits will add appropriate release notes changes etc.

Pushing this now and in a minimal form so there is reasonable time before 9.0
branches to resolve any issues arising from e.g. the backend being exposed on
different sanitizer setups.

The current builder for RISC-V is on the staging build-bot
<http://lab.llvm.org:8014/builders/llvm-riscv-linux>, however with the RISCV
backend being built by default it won't provide any real additional coverage.
We will shortly set up a builder that runs the test-suite in qemu-user.

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

4 years ago[RISCV][NFC] Remove outdated TODO from test/CodeGen/RISCV/dwarf-eh.ll
Alex Bradbury [Wed, 17 Jul 2019 14:04:48 +0000 (14:04 +0000)]
[RISCV][NFC] Remove outdated TODO from test/CodeGen/RISCV/dwarf-eh.ll

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

4 years ago[AsmPrinter] Make the encoding of call sites in .gcc_except_table configurable and...
Alex Bradbury [Wed, 17 Jul 2019 14:00:35 +0000 (14:00 +0000)]
[AsmPrinter] Make the encoding of call sites in .gcc_except_table configurable and use for RISC-V

The original behavior was to always emit the offsets to each call site in the
call site table as uleb128 values, however on some architectures (eg RISCV)
these uleb128 offsets into the code cannot always be resolved until link time
(because relaxation will invalidate any calculated offsets), and there are no
appropriate relocations for uleb128 values. As a consequence it needs to be
possible to specify an alternative.

This also switches RISCV to use DW_EH_PE_udata4 for call side encodings in
.gcc_except_table

Differential Revision: https://reviews.llvm.org/D63415
Patch by Edward Jones.

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

4 years agoMips: Remove immarg from copy and insert intrinsics
Matt Arsenault [Wed, 17 Jul 2019 13:55:01 +0000 (13:55 +0000)]
Mips: Remove immarg from copy and insert intrinsics

These intrinsics do in fact work with non-constant index arguments.

These are lowered to either the generic
ISD::INSERT_VECTOR_ELT/ISD::EXTRACT_VECTOR_ELT, or to
VEXTRACT_SEXT_ELT. The handling of these all accept variable
indexes. Turning these into generic instructions which do allow
variables introduces complications in a future change to immarg
handling.

Since these just turn into generic instructions, these are kind of
pointless and should probably just be autoupgraded to
extractelement/insertelement.

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

4 years ago[RISCV] Set correct encodings for DWARF exception handling
Alex Bradbury [Wed, 17 Jul 2019 13:54:38 +0000 (13:54 +0000)]
[RISCV] Set correct encodings for DWARF exception handling

This patch sets correct encodings for DWARF exception handling for RISC-V
(other than call site encoding, which must be udata4 rather than uleb128 and
is handled by D63415).

This has the same intend as D63409, except this version matches GCC/binutils
behaviour which uses the same encodings regardless of PIC/non-PIC and
medlow/medany code model.

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

4 years ago[RISCV][NFC] Add tests that capture current encodings for DWARF EH
Alex Bradbury [Wed, 17 Jul 2019 13:48:49 +0000 (13:48 +0000)]
[RISCV][NFC] Add tests that capture current encodings for DWARF EH

Items which are known to be wrong/different vs GCC are marked as TODO and will
be address in follow-up patches.

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

4 years ago[llvm-ar][test] \r\n -> \n
Fangrui Song [Wed, 17 Jul 2019 13:40:42 +0000 (13:40 +0000)]
[llvm-ar][test] \r\n -> \n

Also simplify some empty output tests with 'count 0'

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

4 years ago[AMDGPU] Optimize atomic AND/OR/XOR
Jay Foad [Wed, 17 Jul 2019 13:40:03 +0000 (13:40 +0000)]
[AMDGPU] Optimize atomic AND/OR/XOR

Summary: Extend the atomic optimizer to handle AND, OR and XOR.

Reviewers: arsenm, sheredom

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

Tags: #llvm

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

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

4 years ago[AArch64] Add support for Transactional Memory Extension (TME)
Momchil Velikov [Wed, 17 Jul 2019 13:23:27 +0000 (13:23 +0000)]
[AArch64] Add support for Transactional Memory Extension (TME)

TME is a future architecture technology, documented in

https://developer.arm.com/architectures/cpu-architecture/a-profile/exploration-tools
https://developer.arm.com/docs/ddi0601/a

More about the future architectures:

https://community.arm.com/developer/ip-products/processors/b/processors-ip-blog/posts/new-technologies-for-the-arm-a-profile-architecture

This patch adds support for the TME instructions TSTART, TTEST, TCOMMIT, and
TCANCEL and the target feature/arch extension "tme".

It also implements TME builtin functions, defined in ACLE Q2 2019
(https://developer.arm.com/docs/101028/latest)

Patch by Javed Absar and Momchil Velikov

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

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

4 years agoPowerPC: Fix register spilling for SPE registers
Justin Hibbits [Wed, 17 Jul 2019 12:30:48 +0000 (12:30 +0000)]
PowerPC: Fix register spilling for SPE registers

Summary:
Missed in the original commit, use the correct callee-saved register
list for spilling, instead of the standard SVR432 list.  This avoids
needlessly spilling the SPE non-volatile registers when they're not used.

As part of this, also add where missing, and sort, the spill opcode
checks for SPE and SPE4 register classes.

Reviewers: nemanjai, hfinkel, joerg

Subscribers: kbarton, jsji, llvm-commits

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

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

4 years agoPowerPC/SPE: Fix load/store handling for SPE
Justin Hibbits [Wed, 17 Jul 2019 12:30:04 +0000 (12:30 +0000)]
PowerPC/SPE: Fix load/store handling for SPE

Summary:
Pointed out in a comment for D49754, register spilling will currently
spill SPE registers at almost any offset.  However, the instructions
`evstdd` and `evldd` require a) 8-byte alignment, and b) a limit of 256
(unsigned) bytes from the base register, as the offset must fix into a
5-bit offset, which ranges from 0-31 (indexed in double-words).

The update to the register spill test is taken partially from the test
case shown in D49754.

Additionally, pointed out by Kei Thomsen, globals will currently use
evldd/evstdd, though the offset isn't known at compile time, so may
exceed the 8-bit (unsigned) offset permitted.  This fixes that as well,
by forcing it to always use evlddx/evstddx when accessing globals.

Part of the patch contributed by Kei Thomsen.

Reviewers: nemanjai, hfinkel, joerg

Subscribers: kbarton, jsji, llvm-commits

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

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

4 years ago[MIPS GlobalISel] ClampScalar and select pointer G_ICMP
Petar Avramovic [Wed, 17 Jul 2019 12:08:01 +0000 (12:08 +0000)]
[MIPS GlobalISel] ClampScalar and select pointer G_ICMP

Add narrowScalar to half of original size for G_ICMP.
ClampScalar G_ICMP's operands 2 and 3 to to s32.
Select G_ICMP for pointers for MIPS32. Pointer compare is same
as for integers, it is enough to declare them as legal type.

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

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

4 years agoAMDGPU/GFX10: Apply the VMEM-to-scalar-write hazard also to writes to EXEC
Nicolai Haehnle [Wed, 17 Jul 2019 11:22:57 +0000 (11:22 +0000)]
AMDGPU/GFX10: Apply the VMEM-to-scalar-write hazard also to writes to EXEC

Summary: Change-Id: I854fbf7d48e937bef9f8f3f5d0c8aeb970652630

Reviewers: rampitec, mareko

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

Tags: #llvm

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

Change-Id: I4405b3a7f84186acea5a78d291bff71056e745fc

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

4 years agoAMDGPU: Improve alias analysis for GDS
Nicolai Haehnle [Wed, 17 Jul 2019 11:22:19 +0000 (11:22 +0000)]
AMDGPU: Improve alias analysis for GDS

Summary: GDS cannot alias anything else.

Original patch by: Marek Olšák

Reviewers: arsenm, mareko

Subscribers: kzhuravl, jvesely, wdng, yaxunl, dstuttard, tpr, t-tye, Petar.Avramovic, llvm-commits

Tags: #llvm

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

Change-Id: I07bfbd96f5d5c37a6dfba7997df12f291dd794b0

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

4 years ago[TableGen] Do not set ReadNone attribute on intrinsics with side effects
Momchil Velikov [Wed, 17 Jul 2019 10:53:13 +0000 (10:53 +0000)]
[TableGen] Do not set ReadNone attribute on intrinsics with side effects

If an intrinsic is defined without outputs, but having side effects,
it still can be removed completely from the program. This patch makes
TableGen not set Attribute::ReadNone for intrinsics which
are declared with IntrHasSideEffects.

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

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

4 years ago[llvm-ar][test] Add coverage for replace and update key letters
Owen Reynolds [Wed, 17 Jul 2019 10:16:44 +0000 (10:16 +0000)]
[llvm-ar][test] Add coverage for replace and update key letters

Some more tests to increase llvm-ar test coverage, this time for replace 'r' and update 'u'.

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

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

4 years ago[ARM GlobalISel] Cleanup CallLowering. NFC
Diana Picus [Wed, 17 Jul 2019 10:01:27 +0000 (10:01 +0000)]
[ARM GlobalISel] Cleanup CallLowering. NFC

Migrate CallLowering::lowerReturnVal to use the same infrastructure as
lowerCall/FormalArguments and remove the now obsolete code path from
splitToValueTypes.

Forgot to push this earlier.

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

4 years ago[mips] Remove redundant test case. NFC
Simon Atanasyan [Wed, 17 Jul 2019 08:12:03 +0000 (08:12 +0000)]
[mips] Remove redundant test case. NFC

The `inlineasm-constraint-reg64.ll` test checks the same functionality.

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

4 years ago[mips] Name inline asm constraint test cases in a uniform manner. NFC
Simon Atanasyan [Wed, 17 Jul 2019 08:11:57 +0000 (08:11 +0000)]
[mips] Name inline asm constraint test cases in a uniform manner. NFC

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

4 years ago[mips] Use mult/mflo pattern on 64-bit targets prior to MIPS64
Simon Atanasyan [Wed, 17 Jul 2019 08:11:40 +0000 (08:11 +0000)]
[mips] Use mult/mflo pattern on 64-bit targets prior to MIPS64

The `MUL` instruction is available starting from the MIPS32/MIPS64 targets.

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

4 years ago[mips] Implement .cplocal directive
Simon Atanasyan [Wed, 17 Jul 2019 08:11:31 +0000 (08:11 +0000)]
[mips] Implement .cplocal directive

This directive forces to use the alternate register for context pointer.
For example, this code:
  .cplocal $4
  jal foo
expands to:
  ld    $25, %call16(foo)($4)
  jalr  $25

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

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