Jessica Paquette [Tue, 23 Apr 2019 18:20:47 +0000 (18:20 +0000)]
[AArch64][GlobalISel] Teach regbankselect about G_INTRINSIC_TRUNC
Add it to isPreISelGenericFloatingPointOpcode, and add a regbankselect test.
Update arm64-vfloatintrinsics.ll now that we can select it.
llvm-svn: 359022
Jessica Paquette [Tue, 23 Apr 2019 18:20:44 +0000 (18:20 +0000)]
[AArch64][GlobalISel] Legalize G_INTRINSIC_TRUNC
Same patch as G_FCEIL etc.
Add the missing switch case in widenScalar, add G_INTRINSIC_TRUNC to the correct
rule in AArch64LegalizerInfo.cpp, and add a test.
llvm-svn: 359021
Eric Fiselier [Tue, 23 Apr 2019 18:01:58 +0000 (18:01 +0000)]
Fix implementation of ::abs and std::abs LWG 2192.
Summary:
All overloads of `::abs` and `std::abs` must be present in both `<cmath>` and `<cstdlib>`. This is problematic to implement because C defines `fabs` in `math.h` and `labs` in `stdlib.h`. This introduces a circular dependency between the two headers.
This patch implements that requirement by moving `abs` into `math.h` and making `stdlib.h` include `math.h`. In order to get the underlying C declarations from the "real" `stdlib.h` inside our `math.h` we need some trickery. Specifically we need to make `stdlib.h` include next itself.
Suggestions for a cleaner implementation are welcome.
Reviewers: mclow.lists, ldionne
Reviewed By: ldionne
Subscribers: krytarowski, fedor.sergeev, dexonsmith, jdoerfert, jsji, libcxx-commits
Differential Revision: https://reviews.llvm.org/D60097
llvm-svn: 359020
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
llvm-svn: 359019
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.
llvm-svn: 359018
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
llvm-svn: 359017
Jonas Devlieghere [Tue, 23 Apr 2019 17:44:40 +0000 (17:44 +0000)]
[Reproducers] Limit logging to calls that cross the API boundary.
We recently moved API logging into the instrumentation macros. This made
that logging is now consistent and abstracted behind a macro for every
API functions, independent of the reproducers. It also means we have a
lot more output. While this is a good thing, it also meant a lot more
noise in the log, from things that aren't always equally interesting,
such as the copy constructor for example.
To improve usability, we should increase the signal-to-noise ratio. I
propose to achieve this by only logging API functions that cross the API
boundary. This is a divergence of what we had before, where a select
number of functions were logged, irregardless of the API boundary, a
concept that was introduced for the reproducers. However, I believe this
is in line with the purpose of the API log.
Differential revision: https://reviews.llvm.org/D60984
llvm-svn: 359016
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.
llvm-svn: 359015
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
llvm-svn: 359014
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.
llvm-svn: 359013
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
llvm-svn: 359012
Davide Italiano [Tue, 23 Apr 2019 16:51:20 +0000 (16:51 +0000)]
Revert "[EditLineTest] Not always TERM is available, e.g. on some bots."
This was a speculative fix trying to placate some bots, but it's
ultimately just a bot configuration problem and not a code problem.
llvm-svn: 359011
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>
llvm-svn: 359010
Nico Weber [Tue, 23 Apr 2019 16:37:42 +0000 (16:37 +0000)]
MS ABI: Support mangling op<=> now that MSVC 2019 has a mangling
llvm-svn: 359009
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.
llvm-svn: 359008
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.
llvm-svn: 359007
Sanjay Patel [Tue, 23 Apr 2019 16:16:16 +0000 (16:16 +0000)]
[x86] add tests for vector fdiv with splat divisor; NFC
llvm-svn: 359006
Jonas Devlieghere [Tue, 23 Apr 2019 16:00:43 +0000 (16:00 +0000)]
[Docs] Add missing leading slash
llvm-svn: 359005
Jonas Devlieghere [Tue, 23 Apr 2019 15:57:47 +0000 (15:57 +0000)]
[Docs] Add 301 redirects for old URLs
llvm-svn: 359004
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>
llvm-svn: 359003
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."
llvm-svn: 359002
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>
llvm-svn: 359001
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
llvm-svn: 359000
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
llvm-svn: 358999
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.
llvm-svn: 358998
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.
llvm-svn: 358997
Fangrui Song [Tue, 23 Apr 2019 14:51:27 +0000 (14:51 +0000)]
Use llvm::stable_sort
While touching the code, simplify if feasible.
llvm-svn: 358996
Sam Clegg [Tue, 23 Apr 2019 14:49:38 +0000 (14:49 +0000)]
[WebAssembly] Fix typo in relocation checking
Runtime relocation are generated for relocations of type
R_WASM_MEMORY_ADDR_I32 when in PIC mode (either -shared or -pie).
Followup on https://reviews.llvm.org/D60882.
Differential Revision: https://reviews.llvm.org/D60992
llvm-svn: 358995
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
llvm-svn: 358994
Nico Weber [Tue, 23 Apr 2019 14:32:18 +0000 (14:32 +0000)]
gn build: Merge r358944
llvm-svn: 358993
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.
llvm-svn: 358992
Nico Weber [Tue, 23 Apr 2019 14:31:15 +0000 (14:31 +0000)]
gn build: Merge r358949
llvm-svn: 358991
George Rimar [Tue, 23 Apr 2019 14:21:31 +0000 (14:21 +0000)]
[LLD][ELF] - Remove dynamic-section-sh_size.elf binary, convert test to yaml. NFCI.
dynamic-section-sh_size.elf was introduced in D25090.
Now it is possible to use yaml2obj instead.
That is what this patch does.
Also I added one more case of a possibly broken .dynamic
section just in case.
llvm-svn: 358990
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.
llvm-svn: 358989
Louis Dionne [Tue, 23 Apr 2019 14:05:04 +0000 (14:05 +0000)]
[libc++] Remove redundant conditionals for Apple platforms
Summary:
In a bunch of places, we used to check whether LIBCXX_BUILDING_LIBCXXABI
is defined OR we're building for an Apple platform. This used to
be necessary in a time when Apple's build script did NOT define
LIBCXX_BUILDING_LIBCXXABI. However this is not relevant anymore
since Apple's build does define LIBCXX_BUILDING_LIBCXXABI.
Reviewers: EricWF
Subscribers: christof, jkorous, dexonsmith, libcxx-commits
Tags: #libc
Differential Revision: https://reviews.llvm.org/D60842
llvm-svn: 358988
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++.
llvm-svn: 358987
Roman Lebedev [Tue, 23 Apr 2019 13:46:18 +0000 (13:46 +0000)]
[Docs] ReleaseNotes: fixup markup in memcmp()->bcmp() entry
llvm-svn: 358986
George Rimar [Tue, 23 Apr 2019 13:27:54 +0000 (13:27 +0000)]
[LLD][ELF] - Remove file-class.a binary from inputs and improve the test case.
file-class.a was used to diagnose the "corrupted ELF file: invalid file class"
error when the object was fetched from the archive.
file-class.a contained an object of 16 bytes size. I replaced it with
an echo call (because it is impossible to use yaml2obj for that, and I am
not sure it is worth to support), and also increased its size to 18 bytes.
That allowed to also test a case when such object is a regular input and not an
archive member (we have a bit different logic for these cases).
llvm-svn: 358985
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.
llvm-svn: 358984
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
llvm-svn: 358983
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
llvm-svn: 358982
Andrew Ng [Tue, 23 Apr 2019 12:38:52 +0000 (12:38 +0000)]
[ELF] Change default output section type to SHT_PROGBITS
This fixes an issue where a symbol only section at the start of a
PT_LOAD segment, causes incorrect alignment of the file offset for the
start of the segment which results in the output of an invalid ELF.
SHT_PROGBITS was the default output section type in the past.
Differential Revision: https://reviews.llvm.org/D60131
llvm-svn: 358981
Alexandre Ganea [Tue, 23 Apr 2019 12:30:49 +0000 (12:30 +0000)]
[LLD][COFF] Fix /linkrepro with output options that take a filename or path
The following options: /pdb, /out or /implib now emit in the repro.tar/response.txt only a filename stripped from its path, to avoid non-existent paths on the reproducer's machine.
Differential Revision: https://reviews.llvm.org/D59530
llvm-svn: 358980
Andrew Ng [Tue, 23 Apr 2019 12:17:15 +0000 (12:17 +0000)]
[ELF] Change findOrphanPos to only consider live sections
This patch changes the behaviour of findOrphanPos to only consider live
sections when placing orphan sections. This used to be how it behaved in
the past.
Differential Revision: https://reviews.llvm.org/D60273
llvm-svn: 358979
Aaron Ballman [Tue, 23 Apr 2019 12:16:28 +0000 (12:16 +0000)]
Removing the explicit specifier from some default constructors; NFC.
llvm-svn: 358978
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
llvm-svn: 358977
Pavel Labath [Tue, 23 Apr 2019 11:50:07 +0000 (11:50 +0000)]
Move postfix expression code out of the NativePDB plugin
Summary:
The NativePDB plugin contains code to convert "programs" describing the
layout of function frames into dwarf (for easier interaction with the
rest of lldb). This functionality is useful for the Breakpad plugin too,
as it contains the same kind of expressions (because breakpad info is
generated from pdb files).
In this patch, I move the core classes of this code into a common place,
where it can be used from both files. Previously, these were the details
of the implementation, but here I am exposing them (instead of just a
single "string->string" conversion function), as breakpad will need to
use these in a slightly different way. The reason for that is that
breakpad files generated from dwarf expressions use a slightly different
syntax, although most of the core code can be reused with a bit of
thought.
This is also the reason why I am not moving the parsing or dwarf
generation bits, as they will need to be generalized a bit before
they're usable for both scenarios.
This patch should be NFC, modulo renaming the moved entities to more
neutral names.
The reason I am moving this to the "Symbol" library, is because both
customers will be "Symbol"Files, and also the unwinding code lives in
the Symbol library. From a purely dependency standpoint this code will
probably be standalone, and so it could be moved all the way to Utility,
but that seems too low for this kind of functionality.
Reviewers: jasonmolenda, amccarth, clayborg, JDevlieghere, aleksandr.urakov
Subscribers: aprantl, markmentovai, lldb-commits
Differential Revision: https://reviews.llvm.org/D60599
llvm-svn: 358976
Fangrui Song [Tue, 23 Apr 2019 11:47:28 +0000 (11:47 +0000)]
[PPC][PPC64] Improve some llvm-objdump -d -D tests
Various improvement:
Some offsets in disassembly are incorrect after several layout adjustment. Fix them.
llvm-objdump -D should not be used. -D dumps unrelated non-text sections. Replace them with llvm-objdump -d, llvm-readelf -x, etc
Many llvm-objdump -d tests use {{.*}} . Add the option --no-show-raw-insn to avoid check hex bytes.
ppc64-long-branch.s does not need a shared object. Delete it.
Make ppc64-ifunc.s check 2 ifuncs.
Reviewers: ruiu, espindola
Subscribers: emaste, nemanjai, arichardson, kbarton, jsji, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D60998
llvm-svn: 358975
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
llvm-svn: 358974
Simon Pilgrim [Tue, 23 Apr 2019 11:45:28 +0000 (11:45 +0000)]
Fix "-Wimplicit-fallthrough" warning. NFCI.
llvm-svn: 358973
George Rimar [Tue, 23 Apr 2019 11:19:51 +0000 (11:19 +0000)]
[LLD][ELF] - Fix mips-invalid-options-descriptor.s test case and convert to YAML.
It was initially introduced in D25229 to report the "zero option descriptor size"
error message. In following commits it was broken and did not report this
error anymore. I think that happened because elf object was a result of fuzzing
and it was broken in many ways.
This patch converts this test to a YAML, removes a binary and hence fixes the
original intention.
llvm-svn: 358972
Adam Balogh [Tue, 23 Apr 2019 11:18:50 +0000 (11:18 +0000)]
[Analyzer] Second fix for last commit for IteratorChecker
A variable was redeclared instead of assigned in an internal
block, leaving the original uninitialized. This is fixed now.
llvm-svn: 358971
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.
llvm-svn: 358970
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.
llvm-svn: 358969
Rafael Stahl [Tue, 23 Apr 2019 11:04:41 +0000 (11:04 +0000)]
[analyzer][CrossTU] Extend CTU to VarDecls with initializer
Summary:
The existing CTU mechanism imports `FunctionDecl`s where the definition is available in another TU. This patch extends that to VarDecls, to bind more constants.
- Add VarDecl importing functionality to CrossTranslationUnitContext
- Import Decls while traversing them in AnalysisConsumer
- Add VarDecls to CTU external mappings generator
- Name changes from "external function map" to "external definition map"
Reviewers: NoQ, dcoughlin, xazax.hun, george.karpenkov, martong
Reviewed By: xazax.hun
Subscribers: Charusso, baloghadamsoftware, mikhail.ramalho, Szelethus, donat.nagy, dkrupp, george.karpenkov, mgorny, whisperity, szepet, rnkovacs, a.sidorin, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D46421
llvm-svn: 358968
Pavel Labath [Tue, 23 Apr 2019 10:04:22 +0000 (10:04 +0000)]
modify-python-lldb: Remove \a-removing code
instead, remove \a directly from the interface files.
llvm-svn: 358967
George Rimar [Tue, 23 Apr 2019 10:03:09 +0000 (10:03 +0000)]
[LLD][ELF] - Remove multiple-eh-relocs.elf binary from the inputs. NFCI.
Introduced multiple-relocations-sections.test based on YAML instead.
llvm-svn: 358966
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
llvm-svn: 358965
Pavel Labath [Tue, 23 Apr 2019 09:57:14 +0000 (09:57 +0000)]
FuncUnwinders: remove "current_offset" from function arguments
Summary:
This argument was added back in 2010 (r118882) to support the ability to unwind
from functions whose eh_frame entry does not cover the entire range of
the function.
However, due to the caching happening in FuncUnwinders, this solution is
very fragile. FuncUnwinders will cache the plan it got from eh_frame
regardless of the value of the current_offset, so our ability to unwind
from a given function depended what was the value of "current_offset" the
first time that this function was called.
Furthermore, since the "image show-unwind" command did not know what's
the right offset to pass, this created an unfortunate situation where
"image show-unwind" would show no valid plans for a function, even
though they were available and being used.
In this patch I implement the feature slightly differently. Instead of
giving just a base address to the eh_frame unwinder, I give it the
entire range we are interested in. Then, I change the unwinder to return
the first plan that covers (even partially) that range. This way even a
partial plan will be returned, regardless of the address in the function
where we are stopped at.
This solution is still not 100% correct, as it will not handle a
function which is covered by two independent fde entries. However, I
don't expect anybody will write this kind of functions, and this wasn't
handled by the previous implementation either. If this is ever needed in
the future. The eh_frame unwinder can be extended to return "composite"
unwind plans created by merging sevelar fde entries.
I also create a test which triggers this scenario. As doing this is
virtually impossible without hand-written assembly, the test only works
on x86 linux.
Reviewers: jasonmolenda, clayborg
Subscribers: lldb-commits
Differential Revision: https://reviews.llvm.org/D60829
llvm-svn: 358964
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
llvm-svn: 358963
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
llvm-svn: 358962
George Rimar [Tue, 23 Apr 2019 09:30:26 +0000 (09:30 +0000)]
[LLD][ELF] - Update test case after llvm-mc change.
rL358960 "[llvm-mc] - Properly set the the address align field of the compressed sections."
changed the sh_addralign field of the "zlib" compressed debug sections.
llvm-svn: 358961
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
llvm-svn: 358960
Pavel Labath [Tue, 23 Apr 2019 09:16:51 +0000 (09:16 +0000)]
UnwindPlan: pretty-print dwarf expressions
Summary:
Previously we were printing the dwarf expressions in unwind rules simply
as "dwarf-expr". This patch uses the existing dwarf-printing
capabilities in lldb to enhance this dump output, and print the full
decoded dwarf expression.
Reviewers: jasonmolenda, clayborg
Subscribers: aprantl, lldb-commits
Differential Revision: https://reviews.llvm.org/D60949
llvm-svn: 358959
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
llvm-svn: 358958
Pavel Labath [Tue, 23 Apr 2019 08:49:39 +0000 (08:49 +0000)]
yamlify TestMiniDumpUUID binaries
Summary:
Instead of checking in raw minidump binaries, check in their yaml form,
and call yaml2obj in the test.
Reviewers: clayborg
Subscribers: javed.absar, lldb-commits
Differential Revision: https://reviews.llvm.org/D60948
llvm-svn: 358957
Adam Balogh [Tue, 23 Apr 2019 07:45:10 +0000 (07:45 +0000)]
[Analyzer] Fix for previous commit
A compilation warning was in my previous commit which broke the buildbot
because it is using `-Werror` for compilation. This patch fixes this
issue.
llvm-svn: 358955
Fangrui Song [Tue, 23 Apr 2019 07:39:23 +0000 (07:39 +0000)]
[PowerPC] Fix test with -fno-discard-value-names after rC358949
For the clang driver, -DLLVM_ENABLE_ASSERTIONS=off builds default to discard value names.
llvm-svn: 358953
Adam Balogh [Tue, 23 Apr 2019 07:15:55 +0000 (07:15 +0000)]
[Analyzer] Instead of recording comparisons in interator checkers do an eager state split
Currently iterator checkers record comparison of iterator positions
and process them for keeping track the distance between them (e.g.
whether a position is the same as the end position). However this
makes some processing unnecessarily complex and it is not needed at
all: we only need to keep track between the abstract symbols stored
in these iterator positions. This patch changes this and opens the
path to comparisons to the begin() and end() symbols between the
container (e.g. size, emptiness) which are stored as symbols, not
iterator positions. The functionality of the checker is unchanged.
Differential Revision: https://reviews.llvm.org/D53701
llvm-svn: 358951
Fangrui Song [Tue, 23 Apr 2019 06:31:44 +0000 (06:31 +0000)]
[PPC64] Allow R_PPC64_DTPREL* to preemptable local-dynamic symbols
Similar to D60945.
Differential Revision: https://reviews.llvm.org/D60994
llvm-svn: 358950
Qiu Chaofan [Tue, 23 Apr 2019 05:50:24 +0000 (05:50 +0000)]
[PowerPC] [Clang] Port MMX intrinsics and basic test cases to Power
Port mmintrin.h which include x86 MMX intrinsics implementation to PowerPC platform (using Altivec).
To make the include process correct, PowerPC's toolchain class is overrided to insert new headers directory (named ppc_wrappers) into the path. Basic test cases for several intrinsic functions are added.
The header is mainly developed by Steven Munroe, with contributions from Paul Clarke, Bill Schmidt, Jinsong Ji and Zixuan Wu.
Reviewed By: Jinsong Ji
Differential Revision: https://reviews.llvm.org/D59924
llvm-svn: 358949
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
llvm-svn: 358948
Artem Dergachev [Tue, 23 Apr 2019 02:56:00 +0000 (02:56 +0000)]
[analyzer] Unbreak body farms in presence of multiple declarations.
When growing a body on a body farm, it's essential to use the same redeclaration
of the function that's going to be used during analysis. Otherwise our
ParmVarDecls won't match the ones that are used to identify argument regions.
This boils down to trusting the reasoning in AnalysisDeclContext. We shouldn't
canonicalize the declaration before farming the body because it makes us not
obey the sophisticated decision-making process of AnalysisDeclContext.
Differential Revision: https://reviews.llvm.org/D60899
llvm-svn: 358946
Artem Dergachev [Tue, 23 Apr 2019 02:50:38 +0000 (02:50 +0000)]
[analyzer] PR41335: Fix crash when no-store event is in a body-farmed function.
Stuffing invalid source locations (such as those in functions produced by
body farms) into path diagnostics causes crashes.
Fix a typo in a nearby function name.
Differential Revision: https://reviews.llvm.org/D60808
llvm-svn: 358945
Artem Dergachev [Tue, 23 Apr 2019 02:45:42 +0000 (02:45 +0000)]
[analyzer] PR41269: Add a bit of C++ smart pointer modeling.
Implement cplusplus.SmartPtrModeling, a new checker that doesn't
emit any warnings but models methods of smart pointers more precisely.
For now the only thing it does is make `(bool) P` return false when `P`
is a freshly moved pointer. This addresses a false positive in the
use-after-move-checker.
Differential Revision: https://reviews.llvm.org/D60796
llvm-svn: 358944
Fangrui Song [Tue, 23 Apr 2019 02:42:06 +0000 (02:42 +0000)]
Use llvm::stable_sort
Make some small adjustment while touching the code: make parameters
const, use less_first(), etc.
Differential Revision: https://reviews.llvm.org/D60989
llvm-svn: 358943
Qiu Chaofan [Tue, 23 Apr 2019 02:37:48 +0000 (02:37 +0000)]
add Qiu Chaofan (qiucf@cn.ibm.com) to the CREDITS.txt
llvm-svn: 358942
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.
llvm-svn: 358940
Jason Molenda [Tue, 23 Apr 2019 01:13:27 +0000 (01:13 +0000)]
One small tweak to LocateExecutableScriptingResources - I
was still stat'ing the possibly-dSYM FileSpec before I
(more cheaply) checked the filepath for telltale dSYM
components.
<rdar://problem/
50086007>
llvm-svn: 358939
Jason Molenda [Tue, 23 Apr 2019 01:02:51 +0000 (01:02 +0000)]
Add a small check to PlatformDarwin::LoadScriptingResourceForModule
which reads the python files in a dSYM bundle, to check that the
SymbolFile is actually a dSYM bundle filepath; delay any fetching
of the ScriptInterpreter until after we've done that check.
When debugging a binary without a dSYM on darwin systems, the
SymbolFile we fetch is actually the ObjectFile -- so we would do
an unnecessary trip into Python land and stat around the filesystem
looking for a python file to read in. There's no reason to do any
of this unless the SymbolFile's file path includes the .dSYM bundle
telltale path components.
<rdar://problem/
50065315>
llvm-svn: 358938
Louis Dionne [Tue, 23 Apr 2019 00:03:34 +0000 (00:03 +0000)]
[libc++abi] Don't use a .sh.cpp test for uncaught_exception
Otherwise, we don't seem to get the DYLD_LIBRARY_PATH set up correctly
and the tests are run against the system libc++abi dylib.
llvm-svn: 358937
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
llvm-svn: 358935
Adrian Prantl [Mon, 22 Apr 2019 22:51:34 +0000 (22:51 +0000)]
Fully qualify llvm::Optional, some compilers complain otherwise.
llvm-svn: 358933
Richard Smith [Mon, 22 Apr 2019 22:50:11 +0000 (22:50 +0000)]
[c++2a] Implement semantic restrictions for 'export' declarations.
llvm-svn: 358932
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
llvm-svn: 358931
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().
llvm-svn: 358930
Jason Molenda [Mon, 22 Apr 2019 22:42:29 +0000 (22:42 +0000)]
Fix a bug in my change to ModulesDidLoad in r357955.
In the process of hoisting the LoadScriptingResourceForModule
out of Target::ModuleAdded and into Target::ModulesDidLoad,
I had ModulesDidLoad fetching the Target's entire image list
and look for scripting resources in those -- instead of only
looking for scripting resources in the modules that had
been added to the target's image list.
<rdar://problem/
50065315>
llvm-svn: 358929
Jonas Devlieghere [Mon, 22 Apr 2019 22:41:55 +0000 (22:41 +0000)]
[Docs] Move API docs to the front page
This moves the links to the C++ and Python API docs up to the main page.
As of now the links are still broken [1], but at least this will prevent
the additional frustration of searching for the links only to find out
they're broken.
[1] http://lists.llvm.org/pipermail/lldb-dev/2019-April/014992.html
llvm-svn: 358928
Adrian Prantl [Mon, 22 Apr 2019 22:40:37 +0000 (22:40 +0000)]
Try to work around compile errors with older versions of GCC.
llvm-svn: 358927
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.
llvm-svn: 358926
Adrian Prantl [Mon, 22 Apr 2019 22:16:33 +0000 (22:16 +0000)]
Rename C++ TestGlobalVariables.py to have a distinct name from C version.
llvm-svn: 358924
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
llvm-svn: 358922
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>
llvm-svn: 358921
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
llvm-svn: 358919
Davide Italiano [Mon, 22 Apr 2019 20:27:10 +0000 (20:27 +0000)]
[EditLineTest] Not always TERM is available, e.g. on some bots.
llvm-svn: 358918
Joel E. Denny [Mon, 22 Apr 2019 20:25:06 +0000 (20:25 +0000)]
[VerifyDiagnosticConsumer] Document -verify=<prefixes> in doxygen
Previously, it was only documented by `-cc1 -help`, so people weren't
aware of it, as discussed in D60732.
Reviewed By: Charusso, NoQ
Differential Revision: https://reviews.llvm.org/D60845
llvm-svn: 358917
Jonas Devlieghere [Mon, 22 Apr 2019 20:05:02 +0000 (20:05 +0000)]
[Reproducers] Fix lifetime issue
Deallocating the data recorder in during the ::Keep() operation causes
problems down the line when exiting the debugger. The command
interpreter still holds a pointer to the now deallocated object and has
no way to know it no longer exists. This is exactly what the m_record
flag was meant for, although it wasn't hooked up properly either.
llvm-svn: 358916
Petr Hosek [Mon, 22 Apr 2019 19:51:33 +0000 (19:51 +0000)]
[libcxx] Update gen_link_script.py to support different input and output
This enables the use of this script from other build systems like
GN which don't support post-build actions as well as for static
archives.
Differential Revision: https://reviews.llvm.org/D60309
llvm-svn: 358915
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
llvm-svn: 358914
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.
llvm-svn: 358913