Richard Smith [Mon, 10 Feb 2020 15:22:51 +0000 (07:22 -0800)]
P1957R2: conversion from a pointer to bool is considered narrowing.
This is being implemented somewhat speculatively, to match GCC's
behavior.
Andrew Wei [Tue, 11 Feb 2020 14:42:45 +0000 (22:42 +0800)]
[RISCV] Optimize seteq/setne pattern expansions for better code size
ADDI(C.ADDI) may achieve better code size than XORI, since XORI has no C extension.
This patch transforms two patterns and gets almost equivalent results.
Differential Revision: https://reviews.llvm.org/D71774
Kadir Cetinkaya [Tue, 11 Feb 2020 14:26:15 +0000 (15:26 +0100)]
Revert "[DSE] Add first version of MemorySSA-backed DSE (Bottom up walk)."
This reverts commit
d0c4d4fe0929098a98d9fb20c5e5e19d71341517.
Revert "[DSE,MSSA] Move more passing test cases from todo to simple.ll."
This reverts commit
02266e64bb6dacf76f3aa510df4b59f66d834b1f.
Revert "[DSE,MSSA] Adjust mda-with-dbg-values.ll to MSSA backed DSE."
This reverts commit
74f03e4ff0c1f11c29102329af95f7d9782426dc.
Sam McCall [Mon, 10 Feb 2020 10:52:42 +0000 (11:52 +0100)]
[clangd] Expose completion range in code completion results (C++ API)
Summary:
Informative only, useful for positioning UI, interacting with other sources of
completion etc. As requested by an embedder of clangd.
Reviewers: usaxena95
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D74305
Stephan Herhut [Tue, 11 Feb 2020 09:20:55 +0000 (10:20 +0100)]
[MLIR][GPU] Disallow llvm tanh intrinsics when lowering to NVVM/ROCm.
Summary:
The lowering to NVVM and ROCm handles tanh operations differently by
mapping them to NVVM/ROCm specific intrinsics. This conflicts with
the lowering to LLVM, which uses the default llvm intrinsic. This change
declares the LLVM intrinsics to be illegal, hence disallowing the
correspondign rewrite.
Differential Revision: https://reviews.llvm.org/D74389
Jan Kratochvil [Tue, 11 Feb 2020 13:54:23 +0000 (14:54 +0100)]
[NFC] [lldb] Remove unused declaration
ObjectFileELF::GetSectionIndexByType declaration without definition was
added by commit
17220c188635721e948cf02d2b6ad36b267ea393.
Louis Dionne [Tue, 11 Feb 2020 13:47:53 +0000 (14:47 +0100)]
[libc++] Disable a filesystem test that uses debug mode with the macOS system libc++
The system libc++.dylib doesn't support the debug mode, so this test
can't be supported. As a fly-by fix, we also specify more stringently
that only the macOS system library is unsupported in other tests using
the debug mode.
Simon Pilgrim [Tue, 11 Feb 2020 13:37:44 +0000 (13:37 +0000)]
[X86] combineConcatVectorOps - reuse IsSplat and remove duplicate code. NFC.
Sanjay Patel [Mon, 10 Feb 2020 22:49:48 +0000 (17:49 -0500)]
[VectorCombine] remove unused debug counter; NFC
The variable was added to the initial commit via copy/paste of existing
code, but it wasn't actually used in the code. We can add it back with
the proper usage if/when that is needed.
Raphael Isemann [Tue, 11 Feb 2020 13:09:55 +0000 (14:09 +0100)]
[lldb][NFC] Remove the CppVirtualMadness test
We now have a virtual-functions test and a multiple-inheritance test that
are testing the same functionality (and more) using the newer test functions which
we have in LLDB these days. These tests should also be less flaky and
less dependent on other unrelated LLDB functionality.
Alex Zinenko [Tue, 11 Feb 2020 12:54:55 +0000 (13:54 +0100)]
[mlir] StdToLLVM: add a separate test for the new memref calling convention
Louis Dionne [Tue, 11 Feb 2020 12:50:38 +0000 (13:50 +0100)]
[libc++][macOS CI] Ensure that the SDK version is not older than the deployment target
Raphael Isemann [Tue, 11 Feb 2020 12:31:00 +0000 (13:31 +0100)]
[lldb][NFC] Remove ConstString -> const char * -> StringRef conversions when calling Stream::Indent
Let's just pass in a StringRef and save the strlen call when rebuilding the StringRef parameter.
Feng Liu [Tue, 11 Feb 2020 12:33:38 +0000 (07:33 -0500)]
[mlir] Use the first location in the fused location for diagnostic handler
Differential Revision: https://reviews.llvm.org/D71851
Raphael Isemann [Tue, 11 Feb 2020 11:48:37 +0000 (12:48 +0100)]
[lldb] Add test for multiple inheritance
Raphael Isemann [Tue, 11 Feb 2020 12:04:48 +0000 (13:04 +0100)]
[lldb][NFC] Remove Stream::Indent(const char *) overload in favor of the StringRef version
Pavel Labath [Tue, 4 Feb 2020 02:05:21 +0000 (18:05 -0800)]
[lldb] Delete the SharingPtr class
Summary:
The only use of this class was to implement the SharedCluster of ValueObjects.
However, the same functionality can be implemented using a regular
std::shared_ptr, and its little-known "sub-object pointer" feature, where the
pointer can point to one thing, but actually delete something else when it goes
out of scope.
This patch reimplements SharedCluster using this feature --
SharedClusterPointer::GetObject now returns a std::shared_pointer which points
to the ValueObject, but actually owns the whole cluster. The only change I
needed to make here is that now the SharedCluster object needs to be created
before the root ValueObject. This means that all private ValueObject
constructors get a ClusterManager argument, and their static Create functions do
the create-a-manager-and-pass-it-to-value-object dance.
Reviewers: teemperor, JDevlieghere, jingham
Subscribers: mgorny, jfb, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D74153
Simon Pilgrim [Tue, 11 Feb 2020 11:59:17 +0000 (11:59 +0000)]
[X86][SSE] lowerShuffleAsBitRotate - lower to vXi8 shuffles to ROTL on pre-SSSE3 targets
Without PSHUFB we are better using ROTL (expanding to OR(SHL,SRL)) than using the generic v16i8 shuffle lowering - but if we can widen to v8i16 or more then the existing shuffles are still the better option.
Momchil Velikov [Tue, 11 Feb 2020 12:01:17 +0000 (12:01 +0000)]
[ARM][MVE] Fix a corner case of checking for MVE-I with -mfpu=none
-march=armv8.1-m.main+mve.fp+nomve -mfpu=none should disable FP
registers and instructions moving to/from FP registers.
This patch fixes the case when "+mve" (added to the feature list by
"+mve.fp"), is followed by "-mve" (added by "+nomve").
Differential Revision: https://reviews.llvm.org/D72633
Jonathan Coe [Mon, 10 Feb 2020 08:17:42 +0000 (08:17 +0000)]
[clang-format] Improve handling of C# attributes
Summary:
C# attributes can appear on classes and methods, in which case they should go on their own line, or on method parameters in which case
they should be left inline.
Reviewers: krasimir, MyDeveloperDay
Reviewed By: MyDeveloperDay
Subscribers: klimek
Tags: #clang-format
Differential Revision: https://reviews.llvm.org/D74265
Alexey Lapshin [Mon, 10 Feb 2020 20:57:01 +0000 (23:57 +0300)]
[Debuginfo][NFC] Rename error handling functions using the same pattern.
Summary:
That patch is extracted from https://reviews.llvm.org/D74308.
Currently there are two patterns to name error handling functions:
using "Callback" and "Handler". This patch uses "Handler" for all
usage places.
Reviewers: jhenderson, dblaikie, probinson, aprantl
Reviewed By: jhenderson, dblaikie
Subscribers: hiraditya, llvm-commits
Tags: #llvm, #debug-info
Differential Revision: https://reviews.llvm.org/D74354
Kamil Rytarowski [Tue, 11 Feb 2020 09:57:16 +0000 (10:57 +0100)]
[compiler-rt] Restrict sanitizer_linux.cpp dlinfo(3) to FreeBSD
FreeBSD is currently the only user in this file.
Accessing this symbol on Linux does not work as is.
Louis Dionne [Tue, 11 Feb 2020 10:57:35 +0000 (11:57 +0100)]
[libc++] span: Fix incorrect return type of span::subspan
The extent of the returned span was always std::dynamic_extent, which
is incorrect.
Thanks to Michael Schellenberger Costa for the patch.
Differential Revision: https://reviews.llvm.org/D71997
Mirko Brkusanin [Tue, 11 Feb 2020 10:35:23 +0000 (11:35 +0100)]
[Mips] Add intrinsics for 4-byte and 8-byte MSA loads/stores.
New intrinisics are implemented for when we need to port SIMD code from other
arhitectures and only load or store portions of MSA registers.
Following intriniscs are added which only load/store element 0 of a vector:
v4i32 __builtin_msa_ldrq_w (const void *, imm_n2048_2044);
v2i64 __builtin_msa_ldr_d (const void *, imm_n4096_4088);
void __builtin_msa_strq_w (v4i32, void *, imm_n2048_2044);
void __builtin_msa_str_d (v2i64, void *, imm_n4096_4088);
Differential Revision: https://reviews.llvm.org/D73644
Med Ismail Bennani [Mon, 10 Feb 2020 22:29:12 +0000 (23:29 +0100)]
[lldb/test] Add alternate symbol to StackFrame Recognizer
This reimplements commit
6b2979c12300b90a1e69791d43ee9cff14f4265e and updates
the tests to reflect the addition of the alternate symbol attribute.
Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
Louis Dionne [Tue, 11 Feb 2020 10:38:00 +0000 (11:38 +0100)]
[libcxx] span: Remove unneeded comparison
size_t is always greater than 0, so remove the artifact from the old
index_type.
Patch by Michael Schellenberger Costa.
Differential Revision: https://reviews.llvm.org/D71996
Raphael Isemann [Tue, 11 Feb 2020 10:28:14 +0000 (11:28 +0100)]
[lldb] Add test for calling overloaded virtual functions
Kerry McLaughlin [Tue, 11 Feb 2020 10:09:27 +0000 (10:09 +0000)]
[AArch64][SVE] Add SVE2 intrinsics for complex integer dot product
Summary:
Implements the following intrinsics:
- @llvm.aarch64.sve.cdot
- @llvm.aarch64.sve.cdot.lane
Reviewers: sdesmalen, efriedma, dancgr, c-rhodes, rengolin
Reviewed By: efriedma
Subscribers: tschuett, kristof.beyls, hiraditya, rkruppe, psnobl, cfe-commits, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D73687
OCHyams [Tue, 11 Feb 2020 10:07:03 +0000 (10:07 +0000)]
[DebugInfo][NFC] Fixup the UserValue methods to use FragmentInfo
Fixup the UserValue methods to use FragmentInfo instead of DIExpression because
the DIExpression is only ever used to get the to get the FragmentInfo. The
DIExpression is meaningless in the UserValue class because each definition point
added to a UserValue may have a unique DIExpression.
Reviewed By: aprantl
Differential Revision: https://reviews.llvm.org/D74057
OCHyams [Tue, 11 Feb 2020 10:02:31 +0000 (10:02 +0000)]
[DebugInfo][NFC] Rename the class DbgValueLocation to DbgVariableValue
Rename the class DbgValueLocation to DbgVariableValue and instances from Loc to
DbgValue. These names better express the new semantics introduced in D74053.
The class previously represented a { Location } only. It now represents a
{ Location, DIExpression } pair which together describe a value.
Reviewed By: aprantl
Differential Revision: https://reviews.llvm.org/D74055
OCHyams [Tue, 11 Feb 2020 09:44:32 +0000 (09:44 +0000)]
[DebugInfo] Teach LDV how to handle identical variable fragments
LiveDebugVariables uses interval maps to explicitly represent DBG_VALUE
intervals. DBG_VALUEs are filtered into an interval map based on their {
Variable, DIExpression }. The interval map will coalesce adjacent entries that
use the same { Location }. Under this model, DBG_VALUEs which refer to the same
bits of the same variable will be filtered into different interval maps if they
have different DIExpressions which means the original intervals will not be
properly preserved.
This patch fixes the problem by using { Variable, Fragment } to filter the
DBG_VALUEs into maps, and coalesces adjacent entries iff they have the same
{ Location, DIExpression } pair.
The solution is not perfect because we see the similar issues appear when
partially overlapping fragments are encountered, but is far simpler than a
complete solution (i.e. D70121).
Fixes: pr41992, pr43957
Reviewed By: aprantl
Differential Revision: https://reviews.llvm.org/D74053
Louis Dionne [Tue, 11 Feb 2020 10:16:40 +0000 (11:16 +0100)]
[libc++] span: Cleanup includes
Thanks to Michael Schellenberger Costa for the patch.
Differential Revision: https://reviews.llvm.org/D72036
Raphael Isemann [Tue, 11 Feb 2020 10:12:54 +0000 (11:12 +0100)]
[lldb] Add test for lldb_private::Stream's indentation functionality
Georgii Rymar [Thu, 6 Feb 2020 11:15:59 +0000 (14:15 +0300)]
[llvm-readobj][test] - Add a test for --elf-cg-profile option.
This adds a test to document --elf-cg-profile option we have.
I am going to refactor this area, and this patch is mostly to
create a base for a follow-up change.
Differential revision: https://reviews.llvm.org/D74115
Louis Dionne [Tue, 11 Feb 2020 09:59:12 +0000 (10:59 +0100)]
[libcxx] Qualify make_move_iterator in vector::insert for input iterators
Unqualified calls to make_move_iterator in the vector::insert overload
for input iterators lead to ADL issues: https://gcc.godbolt.org/z/bmcNbh
Patch by Logan Smith.
Differential Revision: https://reviews.llvm.org/D74290
Raphael Isemann [Mon, 10 Feb 2020 12:50:29 +0000 (13:50 +0100)]
[lldb] Add test for C++ constructor calls from the expression evaluator
Jay Foad [Mon, 10 Feb 2020 14:09:34 +0000 (14:09 +0000)]
[AMDGPU] Fix non-deterministic iteration order
Summary:
As far as I know this did not affect code generation, but it did affect
the order of -debug-only=si-wqm output and the naming of autonamed
values in -print-after=si-wqm output.
Reviewers: arsenm, rampitec, nhaehnle
Subscribers: kzhuravl, jvesely, wdng, yaxunl, dstuttard, tpr, t-tye, hiraditya, mgrang, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D74317
Haojian Wu [Tue, 11 Feb 2020 09:05:52 +0000 (10:05 +0100)]
[clang-rename] Fix the failure rename test.
We cannot run two different tests in a single lit test, split into two.
Haojian Wu [Fri, 7 Feb 2020 13:27:54 +0000 (14:27 +0100)]
[clang-rename] Fix the missing template constructors.
Summary:
When renaming a class with template constructors, we are missing the
occurrences of the template constructors, because getUSRsForDeclaration doesn't
give USRs of the templated constructors (they are not in the normal `ctors()`
method).
Reviewers: kbobyrev
Subscribers: jkorous, arphaman, kadircet, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D74216
Haojian Wu [Tue, 11 Feb 2020 08:27:00 +0000 (09:27 +0100)]
[clangd] Remove a FIXME which has been done, NFC.
Raphael Isemann [Tue, 11 Feb 2020 08:05:37 +0000 (09:05 +0100)]
[lldb][NFC] Remove several inefficient ConstString -> const char * -> StringRef conversions
StringRef will call strlen on the C string which is inefficient (as ConstString already
knows the string lenght and so does StringRef). This patch replaces all those calls
with GetStringRef() which doesn't recompute the length.
Raphael Isemann [Tue, 11 Feb 2020 07:19:59 +0000 (08:19 +0100)]
[lldb][NFC] Refactor TypeSystemClang::GetTypeName
John Regehr [Tue, 11 Feb 2020 07:05:16 +0000 (00:05 -0700)]
remove outdated comparison with other open-source c++ compilers
Craig Topper [Mon, 10 Feb 2020 06:48:10 +0000 (22:48 -0800)]
[X86] Custom lower ISD::FP16_TO_FP and ISD::FP_TO_FP16 on f16c targets instead of using isel patterns.
We need to use vector instructions for these operations. Previously
we handled this with isel patterns that used extra instructions
and copies to handle the the conversions.
Now we use custom lowering to emit the conversions. This allows
them to be pattern matched and optimized on their own. For
example we can now emit vpextrw to store the result if its going
directly to memory.
I've forced the upper elements to VCVTPHS2PS to zero to keep some
code similar. Zeroes will be needed for strictfp. I've added a
DAG combine for (fp16_to_fp (fp_to_fp16 X)) to avoid extra
instructions in between to be closer to the previous codegen.
This is a step towards strictfp support for f16 conversions.
Kai Luo [Tue, 11 Feb 2020 05:58:35 +0000 (13:58 +0800)]
[NFC] Fix typo.
Fangrui Song [Wed, 5 Feb 2020 04:33:41 +0000 (20:33 -0800)]
[ELF][RISCV] Add R_RISCV_IRELATIVE
https://github.com/riscv/riscv-elf-psabi-doc/pull/131 assigned 58 to R_RISCV_IRELATIVE.
Differential Revision: https://reviews.llvm.org/D74022
Johannes Doerfert [Mon, 10 Feb 2020 17:07:14 +0000 (11:07 -0600)]
[CodingStandards] Clarify C++ Standard Library usage
The existing wording leaves it unclear if C++ standard library data
structures should be preferred over custom LLVM ones, e.g., SmallVector,
even though common practice seems clear on the issue. This change makes
the wording more explicit and aligns it better with the code base.
Some motivating statistics:
```
ag SmallVector llvm/lib/ | wc
8846 40306 901421
ag 'std::vector' llvm/lib/ | wc
2123 8990 214482
ag SmallVector clang/lib/ | wc
3023 13824 281691
ag 'std::vector' clang/lib/ | wc
719 2914 72817
```
Differential Revision: https://reviews.llvm.org/D74340
Evgenii Stepanov [Tue, 11 Feb 2020 02:26:18 +0000 (18:26 -0800)]
[asan] Disable qsort interceptor on Android.
The interceptor uses thread-local variables, which (until very recently)
are emu-tls. An access to such variable may call malloc which can
deadlock the runtime library.
Yuanfang Chen [Tue, 11 Feb 2020 02:22:09 +0000 (18:22 -0800)]
Reland "[NFC][libFuzzer] Prefix TempPath with string showing the work it is doing."
With fix (somehow one hunk is missed).
Jason Molenda [Tue, 11 Feb 2020 02:16:15 +0000 (18:16 -0800)]
Only perform the login_session_has_gui_access on macOS
Michael Kruse [Tue, 11 Feb 2020 02:11:51 +0000 (20:11 -0600)]
[Polly][Docs] Fix wrong claim about optimization levels.
Thanks Justin Paston-Cooper for the report.
Yuanfang Chen [Tue, 11 Feb 2020 02:06:17 +0000 (18:06 -0800)]
Revert "[NFC][libFuzzer] Prefix TempPath with string showing the work it is doing."
This reverts commit
8a29cb4421f1196bc40c4db5298ca13df516bf19.
fuzzer-linux bot has failure because of this.
River Riddle [Tue, 11 Feb 2020 01:51:26 +0000 (17:51 -0800)]
[llvm][TableGen] Define FieldInit::isConcrete overload
Summary:
There are a few field init values that are concrete but not complete/foldable (e.g. `?`). This allows for using those values as initializers without erroring out.
Example:
```
class A {
string value = ?;
}
class B<A impl> : A {
let value = impl.value; // This currently emits an error.
let value = ?; // This doesn't emit an error.
}
```
Differential Revision: https://reviews.llvm.org/D74360
Nathan James [Tue, 11 Feb 2020 02:03:37 +0000 (02:03 +0000)]
Fix Sphinx failure on ReadabilityQualifiedAuto docs
Michael Kruse [Tue, 11 Feb 2020 00:50:51 +0000 (18:50 -0600)]
[Polly] Silence mixed signed/unsigned comparison warnings. NFC.
ISL changed some return types from unsigned to
isl_size (typedef of int), which results in such warnings.
Michael Kruse [Mon, 10 Feb 2020 20:51:33 +0000 (14:51 -0600)]
[Polly] Update ISL to isl-0.22.1-87-gfee05a13.
The primary motivation is to fix an assertion failure in
isl_basic_map_alloc_equality:
isl_assert(ctx, room_for_con(bmap, 1), return -1);
Although the assertion does not occur anymore, I could not identify
which of ISL's commits fixed it.
Compared to the previous ISL version, Polly requires some changes for this update
* Since ISL commit
20d3574 "perform parameter alignment by modifying both arguments to function"
isl_*_gist_* and similar functions do not always align the paramter
list anymore. This caused the parameter lists in JScop files to
become out-of-sync. Since many regression tests use JScop files with
a fixed parameter list and order, we explicitly call align_params to
ensure a predictable parameter list.
* ISL changed some return types to isl_size, a typedef of (signed) int.
This caused some issues where the return type was unsigned int before:
- No overload for std::max(unsigned,isl_size)
- It cause additional 'mixed signed/unsigned comparison' warnings.
Since they do not break compilation, and sizes larger than 2^31
were never supported, I am going to fix it separately.
* With the change to isl_size, commit
57d547 "isl_*_list_size: return isl_size"
also changed the return value in case of an error from 0 to -1. This
caused undefined looping over isl_iterator since the 'end iterator'
got index -1, never reached from the 'begin iterator' with index 0.
* Some internal changes in ISL caused the number of operations to
increase when determining access ranges to determine aliasing
overlaps. In one test, this caused exceeding the default limit of
800000. The operations-limit was disabled for this test.
Peter Collingbourne [Mon, 10 Feb 2020 23:53:07 +0000 (15:53 -0800)]
scudo: Fix Android build.
Differential Revision: https://reviews.llvm.org/D74366
Yuanfang Chen [Mon, 10 Feb 2020 22:33:27 +0000 (14:33 -0800)]
[NFC][libFuzzer] Prefix TempPath with string showing the work it is doing.
Yuanfang Chen [Mon, 10 Feb 2020 22:31:47 +0000 (14:31 -0800)]
[libFuzzer] communicate through pipe to subprocess for MinimizeCrashInput
For CleanseCrashInput, discards stdout output anyway since it is not used.
These changes are to defend against aggressive PID recycle on windows to reduce the chance of contention on files.
Using pipe instead of file also workaround the problem that when the
process is spawned by llvm-lit, the aborted process keeps a handle to the
output file such that the output file can not be removed. This will
cause random test failures.
https://devblogs.microsoft.com/oldnewthing/
20110107-00/?p=11803
Reviewers: kcc, vitalybuka
Reviewed By: vitalybuka
Differential Revision: https://reviews.llvm.org/D73329
diggerlin [Tue, 11 Feb 2020 00:23:01 +0000 (19:23 -0500)]
[NFC] Refactor the tuple of symbol information with structure for llvm-objdump
SUMMARY:
refator the std::tuple<uint64_t, StringRef, uint8_t> to structor
Reviewers: daltenty
Subscribers: wuzish, nemanjai, hiraditya
Differential Revision: https://reviews.llvm.org/D74240
David Blaikie [Mon, 10 Feb 2020 23:47:38 +0000 (15:47 -0800)]
DebugInfo: Avoid truncating addr_base to 32 bits
I'm /guessing/ this isn't terribly testable without a very large input
file. Even generated from a more compact assembly file, it's probably
best not to generate a giant temporary test file - if I'm wrong about
that/anyone has good suggestions for testing, I'm all ears!
Based on post-commit review feedback from Igor Kudrin on
eed0242330926815d19dd0d54f393576bcffc762
Amara Emerson [Mon, 10 Feb 2020 23:41:53 +0000 (15:41 -0800)]
[GlobalISel][CallLowering] Use stripPointerCasts().
A downstream test exposed a simple logic bug with the manual pointer
stripping code, fix that by just using stripPointerCasts() on the value.
I don't think there's a way to expose this issue upstream.
Davide Italiano [Mon, 10 Feb 2020 23:17:31 +0000 (15:17 -0800)]
[TestKernVerStrLCNOTE] Check the *right* architecture.
Eric Christopher [Mon, 10 Feb 2020 23:06:32 +0000 (15:06 -0800)]
Fix you->your typo.
Peter Collingbourne [Wed, 5 Feb 2020 22:49:19 +0000 (14:49 -0800)]
scudo: Add a dump of primary allocation sizes to malloc_info output.
This will be useful for optimizing the size class map.
Differential Revision: https://reviews.llvm.org/D74098
Peter Collingbourne [Wed, 5 Feb 2020 03:50:25 +0000 (19:50 -0800)]
scudo: Table driven size classes for Android allocator.
Add an optional table lookup after the existing logarithm computation
for MidSize < Size <= MaxSize during size -> class lookups. The lookup is
O(1) due to indexing a precomputed (via constexpr) table based on a size
table. Switch to this approach for the Android size class maps.
Other approaches considered:
- Binary search was found to have an unacceptable (~30%) performance cost.
- An approach using NEON instructions (see older version of D73824) was found
to be slightly slower than this approach on newer SoCs but significantly
slower on older ones.
By selecting the values in the size tables to minimize wastage (for example,
by passing the malloc_info output of a target program to the included
compute_size_class_config program), we can increase the density of allocations
at a small (~0.5% on bionic malloc_sql_trace as measured using an identity
table) performance cost.
Reduces RSS on specific Android processes as follows (KB):
Before After
zygote (median of 50 runs) 26836 26792 (-0.2%)
zygote64 (median of 50 runs) 30384 30076 (-1.0%)
dex2oat (median of 3 runs) 375792 372952 (-0.8%)
I also measured the amount of whole-system idle dirty heap on Android by
rebooting the system and then running the following script repeatedly until
the results were stable:
for i in $(seq 1 50); do grep -A5 scudo: /proc/*/smaps | grep Pss: | cut -d: -f2 | awk '{s+=$1} END {print s}' ; sleep 1; done
I did this 3 times both before and after this change and the results were:
Before: 365650, 356795, 372663
After: 344521, 356328, 342589
These results are noisy so it is hard to make a definite conclusion, but
there does appear to be a significant effect.
On other platforms, increase the sizes of all size classes by a fixed offset
equal to the size of the allocation header. This has also been found to improve
density, since it is likely for allocation sizes to be a power of 2, which
would otherwise waste space by pushing the allocation into the next size class.
Differential Revision: https://reviews.llvm.org/D73824
Peter Collingbourne [Mon, 10 Feb 2020 21:36:49 +0000 (13:36 -0800)]
scudo: Instead of exporting a pointer to the allocator, export the allocator directly. NFCI.
This lets us remove two pointer indirections (one by removing the pointer,
and another by making the AllocatorPtr declaration hidden) in the C++ wrappers.
Differential Revision: https://reviews.llvm.org/D74356
Dimitry Andric [Mon, 10 Feb 2020 22:43:12 +0000 (23:43 +0100)]
[Sanitizers] Get link map on FreeBSD and NetBSD via documented API
Summary:
Instead of hand-crafting an offset into the structure returned by
dlopen(3) to get at the link map, use the documented API. This is
described in dlinfo(3): by calling it with `RTLD_DI_LINKMAP`, the
dynamic linker ensures the right address is returned.
This is a recommit of
92e267a94dc4272511be674062f8a3e8897b7083, with
dlinfo(3) expliclity being referenced only for FreeBSD, non-Android
Linux, NetBSD and Solaris. Other OSes will have to add their own
implementation.
Reviewers: devnexen, emaste, MaskRay, krytarowski
Reviewed By: krytarowski
Subscribers: krytarowski, vitalybuka, #sanitizers, llvm-commits
Tags: #sanitizers, #llvm
Differential Revision: https://reviews.llvm.org/D73990
Vedant Kumar [Mon, 10 Feb 2020 22:33:44 +0000 (14:33 -0800)]
Revert "[Host.mm] Check for the right macro instead of inlining it"
This breaks macOS, because TARGET_OS_EMBEDDED is always defined. Thanks
to Jason Molenda for pointing this out.
Revert "Do not define AcceptPIDFromInferior when it will not be used"
This reverts commit
d23c15a687ff15327b88fa64da3184395012c2dc.
This reverts commit
936d1427da1432d724dfa5851097347bcdf7c521.
Dimitry Andric [Mon, 10 Feb 2020 22:24:26 +0000 (23:24 +0100)]
Revert "[Sanitizers] Get link map on FreeBSD via documented API"
This reverts commit
92e267a94dc4272511be674062f8a3e8897b7083, as it
appears Android is missing dlinfo(3).
Sanjay Patel [Mon, 10 Feb 2020 22:13:26 +0000 (17:13 -0500)]
[EarlyCSE] avoid crashing when detecting min/max/abs patterns (PR41083)
As discussed in PR41083:
https://bugs.llvm.org/show_bug.cgi?id=41083
...we can assert/crash in EarlyCSE using the current hashing scheme and
instructions with flags.
ValueTracking's matchSelectPattern() may rely on overflow (nsw, etc) or
other flags when detecting patterns such as min/max/abs composed of
compare+select. But the value numbering / hashing mechanism used by
EarlyCSE intersects those flags to allow more CSE.
Several alternatives to solve this are discussed in the bug report.
This patch avoids the issue by doing simple matching of min/max/abs
patterns that never requires instruction flags. We give up some CSE
power because of that, but that is not expected to result in much
actual performance difference because InstCombine will canonicalize
these patterns when possible. It even has this comment for abs/nabs:
/// Canonicalize all these variants to 1 pattern.
/// This makes CSE more likely.
(And this patch adds PhaseOrdering tests to verify that the expected
transforms are still happening in the standard optimization pipelines.
I left this code to use ValueTracking's "flavor" enum values, so we
don't have to change the callers' code. If we decide to go back to
using the ValueTracking call (by changing the hashing algorithm
instead), it should be obvious how to replace this chunk.
Differential Revision: https://reviews.llvm.org/D74285
Vedant Kumar [Mon, 10 Feb 2020 21:10:47 +0000 (13:10 -0800)]
[ubsan] Null-check and adjust TypeLoc before using it
Null-check and adjut a TypeLoc before casting it to a FunctionTypeLoc.
This fixes a crash in -fsanitize=nullability-return, and also makes the
location of the nonnull type available when the return type is adjusted.
rdar://
59263039
Differential Revision: https://reviews.llvm.org/D74355
Ted Woodward [Mon, 10 Feb 2020 20:42:48 +0000 (14:42 -0600)]
Remove lit feature object-emission
Summary: The lit feature object-emission was added because Hexagon did not support the integrated assembler, so some tests needed to be turned off with a Hexagon target. Hexagon now supports the integrated assembler, so this feature can be removed.
Reviewers: bcain, kparzysz, jverma, whitequark, JDevlieghere
Reviewed By: JDevlieghere
Subscribers: mehdi_amini, hiraditya, steven_wu, dexonsmith, arphaman, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D73568
LLVM GN Syncbot [Mon, 10 Feb 2020 21:43:41 +0000 (21:43 +0000)]
[gn build] Port
bb383ae6120
Hiroshi Yamauchi [Thu, 30 Jan 2020 21:05:31 +0000 (13:05 -0800)]
[CallPromotionUtils] Add tryPromoteCall.
Summary: It attempts to devirtualize a call on alloca through vtable loads.
Reviewers: davidxl
Subscribers: mgorny, Prazek, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D71308
Davide Italiano [Mon, 10 Feb 2020 20:43:59 +0000 (12:43 -0800)]
Revert "[lldb] Fix+re-enable Assert StackFrame Recognizer on Linux"
This reverts commit
1a39f1b966a8d8f15ed0d5a832d5097cccefe93b as
it breaks macOS.
Lei Zhang [Wed, 5 Feb 2020 01:58:10 +0000 (20:58 -0500)]
[mlir][spirv] Use spv.entry_point_abi in GPU to SPIR-V conversions
We have spv.entry_point_abi for specifying the local workgroup size.
It should be decorated onto input gpu.func ops to drive the SPIR-V
CodeGen to generate the proper SPIR-V module execution mode. Compared
to using command-line options for specifying the configuration, using
attributes also has the benefits that 1) we are now able to use
different local workgroup for different entry points and 2) the
tests contains the configuration directly.
Differential Revision: https://reviews.llvm.org/D74012
Alexey Bataev [Mon, 10 Feb 2020 20:49:05 +0000 (15:49 -0500)]
[OPENMP50]Add support for 'release' clause.
Added full support for 'release' clause in flush|atomic directives.
Hanhan Wang [Sat, 8 Feb 2020 00:30:55 +0000 (19:30 -0500)]
[mlir][Linalg] Add a roundtrip test for indexed_generic op with tensors.
Summary:
After D72555 has been landed, `linalg.indexed_generic` also accepts ranked
tensor as input and output. Add a test for it.
Differential Revision: https://reviews.llvm.org/D74267
Martin Storsjö [Wed, 5 Feb 2020 11:53:56 +0000 (13:53 +0200)]
[test] Disable the Passes/PluginsTest cases on windows with BUILD_SHARED_LIBS
The plugin expects to have undefined references to symbols exported
by the loading process, which isn't supported by shared libraries
on windows.
Differential Revision: https://reviews.llvm.org/D74042
Nico Weber [Mon, 10 Feb 2020 20:47:46 +0000 (15:47 -0500)]
git bisect docs: formatting tweaks
Xiangling Liao [Mon, 10 Feb 2020 18:52:08 +0000 (13:52 -0500)]
[AIX] Enable frame pointer for AIX and add related test suite
This patch:
- enable frame pointer for AIX;
- update some of red zone comments;
- add/update testcases;
Differential Revision: https://reviews.llvm.org/D72454
Matt Arsenault [Mon, 10 Feb 2020 20:18:30 +0000 (15:18 -0500)]
RegisterCoalescer: Add LaneMask to debug printing
Nico Weber [Mon, 10 Feb 2020 20:33:20 +0000 (15:33 -0500)]
add GitBisecting to toctrees to try and placate the sphinx bot
Sterling Augustine [Mon, 10 Feb 2020 20:19:35 +0000 (12:19 -0800)]
[DebugInfo] Support file-level include directories when generating DWARFv5 LineTable prologues.
Differential Revision: https://reviews.llvm.org/D74249
Nico Weber [Mon, 10 Feb 2020 20:18:15 +0000 (15:18 -0500)]
git bisect docs: try to make commit ascii art show up
Jan Korous [Mon, 10 Feb 2020 20:11:47 +0000 (12:11 -0800)]
Reland "[clangd][test] Disable a particular testcase in FindExplicitReferencesTest when LLVM_ENABLE_EXPENSIVE_CHECKS""
The test got re-enabled after
d54d71b67e60 landed.
However it seems that the order is still not deterministic as it
currently passes with -DLLVM_ENABLE_EXPENSIVE_CHECKS=OFF but randomly
fails with expensive checks ON.
Sanjay Patel [Mon, 10 Feb 2020 20:10:47 +0000 (15:10 -0500)]
[Transforms] add phase ordering tests for min/max/abs; NFC
Test that instcombine and early-cse can cooperate
to reduce sequences of select patterns that are not
composed of the same underlying instructions.
There's a bug in EarlyCSE (PR41083), and we can test
how much a possible fix (D74285) may affect optimization.
Vedant Kumar [Mon, 10 Feb 2020 20:06:46 +0000 (12:06 -0800)]
Do not define AcceptPIDFromInferior when it will not be used
Nicolas Vasilache [Sat, 8 Feb 2020 18:51:10 +0000 (13:51 -0500)]
[mlir][VectorOps][EDSC] Add EDSC for VectorOps
Summary:
This revision adds EDSC support for VectorOps to enable the creation of a `vector_matmul` declaratively. The `vector_matmul` is a simple configuration
of the `vector.contract` op that follows the StructuredOps abstraction.
Differential Revision: https://reviews.llvm.org/D74284
Sanjay Patel [Mon, 10 Feb 2020 19:50:51 +0000 (14:50 -0500)]
[InstCombine] fix use check when canonicalizing abs/nabs
We were checking for extra uses of the negated operand even
if we were not going to create it as part of this canonicalization.
This was showing up as a regression when we limit EarlyCSE as
proposed in D74285.
Sanjay Patel [Mon, 10 Feb 2020 19:42:50 +0000 (14:42 -0500)]
[InstCombine] add tests for abs with extra use of operand; NFC
Alexey Bataev [Mon, 10 Feb 2020 19:30:39 +0000 (14:30 -0500)]
[OPENMP50]Support for acquire clause.
Added full support for acquire clause in flush|atomic directives.
diggerlin [Mon, 10 Feb 2020 19:45:54 +0000 (14:45 -0500)]
[AIX][XCOFF] Support Mergeable2ByteCString and Mergeable4ByteCString
SUMMARY:
The patch is enable to support Mergeable2ByteCString and Mergeable4ByteCString
Reviewers: daltenty
Subscribers: wuzish, nemanjai, hiraditya
Differential Revision: https://reviews.llvm.org/D74164
Ted Woodward [Mon, 10 Feb 2020 19:40:17 +0000 (13:40 -0600)]
Don't fail step out if remote server doesn't implement qMemoryRegionInfo
Summary:
The return address validation in D71372 will fail if the memory permissions can't be determined. Many embedded stubs either don't implement the qMemoryRegionInfo packet, or don't have memory permissions at all.
Remove the return from the if clause that calls GetLoadAddressPermissions, so this call failing doesn't cause the step out to abort. Instead, assume that the memory permission check doesn't apply to this type of target.
Reviewers: labath, jingham, clayborg, mossberg
Reviewed By: labath, jingham
Subscribers: lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D72513
Nico Weber [Tue, 4 Feb 2020 20:44:09 +0000 (15:44 -0500)]
Add documentation on git bisecting across the MLIR merge
Differential Revision: https://reviews.llvm.org/D73988
serge-sans-paille [Thu, 6 Feb 2020 14:58:29 +0000 (15:58 +0100)]
Prefer __vector over vector keyword for altivec
`vector' uses the keyword-and-predefine mode from gcc, while __vector is
reliably supported.
As a side effect, it also makes the code consistent in its usage of __vector.
Differential Revision: https://reviews.llvm.org/D74129
David Goldman [Mon, 3 Feb 2020 20:14:49 +0000 (15:14 -0500)]
[clang] Add `forceReload` clangd extension to 'textDocument/didChange'
Summary:
- This option forces a preamble rebuild to handle the odd case
of a missing header file being added
Reviewers: sammccall
Subscribers: ilya-biryukov, javed.absar, MaskRay, jkorous, arphaman, jfb, kadircet, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D73916
Nico Weber [Mon, 10 Feb 2020 18:51:23 +0000 (13:51 -0500)]
fix some typos to cycle bots
Eric Christopher [Mon, 10 Feb 2020 18:31:19 +0000 (10:31 -0800)]
Continue removing llgo.