]> granicus.if.org Git - llvm/log
llvm
5 years ago[ConstantRange] Add urem support
Nikita Popov [Tue, 23 Apr 2019 18:00:17 +0000 (18:00 +0000)]
[ConstantRange] Add urem support

Add urem support to ConstantRange, so we can handle in in LVI. This
is an approximate implementation that tries to capture the most useful
conditions: If the LHS is always strictly smaller than the RHS, then
the urem is a no-op and the result is the same as the LHS range.
Otherwise the lower bound is zero and the upper bound is
min(LHSMax, RHSMax - 1).

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

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

5 years ago[ConstantRangeTest] Move helper methods; NFC
Nikita Popov [Tue, 23 Apr 2019 18:00:02 +0000 (18:00 +0000)]
[ConstantRangeTest] Move helper methods; NFC

Move Test(Unsigned|Signed)BinOpExhaustive() towards the top of the
file, so they're easier to reuse.

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

5 years ago[AMDGPU] Fixed addReg() in SIOptimizeExecMaskingPreRA.cpp
Stanislav Mekhanoshin [Tue, 23 Apr 2019 17:59:26 +0000 (17:59 +0000)]
[AMDGPU] Fixed addReg() in SIOptimizeExecMaskingPreRA.cpp

The second argument is flags, not subreg.

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

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

5 years ago[AArch64][GlobalISel] Legalize G_FMA for more vector types
Jessica Paquette [Tue, 23 Apr 2019 17:37:56 +0000 (17:37 +0000)]
[AArch64][GlobalISel] Legalize G_FMA for more vector types

Same as G_FCEIL, G_FABS, etc. Just move it into that rule.

Add a legalizer test for G_FMA, which we didn't have before and update
arm64-vfloatintrinsics.ll.

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

5 years ago[AliasAnalysis] AAResults preserves AAManager.
Alina Sbirlea [Tue, 23 Apr 2019 17:21:18 +0000 (17:21 +0000)]
[AliasAnalysis] AAResults preserves AAManager.

Summary:
AAResults should not invalidate AAManager.
Update tests.

Reviewers: chandlerc

Subscribers: mehdi_amini, jlebar, llvm-commits

Tags: #llvm

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

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

5 years ago[AArch64][GlobalISel] Add G_FMA to isPreISelGenericFloatingPointOpcode
Jessica Paquette [Tue, 23 Apr 2019 17:17:06 +0000 (17:17 +0000)]
[AArch64][GlobalISel] Add G_FMA to isPreISelGenericFloatingPointOpcode

Noticed an unnecessary fallback in arm64-vmul caused by this.

Also add a regbankselect test for G_FMA.

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

5 years ago[APSInt][OpenMP] Fix isNegative, etc. for unsigned types
Joel E. Denny [Tue, 23 Apr 2019 17:04:15 +0000 (17:04 +0000)]
[APSInt][OpenMP] Fix isNegative, etc. for unsigned types

Without this patch, APSInt inherits APInt::isNegative, which merely
checks the sign bit without regard to whether the type is actually
signed.  isNonNegative and isStrictlyPositive call isNegative and so
are also affected.

This patch adjusts APSInt to override isNegative, isNonNegative, and
isStrictlyPositive with implementations that consider whether the type
is signed.

A large set of Clang OpenMP tests are affected.  Without this patch,
these tests assume that `true` is not a valid argument for clauses
like `collapse`.  Indeed, `true` fails APInt::isStrictlyPositive but
not APSInt::isStrictlyPositive.  This patch adjusts those tests to
assume `true` should be accepted.

This patch also adds tests revealing various other similar fixes due
to APSInt::isNegative calls in Clang's ExprConstant.cpp and
SemaExpr.cpp: `++` and `--` overflow in `constexpr`, evaluated object
size based on `alloc_size`, `<<` and `>>` shift count validation, and
OpenMP array section validation.

Reviewed By: lebedev.ri, ABataev, hfinkel

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

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

5 years ago[dsymutil] Put Swift interface files into a per-arch subdirectory.
Adrian Prantl [Tue, 23 Apr 2019 16:42:35 +0000 (16:42 +0000)]
[dsymutil] Put Swift interface files into a per-arch subdirectory.

This was meant to be part of the original commit r358921, but somehow
got lost.

<rdar://problem/49751748>

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

5 years ago[x86] fix test checks for fdiv combine; NFC
Sanjay Patel [Tue, 23 Apr 2019 16:31:30 +0000 (16:31 +0000)]
[x86] fix test checks for fdiv combine; NFC

Must have picked up some transient code changes when originally generating this.

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

5 years agollvm-undname: Support demangling the spaceship operator
Nico Weber [Tue, 23 Apr 2019 16:20:27 +0000 (16:20 +0000)]
llvm-undname: Support demangling the spaceship operator

Also add a test for demanling the co_await operator.

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

5 years ago[x86] add tests for vector fdiv with splat divisor; NFC
Sanjay Patel [Tue, 23 Apr 2019 16:16:16 +0000 (16:16 +0000)]
[x86] add tests for vector fdiv with splat divisor; NFC

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

5 years ago[dsymutil] Fix use-after-free when sys::path::append grows the buffer.
Adrian Prantl [Tue, 23 Apr 2019 15:44:22 +0000 (15:44 +0000)]
[dsymutil] Fix use-after-free when sys::path::append grows the buffer.

<rdar://problem/50117620>

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

5 years agoRevert "[dsymutil] Fix use-after-free when sys::path::append grows the buffer."
Adrian Prantl [Tue, 23 Apr 2019 15:44:19 +0000 (15:44 +0000)]
Revert "[dsymutil] Fix use-after-free when sys::path::append grows the buffer."

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

5 years ago[dsymutil] Fix use-after-free when sys::path::append grows the buffer.
Adrian Prantl [Tue, 23 Apr 2019 15:39:13 +0000 (15:39 +0000)]
[dsymutil] Fix use-after-free when sys::path::append grows the buffer.

<rdar://problem/50117620>

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

5 years ago[InstCombine] Convert a masked.load of a dereferenceable address to an unconditional...
Philip Reames [Tue, 23 Apr 2019 15:25:14 +0000 (15:25 +0000)]
[InstCombine] Convert a masked.load of a dereferenceable address to an unconditional load

If we have a masked.load from a location we know to be dereferenceable, we can simply issue a speculative unconditional load against that address. The key advantage is that it produces IR which is well understood by the optimizer. The select (cnd, load, passthrough) form produced should be pattern matchable back to hardware predication if profitable.

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

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

5 years ago[x86] use psubus for more vsetcc lowering (PR39859)
Sanjay Patel [Tue, 23 Apr 2019 15:20:17 +0000 (15:20 +0000)]
[x86] use psubus for more vsetcc lowering (PR39859)

Circling back to a leftover bit from PR39859:
https://bugs.llvm.org/show_bug.cgi?id=39859#c1

...we have this counter-intuitive (based on the test diffs) opportunity to use 'psubus'.
This appears to be the better perf option for both Haswell and Jaguar based on llvm-mca.
We already do this transform for the SETULT predicate, so this makes the code more
symmetrical too. If we have pminub/pminuw, we prefer those, so this should not affect
anything but pre-SSE4.1 subtargets.

  $ cat before.s
movdqa -16(%rip), %xmm2    ## xmm2 = [32768,32768,32768,32768,32768,32768,32768,32768]
pxor %xmm0, %xmm2
pcmpgtw -32(%rip), %xmm2 ## xmm2 = [255,255,255,255,255,255,255,255]
pand %xmm2, %xmm0
pandn %xmm1, %xmm2
por %xmm2, %xmm0

  $ cat after.s
movdqa -16(%rip), %xmm2    ## xmm2 = [256,256,256,256,256,256,256,256]
psubusw %xmm0, %xmm2
pxor %xmm3, %xmm3
pcmpeqw %xmm2, %xmm3
pand %xmm3, %xmm0
pandn %xmm1, %xmm3
por %xmm3, %xmm0

  $ llvm-mca before.s -mcpu=haswell
  Iterations:        100
  Instructions:      600
  Total Cycles:      909
  Total uOps:        700

  Dispatch Width:    4
  uOps Per Cycle:    0.77
  IPC:               0.66
  Block RThroughput: 1.8

  $ llvm-mca after.s -mcpu=haswell
  Iterations:        100
  Instructions:      700
  Total Cycles:      409
  Total uOps:        700

  Dispatch Width:    4
  uOps Per Cycle:    1.71
  IPC:               1.71
  Block RThroughput: 1.8

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

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

5 years ago[SPARC] Use the correct register set for the "r" asm constraint.
Joerg Sonnenberger [Tue, 23 Apr 2019 15:15:33 +0000 (15:15 +0000)]
[SPARC] Use the correct register set for the "r" asm constraint.

64bit mode must use 64bit registers, otherwise assumptions about the top
half of the registers are made. Problem found by Takeshi Nakayama in
NetBSD.

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

5 years agoRevert "DebugInfo: Emit only one kind of accelerated access/name table"
David Blaikie [Tue, 23 Apr 2019 15:03:24 +0000 (15:03 +0000)]
Revert "DebugInfo: Emit only one kind of accelerated access/name table"

Regresses some apple_names situations - still investigating.

This reverts commit r358931.

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

5 years agoUse llvm::stable_sort
Fangrui Song [Tue, 23 Apr 2019 14:51:27 +0000 (14:51 +0000)]
Use llvm::stable_sort

While touching the code, simplify if feasible.

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

5 years ago[RISCV] Support assembling %tls_{ie,gd}_pcrel_hi modifiers
Lewis Revill [Tue, 23 Apr 2019 14:46:13 +0000 (14:46 +0000)]
[RISCV] Support assembling %tls_{ie,gd}_pcrel_hi modifiers

This patch adds support for parsing and assembling the %tls_ie_pcrel_hi
and %tls_gd_pcrel_hi modifiers.

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

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

5 years agogn build: Merge r358944
Nico Weber [Tue, 23 Apr 2019 14:32:18 +0000 (14:32 +0000)]
gn build: Merge r358944

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

5 years ago[AMDGPU] Fix hidden argument metadata duplication for V3
Scott Linder [Tue, 23 Apr 2019 14:31:17 +0000 (14:31 +0000)]
[AMDGPU] Fix hidden argument metadata duplication for V3

Essentially complete a proper rebase of the V3 metadata change over
https://reviews.llvm.org/D49096.

Minimize the diff between the V2 and V3 variants of the relevant lit
tests, and clean up some trailing whitespace.

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

5 years agogn build: Merge r358949
Nico Weber [Tue, 23 Apr 2019 14:31:15 +0000 (14:31 +0000)]
gn build: Merge r358949

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

5 years ago[X86] Pull out collectConcatOps helper. NFCI.
Simon Pilgrim [Tue, 23 Apr 2019 14:07:49 +0000 (14:07 +0000)]
[X86] Pull out collectConcatOps helper. NFCI.

Create collectConcatOps helper that returns all the subvector ops for CONCAT_VECTORS or a INSERT_SUBVECTOR series.

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

5 years agoARM: disallow add/sub to sp unless Rn is also sp.
Tim Northover [Tue, 23 Apr 2019 13:50:13 +0000 (13:50 +0000)]
ARM: disallow add/sub to sp unless Rn is also sp.

The manual says that Thumb2 add/sub instructions are only allowed to modify sp
if the first source is also sp. This is slightly different from the usual rGPR
restriction since it's context-sensitive, so implement it in C++.

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

5 years ago[Docs] ReleaseNotes: fixup markup in memcmp()->bcmp() entry
Roman Lebedev [Tue, 23 Apr 2019 13:46:18 +0000 (13:46 +0000)]
[Docs] ReleaseNotes: fixup markup in memcmp()->bcmp() entry

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

5 years ago[DAGCombiner] generalize binop-of-splats scalarization
Sanjay Patel [Tue, 23 Apr 2019 13:16:41 +0000 (13:16 +0000)]
[DAGCombiner] generalize binop-of-splats scalarization

If we only match build vectors, we can miss some patterns
that use shuffles as seen in the affected tests.

Note that the underlying calls within getSplatSourceVector()
have the potential for compile-time explosion because of
exponential recursion looking through binop opcodes, but
currently the list of supported opcodes is very limited.
Both of those problems should be addressed in follow-up
patches.

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

5 years agoAMDGPU: Fix LCSSA phi lowering in SILowerI1Copies
Nicolai Haehnle [Tue, 23 Apr 2019 13:12:52 +0000 (13:12 +0000)]
AMDGPU: Fix LCSSA phi lowering in SILowerI1Copies

Summary:
When an LCSSA phi survives through instruction selection, the pass
ends up removing that phi entirely because it is dominated by the
logic that does the lanemask merging.

This then used to trigger an assertion when processing a dependent
phi instruction.

Change-Id: Id4949719f8298062fe476a25718acccc109113b6

Reviewers: llvm-commits

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

Tags: #llvm

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

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

5 years ago[CallSite removal] move InlineCost to CallBase usage
Fedor Sergeev [Tue, 23 Apr 2019 12:43:27 +0000 (12:43 +0000)]
[CallSite removal] move InlineCost to CallBase usage

Converting InlineCost interface and its internals into CallBase usage.
Inliners themselves are still not converted.

Reviewed By: reames
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D60636

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

5 years agoRemoving the explicit specifier from some default constructors; NFC.
Aaron Ballman [Tue, 23 Apr 2019 12:16:28 +0000 (12:16 +0000)]
Removing the explicit specifier from some default constructors; NFC.

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

5 years ago[ARM] Update check for CBZ in Ifcvt
David Green [Tue, 23 Apr 2019 12:11:26 +0000 (12:11 +0000)]
[ARM] Update check for CBZ in Ifcvt

The check for creating CBZ in constant island pass recently obtained the
ability to search backwards to find a Cmp instruction. The code in IfCvt should
mirror this to allow more conversions to the smaller form. The common code has
been pulled out into a separate function to be shared between the two places.

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

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

5 years ago[ARM] Don't replicate instructions in Ifcvt at minsize
David Green [Tue, 23 Apr 2019 11:46:58 +0000 (11:46 +0000)]
[ARM] Don't replicate instructions in Ifcvt at minsize

Ifcvt can replicate instructions as it converts them to be predicated. This
stops that from happening on thumb2 targets at minsize where an extra IT
instruction is likely needed.

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

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

5 years agoFix MSVC "32-bit shift implicitly converted to 64 bits" warning. NFCI.
Simon Pilgrim [Tue, 23 Apr 2019 11:16:16 +0000 (11:16 +0000)]
Fix MSVC "32-bit shift implicitly converted to 64 bits" warning. NFCI.

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

5 years agoFix MSVC "32-bit shift implicitly converted to 64 bits" warning. NFCI.
Simon Pilgrim [Tue, 23 Apr 2019 11:11:34 +0000 (11:11 +0000)]
Fix MSVC "32-bit shift implicitly converted to 64 bits" warning. NFCI.

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

5 years ago[DAGCombiner] Combine OR as ADD when no common bits are set
Bjorn Pettersson [Tue, 23 Apr 2019 10:01:08 +0000 (10:01 +0000)]
[DAGCombiner] Combine OR as ADD when no common bits are set

Summary:
The DAGCombiner is rewriting (canonicalizing) an ISD::ADD
with no common bits set in the operands as an ISD::OR node.

This could sometimes result in "missing out" on some
combines that normally are performed for ADD. To be more
specific this could happen if we already have rewritten an
ADD into OR, and later (after legalizations or combines)
we expose patterns that could have been optimized if we
had seen the OR as an ADD (e.g. reassociations based on ADD).

To make the DAG combiner less sensitive to if ADD or OR is
used for these "no common bits set" ADD/OR operations we
now apply most of the ADD combines also to an OR operation,
when value tracking indicates that the operands have no
common bits set.

Reviewers: spatel, RKSimon, craig.topper, kparzysz

Reviewed By: spatel

Subscribers: arsenm, rampitec, lebedev.ri, jvesely, nhaehnle, hiraditya, javed.absar, llvm-commits

Tags: #llvm

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

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

5 years ago[AArch64] Add support for MTE intrinsics
Javed Absar [Tue, 23 Apr 2019 09:39:58 +0000 (09:39 +0000)]
[AArch64] Add support for MTE intrinsics

This patch provides intrinsics support for Memory Tagging Extension (MTE),
which was introduced with the Armv8.5-a architecture.
The intrinsics are described in detail in the latest
ACLE Q1 2019 documentation: https://developer.arm.com/docs/101028/latest
Reviewed by: David Spickett
Differential Revision: https://reviews.llvm.org/D60486

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

5 years ago[ARM][FIX] Add missing f16.lane.vldN/vstN lowering
Diogo N. Sampaio [Tue, 23 Apr 2019 09:36:39 +0000 (09:36 +0000)]
[ARM][FIX] Add missing f16.lane.vldN/vstN lowering

Summary:
Add missing D and Q lane VLDSTLane lowering
for fp16 elements.

Reviewers: efriedma, kosarev, SjoerdMeijer, ostannard

Reviewed By: efriedma

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

Tags: #llvm

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

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

5 years ago[llvm-mc] - Properly set the the address align field of the compressed sections.
George Rimar [Tue, 23 Apr 2019 09:16:53 +0000 (09:16 +0000)]
[llvm-mc] - Properly set the the address align field of the compressed sections.

About the compressed sections spec says:
(https://docs.oracle.com/cd/E37838_01/html/E36783/section_compression.html)
sh_addralign fields of the section header for a compressed section
reflect the requirements of the compressed section.

Currently, llvm-mc always puts uncompressed section alignment to sh_addralign.
It is not correct. zlib styled section contains an Elfxx_Chdr header,
so we should either use 4 or 8 values depending on the target
(Uncompressed section alignment is stored in ch_addralign field of the compression header).

GNU assembler version 2.31.1 also has this issue,
but in 2.32.51 it was already fixed. This is how it was found
during debugging of the https://bugs.llvm.org/show_bug.cgi?id=40482
actually.

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

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

5 years ago[LSR] Limit the recursion for setup cost
David Green [Tue, 23 Apr 2019 08:52:21 +0000 (08:52 +0000)]
[LSR] Limit the recursion for setup cost

In some circumstances we can end up with setup costs that are very complex to
compute, even though the scevs are not very complex to create. This can also
lead to setupcosts that are calculated to be exactly -1, which LSR treats as an
invalid cost. This patch puts a limit on the recursion depth for setup cost to
prevent them taking too long.

Thanks to @reames for the report and test case.

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

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

5 years ago[WebAssembly] Bail out of fastisel earlier when computing PIC addresses
Sam Clegg [Tue, 23 Apr 2019 03:43:26 +0000 (03:43 +0000)]
[WebAssembly] Bail out of fastisel earlier when computing PIC addresses

This change partially reverts https://reviews.llvm.org/D54647 in favor
of bailing out during computeAddress instead.

This catches the condition earlier and handles more cases.

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

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

5 years agoadd Qiu Chaofan (qiucf@cn.ibm.com) to the CREDITS.txt
Qiu Chaofan [Tue, 23 Apr 2019 02:37:48 +0000 (02:37 +0000)]
add Qiu Chaofan (qiucf@cn.ibm.com) to the CREDITS.txt

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

5 years agoRevert "Use const DebugLoc&"
Chandler Carruth [Tue, 23 Apr 2019 01:42:07 +0000 (01:42 +0000)]
Revert "Use const DebugLoc&"

This reverts r358910 (git commit 2b744665308fc8d30a3baecb4947f2bd81aa7d30)

While this patch *seems* trivial and safe and correct, it is not. The
copies are actually load bearing copies. You can observe this with MSan
or other ways of checking for use-after-destroy, but otherwise this may
result in ... difficult to debug inexplicable behavior.

I suspect the issue is that the debug location is used after the
original reference to it is removed. The metadata backing it gets
destroyed as its last references goes away, and then we reference it
later through these const references.

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

5 years ago[CMake] Replace the sanitizer support in runtimes build with multilib
Petr Hosek [Mon, 22 Apr 2019 23:31:39 +0000 (23:31 +0000)]
[CMake] Replace the sanitizer support in runtimes build with multilib

This is a more generic solution; while the sanitizer support can be used
only for sanitizer instrumented builds, the multilib support can be used
to build other variants such as noexcept which is what we would like to use
in Fuchsia.

The name CMake target name uses the target name, same as for the regular
runtimes build and the name of the multilib, concatenated with '+'. The
libraries are installed in a subdirectory named after the multilib.

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

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

5 years agoFully qualify llvm::Optional, some compilers complain otherwise.
Adrian Prantl [Mon, 22 Apr 2019 22:51:34 +0000 (22:51 +0000)]
Fully qualify llvm::Optional, some compilers complain otherwise.

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

5 years agoDebugInfo: Emit only one kind of accelerated access/name table
David Blaikie [Mon, 22 Apr 2019 22:45:11 +0000 (22:45 +0000)]
DebugInfo: Emit only one kind of accelerated access/name table

Currently to opt in to debug_names in DWARFv5, the IR must contain
'nameTableKind: Default' which also enables debug_pubnames.

Instead, only allow one of {debug_names, apple_names, debug_pubnames,
debug_gnu_pubnames}.

nameTableKind: Default gives debug_names in DWARFv5 and greater,
debug_pubnames in v4 and earlier - and apple_names when tuning for lldb
on MachO.
nameTableKind: GNU always gives gnu_pubnames

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

5 years ago[SelectionDAG] move splat util functions up from x86 lowering
Sanjay Patel [Mon, 22 Apr 2019 22:43:36 +0000 (22:43 +0000)]
[SelectionDAG] move splat util functions up from x86 lowering

This was supposed to be NFC, but the change in SDLoc
definitions causes instruction scheduling changes.

There's nothing x86-specific in this code, and it can
likely be used from DAGCombiner's simplifyVBinOp().

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

5 years agoTry to work around compile errors with older versions of GCC.
Adrian Prantl [Mon, 22 Apr 2019 22:40:37 +0000 (22:40 +0000)]
Try to work around compile errors with older versions of GCC.

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

5 years agoRelax test to check for a valid number instead of a specific number.
Douglas Yung [Mon, 22 Apr 2019 22:31:57 +0000 (22:31 +0000)]
Relax test to check for a valid number instead of a specific number.

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

5 years ago[AMDGPU] Fix an issue in `op_sel_hi` skipping.
Michael Liao [Mon, 22 Apr 2019 22:05:49 +0000 (22:05 +0000)]
[AMDGPU] Fix an issue in `op_sel_hi` skipping.

Summary:
- Only apply packed literal `op_sel_hi` skipping on operands requiring
  packed literals. Even an instruction is `packed`, it may have operand
  requiring non-packed literal, such as `v_dot2_f32_f16`.

Reviewers: rampitec, arsenm, kzhuravl

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

Tags: #llvm

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

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

5 years ago[dsymutil] Collect parseable Swift interfaces in the .dSYM bundle.
Adrian Prantl [Mon, 22 Apr 2019 21:33:22 +0000 (21:33 +0000)]
[dsymutil] Collect parseable Swift interfaces in the .dSYM bundle.

When a Swift module built with debug info imports a library without
debug info from a textual interface, the textual interface is
necessary to reconstruct types defined in the library's interface. By
recording the Swift interface files in DWARF dsymutil can collect them
and LLDB can find them.

This patch teaches dsymutil to look for DW_TAG_imported_modules and
records all references to parseable Swift ingterfrace files and copies
them to

  a.out.dSYM/Contents/Resources/<Arch>/<ModuleName>.swiftinterface

<rdar://problem/49751748>

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

5 years ago[InstCombine] Eliminate stores to constant memory
Philip Reames [Mon, 22 Apr 2019 20:28:19 +0000 (20:28 +0000)]
[InstCombine] Eliminate stores to constant memory

If we have a store to a piece of memory which is known constant, then we know the store must be storing back the same value. As a result, the store (or memset, or memmove) must either be down a dead path, or a noop. In either case, it is valid to simply remove the store.

The motivating case for this involves a memmove to a buffer which is constant down a path which is dynamically dead.

Note that I'm choosing to implement the less aggressive of two possible semantics here. We could simply say that the store *is undefined*, and prune the path. Consensus in the review was that the more aggressive form might be a good follow on change at a later date.

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

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

5 years ago[Support] unflake TempFileCollisions test
Bob Haarman [Mon, 22 Apr 2019 19:46:25 +0000 (19:46 +0000)]
[Support] unflake TempFileCollisions test

Summary:
This test was added to verify that createUniqueEntity() does
not enter an infinite loop when all possible names are taken. However,
it also checked that all possible names are generated, which is flaky
(because the names are generated randomly). This change increases the
number of attempts we make to make flakes exceedingly
unlikely (3.88e-62).

Reviewers: fedor.sergeev, rsmith

Reviewed By: fedor.sergeev

Subscribers: llvm-commits

Tags: #llvm

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

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

5 years ago[InstSimplify] Move masked.gather w/no active lanes handling to InstSimplify from...
Philip Reames [Mon, 22 Apr 2019 19:30:01 +0000 (19:30 +0000)]
[InstSimplify] Move masked.gather w/no active lanes handling to InstSimplify from InstCombine

In the process, use the existing masked.load combine which is slightly stronger, and handles a mix of zero and undef elements in the mask.

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

5 years agogn build: Merge r358869
Nico Weber [Mon, 22 Apr 2019 19:25:40 +0000 (19:25 +0000)]
gn build: Merge r358869

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

5 years agoUse const DebugLoc&
Matt Arsenault [Mon, 22 Apr 2019 19:14:27 +0000 (19:14 +0000)]
Use const DebugLoc&

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

5 years agoAMDGPU: Skip debug instructions in assert
Matt Arsenault [Mon, 22 Apr 2019 19:14:26 +0000 (19:14 +0000)]
AMDGPU: Skip debug instructions in assert

These are inserted after branch relaxation, and for some reason it's
decided to put them in the long branch expansion block. It's probably
not great to rely on the source block address, so this should probably
be switched to being PC relative instead of relying on the block
address

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

5 years ago[Tests] Revise a test as requested by reviewer in D59703
Philip Reames [Mon, 22 Apr 2019 18:51:58 +0000 (18:51 +0000)]
[Tests] Revise a test as requested by reviewer in D59703

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

5 years ago[Tests] Add a negative test for masked.gather part of D59703
Philip Reames [Mon, 22 Apr 2019 18:28:44 +0000 (18:28 +0000)]
[Tests] Add a negative test for masked.gather part of D59703

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

5 years ago[IPSCCP] Add missing `AssumptionCacheTracker` dependency
Justin Bogner [Mon, 22 Apr 2019 17:38:29 +0000 (17:38 +0000)]
[IPSCCP] Add missing `AssumptionCacheTracker` dependency

Back in August, r340525 introduced a dependency on the assumption
cache tracker in the ipsccp pass, but that commit missed a call to
INITIALIZE_PASS_DEPENDENCY, which leaves the assumption cache
improperly registered if SCCP is the only thing that pulls it in.

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

5 years ago[LPM/BPI] Preserve BPI through trivial loop pass pipeline (e.g. LCSSA, LoopSimplify)
Philip Reames [Mon, 22 Apr 2019 17:13:43 +0000 (17:13 +0000)]
[LPM/BPI] Preserve BPI through trivial loop pass pipeline (e.g. LCSSA, LoopSimplify)

Currently, we do not expose BPI to loop passes at all. In the old pass manager, we appear to have been ignoring the fact that LCSSA and/or LoopSimplify didn't preserve BPI, and making it available to the following loop passes anyways.  In the new one, it's invalidated before running any loop pass if either LCSSA or LoopSimplify actually make changes. If they don't make changes, then BPI is valid and available.  So, we go ahead and teach LCSSA and LoopSimplify how to preserve BPI for consistency between old and new pass managers.

This patch avoids an invalidation between the two requires in the following trivial pass pipeline:
opt -passes="requires<branch-prob>,loop(no-op-loop),requires<branch-prob>"
(when the input file is one which requires either LCSSA or LoopSimplify to canonicalize the loops)

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

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

5 years ago[PGO/SamplePGO][NFC] Move the function updateProfWeight from Instruction
Wei Mi [Mon, 22 Apr 2019 17:04:51 +0000 (17:04 +0000)]
[PGO/SamplePGO][NFC] Move the function updateProfWeight from Instruction
to CallInst.

The issue was raised here: https://reviews.llvm.org/D60903#1472783

The function Instruction::updateProfWeight is only used for CallInst in
profile update. From the current interface, it is very easy to think that
the function can also be used for branch instruction. However, Branch
instruction does't need the scaling the function provides for
branch_weights and VP (value profile), in addition, scaling may introduce
inaccuracy for branch probablity.

The patch moves the function updateProfWeight from Instruction class to
CallInst to remove the confusion. The patch also changes the scaling of
branch_weights from a loop to a block because we know that ProfileData
for branch_weights of CallInst will only have two operands at most.

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

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

5 years agoUse llvm::stable_sort. NFC
Fangrui Song [Mon, 22 Apr 2019 15:53:43 +0000 (15:53 +0000)]
Use llvm::stable_sort. NFC

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

5 years agoRemove spurious semicolons; NFC.
Aaron Ballman [Mon, 22 Apr 2019 15:31:09 +0000 (15:31 +0000)]
Remove spurious semicolons; NFC.

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

5 years agoAMDGPU/GlobalISel: Fix non-power-of-2 G_EXTRACT sources
Matt Arsenault [Mon, 22 Apr 2019 15:22:46 +0000 (15:22 +0000)]
AMDGPU/GlobalISel: Fix non-power-of-2 G_EXTRACT sources

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

5 years agoSTLExtras: add stable_sort wrappers
Fangrui Song [Mon, 22 Apr 2019 15:19:13 +0000 (15:19 +0000)]
STLExtras: add stable_sort wrappers

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

5 years agoGlobalISel: Legalize scalar G_EXTRACT sources
Matt Arsenault [Mon, 22 Apr 2019 15:10:42 +0000 (15:10 +0000)]
GlobalISel: Legalize scalar G_EXTRACT sources

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

5 years agollvm-undname: Fix an assert-on-invalid, found by oss-fuzz
Nico Weber [Mon, 22 Apr 2019 15:05:18 +0000 (15:05 +0000)]
llvm-undname: Fix an assert-on-invalid, found by oss-fuzz

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

5 years agoAMDGPU: Fix not checking for copy when looking at copy src
Matt Arsenault [Mon, 22 Apr 2019 14:54:39 +0000 (14:54 +0000)]
AMDGPU: Fix not checking for copy when looking at copy src

Effectively reverts r356956. The check for isFullCopy was excessive,
but there still needs to be a check that this is a copy.

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

5 years ago[AMDGPU][MC] Corrected parsing of SP3 'neg' modifier
Dmitry Preobrazhensky [Mon, 22 Apr 2019 14:35:47 +0000 (14:35 +0000)]
[AMDGPU][MC] Corrected parsing of SP3 'neg' modifier

See bug 41156: https://bugs.llvm.org/show_bug.cgi?id=41156

Reviewers: artem.tamazov, arsenm

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

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

5 years ago[TargetLowering][AMDGPU][X86] Improve SimplifyDemandedBits bitcast handling
Simon Pilgrim [Mon, 22 Apr 2019 14:04:35 +0000 (14:04 +0000)]
[TargetLowering][AMDGPU][X86] Improve SimplifyDemandedBits bitcast handling

This patch adds support for BigBitWidth -> SmallBitWidth bitcasts, splitting the DemandedBits/Elts accordingly.

The AMDGPU backend needed an extra  (srl (and x, c1 << c2), c2) -> (and (srl(x, c2), c1) combine to encourage BFE creation, I investigated putting this in DAGCombine but it caused a lot of noise on other targets - some improvements, some regressions.

The X86 changes are all definite wins.

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

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

5 years ago[DAGCombiner] make variable name less ambiguous; NFC
Sanjay Patel [Mon, 22 Apr 2019 13:42:50 +0000 (13:42 +0000)]
[DAGCombiner] make variable name less ambiguous; NFC

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

5 years ago[DAGCombiner] prepare shuffle-of-splat to handle more patterns; NFC
Sanjay Patel [Mon, 22 Apr 2019 13:36:07 +0000 (13:36 +0000)]
[DAGCombiner] prepare shuffle-of-splat to handle more patterns; NFC

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

5 years ago[LLVM-C] Add accessors to the default floating-point metadata node
Robert Widmann [Mon, 22 Apr 2019 13:13:22 +0000 (13:13 +0000)]
[LLVM-C] Add accessors to the default floating-point metadata node

Summary: Add a getter and setter pair for floating-point accuracy metadata.

Reviewers: whitequark, deadalnix

Reviewed By: whitequark

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

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

5 years ago[NewPM] Add Option handling for SimpleLoopUnswitch
Serguei Katkov [Mon, 22 Apr 2019 10:35:07 +0000 (10:35 +0000)]
[NewPM] Add Option handling for SimpleLoopUnswitch

This patch enables passing options to SimpleLoopUnswitch via the passes pipeline.

Reviewers: chandlerc, fedor.sergeev, leonardchan, philip.pfaffe
Reviewed By: fedor.sergeev
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D60676

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

5 years ago[AMDGPU] Regenerate uitofp i8 to float conversion tests.
Simon Pilgrim [Mon, 22 Apr 2019 10:19:09 +0000 (10:19 +0000)]
[AMDGPU] Regenerate uitofp i8 to float conversion tests.

Prep work for D60462

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

5 years ago[NewPM] Add dummy Test for LoopVectorize option parsing.
Serguei Katkov [Mon, 22 Apr 2019 09:53:26 +0000 (09:53 +0000)]
[NewPM] Add dummy Test for LoopVectorize option parsing.

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

5 years agoRevert "[ConstantRange] Rename make{Guaranteed -> Exact}NoWrapRegion() NFC"
Nikita Popov [Mon, 22 Apr 2019 09:01:38 +0000 (09:01 +0000)]
Revert "[ConstantRange] Rename make{Guaranteed -> Exact}NoWrapRegion() NFC"

This reverts commit 7bf4d7c07f2fac862ef34c82ad0fef6513452445.

After thinking about this more, this isn't right, the range is not exact
in the same sense as makeExactICmpRegion(). This needs a separate
function.

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

5 years ago[ConstantRange] Rename make{Guaranteed -> Exact}NoWrapRegion() NFC
Nikita Popov [Mon, 22 Apr 2019 08:36:05 +0000 (08:36 +0000)]
[ConstantRange] Rename make{Guaranteed -> Exact}NoWrapRegion() NFC

Following D60632 makeGuaranteedNoWrapRegion() always returns an
exact nowrap region. Rename the function accordingly. This is in
line with the naming of makeExactICmpRegion().

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

5 years ago[X86] Reject 512-bit types in getRegForInlineAsmConstraint when AVX512 is not enabled...
Craig Topper [Mon, 22 Apr 2019 06:12:02 +0000 (06:12 +0000)]
[X86] Reject 512-bit types in getRegForInlineAsmConstraint when AVX512 is not enabled. Same for 256 bit and AVX.

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

5 years ago[JITLink] Remove a lot of reduntant 'JITLink_' prefixes. NFC.
Lang Hames [Mon, 22 Apr 2019 03:03:09 +0000 (03:03 +0000)]
[JITLink] Remove a lot of reduntant 'JITLink_' prefixes. NFC.

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

5 years ago[cmake] Add llvm-jit to LLVM_TEST_DEPENDS
Fangrui Song [Mon, 22 Apr 2019 02:23:09 +0000 (02:23 +0000)]
[cmake] Add llvm-jit to LLVM_TEST_DEPENDS

Otherwise llvm-jit would say "utils/lit/lit/llvm/subst.py:127: note: Did not find llvm-jitlink in ..."

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

5 years ago[JITLink] Fix section start address calculation in eh-frame recorder.
Lang Hames [Mon, 22 Apr 2019 01:35:16 +0000 (01:35 +0000)]
[JITLink] Fix section start address calculation in eh-frame recorder.

Section atoms are not sorted, so we need to scan the whole section to find the
start address.

No test case: Found by inspection, and any reproduction would depend on pointer
ordering.

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

5 years agoAttemp get llvm-jitlink building on Windows
Nico Weber [Sun, 21 Apr 2019 23:50:24 +0000 (23:50 +0000)]
Attemp get llvm-jitlink building on Windows

By removing an include of dlfcn.h that looks unused.

And clang-format a too-long line while here.

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

5 years ago[JITLink] Add an option to dump relocated section content.
Lang Hames [Sun, 21 Apr 2019 20:34:19 +0000 (20:34 +0000)]
[JITLink] Add an option to dump relocated section content.

The -dump-relocated-section-content option will dump the contents of each
section after relocations are applied, and before any checks are run or
code executed.

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

5 years agogn build: Re-run `git ls-files '*.gn' '*.gni' | xargs llvm/utils/gn/gn.py format`
Nico Weber [Sun, 21 Apr 2019 20:14:21 +0000 (20:14 +0000)]
gn build: Re-run `git ls-files '*.gn' '*.gni' | xargs llvm/utils/gn/gn.py format`

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

5 years agogn build: Merge r358749
Nico Weber [Sun, 21 Apr 2019 20:08:45 +0000 (20:08 +0000)]
gn build: Merge r358749

Since the symlinks list for llvm-symbolizer is now never empty,
the :symlinks target no longer needs an explicit dep on :llvm-symbolizer
-- there will be at least one dep on a symlink, and each symlink depends
on :llvm-symbolizer already.

Since llvm-symbolizer:symlinks now produces symlinks that check-llvm
uses, make llvm/test depend on the symlink target.

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

5 years agogn build: Merge r358818 (JITLink)
Nico Weber [Sun, 21 Apr 2019 19:45:37 +0000 (19:45 +0000)]
gn build: Merge r358818 (JITLink)

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

5 years ago[cmake] Fix bug in r358779 - [CMake] Pass monorepo build settings in cross compile
Don Hinton [Sun, 21 Apr 2019 19:20:13 +0000 (19:20 +0000)]
[cmake] Fix bug in r358779 - [CMake] Pass monorepo build settings in cross compile

Escape semicolons in the targets list so that cmake doesn't expand
them to spaces.

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

5 years agollvm-undname: Fix hex escapes in wchar_t, char16_t, char32_t strings
Nico Weber [Sun, 21 Apr 2019 17:19:27 +0000 (17:19 +0000)]
llvm-undname: Fix hex escapes in wchar_t, char16_t, char32_t strings

llvm-undname used to put '\x' in front of every pair of nibbles, but
u"\xD7\xFF" produces a string with 6 bytes: \xD7 \0 \xFF \0 (and \0\0). Correct
for a single character (plus terminating \0) is u\xD7FF instead.
Now, wchar_t, char16_t, and char32_t strings roundtrip from source to
clang-cl (and cl.exe) and then llvm-undname.

(...at least as long as it's not a string like L"\xD7FF" L"foo" which
gets demangled as L"\xD7FFfoo", where the compiler then considers the
"f" as part of the hex escape. That seems ok.)

Also add a comment saying that the "almost-valid" char32_t string I
added in my last commit is actually produced by compilers.

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

5 years agollvm-undname: Fix stack overflow on almost-valid
Nico Weber [Sun, 21 Apr 2019 16:58:25 +0000 (16:58 +0000)]
llvm-undname: Fix stack overflow on almost-valid

If a unsigned with all 4 bytes non-0 was passed to outputHex(), there
were two off-by-ones in it:

- Both MaxPos and Pos left space for the final \0, which left the buffer
  one byte to small. Set MaxPos to 16 instead of 15 to fix.

- The `assert(Pos >= 0);` was after a `Pos--`, move it up one line.

Since valid Unicode codepoints are <= 0x10ffff, this could never really
happen in practice.

Found by oss-fuzz.

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

5 years ago[ConstantRange] Add saturating add/sub methods
Nikita Popov [Sun, 21 Apr 2019 15:23:05 +0000 (15:23 +0000)]
[ConstantRange] Add saturating add/sub methods

Add support for uadd_sat and friends to ConstantRange, so we can
handle uadd.sat and friends in LVI. The implementation is forwarding
to the corresponding APInt methods with appropriate bounds.

One thing worth pointing out here is that the handling of wrapping
ranges is not maximally accurate. A simple example is that adding 0
to a wrapped range will return a full range, rather than the original
wrapped range. The tests also only check that the non-wrapping
envelope is correct and minimal.

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

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

5 years ago[ConstantRange] Add getNonEmpty() constructor
Nikita Popov [Sun, 21 Apr 2019 15:22:54 +0000 (15:22 +0000)]
[ConstantRange] Add getNonEmpty() constructor

ConstantRanges have an annoying special case: If upper and lower are
the same, it can be either an empty or a full set. When constructing
constant ranges nearly always a full set is intended, but this still
requires an explicit check in many places.

This revision adds a getNonEmpty() constructor that disambiguates this
case: If upper and lower are the same, a full set is created.

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

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

5 years ago[AArch64] add tests with multiple binop+splat vals; NFC
Sanjay Patel [Sun, 21 Apr 2019 15:01:19 +0000 (15:01 +0000)]
[AArch64] add tests with multiple binop+splat vals; NFC

See D60890 for context.

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

5 years agollvm-undname: Fix stack overflow on invalid found by oss-fuzz
Nico Weber [Sun, 21 Apr 2019 14:25:07 +0000 (14:25 +0000)]
llvm-undname: Fix stack overflow on invalid found by oss-fuzz

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

5 years agogn build: Fix build after r358837
Nico Weber [Sun, 21 Apr 2019 14:07:13 +0000 (14:07 +0000)]
gn build: Fix build after r358837

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

5 years ago[ARM] Rewrite isLegalT2AddressImmediate
David Green [Sun, 21 Apr 2019 09:54:29 +0000 (09:54 +0000)]
[ARM] Rewrite isLegalT2AddressImmediate

This does two main things, firstly adding some at least basic addressing modes
for i64 types, and secondly treats floats and doubles sensibly when there is no
fpu. The floating point change can help codesize in some cases, especially with
D60294.

Most backends seems to not consider the exact VT in isLegalAddressingMode,
instead switching on type size. That is now what this does when the target does
not have an fpu (as the float data will be loaded using LDR's). i64's currently
use the address range of an LDRD (even though they may be legalised and loaded
with an LDR). This is at least better than marking them all as illegal
addressing modes.

I have not attempted to do much with vectors yet. That will need changing once
MVE is added.

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

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

5 years ago[X86] Add the rounding control operand to the printing for some scalar FMA instructions.
Craig Topper [Sun, 21 Apr 2019 07:12:56 +0000 (07:12 +0000)]
[X86] Add the rounding control operand to the printing for some scalar FMA instructions.

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

5 years ago[CachePruning] Simplify comparator
Fangrui Song [Sun, 21 Apr 2019 06:17:40 +0000 (06:17 +0000)]
[CachePruning] Simplify comparator

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

5 years ago[JITLink] Add dependency on MCParser to unit test after rL358818
Fangrui Song [Sun, 21 Apr 2019 06:12:00 +0000 (06:12 +0000)]
[JITLink] Add dependency on MCParser to unit test after rL358818

This is required by -DBUILD_SHARED_LIBS=on builds for createMCAsmParser.

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

5 years ago[X86] Don't form masked vfpclass instruction from and+vfpclass unless the fpclass...
Craig Topper [Sun, 21 Apr 2019 05:18:04 +0000 (05:18 +0000)]
[X86] Don't form masked vfpclass instruction from and+vfpclass unless the fpclass only has a single use.

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