OSDN Git Service

android-x86/external-llvm.git
4 years agoandroid: Moving libFuzzer from LLVM to compiler-rt.
Mauro Rossi [Sat, 25 Aug 2018 14:50:30 +0000 (16:50 +0200)]
android: Moving libFuzzer from LLVM to compiler-rt.

Reference:
ec925a2578 ("Moving libFuzzer from LLVM to compiler-rt.")

4 years agoandroid: Move lib/LibDriver -> lib/ToolDrivers/llvm-lib. NFCI.
Mauro Rossi [Sat, 25 Aug 2018 17:58:03 +0000 (19:58 +0200)]
android: Move lib/LibDriver -> lib/ToolDrivers/llvm-lib. NFCI.

Reference:
a844915ce0 ("Move lib/LibDriver -> lib/ToolDrivers/llvm-lib. NFCI.")

4 years agoDO NOT MERGE: util: build only TableGen
Mauro Rossi [Sat, 25 Aug 2018 11:23:34 +0000 (13:23 +0200)]
DO NOT MERGE: util: build only TableGen

Necessary to avoid collisions with external/llvm utils

4 years agoDO NOT MERGE: android: avoid re-building tools
Mauro Rossi [Sat, 25 Aug 2018 10:59:12 +0000 (12:59 +0200)]
DO NOT MERGE: android: avoid re-building tools

Necessary to avoid Android Build System targets conflicts with external/llvm

4 years agoandroid: update version in {config,llvm-config}.h headers
Mauro Rossi [Sat, 25 Aug 2018 10:50:12 +0000 (12:50 +0200)]
android: update version in {config,llvm-config}.h headers

Version information is set to 7.0.0

4 years agoandroid: add soong building rules
Mauro Rossi [Sat, 25 Aug 2018 10:44:44 +0000 (12:44 +0200)]
android: add soong building rules

Android.bp and building rules including Android specific .go files
are imported from oreo-x86 llvm 3.9 branch to the release_70 branch

cd ~/oreo-x86_kernel/external
git clone https://github.com/llvm-mirror/llvm llvm70
cd ~/oreo-x86_kernel/external/llvm70
git reset --hard
git fetch llvm-mirror release_70
git checkout FETCH_HEAD
git clean -dxf

cd ~/oreo-x86_kernel/external/llvm
find . -name 'Android.bp' -exec cp -v --parents {} ~/oreo-x86_kernel/external/llvm70 \;
find . -name 'Android.bp' -exec git -C /home/utente/oreo-x86_kernel/external/llvm70 add {} \;

find . -name 'llvm.go' -exec cp -v --parents {} ~/oreo-x86_kernel/external/llvm70 \;
find . -name 'llvm.go' -exec git -C /home/utente/oreo-x86_kernel/external/llvm70 add {} \;

find . -name 'tblgen.go' -exec cp -v --parents {} ~/oreo-x86_kernel/external/llvm70 \;
find . -name 'tblgen.go' -exec git -C /home/utente/oreo-x86_kernel/external/llvm70 add {} \;

find . -name 'android_test.sh' -exec cp -v --parents {} ~/oreo-x86_kernel/external/llvm70 \;
find . -name 'android_test.sh' -exec git -C /home/utente/oreo-x86_kernel/external/llvm70 add {} \;

find . -name 'AsmParsers.def' -exec cp -v --parents {} ~/oreo-x86_kernel/external/llvm70 \;
find . -name 'AsmParsers.def' -exec git -C /home/utente/oreo-x86_kernel/external/llvm70 add {} \;

find . -name 'AsmPrinters.def' -exec cp -v --parents {} ~/oreo-x86_kernel/external/llvm70 \;
find . -name 'AsmPrinters.def' -exec git -C /home/utente/oreo-x86_kernel/external/llvm70 add {} \;

find . -name 'Disassemblers.def' -exec cp -v --parents {} ~/oreo-x86_kernel/external/llvm70 \;
find . -name 'Disassemblers.def' -exec git -C /home/utente/oreo-x86_kernel/external/llvm70 add {} \;

find . -name 'Targets.def' -exec cp -v --parents {} ~/oreo-x86_kernel/external/llvm70 \;
find . -name 'Targets.def' -exec git -C /home/utente/oreo-x86_kernel/external/llvm70 add {} \;

find . -name 'config.h' -exec cp -v --parents {} ~/oreo-x86_kernel/external/llvm70 \;
find . -name 'config.h' -exec git -C /home/utente/oreo-x86_kernel/external/llvm70 add {} \;

find . -name 'llvm-config.h' -exec cp -v --parents {} ~/oreo-x86_kernel/external/llvm70 \;
find . -name 'llvm-config.h' -exec git -C /home/utente/oreo-x86_kernel/external/llvm70 add {} \;

cd ~/oreo-x86_kernel/external/llvm70

4 years agoAdd external project LDC to release notes.
Kai Nacke [Tue, 17 Sep 2019 19:16:16 +0000 (19:16 +0000)]
Add external project LDC to release notes.

LDC, the LLVM-based D compiler, is already ready for LLVM 9.0.0.

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

4 years agoReleaseNotes: known issue: PR40547
Hans Wennborg [Mon, 16 Sep 2019 09:11:39 +0000 (09:11 +0000)]
ReleaseNotes: known issue: PR40547

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

4 years agoMerging r371434:
Hans Wennborg [Tue, 10 Sep 2019 07:31:55 +0000 (07:31 +0000)]
Merging r371434:
------------------------------------------------------------------------
r371434 | efriedma | 2019-09-09 20:29:27 +0200 (Mon, 09 Sep 2019) | 15 lines

[IfConversion] Correctly handle cases where analyzeBranch fails.

If analyzeBranch fails, on some targets, the out parameters point to
some blocks in the function. But we can't use that information, so make
sure to clear it out.  (In some places in IfConversion, we assume that
any block with a TrueBB is analyzable.)

The change to the testcase makes it trigger a bug on builds without this
fix: IfConvertDiamond tries to perform a followup "merge" operation,
which isn't legal, and we somehow end up with a branch to a deleted MBB.
I'm not sure how this doesn't crash the compiler.

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

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

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

4 years agoMerging r370592:
Hans Wennborg [Mon, 9 Sep 2019 09:48:38 +0000 (09:48 +0000)]
Merging r370592:
------------------------------------------------------------------------
r370592 | rksimon | 2019-08-31 18:21:31 +0200 (Sat, 31 Aug 2019) | 3 lines

[X86] EltsFromConsecutiveLoads - Don't confuse elt count with vector element count (PR43170)

EltsFromConsecutiveLoads was assuming that the number of input elts was the same as the number of elements in the output vector type when creating a zeroing shuffle, causing an assert when subvectors were being combined instead of just scalars.
------------------------------------------------------------------------

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

4 years agoMerging r371221 and r371224:
Hans Wennborg [Mon, 9 Sep 2019 09:43:19 +0000 (09:43 +0000)]
Merging r371221 and r371224:

------------------------------------------------------------------------
r371221 | spatel | 2019-09-06 18:10:18 +0200 (Fri, 06 Sep 2019) | 3 lines

[SimplifyLibCalls] handle pow(x,-0.0) before it can assert (PR43233)

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

------------------------------------------------------------------------
r371224 | jfb | 2019-09-06 18:26:59 +0200 (Fri, 06 Sep 2019) | 39 lines

[InstCombine] pow(x, +/- 0.0) -> 1.0

Summary:
This isn't an important optimization at all... We're already doing:
  pow(x, 0.0) -> 1.0
My patch merely teaches instcombine that -0.0 does the same.

However, doing this fixes an AMAZING bug! Compile this program:

  extern "C" double pow(double, double);
  double boom(double base) {
    return pow(base, -0.0);
  }

With:
  clang++ ~/Desktop/fast-math.cpp -ffast-math -O2 -S

And clang will crash with a signal. Wow, fast math is so fast it ICEs the
compiler! Arguably, the generated math is infinitely fast.

What's actually happening is that we recurse infinitely in getPow. In debug we
hit its assertion:
  assert(Exp != 0 && "Incorrect exponent 0 not handled");

We avoid this entire mess if we instead recognize that an exponent of positive
and negative zero yield 1.0.

A separate commit, r371221, fixed the same problem. This only contains the added
tests.

<rdar://problem/54598300>

Reviewers: scanon

Subscribers: hiraditya, jkorous, dexonsmith, ributzka, llvm-commits

Tags: #llvm

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

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

4 years agoMerging r371305 and r371307:
Hans Wennborg [Mon, 9 Sep 2019 09:36:49 +0000 (09:36 +0000)]
Merging r371305 and r371307:

------------------------------------------------------------------------
r371305 | nikic | 2019-09-07 14:03:48 +0200 (Sat, 07 Sep 2019) | 1 line

[X86] Add test for PR43230; NFC
------------------------------------------------------------------------

------------------------------------------------------------------------
r371307 | nikic | 2019-09-07 14:13:44 +0200 (Sat, 07 Sep 2019) | 9 lines

[X86] Fix pshuflw formation from repeated shuffle mask (PR43230)

Fix for https://bugs.llvm.org/show_bug.cgi?id=43230.

When creating PSHUFLW from a repeated shuffle mask, we have to apply
the checks to the repeated mask, not the original one. For the test
case from PR43230 the inspected part of the original mask is all undef.

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

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

4 years agoMerging r371111:
Hans Wennborg [Mon, 9 Sep 2019 09:08:44 +0000 (09:08 +0000)]
Merging r371111:
------------------------------------------------------------------------
r371111 | efriedma | 2019-09-05 22:02:38 +0200 (Thu, 05 Sep 2019) | 17 lines

[IfConversion] Fix diamond conversion with unanalyzable branches.

The code was incorrectly counting the number of identical instructions,
and therefore tried to predicate an instruction which should not have
been predicated.  This could have various effects: a compiler crash,
an assembler failure, a miscompile, or just generating an extra,
unnecessary instruction.

Instead of depending on TargetInstrInfo::removeBranch, which only
works on analyzable branches, just remove all branch instructions.

Fixes https://bugs.llvm.org/show_bug.cgi?id=43121 and
https://bugs.llvm.org/show_bug.cgi?id=41121 .

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

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

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

4 years agoMerging r371262:
Hans Wennborg [Mon, 9 Sep 2019 08:59:27 +0000 (08:59 +0000)]
Merging r371262:
------------------------------------------------------------------------
r371262 | nickdesaulniers | 2019-09-06 23:50:11 +0200 (Fri, 06 Sep 2019) | 45 lines

[IR] CallBrInst: scan+update arg list when indirect dest list changes

Summary:
There's an unspoken invariant of callbr that the list of BlockAddress
Constants in the "function args" list match the BasicBlocks in the
"other labels" list. (This invariant is being added to the LangRef in
https://reviews.llvm.org/D67196).

When modifying the any of the indirect destinations of a callbr
instruction (possible jump targets), we need to update the function
arguments if the argument is a BlockAddress whose BasicBlock refers to
the indirect destination BasicBlock being replaced.  Otherwise, many
transforms that modify successors will end up violating that invariant.
A recent change to the arm64 Linux kernel exposed this bug, which
prevents the kernel from booting.

I considered maintaining a mapping from indirect destination BasicBlock
to argument operand BlockAddress, but this ends up being a one to
potentially many (though usually one) mapping.  Also, the list of
arguments to a function (or more typically inline assembly) ends up
being less than 10.  The implementation is significantly simpler to just
rescan the full list of arguments. Because of the one to potentially
many relationship, the full arg list must be scanned (we can't stop at
the first instance).

Thanks to the following folks that reported the issue and helped debug
it:
* Nathan Chancellor
* Will Deacon
* Andrew Murray
* Craig Topper

Link: https://bugs.llvm.org/show_bug.cgi?id=43222
Link: https://github.com/ClangBuiltLinux/linux/issues/649
Link: https://lists.infradead.org/pipermail/linux-arm-kernel/2019-September/678330.html
Reviewers: craig.topper, chandlerc

Reviewed By: craig.topper

Subscribers: void, javed.absar, kristof.beyls, hiraditya, llvm-commits, nathanchance, srhines

Tags: #llvm

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

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

4 years agoMerging r371088 and r371095:
Hans Wennborg [Fri, 6 Sep 2019 08:17:47 +0000 (08:17 +0000)]
Merging r371088 and r371095:

------------------------------------------------------------------------
r371088 | spatel | 2019-09-05 18:58:18 +0200 (Thu, 05 Sep 2019) | 1 line

[x86] add test for horizontal math bug (PR43225); NFC
------------------------------------------------------------------------

------------------------------------------------------------------------
r371095 | spatel | 2019-09-05 19:28:17 +0200 (Thu, 05 Sep 2019) | 3 lines

[x86] fix horizontal math bug exposed by improved demanded elements analysis (PR43225)

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

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

4 years agoMerging r370426:
Hans Wennborg [Thu, 5 Sep 2019 11:43:42 +0000 (11:43 +0000)]
Merging r370426:
------------------------------------------------------------------------
r370426 | maskray | 2019-08-30 04:20:49 +0200 (Fri, 30 Aug 2019) | 26 lines

[PPC32] Emit R_PPC_GOT_TPREL16 instead R_PPC_GOT_TPREL16_LO

Unlike ppc64, which has ADDISgotTprelHA+LDgotTprelL pairs,
ppc32 just uses LDgotTprelL32, so it does not make lots of sense to use
_LO without a paired _HA.

Emit R_PPC_GOT_TPREL16 instead R_PPC_GOT_TPREL16_LO to match GCC, and
get better linker relocation check. Note, R_PPC_GOT_TPREL16_{HA,LO}
don't have good linker support:

(a) lld does not support R_PPC_GOT_TPREL16_{HA,LO}.
(b) Top of tree ld.bfd does not support R_PPC_GOT_REL16_HA Initial-Exec -> Local-Exec relaxation:

  // a.o
  addis 3, 3, tsd_tls@got@tprel@ha
  lwz 3, tsd_tls@got@tprel@l(3)
  add 3, 3, tsd_tls@tls
  // b.o
  .section .tdata,"awT"; .globl tsd_tls; tsd_tls:

  // ld/ld-new a.o b.o
  internal error, aborting at ../../bfd/elf32-ppc.c:7952 in ppc_elf_relocate_section

Reviewed By: adalava

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

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

4 years agoMerging r371048:
Hans Wennborg [Thu, 5 Sep 2019 11:33:27 +0000 (11:33 +0000)]
Merging r371048:
------------------------------------------------------------------------
r371048 | jonpa | 2019-09-05 12:20:05 +0200 (Thu, 05 Sep 2019) | 7 lines

[SystemZ]  Recognize INLINEASM_BR in backend

Handle the remaining cases also by handling asm goto in
SystemZInstrInfo::getBranchInfo().

Review: Ulrich Weigand
https://reviews.llvm.org/D67151
------------------------------------------------------------------------

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

4 years agoMerging r370430:
Hans Wennborg [Thu, 5 Sep 2019 10:50:25 +0000 (10:50 +0000)]
Merging r370430:
------------------------------------------------------------------------
r370430 | djg | 2019-08-30 06:33:22 +0200 (Fri, 30 Aug 2019) | 12 lines

[CodeGen] Fix lowering for returning the result of an extractvalue

When the number of return values exceeds the number of registers available,
SelectionDAGBuilder::visitRet transforms a function's return to use a
pointer to a buffer to hold return values. When the returned value is an
operator such as extractvalue, the value may have a non-zero result number.
Add that number to the indexing when obtaining the values to store.

This fixes https://bugs.llvm.org/show_bug.cgi?id=43132.

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

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

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

4 years agoMerging r370720 and r370721:
Hans Wennborg [Thu, 5 Sep 2019 09:57:35 +0000 (09:57 +0000)]
Merging r370720 and r370721:

------------------------------------------------------------------------
r370720 | bjope | 2019-09-03 11:33:40 +0200 (Tue, 03 Sep 2019) | 13 lines

[LV] Precommit test case showing miscompile from PR43166. NFC

Summary:  Precommit test case showing miscompile from PR43166.

Reviewers: fhahn, Ayal

Reviewed By: fhahn

Subscribers: rkruppe, llvm-commits

Tags: #llvm

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

------------------------------------------------------------------------
r370721 | bjope | 2019-09-03 11:33:55 +0200 (Tue, 03 Sep 2019) | 20 lines

[LV] Fix miscompiles by adding non-header PHI nodes to AllowedExit

Summary:
Fold-tail currently supports reduction last-vector-value live-out's,
but has yet to support last-scalar-value live-outs, including
non-header phi's. As it relies on AllowedExit in order to detect
them and bail out we need to add the non-header PHI nodes to
AllowedExit, otherwise we end up with miscompiles.

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

Reviewers: fhahn, Ayal

Reviewed By: fhahn, Ayal

Subscribers: anna, hiraditya, rkruppe, llvm-commits

Tags: #llvm

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

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

4 years agoMerging r370753:
Hans Wennborg [Thu, 5 Sep 2019 09:54:36 +0000 (09:54 +0000)]
Merging r370753:
------------------------------------------------------------------------
r370753 | jonpa | 2019-09-03 15:31:22 +0200 (Tue, 03 Sep 2019) | 6 lines

[SystemZ]  Recognize INLINEASM_BR in backend.

SystemZInstrInfo::analyzeBranch() needs to check for INLINEASM_BR
instructions, or it will crash.

Review: Ulrich Weigand
------------------------------------------------------------------------

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

4 years agoMerging r369310:
Hans Wennborg [Thu, 5 Sep 2019 09:51:30 +0000 (09:51 +0000)]
Merging r369310:
------------------------------------------------------------------------
r369310 | hubert.reinterpretcast | 2019-08-20 01:12:48 +0200 (Tue, 20 Aug 2019) | 24 lines

[cmake] Link in LLVMPasses due to dependency by LLVMOrcJIT; NFC

Summary:
rL367756 (f5c40cb) increases the dependency of LLVMOrcJIT on LLVMPasses.
In particular, symbols defined in LLVMPasses that are referenced by the
destructor of `PassBuilder` are now referenced by LLVMOrcJIT through
`Speculation.cpp.o`.

We believe that referencing symbols defined in LLVMPasses in the
destructor of `PassBuilder` is valid, and that adding to the set of such
symbols is legitimate. To support such cases, this patch adds LLVMPasses
to the set of libraries being linked when linking in LLVMOrcJIT causes
such symbols from LLVMPasses to be referenced.

Reviewers: Whitney, anhtuyen, pree-jackie

Reviewed By: pree-jackie

Subscribers: mgorny, llvm-commits

Tags: #llvm

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

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

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

4 years agoindex.rst: Remove non-release warning
Hans Wennborg [Fri, 30 Aug 2019 15:15:53 +0000 (15:15 +0000)]
index.rst: Remove non-release warning

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

4 years agoMerging r370355:
Hans Wennborg [Fri, 30 Aug 2019 09:06:49 +0000 (09:06 +0000)]
Merging r370355:
------------------------------------------------------------------------
r370355 | joerg | 2019-08-29 15:22:30 +0200 (Thu, 29 Aug 2019) | 5 lines

Allow replaceAndRecursivelySimplify to list unsimplified visitees.

This is part of D65280 and split it to avoid ABI changes on the 9.0
release branch.

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

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

4 years agoMerging r370404:
Hans Wennborg [Fri, 30 Aug 2019 09:02:10 +0000 (09:02 +0000)]
Merging r370404:
------------------------------------------------------------------------
r370404 | rksimon | 2019-08-29 22:22:08 +0200 (Thu, 29 Aug 2019) | 3 lines

[X86][SSE] combinePMULDQ - pmuldq(x, 0) -> zero vector (PR43159)

ISD::isBuildVectorAllZeros permits undef elements to be present, which means we can't return it as a zero vector. PMULDQ/PMULUDQ is an extending multiply so a multiply by zero of the lower 32-bits should result in a zero 64-bit element.
------------------------------------------------------------------------

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

4 years agoReleaseNotes: pocl and TCE; by Pekka Jääskeläinen
Hans Wennborg [Fri, 30 Aug 2019 07:34:24 +0000 (07:34 +0000)]
ReleaseNotes: pocl and TCE; by Pekka Jääskeläinen

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

4 years agoMerging r368164:
Hans Wennborg [Fri, 30 Aug 2019 07:27:12 +0000 (07:27 +0000)]
Merging r368164:
------------------------------------------------------------------------
r368164 | s.desmalen | 2019-08-07 14:41:38 +0200 (Wed, 07 Aug 2019) | 13 lines

[AArch64][WinCFI] Do not pair callee-save instructions in LoadStoreOptimizer

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

Reviewers: efriedma, mstorsjo, ssijaric

Reviewed By: efriedma

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

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

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

4 years agoReleaseNotes: cleanups
Hans Wennborg [Thu, 29 Aug 2019 13:41:38 +0000 (13:41 +0000)]
ReleaseNotes: cleanups

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

4 years agoReleaseNotes: remove in-progress warning and empty sections
Hans Wennborg [Thu, 29 Aug 2019 13:23:59 +0000 (13:23 +0000)]
ReleaseNotes: remove in-progress warning and empty sections

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

4 years agoReleaseNotes: matching wide stores (r362472)
Hans Wennborg [Thu, 29 Aug 2019 13:03:14 +0000 (13:03 +0000)]
ReleaseNotes: matching wide stores (r362472)

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

4 years agoReleaseNotes: reduce the indent
Hans Wennborg [Thu, 29 Aug 2019 12:44:53 +0000 (12:44 +0000)]
ReleaseNotes: reduce the indent

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

4 years agoReleaseNotes: sinking of instructions without uses
Hans Wennborg [Thu, 29 Aug 2019 12:37:46 +0000 (12:37 +0000)]
ReleaseNotes: sinking of instructions without uses

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

4 years agoReleaseNotes: omitting range checks for switches with unreachable defaults
Hans Wennborg [Thu, 29 Aug 2019 12:19:19 +0000 (12:19 +0000)]
ReleaseNotes: omitting range checks for switches with unreachable defaults

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

4 years agoReleaseNotes from Sam Parker
Hans Wennborg [Thu, 29 Aug 2019 10:04:58 +0000 (10:04 +0000)]
ReleaseNotes from Sam Parker

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

4 years agoMerging r370271:
Hans Wennborg [Thu, 29 Aug 2019 08:58:14 +0000 (08:58 +0000)]
Merging r370271:
------------------------------------------------------------------------
r370271 | tstellar | 2019-08-29 00:59:04 +0200 (Thu, 29 Aug 2019) | 6 lines

[LLVM-C] Fix omission of INSTALL_WITH_TOOLCHAIN to llvm_add_library()

Due to a misstake with r365902 that tried to simplify the install with
toolchain logic LLVM-C.dll was no longer being installed.

Patch By: Jakob Bornecrantz
------------------------------------------------------------------------

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

4 years agoMerging r370204:
Hans Wennborg [Wed, 28 Aug 2019 13:58:21 +0000 (13:58 +0000)]
Merging r370204:
------------------------------------------------------------------------
r370204 | hans | 2019-08-28 15:55:10 +0200 (Wed, 28 Aug 2019) | 6 lines

[SelectionDAG] Don't generate libcalls for wide shifts on Windows (PR42711)

Neither libgcc or compiler-rt are usually used on Windows, so these
functions can't be called.

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

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

4 years agoMerging r369886:
Hans Wennborg [Wed, 28 Aug 2019 09:55:07 +0000 (09:55 +0000)]
Merging r369886:
------------------------------------------------------------------------
r369886 | bjope | 2019-08-26 11:29:53 +0200 (Mon, 26 Aug 2019) | 23 lines

[LoopUnroll] Handle certain PHIs in full unrolling properly

Summary:
When reconstructing the CFG of the loop after unrolling,
LoopUnroll could in some cases remove the phi operands of
loop-carried values instead of preserving them, resulting
in undef phi values after loop unrolling.

When doing this reconstruction, avoid removing incoming
phi values for phis in the successor blocks if the successor
is the block we are jumping to anyway.

Patch-by: ebevhan
Reviewers: fhahn, efriedma

Reviewed By: fhahn

Subscribers: bjope, lebedev.ri, zzheng, dmgreen, llvm-commits

Tags: #llvm

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

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

4 years agoMerging r370176:
Hans Wennborg [Wed, 28 Aug 2019 09:25:24 +0000 (09:25 +0000)]
Merging r370176:
------------------------------------------------------------------------
r370176 | hans | 2019-08-28 11:21:56 +0200 (Wed, 28 Aug 2019) | 15 lines

[LLVM-C] Fix ByVal Attribute crashing

With the introduction of the typed byval attribute change there was no
way that the LLVM-C API could create the correct class Attribute. If a
program that uses the C API creates a ByVal attribute and annotates a
function with that attribute LLVM will crash when it assembles or write
that module containing the function out as bitcode.

This change is a minimal fix to at least allow code to work, this is
because the byval change is on the 9.0 and I don't want to introduce new
LLVM-C API this late in the release cycle.

By Jakob Bornecrantz!

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

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

4 years agoReleaseNotes: ORC note, by Lang
Hans Wennborg [Wed, 28 Aug 2019 08:21:46 +0000 (08:21 +0000)]
ReleaseNotes: ORC note, by Lang

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

4 years agoReleaseNotes: Zig
Hans Wennborg [Tue, 27 Aug 2019 16:42:28 +0000 (16:42 +0000)]
ReleaseNotes: Zig

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

4 years agoReleaseNotes: RISCV
Hans Wennborg [Tue, 27 Aug 2019 16:26:35 +0000 (16:26 +0000)]
ReleaseNotes: RISCV

By Alex Bradbury!

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

4 years agoReleaseNotes: PowerPC
Hans Wennborg [Tue, 27 Aug 2019 14:36:51 +0000 (14:36 +0000)]
ReleaseNotes: PowerPC

By Lei Huang!

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

4 years agoMerging r370036:
Hans Wennborg [Tue, 27 Aug 2019 14:30:02 +0000 (14:30 +0000)]
Merging r370036:
------------------------------------------------------------------------
r370036 | tnorthover | 2019-08-27 12:21:11 +0200 (Tue, 27 Aug 2019) | 8 lines

AArch64: avoid creating cycle in DAG for post-increment NEON ops.

Inserting a value into Visited has the effect of terminating a search for
predecessors if that node is seen. This is legitimate for the base address, and
acts as a slight performance optimization, but the vector-building node can be
paert of a legitimate cycle so we shouldn't stop searching there.

PR43056.
------------------------------------------------------------------------

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

4 years agoReleaseNotes: ARM and AArch64
Hans Wennborg [Mon, 26 Aug 2019 14:47:37 +0000 (14:47 +0000)]
ReleaseNotes: ARM and AArch64

From Kristof!

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

4 years agoMerging r366447:
Hans Wennborg [Mon, 26 Aug 2019 12:31:37 +0000 (12:31 +0000)]
Merging r366447:
------------------------------------------------------------------------
r366447 | jdevlieghere | 2019-07-18 17:17:42 +0200 (Thu, 18 Jul 2019) | 19 lines

[CMake] Don't set Python_ADDITIONAL_VERSIONS

Until recently, Python_ADDITIONAL_VERSIONS was used to limit LLVM's
Python support to 2.7. Now that both LLVM and LLDB both support Python
3, there's no longer a need to put an arbitrary limit on this.

However, instead of removing the variable, r365692 expanded the list,
which has the (presumably unintentional) side-effect of expression
preference for Python 3.

Instead, as Michal proposed in the original code review, we should just
not set the list at all, and let CMake pick whatever Python interpreter
you have in your path.

This patch removes the Python_ADDITIONAL_VERSIONS variable in llvm,
clang and lld. I've also updated the docs with the default behavior and
how to force a different Python version to be used.

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

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

4 years agoAdd Mull project to the release notes
Alex Denisov [Fri, 23 Aug 2019 10:01:52 +0000 (10:01 +0000)]
Add Mull project to the release notes

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

4 years agoMerging r367580:
Hans Wennborg [Thu, 22 Aug 2019 15:52:41 +0000 (15:52 +0000)]
Merging r367580:
------------------------------------------------------------------------
r367580 | atanasyan | 2019-08-01 18:04:29 +0200 (Thu, 01 Aug 2019) | 18 lines

[mips] Fix lowering load/store instruction in PIC case

If an operand of the `lw/sw` instructions is a symbol, these instructions
incorrectly lowered using not-position-independent chain of commands.
For PIC code we should use `lw/addiu` instructions with the `R_MIPS_GOT16`
and `R_MIPS_LO16` relocations respectively. Instead of that LLVM generates
position dependent code with the `R_MIPS_HI16` and `R_MIPS_LO16`
relocations.

This patch provides a fix for the bug by handling PIC case separately in
the `MipsAsmParser::expandMemInst`. The main idea is to generate a chain
of PIC instructions to load a symbol address into a register and then
load the address content.

The fix is not optimal and does not fix all PIC-related problems. This
is a task for subsequent patches.

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

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

4 years agoMerging r369426 and r369443:
Hans Wennborg [Thu, 22 Aug 2019 14:28:05 +0000 (14:28 +0000)]
Merging r369426 and r369443:

------------------------------------------------------------------------
r369426 | mstorsjo | 2019-08-20 20:58:05 +0200 (Tue, 20 Aug 2019) | 5 lines

[TargetMachine] Don't try to create COFFSTUB references on windows on non-COFF

This avoids spurious relocation types for windows/elf targets.

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

------------------------------------------------------------------------
r369443 | mstorsjo | 2019-08-20 22:58:02 +0200 (Tue, 20 Aug 2019) | 11 lines

[test] Fix tests when run on windows after SVN r369426. NFC.

When running tests on windows, invoking "llc -march=<arch>" will
implicitly use windows as the target os, making these tests misbehave
after this change.

Fix the issue by using more specific -mtriple values instead of plain
-march in these tests.

This should hopefully fix buildbot failures like
http://lab.llvm.org:8011/builders/clang-x64-windows-msvc/builds/9816.
------------------------------------------------------------------------

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

4 years agoMerging r369095:
Hans Wennborg [Thu, 22 Aug 2019 13:49:53 +0000 (13:49 +0000)]
Merging r369095:
------------------------------------------------------------------------
r369095 | lewis-revill | 2019-08-16 12:28:34 +0200 (Fri, 16 Aug 2019) | 11 lines

[RISCV] Lower inline asm constraint A for RISC-V

This allows arguments with the constraint A to be lowered to input nodes
for RISC-V, which implies a memory address stored in a register.

This patch adds the minimal amount of code required to get operands with
the right constraints to compile.

https://reviews.llvm.org/D54296

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

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

4 years agoMerging r367412 and r367429:
Hans Wennborg [Tue, 20 Aug 2019 10:10:05 +0000 (10:10 +0000)]
Merging r367412 and r367429:
------------------------------------------------------------------------
r367412 | rksimon | 2019-07-31 13:35:01 +0200 (Wed, 31 Jul 2019) | 1 line

[X86][AVX] Add reduced test case for PR42833
------------------------------------------------------------------------

------------------------------------------------------------------------
r367429 | rksimon | 2019-07-31 14:55:39 +0200 (Wed, 31 Jul 2019) | 3 lines

[X86][AVX] Ensure chained subvector insertions are the same size (PR42833)

Before combining insert_subvector(insert_subvector(vec, sub0, c0), sub1, c1) patterns, ensure that the subvectors are all the same type. On AVX512 targets especially we might have a mixture of 128/256 subvector insertions.
------------------------------------------------------------------------

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

4 years agoMerging r369199:
Hans Wennborg [Tue, 20 Aug 2019 09:56:16 +0000 (09:56 +0000)]
Merging r369199:
------------------------------------------------------------------------
r369199 | yhs | 2019-08-18 00:12:00 +0200 (Sun, 18 Aug 2019) | 26 lines

[BPF] Fix bpf llvm-objdump issues.

Commit https://reviews.llvm.org/D57939 ("[DWARF] Refactor
RelocVisitor and fix computation of SHT_RELA-typed relocation entries)
made a change for relocation resolution when operating
on an object file.

The change unfortunately broke BPF as given SymbolValue (S) and
Addent (A), previously relocation is resolved to
    S + A
and after the change, it is resolved to
    S

This patch fixed the issue by resolving relocation correctly.

It looks not all relocation resolution reaches here and I did not
trace down exactly when. But I do find if the object file includes
codes in two different ELF sections than default ".text",
the above bug will be triggered.

This patch included a trivial two function source code to
demonstrate this issue. The relocation for .debug_loc is resolved
incorrectly due to this and llvm-objdump cannot display source
annotated assembly.

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

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

4 years agoMerging r369084:
Hans Wennborg [Tue, 20 Aug 2019 09:52:26 +0000 (09:52 +0000)]
Merging r369084:
------------------------------------------------------------------------
r369084 | ctopper | 2019-08-16 06:47:44 +0200 (Fri, 16 Aug 2019) | 5 lines

[X86] Manually reimplement getTargetInsertSubreg in X86DAGToDAGISel::matchBitExtract so we can call insertDAGNode on the target constant.

This is needed to maintain the topological sort order.

Fixes PR42992.
------------------------------------------------------------------------

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

4 years agoMerging r369168:
Hans Wennborg [Tue, 20 Aug 2019 09:45:09 +0000 (09:45 +0000)]
Merging r369168:
------------------------------------------------------------------------
r369168 | spatel | 2019-08-17 01:10:34 +0200 (Sat, 17 Aug 2019) | 16 lines

[CodeGenPrepare] Fix use-after-free

If OptimizeExtractBits() encountered a shift instruction with no operands at all,
it would erase the instruction, but still return false.

This previously didn’t matter because its caller would always return after
processing the instruction, but https://reviews.llvm.org/D63233 changed the
function’s caller to fall through if it returned false, which would then cause
a use-after-free detectable by ASAN.

This change makes OptimizeExtractBits return true if it removes a shift
instruction with no users, terminating processing of the instruction.

Patch by: @brentdax (Brent Royal-Gordon)

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

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

4 years agoMerging r369026:
Hans Wennborg [Tue, 20 Aug 2019 09:35:16 +0000 (09:35 +0000)]
Merging r369026:
------------------------------------------------------------------------
r369026 | jmorse | 2019-08-15 19:49:46 +0200 (Thu, 15 Aug 2019) | 17 lines

[DebugInfo] Avoid crash from dropped fragments in LiveDebugValues

This patch avoids a crash caused by DW_OP_LLVM_fragments being dropped
from DIExpressions by LiveDebugValues spill-restore code. The appearance
of a previously unseen fragment configuration confuses LDV, as documented
in PR42773, and reproduced by the test function this patch adds (Crashes
on a x86_64 debug build).

To avoid this, on spill restore, we now use fragment information from the
spilt-location-expression.

In addition, when spilling, we now don't spill any DBG_VALUE with a complex
expression, as it can't be safely restored and will definitely lead to an
incorrect variable location. The discussion of this is in D65368.

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

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

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

4 years agoMerging r369097:
Hans Wennborg [Tue, 20 Aug 2019 07:45:44 +0000 (07:45 +0000)]
Merging r369097:
------------------------------------------------------------------------
r369097 | lewis-revill | 2019-08-16 14:00:56 +0200 (Fri, 16 Aug 2019) | 8 lines

[RISCV] Allow parsing of bare symbols with offsets

This patch allows symbols followed by an expression for an offset to be
parsed as bare symbols.

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

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

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

4 years agoMerging r369011:
Hans Wennborg [Tue, 20 Aug 2019 07:26:05 +0000 (07:26 +0000)]
Merging r369011:
------------------------------------------------------------------------
r369011 | bogner | 2019-08-15 17:36:13 +0200 (Thu, 15 Aug 2019) | 4 lines

[cmake] install_symlink should obey DESTDIR unconditionally

Setting DESTDIR was erroneously buried under a condition here - if
it's set it should always be used.
------------------------------------------------------------------------

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

4 years agoMerging r367019:
Hans Wennborg [Fri, 16 Aug 2019 07:44:53 +0000 (07:44 +0000)]
Merging r367019:
------------------------------------------------------------------------
r367019 | chill | 2019-07-25 15:56:04 +0200 (Thu, 25 Jul 2019) | 10 lines

[AArch64][SVE] Allow explicit size specifier for predicate operand

... for the vector forms of `{SQ,UQ,}{INC,DEC}P` instructions. Also continue
supporting the exsting behaviour of not requiring an explicit size
specifier. The preferred disasembly is *with* the specifier.

This is implemented by redefining intruction forms to require vector predicates
with explicit size and adding aliases, which allow a predicate with no size.

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

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

4 years agoMerging r368873:
Hans Wennborg [Fri, 16 Aug 2019 07:18:49 +0000 (07:18 +0000)]
Merging r368873:
------------------------------------------------------------------------
r368873 | void | 2019-08-14 18:44:07 +0200 (Wed, 14 Aug 2019) | 15 lines

Ignore indirect branches from callbr.

Summary:
We can't speculate around indirect branches: indirectbr and invoke. The
callbr instruction needs to be included here.

Reviewers: nickdesaulniers, manojgupta, chandlerc

Reviewed By: chandlerc

Subscribers: llvm-commits

Tags: #llvm

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

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

4 years agoMerging r367084:
Hans Wennborg [Wed, 14 Aug 2019 13:14:17 +0000 (13:14 +0000)]
Merging r367084:
------------------------------------------------------------------------
r367084 | kongyi | 2019-07-26 07:17:14 +0200 (Fri, 26 Jul 2019) | 6 lines

Fix macOS build after r358716

COPYFILE_CLONE is only defined on newer macOS versions, using it without
check breaks build on systems running legacy OS and toolchain.

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

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

4 years agoMerging r368300:
Hans Wennborg [Wed, 14 Aug 2019 12:59:17 +0000 (12:59 +0000)]
Merging r368300:
------------------------------------------------------------------------
r368300 | lenary | 2019-08-08 16:40:54 +0200 (Thu, 08 Aug 2019) | 18 lines

[RISCV] Minimal stack realignment support

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

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

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

Reviewers: asb

Reviewed By: asb

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

Tags: #llvm

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

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

4 years agoMerging r368478:
Hans Wennborg [Tue, 13 Aug 2019 12:08:26 +0000 (12:08 +0000)]
Merging r368478:
------------------------------------------------------------------------
r368478 | void | 2019-08-09 22:18:30 +0200 (Fri, 09 Aug 2019) | 16 lines

[CodeGen] Require a name for a block addr target

Summary:
A block address may be used in inline assembly. In which case it
requires a name so that the asm parser has something to parse. Creating
a name for every block address is a large hammer, but is necessary
because at the point when a temp symbol is created we don't necessarily
know if it's used in inline asm. This ensures that it exists regardless.

Reviewers: nickdesaulniers, craig.topper

Subscribers: nathanchance, javed.absar, llvm-commits

Tags: #llvm

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

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

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