Michal Gorny [Wed, 5 Jun 2019 08:21:42 +0000 (08:21 +0000)]
[clang] [test] Add a (xfailing) test for PR41027
Add a test for tracking PR41027 (8.0 regression breaking assembly code
relying on __builtin_constant_p() to identify compile-time constants).
Mark it as expected to fail everywhere.
Differential Revision: https://reviews.llvm.org/D60728
llvm-svn: 362587
Pavel Labath [Wed, 5 Jun 2019 07:29:55 +0000 (07:29 +0000)]
Ignore DIEs in the skeleton unit in a DWO scenario
Summary:
r362103 exposed a bug, where we could read incorrect data if a skeleton
unit contained more than the single unit DIE. Clang emits these kinds of
units with -fsplit-dwarf-inlining (which is also the default).
Changing lldb to handle these DIEs is nontrivial, as we'd have to change
the UID encoding logic to be able to reference these DIEs, and fix up
various places which are assuming that all DIEs come from the separate
compile unit.
However, it turns out this is not necessary, as the DWO unit contains
all the information that the skeleton unit does. So, this patch just
skips parsing the extra DIEs if we have successfully found the DWO file.
This enforces the invariant that the rest of the code is already
operating under.
This patch fixes a couple of existing tests, but I've also included a
simpler test which does not depend on execution of binaries, and would
have helped us in catching this sooner.
Reviewers: clayborg, JDevlieghere, aprantl
Subscribers: probinson, dblaikie, lldb-commits
Differential Revision: https://reviews.llvm.org/D62852
llvm-svn: 362586
Petr Hosek [Wed, 5 Jun 2019 06:58:41 +0000 (06:58 +0000)]
[CMake][Fuchsia] Use libc++ ABIv2 for the first stage build
This also unifies flags between macOS and Linux builds.
llvm-svn: 362585
Serge Guelton [Wed, 5 Jun 2019 06:35:10 +0000 (06:35 +0000)]
Reduce memory consumption of coverage dumps
Avoiding an intermediate join operation removes the need for an
intermediate buffer that may be quite large, as showcased by
https://bugs.llvm.org/show_bug.cgi?id=41965
Differential Revision: https://reviews.llvm.org/D62623
llvm-svn: 362584
Yevgeny Rouban [Wed, 5 Jun 2019 05:46:40 +0000 (05:46 +0000)]
Resubmit "[CorrelatedValuePropagation] Fix prof branch_weights metadata handling for SwitchInst"
This reverts commit
5b32f60ec31ce136edac6f693538aeb6039f4ad0.
The fix is in commit
4f9e68148bd0dada2d6997625432385918ac2e2c.
This patch fixes the CorrelatedValuePropagation pass to keep
prof branch_weights metadata of SwitchInst consistent.
It makes use of SwitchInstProfUpdateWrapper.
New tests are added.
Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/D62126
llvm-svn: 362583
Michael Liao [Wed, 5 Jun 2019 04:18:12 +0000 (04:18 +0000)]
Suppress false-positive GCC -Wreturn-type warning.
llvm-svn: 362582
Kristina Brooks [Wed, 5 Jun 2019 03:47:02 +0000 (03:47 +0000)]
Add __FILE_NAME__ to ReleaseNotes. NFC
Added it under C language changes as a nonstandard
extension for the time being.
llvm-svn: 362581
Petr Hosek [Wed, 5 Jun 2019 03:17:11 +0000 (03:17 +0000)]
[Clang] Disable new PM for tests that use optimization level -O1, -O2 and -O3
Tests that use -O1, -O2 and -O3 would often produce different results
with the new pass manager which makes these tests fail. Disable new PM
explicitly for these tests.
Differential Revision: https://reviews.llvm.org/D58375
llvm-svn: 362580
Rui Ueyama [Wed, 5 Jun 2019 03:04:46 +0000 (03:04 +0000)]
Read .note.gnu.property sections and emit a merged .note.gnu.property section.
This patch also adds `--require-cet` option for the sake of testing.
The actual feature for IBT-aware PLT is not included in this patch.
This is a part of https://reviews.llvm.org/D59780. Submitting this
first should make it easy to work with a related change
(https://reviews.llvm.org/D62609).
Differential Revision: https://reviews.llvm.org/D62853
llvm-svn: 362579
Johannes Doerfert [Wed, 5 Jun 2019 03:02:24 +0000 (03:02 +0000)]
[Attributor] Pass infrastructure and fixpoint framework
NOTE: Note that no attributes are derived yet. This patch will not go in
alone but only with others that derive attributes. The framework is
split for review purposes.
This commit introduces the Attributor pass infrastructure and fixpoint
iteration framework. Further patches will introduce abstract attributes
into this framework.
In a nutshell, the Attributor will update instances of abstract
arguments until a fixpoint, or a "timeout", is reached. Communication
between the Attributor and the abstract attributes that are derived is
restricted to the AbstractState and AbstractAttribute interfaces.
Please see the file comment in Attributor.h for detailed information
including design decisions and typical use case. Also consider the class
documentation for Attributor, AbstractState, and AbstractAttribute.
Reviewers: chandlerc, homerdin, hfinkel, fedor.sergeev, sanjoy, spatel, nlopes, nicholas, reames
Subscribers: mehdi_amini, mgorny, hiraditya, bollu, steven_wu, dexonsmith, dang, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D59918
llvm-svn: 362578
Johannes Doerfert [Wed, 5 Jun 2019 03:00:06 +0000 (03:00 +0000)]
[NFC][FnAttrs] Stress tests for attribute deduction
This commit is a preparation of upcoming patches on attribute deduction.
It will shorten the diffs and make it clear what we inferred before.
Reviewers: chandlerc, homerdin, hfinkel, fedor.sergeev, sanjoy, spatel, nlopes
Subscribers: bollu, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D59903
llvm-svn: 362577
Nemanja Ivanovic [Wed, 5 Jun 2019 02:36:40 +0000 (02:36 +0000)]
[PowerPC] Collapse RLDICL/RLDICR into RLDIC when possible
Generally speaking, we lower to an optimal rotate sequence for nodes visible in
the SDAG. However, there are instances where the two rotates are not visible at
ISEL time - most notably those in a very common sequence when lowering switch
statements to jump tables.
A common situation is a switch on a 32-bit integer. This value has to have the
upper 32 bits cleared and because jump table offsets are word offsets, the value
needs to be shifted left by 2 bits. We currently emit the clear and the left
shift as two separate instructions, but this is not needed as we can lower it to
a single RLDIC.
This patch just cleans that up.
Differential revision: https://reviews.llvm.org/D60402
llvm-svn: 362576
Artem Dergachev [Wed, 5 Jun 2019 02:09:49 +0000 (02:09 +0000)]
[analyzer] exploded-graph-rewriter: Add the missing license header!
llvm-svn: 362575
Artem Dergachev [Wed, 5 Jun 2019 02:09:29 +0000 (02:09 +0000)]
[analyzer] exploded-graph-rewriter: Pick up python from cmake in tests.
This should fix NetBSD buildbots.
llvm-svn: 362574
Nemanja Ivanovic [Wed, 5 Jun 2019 02:09:03 +0000 (02:09 +0000)]
[PowerPC][NFC] Add codegen test for consecutive stores of vector elements
NFC commit of a test case in order for the subsequent review to show differences
in codegen.
Differential revision: https://reviews.llvm.org/D62843
llvm-svn: 362573
Alexandre Ganea [Wed, 5 Jun 2019 02:01:43 +0000 (02:01 +0000)]
[LLD][COFF] Don't take into account the 'age' when looking for PDB type server
The age field is only there to say how many times an OBJ or a PDB was incrementally linked. It shouldn't be used to validate the link between the OBJ and the PDB.
Differential Revision: https://reviews.llvm.org/D62837
llvm-svn: 362572
Nemanja Ivanovic [Wed, 5 Jun 2019 01:57:57 +0000 (01:57 +0000)]
Initial support for vectorization using MASSV (IBM MASS vector library)
Part 2 (the Clang portion) of D59881.
This patch (first of two patches) enables the vectorizer to recognize the
IBM MASS vector library routines. This patch specifically adds support for
recognizing the -vector-library=MASSV option, and defines mappings from IEEE
standard scalar math functions to generic PowerPC MASS vector counterparts.
For instance, the generic PowerPC MASS vector entry for double-precision
cbrt function is __cbrtd2_massv.
The second patch will further lower the generic PowerPC vector entries to
PowerPC subtarget-specific entries.
For instance, the PowerPC generic entry cbrtd2_massv is lowered to
cbrtd2_P9 for Power9 subtarget.
The overall support for MASS vector library is presented as such in two patches
for ease of review.
Patch by Jeeva Paudel.
Differential revision: https://reviews.llvm.org/D59881
llvm-svn: 362571
Fangrui Song [Wed, 5 Jun 2019 01:49:06 +0000 (01:49 +0000)]
Fix -Wsign-compare by explicit cast after r362557
llvm-svn: 362570
Fangrui Song [Wed, 5 Jun 2019 01:36:48 +0000 (01:36 +0000)]
[llvm-objdump/llvm-readobj/obj2yaml/yaml2obj] Support DT_PPC_GOT and DT_PPC_OPT
In glibc, DT_PPC_GOT indicates that PowerPC32 Secure PLT ABI is used.
I plan to use it in D62464.
DT_PPC_OPT currently indicates if a TLSDESC inspired TLS optimization is
enabled.
Reviewed By: grimar, jhenderson, rupprecht
Differential Revision: https://reviews.llvm.org/D62851
llvm-svn: 362569
Nemanja Ivanovic [Wed, 5 Jun 2019 01:31:43 +0000 (01:31 +0000)]
Initial support for IBM MASS vector library
This is the LLVM portion of patch https://reviews.llvm.org/D59881.
The clang portion is to follow.
llvm-svn: 362568
Nick Desaulniers [Wed, 5 Jun 2019 01:28:55 +0000 (01:28 +0000)]
[TargetTransformInfo] assert on nullptr
Summary:
This was flagged in https://www.viva64.com/en/b/0629/ under "Snippet No.
38".
Add an assertion, since it's unlikely that this parameter is nullptr.
Reviewers: RKSimon, fhahn
Reviewed By: RKSimon
Subscribers: fhahn, llvm-commits, RKSimon, srhines
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D62229
llvm-svn: 362567
Mitch Phillips [Wed, 5 Jun 2019 01:27:39 +0000 (01:27 +0000)]
Changed force build of GWP-ASan options parser to be statically
linked instead of dynamic. This should help resolve a downstream
build order issue against libc++.
llvm-svn: 362566
Craig Topper [Wed, 5 Jun 2019 01:00:34 +0000 (01:00 +0000)]
[X86] Cleanup convertIntLogicToFPLogic a little. NFCI
-Use early returns to reduce indentation
-Replace multipe ifs with a switch.
-Replace an assert with an llvm_unreachable default in the switch.
-Check that the FP type we're going to use for the
X86ISD::FAND/FOR/FXOR is legal rather than checking that the
integer type matches the width of a legal scalar fp type. This all
runs after legalization so it shouldn't really matter, but making
sure we're using a valid type in the X86ISD node is really
whats important.
llvm-svn: 362565
Richard Smith [Wed, 5 Jun 2019 00:21:47 +0000 (00:21 +0000)]
Factor out duplicated code building a MemberExpr and marking it
referenced.
llvm-svn: 362563
Richard Smith [Wed, 5 Jun 2019 00:04:33 +0000 (00:04 +0000)]
PR42111: Use guarded initialization for thread-local variables with
unordered initialization and internal linkage.
We'll run their initializers once on each reference, so we need a guard
variable even though they only have a single definition.
llvm-svn: 362562
Nico Weber [Tue, 4 Jun 2019 23:35:07 +0000 (23:35 +0000)]
svn propset svn:executable on utils/prepare-code-coverage-artifact.py
llvm-svn: 362561
Nico Weber [Tue, 4 Jun 2019 23:27:40 +0000 (23:27 +0000)]
msabi: Fix exponential mangling time for even more contrived inputs
This is a follow-up to r362293 which fixed exponential time needed
for mangling certain templates. This fixes the same issue if that
template pattern happens in template arguments > 10: The first
ten template arguments can use back references, and r362293 added
caching for back references. For latter arguments, we have to add
a cache for the mangling itself instead.
Fixes PR42091 even more.
Differential Revision: https://reviews.llvm.org/D62780
llvm-svn: 362560
Amara Emerson [Tue, 4 Jun 2019 23:11:42 +0000 (23:11 +0000)]
[AArch64] FastISel: fix test to specify -fast-isel when -fast-isel-abort=1 is used.
This test has been inadvertently been GISel, and now assert due to incompatible flags.
llvm-svn: 362559
Cameron McInally [Tue, 4 Jun 2019 23:01:36 +0000 (23:01 +0000)]
[Scalarizer] Add UnaryOperator visitor to scalarization pass
Differential Revision: https://reviews.llvm.org/D62858
llvm-svn: 362558
Jason Molenda [Tue, 4 Jun 2019 22:46:20 +0000 (22:46 +0000)]
Call abs to avoid signed/unsigned comparison warning.
llvm-svn: 362557
Alex Brachet [Tue, 4 Jun 2019 22:17:27 +0000 (22:17 +0000)]
[test][llvm-objcopy] Test llvm-objcopy with standard streams
Differential Revision: https://reviews.llvm.org/D62817
llvm-svn: 362556
Don Hinton [Tue, 4 Jun 2019 22:07:40 +0000 (22:07 +0000)]
[Analysis] Only build Analysis plugins when CLANG_ENABLE_STATIC_ANALYZER is enabled.
Fixes bug introduced in r362328.
Thanks to Nathan Chancellor for reporting this!
llvm-svn: 362555
Michael Kruse [Tue, 4 Jun 2019 21:58:54 +0000 (21:58 +0000)]
[ScopBuilder] Move canonicalizeDynamicsBasePtrs from ScopInfo. NFC.
Refactor Scop and ScopBuilder class. Move canonicalizeDynamicsBasePtrs
and corresponding static functions from ScopInfo.cpp to ScopBuilder.cpp
Patch by Dominik Adamski <adamski.dominik@gmail.com>
Differential Revision: https://reviews.llvm.org/D62781
llvm-svn: 362554
Amara Emerson [Tue, 4 Jun 2019 21:51:34 +0000 (21:51 +0000)]
[AArch64][GlobalISel] Make extloads to i64 legal.
Although we had the support in the prelegalizer combiner to generate the
G_SEXTLOAD or G_ZEXTLOAD ops, the legalizer definitions for arm64 had them as
lowering back to separate ops.
llvm-svn: 362553
Craig Topper [Tue, 4 Jun 2019 21:47:50 +0000 (21:47 +0000)]
[X86] Add avx512bw to the avx512 machine-combiner-int-vec.ll to ensure we use zmm for v32i16/v64i8.
llvm-svn: 362552
Richard Smith [Tue, 4 Jun 2019 21:29:28 +0000 (21:29 +0000)]
Convert MemberExpr creation and serialization to work the same way as
most / all other Expr subclasses.
llvm-svn: 362551
Craig Topper [Tue, 4 Jun 2019 21:26:46 +0000 (21:26 +0000)]
[X86] Add vector min/max reassociation tests to machine-combiner-int-vec.ll. NFC
llvm-svn: 362550
Craig Topper [Tue, 4 Jun 2019 21:26:36 +0000 (21:26 +0000)]
[X86] Add 512-bit test cases to machine-combiner-int-vec.ll. NFC
llvm-svn: 362549
Thomas Lively [Tue, 4 Jun 2019 21:13:41 +0000 (21:13 +0000)]
[WebAssembly] make wasm-ld --verbose show data section startVA and name
Summary:
Make `wasm-ld --verbose` show data section start virtual address and name
as well, instead of just showing the size. This makes it much easier to
track which global variable is in which address when used in conjunction
with `--no-merge-data-sections`.
Patch by Guanzhong Chen
Reviewers: tlively, aheejin, sbc100, ruiu
Reviewed By: sbc100, ruiu
Subscribers: ruiu, dschuff, jgravelle-google, sunfish, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D62834
llvm-svn: 362548
Thomas Lively [Tue, 4 Jun 2019 21:08:20 +0000 (21:08 +0000)]
[WebAssembly] Fix ISel crash on sext_inreg/extract type mismatch
Summary:
Adjusts the index and adds a bitcast around the vector operand of
EXTRACT_VECTOR_ELT so that its lane type matches the source type of
its parent sext_inreg. Without this bitcast the ISel patterns do not
match and ISel fails.
Reviewers: aheejin
Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D62646
llvm-svn: 362547
Johannes Doerfert [Tue, 4 Jun 2019 20:34:43 +0000 (20:34 +0000)]
[SelectionDAG][FIX] Allow "returned" arguments to be bit-casted
Summary:
An argument that is return by a function but bit-casted before can still
be annotated as "returned". Make sure we do not crash for this case.
Reviewers: sunfish, stephenwlin, niravd, arsenm
Subscribers: wdng, hiraditya, bollu, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D59917
llvm-svn: 362546
Johannes Doerfert [Tue, 4 Jun 2019 20:21:46 +0000 (20:21 +0000)]
Introduce Value::stripPointerCastsSameRepresentation
This patch allows current users of Value::stripPointerCasts() to force
the result of the function to have the same representation as the value
it was called on. This is useful in various cases, e.g., (non-)null
checks.
In this patch only a single call site was adjusted to fix an existing
misuse that would cause nonnull where they may be wrong. Uses in
attribute deduction and other areas, e.g., D60047, are to be expected.
For a discussion on this topic, please see [0].
[0] http://lists.llvm.org/pipermail/llvm-dev/2018-December/128423.html
Reviewers: hfinkel, arsenm, reames
Subscribers: wdng, hiraditya, bollu, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D61607
llvm-svn: 362545
Alex Langford [Tue, 4 Jun 2019 20:14:33 +0000 (20:14 +0000)]
[Target] Remove Process::GetCPPLanguageRuntime
Summary:
I want to remove this method because I think that Process should be
language agnostic, or at least, not have knowledge about specific language
runtimes. There is "GetLanguageRuntime()" which should be used instead. If the
caller a CPPLanguageRuntime, they should cast it as needed. Ideally, this
should only happen in plugins that need C++ specific knowledge.
The next step I would like to do is remove "GetObjCLanguageRuntime()" as well.
There are a lot more instances of that function being used, so I wanted to
upload this one first to get the general reception to this idea.
Reviewers: compnerd, davide, JDevlieghere, jingham, clayborg, labath, aprantl
Subscribers: lldb-commits
Differential Revision: https://reviews.llvm.org/D62755
llvm-svn: 362544
Alex Langford [Tue, 4 Jun 2019 19:29:59 +0000 (19:29 +0000)]
[ABI] Fix SystemV ABI to handle nested aggregate type returned in register
Add a function to flatten the nested aggregate type
Differential Revision: https://reviews.llvm.org/D62702
Patch by Wanyi Ye <kusmour@gmail.com>
llvm-svn: 362543
Mitch Phillips [Tue, 4 Jun 2019 19:18:40 +0000 (19:18 +0000)]
Fixed GWP-ASan build breakage. When adding the optional flag parser, there was a missing dependency on compiler-rt (and thus SanitizerCommon) for this feature.
llvm-svn: 362542
Nico Weber [Tue, 4 Jun 2019 19:10:08 +0000 (19:10 +0000)]
llvm-undname: Correctly demangle vararg parameters
FunctionSignatureNode already had an IsVariadic field,
but it wasn't used anywhere yet. Set it and use it.
llvm-svn: 362541
Nico Weber [Tue, 4 Jun 2019 18:49:05 +0000 (18:49 +0000)]
llvm-undname: More coverage-related cleanups
- The loop in demangleFunctionParameterList() only exits
on Error, @, and Z. All 3 cases were handled, so the
rest of the function is DEMANGLE_UNREACHABLE.
- The loop in demangleTemplateParameterList() always returns
on Error, so there's no need to check for that in the loop
header and after the loop.
- Add test cases for invalid function parameter manglings.
- Add a (redundant) test case for a simple template parameter
list mangling.
- Add a test case pointing out that varargs functions aren't
demangled correctly.
llvm-svn: 362540
Nemanja Ivanovic [Tue, 4 Jun 2019 18:48:43 +0000 (18:48 +0000)]
Revert r362472 as it is breaking PPC build bots
The patch https://reviews.llvm.org/rL362472 broke PPC LNT buildbots.
Reverting it to bring the bots back to green.
llvm-svn: 362539
Alina Sbirlea [Tue, 4 Jun 2019 18:45:15 +0000 (18:45 +0000)]
[Utils] Clean another duplicated util method.
Summary:
Following the cleanup in D48202, method foldBlockIntoPredecessor has the
same behavior. Replace its uses with MergeBlockIntoPredecessor.
Remove foldBlockIntoPredecessor.
Reviewers: chandlerc, dmgreen
Subscribers: jlebar, javed.absar, zzheng, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D62751
llvm-svn: 362538
Richard Smith [Tue, 4 Jun 2019 18:30:46 +0000 (18:30 +0000)]
Factor out repeated code to build a DeclRefExpr and mark it referenced.
llvm-svn: 362537
Nico Weber [Tue, 4 Jun 2019 18:06:28 +0000 (18:06 +0000)]
llvm-undname: Add test coverage for demangleInitFiniStub()
llvm-svn: 362536
Craig Topper [Tue, 4 Jun 2019 18:03:07 +0000 (18:03 +0000)]
[X86] Mutate fceil/ffloor/ftrunc/fnearbyint/frint into X86ISD::RNDSCALE during PreProcessIselDAG to cut down on pattern permutations
We already need to have patterns for X86ISD::RNDSCALE to support software intrinsics. But we currently have 5 sets of patterns for the 5 rounding operations. For of these 6 patterns we have to support 3 vectors widths, 2 element sizes, sse/vex/evex encodings, load folding, and broadcast load folding. This results in a fair amount of bytes in the isel table.
This patch adds code to PreProcessIselDAG to morph the fceil/ffloor/ftrunc/fnearbyint/frint to X86ISD::RNDSCALE. This way we can remove everything, but the intrinsic pattern while still allowing the operations to be considered Legal for DAGCombine and Legalization. This shrinks the DAGISel by somewhere between 9K and 10K.
There is one complication to this, the STRICT versions of these nodes are currently mutated to their none strict equivalents at isel time when the node is visited. This won't be true in the future since that loses the chain ordering information. For now I've also added support for the non-STRICT nodes to Select so we can change the STRICT versions there after they've been mutated to their non-STRICT versions. We'll probably need a STRICT version of RNDSCALE or something to handle this in the future. Which will take us back to needing 2 sets of patterns for strict and non-strict, but that's still better than the 11 or 12 sets of patterns we'd need.
We can probably do something similar for scalar, but I haven't looked at it yet.
Differential Revision: https://reviews.llvm.org/D62757
llvm-svn: 362535
Benjamin Kramer [Tue, 4 Jun 2019 18:01:07 +0000 (18:01 +0000)]
[X86] Fold single-use variable into assert. NFC.
Avoids an unused variable warning in Release builds.
llvm-svn: 362534
Craig Topper [Tue, 4 Jun 2019 17:44:18 +0000 (17:44 +0000)]
[DAGCombiner][X86] Fold (not (neg X)) -> (add X, -1)
This is a special case of a more general transform (not (sub Y, X)) -> (add X, ~Y). InstCombine knows the general form. I've restricted to the special case to fix the motivating case PR42118. I tried handling any case where Y was constant, but got some changes on some Mips tests that I couldn't quickly prove where beneficial.
Fixes PR42118
Differential Revision: https://reviews.llvm.org/D62828
llvm-svn: 362533
Philip Reames [Tue, 4 Jun 2019 17:29:55 +0000 (17:29 +0000)]
[Tests] Autogen a test so future changes are visible
Oddly, I had to change a value name from "tmp0" to "bc0" to get the autogened test to pass. I'm putting this down to an oddity of update_test_checks or FileCheck, but don't understand it.
llvm-svn: 362532
Richard Smith [Tue, 4 Jun 2019 17:17:20 +0000 (17:17 +0000)]
PR42104: Support instantiations of lambdas that implicitly capture
packs.
Two changes:
* Track odr-use via FunctionParmPackExprs to properly handle dependent
odr-uses of packs in generic lambdas.
* Do not instantiate implicit captures; instead, regenerate them by
instantiating the body of the lambda. This is necessary to
distinguish between cases where only one element of a pack is
captured and cases where the entire pack is captured.
This reinstates r362358 (reverted in r362375) with a fix for an
uninitialized variable use in UpdateMarkingForLValueToRValue.
llvm-svn: 362531
Ilya Biryukov [Tue, 4 Jun 2019 17:15:48 +0000 (17:15 +0000)]
[Syntax] Do not depend on llvm targets for Syntax tests. NFC
They are not required and only slow down the build.
llvm-svn: 362530
Roman Lebedev [Tue, 4 Jun 2019 17:05:34 +0000 (17:05 +0000)]
[NFC][Codegen][PowerPC] Autogenerate shift-cmp.ll test
Being affected by upcoming patch
llvm-svn: 362529
Roman Lebedev [Tue, 4 Jun 2019 17:05:06 +0000 (17:05 +0000)]
[NFC][Codegen][AMDGPU] Autogenerate commute-shifts.ll test
Being affected by upcoming patch
llvm-svn: 362528
Mitch Phillips [Tue, 4 Jun 2019 17:01:11 +0000 (17:01 +0000)]
[GWP-ASan] Configuration options [3].
Summary:
See D60593 for further information.
This patch introduces the configuration options for GWP-ASan. In general, we expect the supporting allocator to populate the options struct, and give that to GWP-ASan during initialisation. For allocators that are okay with pulling in sanitizer_common, we also provide an optional parser that populates the gwp_asan::Options struct with values provided in the GWP_ASAN_OPTIONS environment variable.
This patch contains very little logic, and all of the testable components (i.e. the optional parser's internal logic) is tested as part of the sanitizer_common testbed.
Reviewers: vlad.tsyrklevich, morehouse, jfb
Reviewed By: morehouse
Subscribers: dexonsmith, kubamracek, mgorny, #sanitizers, llvm-commits, vitalybuka
Tags: #sanitizers, #llvm
Differential Revision: https://reviews.llvm.org/D62698
llvm-svn: 362527
Alex Brachet [Tue, 4 Jun 2019 16:55:30 +0000 (16:55 +0000)]
[MACHO] Replaced calls to getStruct with getStructOrErr in functions returning Error or Expected or similar
llvm-svn: 362526
Louis Dionne [Tue, 4 Jun 2019 16:47:18 +0000 (16:47 +0000)]
[libcxx] Add test to check min/max requirement to regular expression
This commit adds tests that repeated characters in regular expressions
are within numeric limits, and that a <= b in a regex like `x{a,b}`.
Thanks to Andrey Maksimov for the patch.
Differential Revision: https://reviews.llvm.org/D62816
llvm-svn: 362525
Sanjay Patel [Tue, 4 Jun 2019 16:40:04 +0000 (16:40 +0000)]
[x86] split 256-bit store of concatenated vectors
This shows up as a side issue to the main problem for the AVX target example from PR37428:
https://bugs.llvm.org/show_bug.cgi?id=37428 - https://godbolt.org/z/7tpRa3
But as we can see in the pile of existing test diffs, it's actually a widespread problem
that affects any AVX or later target. Apart from a couple of oddballs, I think these are
all improvements for the reasons stated in the code comment: we do not want to enable YMM
unnecessarily (avoid vzeroupper and frequency throttling) and some cores split 256-bit
stores anyway.
We could say that MergeConsecutiveStores() is going overboard on some of these examples,
but that won't solve the problem completely. But that is a reason I'm proposing this as
a lowering rather than a combine: we will infinite loop fighting the merge code if we try
this earlier.
Differential Revision: https://reviews.llvm.org/D62498
llvm-svn: 362524
Peter Smith [Tue, 4 Jun 2019 16:35:40 +0000 (16:35 +0000)]
[AArch64][ELF] Add support for PLT decoding with BTI instructions present
Arm Architecture v8.5a introduces Branch Target Identification (BTI). When
enabled all indirect branches must target a bti instruction of the
appropriate form. As PLT sequences may sometimes be the target of an
indirect branch and PLT[0] always is, a static linker may need to generate
PLT sequences that contain "bti c" as the first instruction. In effect:
bti c
adrp x16, page offset to .got.plt
...
Instead of:
adrp x16, page offset to .got.plt
...
At present the PLT decoding assumes the adrp will always be the first
instruction. This patch adds support for a single "bti c" to prefix it. A
test binary has been uploaded with such a PLT sequence. A forthcoming LLD
patch will make heavy use of the PLT decoding code.
Differential Revision: https://reviews.llvm.org/D62598
llvm-svn: 362523
Sam Clegg [Tue, 4 Jun 2019 16:35:23 +0000 (16:35 +0000)]
[WebAssembly] Add comment as follow-up to rL362276. NFC.
Subscribers: dschuff, jgravelle-google, aheejin, sunfish, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D62824
llvm-svn: 362522
Akira Hatanaka [Tue, 4 Jun 2019 16:29:58 +0000 (16:29 +0000)]
[CodeGen][ObjC] Convert '[self alloc]' in a class method to a call to
'objc_alloc(self)'
Also convert '[[self alloc] init]' in a class method to a call to
'objc_alloc_init(self)'.
rdar://problem/
50855121
Differential Revision: https://reviews.llvm.org/D62643
llvm-svn: 362521
Nico Weber [Tue, 4 Jun 2019 16:25:28 +0000 (16:25 +0000)]
llvm-undname: Yet more coverage for error paths
- For error returns in demangleSpecialTableNode(),
demangleLocalStaticGuard(), RTTITypeDescriptor,
demangleRttiBaseClassDescriptorNode(), demangleUnsigned(),
demangleUntypedVariable() (via RttiBaseClassArray)
- For ?_A and ?_P which are handled at early levels of the
demangler but are not implemented in a later stage; this
is now more obvious
- Replace a "default:" with an explicit list of cases, to
get -Wswitch check we list all cases
llvm-svn: 362520
Nikita Popov [Tue, 4 Jun 2019 16:24:09 +0000 (16:24 +0000)]
[LVI][CVP] Add support for urem, srem and sdiv
The underlying ConstantRange functionality has been added in D60952,
D61207 and D61238, this just exposes it for LVI.
I'm switching the code from using a whitelist to a blacklist, as
we're down to one unsupported operation here (xor) and writing it
this way seems more obvious :)
Differential Revision: https://reviews.llvm.org/D62822
llvm-svn: 362519
Philip Reames [Tue, 4 Jun 2019 16:19:34 +0000 (16:19 +0000)]
[Tests] Update a test to consistently use new pass manager and FileCheck the result
llvm-svn: 362518
Ilya Biryukov [Tue, 4 Jun 2019 16:19:11 +0000 (16:19 +0000)]
[clangd] Minor cleanup. NFC
Removed unused using declaration from TweakTests.cpp
llvm-svn: 362517
Philip Reames [Tue, 4 Jun 2019 16:15:19 +0000 (16:15 +0000)]
[Tests] Autogen tests so that diffs for a future change are understandable
llvm-svn: 362516
Nico Weber [Tue, 4 Jun 2019 15:47:25 +0000 (15:47 +0000)]
llvm-undname: Add coverage for startsWithLocalScopePattern()
llvm-svn: 362515
Nico Weber [Tue, 4 Jun 2019 15:38:00 +0000 (15:38 +0000)]
llvm-undname: More no-op changes to increase test coverage
- Add test coverage around invalid anon namespaces and
for error paths in demanglePrimitiveType() and in
demangleFullyQualifiedTypeName()
- Use DEMANGLE_UNREACHABLE in two more unreachable places
llvm-svn: 362514
James Henderson [Tue, 4 Jun 2019 15:34:58 +0000 (15:34 +0000)]
[llvm-symbolizer] Flush output on bad input
One way of using llvm-symbolizer is to interactively within a process
write a line from a parent process to llvm-symbolizer's stdin, and then
read the output, then write the next line, read, etc. This worked as
long as all the lines were good. However, this didn't work prior to this
patch if any of the inputs were bad inputs, because the output is not
flushed after a bad input, meaning the parent process is sat waiting for
output, whilst llvm-symbolizer is sat waiting for input. This patch
flushes the output after every invocation of symbolizeInput when reading
from stdin. It also removes unnecessary flushing when llvm-symbolizer is
not reading addresses from stdin, which should give a slight performance
boost in these situations.
Reviewed by: ikudrin
Differential Revision: https://reviews.llvm.org/D62371
llvm-svn: 362511
James Y Knight [Tue, 4 Jun 2019 15:27:19 +0000 (15:27 +0000)]
[lldb] Fix out-of-bounds read after
c3ea7c66fec021867e005ad1b02f3c7e80feaa85
"Add support for mid-function epilogues on x86 that end in a non-local jump."
Detected by asan.
llvm-svn: 362510
Jinsong Ji [Tue, 4 Jun 2019 15:22:23 +0000 (15:22 +0000)]
[PowerPC] P9 Scheduling Model: dispatching rule fixes
This is to address some of the problems in existing P9 resource modeling,
especially about the dispatching rules.
Instead of using a hypothetical DISPATCHER , we try to use the number of
actual dispatch slots, and define SchedWriteRes to model dispatch rules,
then update instruction classes according to dispatch rules.
All the dispatch rules and instruction classes update are made according
to POWER9 User Manual.
Differential Revision: https://reviews.llvm.org/D61873
llvm-svn: 362509
Marshall Clow [Tue, 4 Jun 2019 15:18:46 +0000 (15:18 +0000)]
No longer reject inputs when using a locale that has grouping information _and_ the input has no grouping characters at all. We continue to reject cases when the input has grouping characters in the wrong place. Fixes PR#28704
llvm-svn: 362508
Sanjay Patel [Tue, 4 Jun 2019 15:15:59 +0000 (15:15 +0000)]
[SelectionDAG][x86] limit post-legalization store merging by type
The proposal in D62498 showed that x86 would benefit from vector
store splitting, but that may conflict with the generic DAG
combiner's store merging transforms.
Add memory type to the existing TLI hook that enables the merging
transforms, so we can limit those changes to scalars only for x86.
llvm-svn: 362507
Nico Weber [Tue, 4 Jun 2019 15:13:30 +0000 (15:13 +0000)]
llvm-undname: Several behavior-preserving changes to increase coverage
- Replace `Error = true` in a few branches that are truly unreachable
with DEMANGLE_UNREACHABLE
- Remove early return early in startsWithLocalScopePattern() because
it's redundant with the next two early returns
- Remove unreachable `case '0'` (it's handled in the branch below)
- Remove an unused bool return
- Add test coverage for several early error returns, mostly in
array type parsing
llvm-svn: 362506
Gheorghe-Teodor Bercea [Tue, 4 Jun 2019 15:05:53 +0000 (15:05 +0000)]
[OpenMP][libomptarget] Enable usage of unified memory for declare target link variables
Summary: This patch enables the usage of a host variable on the device for declare target link variables when unified memory is available.
Reviewers: ABataev, caomhin, grokos
Reviewed By: grokos
Subscribers: Hahnfeld, guansong, jdoerfert, openmp-commits
Tags: #openmp
Differential Revision: https://reviews.llvm.org/D60884
llvm-svn: 362505
Simon Pilgrim [Tue, 4 Jun 2019 15:02:33 +0000 (15:02 +0000)]
[X86][SSE] Pulled out (sub (xor X, M), M) 'ConditionalNegate' out pattern match code. NFCI.
As discussed on D62777 - we should be able to use this in more SSE41+ cases as well but that requires us to separate it from the OR(AND(),ANDN()) matcher.
llvm-svn: 362504
Shawn Landden [Tue, 4 Jun 2019 14:51:15 +0000 (14:51 +0000)]
[Support] make countLeadingZeros() countTrailingZeros() countLeadingOnes() and countTrailingOnes() return unsigned
This matches APInt's versions of these functions, and there is no need for these to be size_t.
(as well as __builtin_clzll())
Differential Revision: https://reviews.llvm.org/D60823
llvm-svn: 362503
Sanjay Patel [Tue, 4 Jun 2019 14:40:37 +0000 (14:40 +0000)]
[x86] add test for store merging/splitting; NFC
This is a reduction of a test that would infinite loop with D62498.
llvm-svn: 362502
Shawn Landden [Tue, 4 Jun 2019 14:32:52 +0000 (14:32 +0000)]
[SimplifyCFG] fix last commit
llvm-svn: 362501
Stefan Granitz [Tue, 4 Jun 2019 14:21:48 +0000 (14:21 +0000)]
[CMake] Move and add settings to Apple-lldb-base cache script
llvm-svn: 362500
Shawn Landden [Tue, 4 Jun 2019 14:17:46 +0000 (14:17 +0000)]
[SimplifyCFG] NFC; remove bogus test case
Even if one bit is defined, the code is not clear what it is suppose to do.
The test wants to assert that some bits are undef, but that's not what the IR does and I don't think it's even possible to do that in any meaningful way. It was added in D12497, so @reames might want to double check.
Differential Revision: https://reviews.llvm.org/D60859
llvm-svn: 362499
Nico Weber [Tue, 4 Jun 2019 13:42:45 +0000 (13:42 +0000)]
gn build: Merge r362459
llvm-svn: 362498
Fangrui Song [Tue, 4 Jun 2019 13:41:29 +0000 (13:41 +0000)]
[ELF] Suppress "STT_SECTION symbol should be defined" on .eh_frame, .debug*, .zdebug* and .gcc_except_table
Summary:
With -r or --emit-relocs, we warn `STT_SECTION symbol should be defined`
on relocations to discarded section symbol. This was added as an error
in rLLD319404, but was not so effective before D61583 (it turned the
error to a warning).
Relocations from .eh_frame .debug* .zdebug* .gcc_except_table to
discarded .text are very common and somewhat expected. Don't warn/error
on them. As a reference, ld.bfd has a similar logic in
_bfd_elf_default_action_discarded() to allow these cases.
Delete invalid-undef-section-symbol.test because what it intended to
check is now covered by the updated comdat-discarded-reloc.s
Delete relocatable-eh-frame.s because we allow relocations from
.eh_frame as a special case now.
Reviewers: grimar, phosek, ruiu, espindola
Reviewed By: ruiu
Subscribers: emaste, arichardson, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D62840
llvm-svn: 362497
Kadir Cetinkaya [Tue, 4 Jun 2019 13:38:36 +0000 (13:38 +0000)]
[clangd] Also apply adjustArguments when returning fallback commands
Reviewers: ilya-biryukov
Subscribers: MaskRay, jkorous, arphaman, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D62856
llvm-svn: 362496
Dmitri Gribenko [Tue, 4 Jun 2019 12:55:00 +0000 (12:55 +0000)]
Include what you use in PPCRegisterInfo.cpp
llvm-svn: 362495
Roman Lebedev [Tue, 4 Jun 2019 11:44:50 +0000 (11:44 +0000)]
[NFC][Codegen] D62818 - also add tests with X being constant
For X86, these may be a 'BT' pattern, and in general, can cause
the transform to deadlock.
llvm-svn: 362494
Peter Smith [Tue, 4 Jun 2019 11:44:33 +0000 (11:44 +0000)]
[AArch64][ELF][llvm-readobj] Add support for BTI and PAC dynamic tags
ELF for the 64-bit Arm Architecture defines two processor-specific dynamic
tags:
DT_AARCH64_BTI_PLT 0x70000001, d_val
DT_AARCH64_PAC_PLT 0x70000003, d_val
These presence of these tags indicate that PLT sequences have been
protected using Branch Target Identification and Pointer Authentication
respectively. The presence of both indicates that the PLT sequences have
been protected with both Branch Target Identification and Pointer
Authentication.
This patch adds the tags and tests for llvm-readobj and yaml2obj.
As some of the processor specific dynamic tags overlap, this patch splits
them up, keeping their original default value if they were not previously
mentioned explicitly in a switch case.
Differential Revision: https://reviews.llvm.org/D62596
llvm-svn: 362493
David Zarzycki [Tue, 4 Jun 2019 11:33:49 +0000 (11:33 +0000)]
Unbreak my hasty "unbreak" cmake fix
llvm-svn: 362492
Simon Pilgrim [Tue, 4 Jun 2019 11:31:45 +0000 (11:31 +0000)]
Fix -Wparentheses warning. NFCI.
llvm-svn: 362491
Peter Smith [Tue, 4 Jun 2019 11:28:22 +0000 (11:28 +0000)]
[AARCH64][ELF][llvm-readobj] Support for AArch64 .note.gnu.property
ELF for the 64-bit Arm Architecture defines a processor specific property
type GNU_PROPERTY_AARCH64_FEATURE_1_AND as GNU_PROPERTY_LOPROC. This
property works in a similar way to the existing X86 processor specific
property GNU_PROPERTY_GNU_X86_FEATURE_1_AND.
Two feature bits are defined for GNU_PROPERTY_AARCH64_FEATURE_1_AND:
- GNU_PROPERTY_AARCH64_FEATURE_1_BTI 0x1
- GNU_PROPERTY_AARCH64_FEATURE_1_PAC 0x2
This patch defines the property, feature bits and implements support for
printing in llvm-readobj.
Differential Revision: https://reviews.llvm.org/D62595
llvm-svn: 362490
Simon Pilgrim [Tue, 4 Jun 2019 11:11:51 +0000 (11:11 +0000)]
Fix Wshadow warning
llvm-svn: 362489
Roman Lebedev [Tue, 4 Jun 2019 11:06:21 +0000 (11:06 +0000)]
[DAGCombine][X86][AArch64][MIPS][LANAI] (C - x) - y -> C - (x + y) fold (PR41952)
Summary:
This *might* be the last fold for `sink-addsub-of-const.ll`, but i'm not sure yet.
As far as i can tell, there are no regressions here (ignoring x86-32),
all changes are either good or neutral.
This, almost surprisingly to me, fixes the motivational tests (in `shift-amount-mod.ll`)
`@reg32_lshr_by_sub_from_negated` from [[ https://bugs.llvm.org/show_bug.cgi?id=41952 | PR41952 ]].
https://rise4fun.com/Alive/vMd3
Reviewers: RKSimon, t.p.northover, craig.topper, spatel, efriedma
Reviewed By: RKSimon
Subscribers: sdardis, javed.absar, arichardson, kristof.beyls, jrtc27, atanasyan, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D62774
llvm-svn: 362488
Roman Lebedev [Tue, 4 Jun 2019 11:06:08 +0000 (11:06 +0000)]
[DAGCombine][X86][AArch64][ARM] (C - x) + y -> (y - x) + C fold
Summary:
All changes except ARM look **great**.
https://rise4fun.com/Alive/R2M
The regression `test/CodeGen/ARM/addsubcarry-promotion.ll`
is recovered fully by D62392 + D62450.
Reviewers: RKSimon, craig.topper, spatel, rogfer01, efriedma
Reviewed By: efriedma
Subscribers: dmgreen, javed.absar, kristof.beyls, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D62266
llvm-svn: 362487
Simon Pilgrim [Tue, 4 Jun 2019 10:49:06 +0000 (10:49 +0000)]
[SelectionDAG] ComputeNumSignBits - support constant pool values from target
As I mentioned on D61887 we don't get many hits on ComputeNumSignBits as we did on computeKnownBits.
The case we do get is interesting though - it allows us to use the 'ConditionalNegate' combine in combineLogicBlendIntoPBLENDV to remove a select.
It comes too late for SSE41 (BLENDV) cases, but SSE2 tests can hit it now. We should probably try to make use of this for SSE41+ targets as well - avoiding variable blends is usually a good idea. I'll investigate as a followup.
Differential Revision: https://reviews.llvm.org/D62777
llvm-svn: 362486
Simon Pilgrim [Tue, 4 Jun 2019 10:17:56 +0000 (10:17 +0000)]
[SelectionDAG] ComputeNumSignBits - clang-format + improve *EXTLOAD comments. NFCI.
Pre-commit requested for D62777.
llvm-svn: 362485