Fangrui Song [Fri, 15 Mar 2019 10:20:51 +0000 (10:20 +0000)]
[llvm-objcopy] Don't use {}; NFC
llvm-svn: 356244
Sam Parker [Fri, 15 Mar 2019 10:19:32 +0000 (10:19 +0000)]
[ARM][ParallelDSP] Disable for big-endian
Bail early when we don't have a preheader and also if the target is
big endian because it's written with only little endian in mind!
Differential Revision: https://reviews.llvm.org/D59368
llvm-svn: 356243
Jonas Hahnfeld [Fri, 15 Mar 2019 10:15:13 +0000 (10:15 +0000)]
[msan] Fix BMI2 detection in msan tests, take 2.
It's not enough if only one bit is present, we need to check that
both are set. This finally fixes the test failures for me.
llvm-svn: 356242
Fangrui Song [Fri, 15 Mar 2019 09:40:03 +0000 (09:40 +0000)]
[COFF] Delete unused declarations and add a missing forward declaration. NFC
llvm-svn: 356241
Fangrui Song [Fri, 15 Mar 2019 07:16:39 +0000 (07:16 +0000)]
[ELF] Delete unused forward declarations and unused DynamicReloc::getInputSec(). NFC
llvm-svn: 356239
Petar Avramovic [Fri, 15 Mar 2019 07:07:50 +0000 (07:07 +0000)]
[MIPS GlobalISel] Improve selection of constants
Certain 32 bit constants can be generated with a single instruction
instead of two. Implement materialize32BitImm function for MIPS32.
Differential Revision: https://reviews.llvm.org/D59369
llvm-svn: 356238
Fangrui Song [Fri, 15 Mar 2019 06:58:23 +0000 (06:58 +0000)]
[ELF] De-template wrapSymbols, isReserved and addGotEntry. NFC
llvm-svn: 356237
Yonghong Song [Fri, 15 Mar 2019 05:51:25 +0000 (05:51 +0000)]
[BPF] do not generate unused local/global types
The kernel currently has a limit for # of types to be 64KB and
the size of string subsection to be 64KB. A simple bcc tool
runqlat.py generates:
. the size of ~33KB type section, roughly ~10K types
. the size of ~17KB string section
The majority type is from the types referenced by local
variables in the bpf program. For example, the kernel "task_struct"
itself recursively brings in ~900 other types.
This patch did the following optimization to avoid generating
unused types:
. do not generate types for local variables unless they are
function arguments.
. do not generate types for external globals.
If an external global is not used in the program, llvm
already removes it from IR, so global variable saving is
typical small. For runqlat.py, only one variable "llvm.used"
is the external global.
The types for locals and external globals can be added back
once there is a usage for them.
After the above optimization, the runqlat.py generates:
. the size of ~1.5KB type section, roughtly 500 types
. the size of ~0.7KB string section
UPDATE:
resubmitted the patch after previous revert with
the following fix:
use Global.hasExternalLinkage() to test "external"
linkage instead of using Global.getInitializer(),
which will assert on external variables.
Signed-off-by: Yonghong Song <yhs@fb.com>
llvm-svn: 356234
Yonghong Song [Fri, 15 Mar 2019 05:02:19 +0000 (05:02 +0000)]
Revert "[BPF] do not generate unused local/global types"
This reverts commit r356232.
Reason: test failure with ASSERT on enabled build.
llvm-svn: 356233
Yonghong Song [Fri, 15 Mar 2019 04:42:01 +0000 (04:42 +0000)]
[BPF] do not generate unused local/global types
The kernel currently has a limit for # of types to be 64KB and
the size of string subsection to be 64KB. A simple bcc tool
runqlat.py generates:
. the size of ~33KB type section, roughly ~10K types
. the size of ~17KB string section
The majority type is from the types referenced by local
variables in the bpf program. For example, the kernel "task_struct"
itself recursively brings in ~900 other types.
This patch did the following optimization to avoid generating
unused types:
. do not generate types for local variables unless they are
function arguments.
. do not generate types for external globals.
If an external global is not used in the program, llvm
already removes it from IR, so global variable saving is
typical small. For runqlat.py, only one variable "llvm.used"
is the external global.
The types for locals and external globals can be added back
once there is a usage for them.
After the above optimization, the runqlat.py generates:
. the size of ~1.5KB type section, roughtly 500 types
. the size of ~0.7KB string section
Signed-off-by: Yonghong Song <yhs@fb.com>
llvm-svn: 356232
Richard Trieu [Fri, 15 Mar 2019 04:26:02 +0000 (04:26 +0000)]
Remove an assert in template pack deduction during nested instantiation.
llvm-svn: 356231
Fangrui Song [Fri, 15 Mar 2019 03:37:42 +0000 (03:37 +0000)]
[ELF] Add a test for large .bss.rel.ro
Reviewers: ruiu, pcc, espindola
Reviewed By: pcc
Subscribers: emaste, arichardson, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D59404
llvm-svn: 356230
Fangrui Song [Fri, 15 Mar 2019 03:20:13 +0000 (03:20 +0000)]
[ELF] Fix 3 tests after D56828
arm-plt-reloc.s arm-thumb-plt-reloc.s: update offset calculations
pack-dyn-relocs-loop.s: this test is very sensitive to exact section
offsets and sizes. If we comment out the following two lines in
SyntheticSections.cpp, we should reproduce `ld.lld: error: thunk
creation not converged` caused by oscillation of the section size.
if (RelocData.size() < OldSize)
RelocData.append(OldSize - RelocData.size(), 0);
Use -z norelro to counteract the layout change (to be more specific,
we have to place .dynamic below .foo so that offset(foo) remains 0x10004)
llvm-svn: 356229
Aaron Puchert [Fri, 15 Mar 2019 02:30:07 +0000 (02:30 +0000)]
Add missing override specifier [NFC]
This should fix a -Winconsistent-missing-override warning that is only
visible when Z3 is enabled.
llvm-svn: 356228
Jorge Gorbe Moya [Fri, 15 Mar 2019 01:46:50 +0000 (01:46 +0000)]
[lldb-vscode] Fix dangling pointer in request_evaluate.
SBError::GetCString() returns a pointer to a string owned by the SBError
object. The code here was calling GetCString on a temporary and using
the returned pointer after the temporary was destroyed.
Differential Revision: https://reviews.llvm.org/D59400
llvm-svn: 356227
Fangrui Song [Fri, 15 Mar 2019 01:29:57 +0000 (01:29 +0000)]
[ELF] Split RW PT_LOAD on the PT_GNU_RELRO boundary
Summary:
Based on Peter Collingbourne's suggestion in D56828.
Before D56828: PT_LOAD(.data PT_GNU_RELRO(.data.rel.ro .bss.rel.ro) .bss)
Old: PT_LOAD(PT_GNU_RELRO(.data.rel.ro .bss.rel.ro) .data .bss)
New: PT_LOAD(PT_GNU_RELRO(.data.rel.ro .bss.rel.ro)) PT_LOAD(.data. .bss)
The new layout reflects the runtime memory mappings.
By having two PT_LOAD segments, we can utilize the NOBITS part of the
first PT_LOAD and save bytes for .bss.rel.ro.
.bss.rel.ro is currently small and only used by copy relocations of
symbols in read-only segments, but it can be used for other purposes in
the future, e.g. if a relro section's statically relocated data is all
zeros, we can move it to .bss.rel.ro.
Reviewers: espindola, ruiu, pcc
Reviewed By: ruiu
Subscribers: nemanjai, jvesely, nhaehnle, javed.absar, kbarton, emaste, arichardson, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D58892
llvm-svn: 356226
Davide Italiano [Fri, 15 Mar 2019 00:45:57 +0000 (00:45 +0000)]
[DataFormatters] Remove LLDB_DISABLE_PYTHON from FormatManager.
And DataVisualization. One step closer.
llvm-svn: 356225
Marshall Clow [Fri, 15 Mar 2019 00:29:35 +0000 (00:29 +0000)]
Mark vector::operator[] and front/back as noexcept. We already do this for string and string_view. This should give better codegen inside of noexcept functions. Add tests for op[]/front/back/at, because apparently we had none.
llvm-svn: 356224
Artem Dergachev [Fri, 15 Mar 2019 00:26:17 +0000 (00:26 +0000)]
[analyzer] RetainCount: A function isn't a CFRetain if it takes no arguments.
Don't crash when a function has a name that starts with "CF" and ends with
"Retain" but takes 0 arguments. In particular, don't try to treat it as if
it returns its first argument.
These problems are inevitable because the checker is naming-convention-based,
but at least we shouldn't crash.
Differential Revision: https://reviews.llvm.org/D59123
llvm-svn: 356223
Artem Dergachev [Fri, 15 Mar 2019 00:22:59 +0000 (00:22 +0000)]
[analyzer] Support C++17 aggregates with bases without constructors.
RegionStore now knows how to bind a nonloc::CompoundVal that represents the
value of an aggregate initializer when it has its initial segment of sub-values
correspond to base classes.
Additionally, fixes the crash from pr40022.
Differential Revision: https://reviews.llvm.org/D59054
llvm-svn: 356222
Sam Clegg [Fri, 15 Mar 2019 00:20:13 +0000 (00:20 +0000)]
[WebAssembly] Remove unused load/store patterns that use texternalsym
Differential Revision: https://reviews.llvm.org/D59395
llvm-svn: 356221
Yan Zhang [Fri, 15 Mar 2019 00:17:41 +0000 (00:17 +0000)]
Fixed global constant/variable naming check on C++ class for ObjC++ files.
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D59283
llvm-svn: 356220
Matt Arsenault [Thu, 14 Mar 2019 23:45:09 +0000 (23:45 +0000)]
AMDGPU: Remove intrinsic operand assert
Before r355981, this was under LLVM_DEBUG. I don't think the assert is
quite right, but this really should be a verifier check. Instcombine
should not be asserting on this sort of thing.
llvm-svn: 356219
Sanjay Patel [Thu, 14 Mar 2019 23:14:31 +0000 (23:14 +0000)]
[CGP] add another bailout for degenerate code (PR41064)
This is almost the same as:
rL355345
...and should prevent any potential crashing from examples like:
https://bugs.llvm.org/show_bug.cgi?id=41064
...although the bug was masked by:
rL355823
...and I'm not sure how to repro the problem after that change.
llvm-svn: 356218
Paul Robinson [Thu, 14 Mar 2019 23:09:17 +0000 (23:09 +0000)]
Tighten up tests that use -debugify as a shortcut. NFC
These now verify that a given instruction has a specific source
location, rather than any old location. We want to make sure we
propagate the correct locations from one instruction to another.
llvm-svn: 356217
Eli Friedman [Thu, 14 Mar 2019 23:08:19 +0000 (23:08 +0000)]
[MC] Sort FDEs by the associated CIE before emitting them.
This isn't necessary according to the DWARF standard, but it matches the
.eh_frame sections emitted by other tools in practice, and the Android
libunwindstack rejects .eh_frame sections where an FDE refers to a CIE
other than the closest previous CIE. So match the other tools and also
sort accordingly.
I consider this a bug in libunwindstack, but it's easy enough to emit
a compatible .eh_frame section for compatibility with installed
operating systems.
Differential Revision: https://reviews.llvm.org/D58266
llvm-svn: 356216
Matt Arsenault [Thu, 14 Mar 2019 22:54:43 +0000 (22:54 +0000)]
MIR: Allow targets to serialize MachineFunctionInfo
This has been a very painful missing feature that has made producing
reduced testcases difficult. In particular the various registers
determined for stack access during function lowering were necessary to
avoid undefined register errors in a large percentage of
cases. Implement a subset of the important fields that need to be
preserved for AMDGPU.
Most of the changes are to support targets parsing register fields and
properly reporting errors. The biggest sort-of bug remaining is for
fields that can be initialized from the IR section will be overwritten
by a default initialized machineFunctionInfo section. Another
remaining bug is the machineFunctionInfo section is still printed even
if empty.
llvm-svn: 356215
Jessica Paquette [Thu, 14 Mar 2019 22:54:29 +0000 (22:54 +0000)]
[AArch64][GlobalISel] Add isel support for G_UADDO on s32s and s64s
This adds instruction selection support for G_UADDO on s32s and s64s.
Also
- Add an instruction selection test
- Update the arm64-xaluo.ll test to show that we generate the correct assembly
Differential Revision: https://reviews.llvm.org/D58734
llvm-svn: 356214
Amara Emerson [Thu, 14 Mar 2019 22:48:18 +0000 (22:48 +0000)]
[AArch64][GlobalISel] Implement selection for G_UNMERGE of vectors to vectors.
This re-uses the previous support for extract vector elt to extract the
subvectors.
Differential Revision: https://reviews.llvm.org/D59390
llvm-svn: 356213
Amara Emerson [Thu, 14 Mar 2019 22:48:15 +0000 (22:48 +0000)]
[AArch64][GlobalISel] Add some support for G_CONCAT_VECTORS.
Handles concatenating 2 x v2s32 and 2 x v4s16
Differential Revision: https://reviews.llvm.org/D59390
llvm-svn: 356212
Marshall Clow [Thu, 14 Mar 2019 22:24:32 +0000 (22:24 +0000)]
XFAIL this debug-mode test that I just broke. Eric has a patch out for review (D59166) that rewrites this test completely, so I'm not going to bother fixing it.
llvm-svn: 356211
Davide Italiano [Thu, 14 Mar 2019 22:12:59 +0000 (22:12 +0000)]
[ObjCLanguage] Remove LLDB_DISABLE_PYTHON markers from the formatters.
llvm-svn: 356210
Marshall Clow [Thu, 14 Mar 2019 21:56:57 +0000 (21:56 +0000)]
Add noexcept to operator[] for array and deque. This is an extension. We already do this for string and string_view. This should give better codegen inside of noexcept functions.
llvm-svn: 356209
Jason Liu [Thu, 14 Mar 2019 21:54:30 +0000 (21:54 +0000)]
Reland the rest of "Add AIX Target Info"
llvm-svn 356197 relanded previously failing test case max_align.c.
This commit will reland the rest of llvm-svn 356060 commit.
Differential Revision: https://reviews.llvm.org/D59048
llvm-svn: 356208
Jordan Rupprecht [Thu, 14 Mar 2019 21:51:42 +0000 (21:51 +0000)]
[llvm-strip] Hook up (unimplemented) --only-keep-debug
For ELF, we accept but ignore --only-keep-debug. Do the same for llvm-strip.
COFF does implement this, so update the test that it is supported.
llvm-svn: 356207
Matt Arsenault [Thu, 14 Mar 2019 21:23:59 +0000 (21:23 +0000)]
AMDGPU: Correct type for waitcnt debug flag
llvm-svn: 356206
Adrian Prantl [Thu, 14 Mar 2019 21:23:52 +0000 (21:23 +0000)]
Add test I forgot to git-add in r356163.
llvm-svn: 356205
Sam Clegg [Thu, 14 Mar 2019 21:09:14 +0000 (21:09 +0000)]
Line wrap README file
llvm-svn: 356204
Nikita Popov [Thu, 14 Mar 2019 21:06:46 +0000 (21:06 +0000)]
[InstCombine] Add tests for range-based saturing math overflow; NFC
Tests for cases where overflow can be determined, but not based on
known bits.
llvm-svn: 356203
Julian Lettner [Thu, 14 Mar 2019 20:59:41 +0000 (20:59 +0000)]
[NFC][TSan] Move libdispatch tests into their own subfolder
Remove 'gcd' file prefix. GCD stands for Grand Central Dispatch, which
is another name for libdispatch.
https://apple.github.io/swift-corelibs-libdispatch/
Remove `REQUIRE: dispatch` from tests.
Also rename lit feature 'dispatch' -> 'libdispatch' to be more explicit
what this is about.
Reviewed By: kubamracek
Differential Revision: https://reviews.llvm.org/D59341
llvm-svn: 356202
Julian Lettner [Thu, 14 Mar 2019 20:59:37 +0000 (20:59 +0000)]
[TSan][libdispatch] Remove dependency on system headers
Including <dispatch/dispatch.h> and <Blocks.h> transitively pulls in
other system headers. Let's try to avoid that.
Blocks.h: compiler-rt already includes a blocks runtime. Just use the
header file that comes with it.
dispatch.h: Declare the bare minimum required for our implementation,
i.e., everything needed to define the interceptors, but not the
interceptors themselves. See tsan_dispatch_defs.h. I spotted a few other
places in compile-rt, where we declare libdispatch types. Maybe this
file can be moved to sanitizer_common if we deem it useful enough.
tsan_libdispatch.cc now compiles on Linux/Clang (requires support for
-fblocks). Linking still requires some manual configuration.
Reviewed By: kubamracek
Differential Revision: https://reviews.llvm.org/D59145
llvm-svn: 356201
Pete Couperus [Thu, 14 Mar 2019 20:50:54 +0000 (20:50 +0000)]
[ARC] Add more load/store variants.
On ARC ISA, general format of load instruction is this:
LD<zz><.x><.aa><.di> a, [b,c]
And general format of store is this:
ST<zz><.aa><.di> c, [b,s9]
Where:
<zz> is data size field and can be one of
<empty> (bits 00) - Word (32-bit), default behavior
B (bits 01) - Byte
H (bits 10) - Half-word (16-bit)
<.x> is data extend mode:
<empty> (bit 0) - If size is not Word(32-bit), then data is zero extended
X (bit 1) - If size is not Word(32-bit), then data is sign extended
<.aa> is address write-back mode:
<empty> (bits 00) - no write-back
.AW (bits 01) - Preincrement, base register updated pre memory transaction
.AB (bits 10) - Postincrement, base register updated post memory transaction
<.di> is cache bypass mode:
<empty> (bit 0) - Cached memory access, default mode
.DI (bit 1) - Non-cached data memory access
This patch adds these load/store instruction variants to the ARC backend.
Patch By Denis Antrushin! <denis@synopsys.com>
Differential Revision: https://reviews.llvm.org/D58980
llvm-svn: 356200
Nico Weber [Thu, 14 Mar 2019 20:41:19 +0000 (20:41 +0000)]
gn build: Add build files for clang-doc
Differential Revision: https://reviews.llvm.org/D59379
llvm-svn: 356199
Alexey Bataev [Thu, 14 Mar 2019 20:36:00 +0000 (20:36 +0000)]
[OPENMP]Fix crash for the ordered(n) clause.
If the doacross lop construct is used and the loop counter is declare
outside of the loop, the compiler might crash trying to get the address
of the loop counter. Patch fixes this problem.
llvm-svn: 356198
Jason Liu [Thu, 14 Mar 2019 20:27:39 +0000 (20:27 +0000)]
Reland part of "Add AIX Target Info"
This patch reland the test case max_align.c which is failing at
Windows and PS4 platform in the previous commit.
Differential Revision: https://reviews.llvm.org/D59048
original llvm-svn: 356060
llvm-svn: 356197
Eli Friedman [Thu, 14 Mar 2019 19:46:51 +0000 (19:46 +0000)]
[CodeGen] Consider tied operands when adjusting inline asm operands.
The constraint "0" in the following asm did not consider the its
relationship with "=y" when try to replace the type of the operands.
asm ("nop" : "=y"(Mu8_1 ) : "0"(Mu8_0 ));
Patch by Xiang Zhang.
Differential Revision: https://reviews.llvm.org/D56990
llvm-svn: 356196
Sanjay Patel [Thu, 14 Mar 2019 19:41:21 +0000 (19:41 +0000)]
[InstCombine] remove duplicate tests
These got accidentally doubled with rL356191.
llvm-svn: 356195
Louis Dionne [Thu, 14 Mar 2019 19:33:58 +0000 (19:33 +0000)]
[pstl] By default, disable the parallel policies
Since we don't have any non-trivial PSTL backend that doesn't require
TBB yet, enabling the parallel policies by default breaks people that
try to build all of LLVM without having an installation of TBB. Since
this is unacceptable, parallel policies are disabled by default.
We can re-enable it once we have a backend that does not require anything
beyond what C++ already requires. For example, we could have a simple
backend that uses std::thread by default or something along those lines,
with the understanding that vendors would use their own (more efficient)
backend.
llvm-svn: 356194
Sunil Srivastava [Thu, 14 Mar 2019 19:26:04 +0000 (19:26 +0000)]
Handle consecutive-double-quotes in Windows argument parsing
Windows command line argument processing treats consecutive double quotes
as a single double-quote. This patch implements this functionality.
Differential Revision: https://reviews.llvm.org/D58662
llvm-svn: 356193
Sanjay Patel [Thu, 14 Mar 2019 19:22:08 +0000 (19:22 +0000)]
[InstCombine] canonicalize funnel shift constant shift amount to be modulo bitwidth
The shift argument is defined to be modulo the bitwidth, so if that argument
is a constant, we can always reduce the constant to its minimal form to allow
better CSE and other follow-on transforms.
We need to be careful to ignore constant expressions here, or we will likely
infinite loop. I'm adding a general vector constant query for that case.
Differential Revision: https://reviews.llvm.org/D59374
llvm-svn: 356192
Sanjay Patel [Thu, 14 Mar 2019 19:22:00 +0000 (19:22 +0000)]
[InstCombine] add tests for funnel shift constant shift amount mod bitwidth; NFC
llvm-svn: 356191
Zachary Turner [Thu, 14 Mar 2019 19:05:55 +0000 (19:05 +0000)]
Return llvm::Error and llvm::Expected from DWARF parsing code.
The goal here is to improve our error handling and error recovery while
parsing DWARF, while at the same time getting us closer to being able to
merge LLDB's DWARF parser with LLVM's. To this end, I've udpated several
of the low-level parsing functions in LLDB to return llvm::Error and
llvm::Expected.
For now, this only updates LLDB parsing functions and not LLVM. In some
ways, this actually gets us *farther* from parity with the two
interfaces, because prior to this patch, at least the parsing interfaces
were the same (i.e. they all just returned bools, and now with this
patch they're diverging). But, I chose to do this for two primary
reasons.
LLDB has error logging code engrained deep within some of its parsing
functions. We don't want to lose this logging information, but obviously
LLVM has no logging mechanism at all. So if we're to merge the
interfaces, we have to find a way to still allow LLDB to properly report
parsing errors while not having the reporting code be inside of LLVM.
LLDB (and indeed, LLVM) overload the meaning of the false return value
from all of these extraction functions to mean both "We reached the null
entry at the end of a list of items, therefore everything was
successful" as well as "something bad and unrecoverable happened during
parsing". So you would have a lot code that would do something like:
while (foo.extract(...)) {
...
}
But when the loop stops, why did it stop? Did it stop because it
finished parsing, or because there was an error? Because of this, in
some cases we don't always know whether it is ok to proceed, or how to
proceed, but we were doing it anyway.
In this patch, I solve the second problem by introducing an
enumeration called DWARFEnumState which has two values MoreItems and
Complete. Both of these indicate success, but the latter indicates
that we reached the null entry. Then, I return this value instead of
bool, and convey parsing failure separately.
To solve the first problem (and convey parsing failure) these
functions now return either llvm::Error or llvm::Expected<DWARFEnumState>.
Having this extra bit of information allows us to properly convey all 3 of
"error, bail out", "success, call this function again", and "success,
don't call this function again".
In subsequent patches I plan to extend this pattern to the rest of the
parsing interfaces, which will ultimately get all of the log statements
and error reporting out of the low level parsing code and into the high
level parsing code (e.g. SymbolFileDWARF, DWARFASTParserClang, etc).
Eventually, these same changes will have to be backported to LLVM's
DWARF parser, but diverging in the short term is the easiest way to
converge in the long term.
Differential Revision: https://reviews.llvm.org/D59370
llvm-svn: 356190
Alina Sbirlea [Thu, 14 Mar 2019 18:45:17 +0000 (18:45 +0000)]
[MemorySSA] Remove redundant walker assignment [NFC].
Subscribers: llvm-commits
llvm-svn: 356189
Alexandre Ganea [Thu, 14 Mar 2019 18:45:08 +0000 (18:45 +0000)]
[LLD][COFF] Add /summary to print statistics
/summary prints information about the data (OBJ/LIB/PDB) processed by LLD. The goal is have an estimate about the inputs and outputs, to better understand where the timings go.
Differential Revision: https://reviews.llvm.org/D58599
llvm-svn: 356188
Erik Pilkington [Thu, 14 Mar 2019 18:38:02 +0000 (18:38 +0000)]
[Sema] Fix a use-after-free of a _Nonnull ParsedAttr
We were allocating the implicit attribute in the declarator's attribute pool,
but putting into the declaration specifier's ParsedAttributesView. If there are
multiple declarators, then we'll use the attribute from the declaration
specifier after clearing out the declarators attribute pool. Fix this by
allocating the attribute in the declaration specifier's pool.
rdar://
48529718
Differential revision: https://reviews.llvm.org/D59327
llvm-svn: 356187
Rui Ueyama [Thu, 14 Mar 2019 18:21:32 +0000 (18:21 +0000)]
Make a hack for LTO work only when you are actually doing LTO.
We allow an archive file without symbol table as a linker input as a
workaround for a very common error in LTO build. But that logic worked
even for an archive file containing non-bitcode files, which is not
expected. This patch limits that workaround to one that contains only
bitcode files.
Differential Revision: https://reviews.llvm.org/D59373
llvm-svn: 356186
Reid Kleckner [Thu, 14 Mar 2019 18:12:17 +0000 (18:12 +0000)]
Add PragmaHandler for MSVC pragma execution_character_set
__pragma(execution_character_set(push, "UTF-8")) is used in
TraceLoggingProvider.h. This commit implements a no-op handler for
compatability, similar to how the flag -fexec_charset is handled.
Patch by Matt Gardner!
Differential Revision: https://reviews.llvm.org/D58530
llvm-svn: 356185
Philip Reames [Thu, 14 Mar 2019 18:06:15 +0000 (18:06 +0000)]
[Tests] Add tests to demonstrate hoisting of unordered invariant loads
llvm-svn: 356184
Philip Reames [Thu, 14 Mar 2019 18:02:19 +0000 (18:02 +0000)]
[Tests] Revert an accident change to a test
llvm-svn: 356183
Jessica Paquette [Thu, 14 Mar 2019 18:01:30 +0000 (18:01 +0000)]
[GlobalISel][AArch64] Add partial selection support for G_INSERT_VECTOR_ELT
This adds support for inserting elements into packed vectors. It also adds
two tests: one for selection, and one for regbank select.
Unpacked vectors will come in a follow-up.
Differential Revision: https://reviews.llvm.org/D59325
llvm-svn: 356182
Philip Reames [Thu, 14 Mar 2019 17:59:59 +0000 (17:59 +0000)]
Auto-generate an existing test to make it easier to update
llvm-svn: 356181
Pete Couperus [Thu, 14 Mar 2019 17:50:46 +0000 (17:50 +0000)]
[ARC] Better classify add/sub immediate instructions in frame lowering.
Summary:
Some operations have multiple ARC instructions that are applicable.
For instance, "add r0, r0, 123" can be encoded as a "LImm" instruction
with a 32-bit immediate (8-bytes), or as a signed 12-bit immediate instruction
for the case where the source and destination register are the same (4-bytes).
The ARC assembler will choose the shortest encoding, but we should track
the correct instruction in the compiler.
This patch fixes the instruction used in some cases from ARCFrameLowering.
Subscribers: hiraditya, jdoerfert, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D59326
llvm-svn: 356179
Max Moroz [Thu, 14 Mar 2019 17:49:27 +0000 (17:49 +0000)]
Speeding up llvm-cov export with multithreaded renderFiles implementation.
Summary:
CoverageExporterJson::renderFiles accounts for most of the execution time given a large profdata file with multiple binaries.
Proposed solution is to generate JSON for each file in parallel and sort at the end to preserve deterministic output. Also added flags to skip generating parts of the output to trim the output size.
Patch by Sajjad Mirza (@sajjadm).
Reviewers: Dor1s, vsk
Reviewed By: Dor1s, vsk
Subscribers: liaoyuke, mgrang, jdoerfert, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D59277
llvm-svn: 356178
Marshall Clow [Thu, 14 Mar 2019 17:43:41 +0000 (17:43 +0000)]
Reorg the midpoint pointer test into runtime and constexpr tests; comment out the volatile constexpr tests for GCC because our experimental gcc bot barfs on them.
llvm-svn: 356177
Davide Italiano [Thu, 14 Mar 2019 17:41:29 +0000 (17:41 +0000)]
[DataFormatters] Delete unused code. Not even exposed in the API.
I stumbled upon this while removing LLDB_DISABLE_PYTHON when
not needed.
llvm-svn: 356176
Sanjay Patel [Thu, 14 Mar 2019 17:39:40 +0000 (17:39 +0000)]
[InstCombine] add tests for funnel shift constant shift amount mod bitwidth; NFC
llvm-svn: 356175
Raphael Isemann [Thu, 14 Mar 2019 17:39:39 +0000 (17:39 +0000)]
Safer casting in ClangExpressionParser code completion
Summary:
Makes the code a bit safer in the unlikely situation that we don't get a ClangUserExpression
when doing code completion.
Reviewers: aprantl, jingham
Reviewed By: aprantl
Subscribers: labath, jdoerfert, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D59359
llvm-svn: 356174
Philip Reames [Thu, 14 Mar 2019 17:36:58 +0000 (17:36 +0000)]
[Tests] Add tests for reordering of unordered atomics on invariant locations
llvm-svn: 356172
Davide Italiano [Thu, 14 Mar 2019 17:23:08 +0000 (17:23 +0000)]
[Python] Start eradicating unneeded LLDB_DISABLE_PYTHON guards.
While we don't have a bot, I'm testing by hand that this configuration
compiles. We'll probably set up one once I'm done flensing.
llvm-svn: 356171
Philip Reames [Thu, 14 Mar 2019 17:20:59 +0000 (17:20 +0000)]
Allow code motion (and thus folding) for atomic (but unordered) memory operands
Building on the work done in D57601, now that we can distinguish between atomic and volatile memory accesses, go ahead and allow code motion of unordered atomics. As seen in the diffs, this allows much better folding of memory operations into using instructions. (Mostly done by the PeepholeOpt pass.)
Note: I have not reviewed all callers of hasOrderedMemoryRef since one of them - isSafeToMove - is very widely used. I'm relying on the documented semantics of each method to judge correctness.
Differential Revision: https://reviews.llvm.org/D59345
llvm-svn: 356170
Marshall Clow [Thu, 14 Mar 2019 17:20:02 +0000 (17:20 +0000)]
Fix two of the three bot failures for midpoint; the ones regarding the lack of '__int128_t'
llvm-svn: 356169
Jonas Devlieghere [Thu, 14 Mar 2019 17:19:34 +0000 (17:19 +0000)]
[Reproducers] Fix data race found by tsan
This fixes a data race uncovered by tsan during destruction of the
GDBRemoteReplay server. The solution is to lock the thread state mutex
when receiving packets.
llvm-svn: 356168
Louis Dionne [Thu, 14 Mar 2019 17:15:47 +0000 (17:15 +0000)]
[libc++][CMake] Do not define `cxx_shared_EXPORTS` when building the shared library
CMake will define -Dcxx_shared_EXPORTS when building the shared library
by default. In theory, this is used to signal to the library that we're
building a shared library and that dllimport/dllexport should be used.
However, we already have our own way of doing that, so I'm removing this
define to avoid meaningless command line arguments in the build.
llvm-svn: 356167
Mitch Phillips [Thu, 14 Mar 2019 17:05:53 +0000 (17:05 +0000)]
[HWASan] Use less Printf() calls in register dump.
Summary:
Explicitly print 4 registers/line in each iteration during register
dump. Reduces logcat spam as we get a single logcat message per call to
Printf(), even if the output isn't newline-terminated. This brings the
output format in logcat closer to that of the normal textual dump.
Reviewers: eugenis, pcc
Reviewed By: pcc
Subscribers: kubamracek, #sanitizers, llvm-commits
Tags: #sanitizers, #llvm
Differential Revision: https://reviews.llvm.org/D59320
llvm-svn: 356166
Philip Reames [Thu, 14 Mar 2019 17:05:18 +0000 (17:05 +0000)]
[Tests] Add negative folding tests w/fences as requested in D59345
llvm-svn: 356165
Craig Topper [Thu, 14 Mar 2019 16:53:24 +0000 (16:53 +0000)]
[X86] Fix the pattern changes from r356121 so that the ROR*r1/ROR*m1 pattern use the rotr opcode.
These instructions used to use rotl with a bitwidth-1 immediate. I changed the immediate to 1,
but failed to change the opcode.
Thankfully this seems to have not caused a functional issue because we now had two rotl by 1 patterns,
but the correct ones were earlier and took priority. So we just missed some optimization.
llvm-svn: 356164
Adrian Prantl [Thu, 14 Mar 2019 16:29:54 +0000 (16:29 +0000)]
Add IR debug info support for Elemental, Pure, and Recursive Procedures.
Patch by Eric Schweitz!
Differential Revision: https://reviews.llvm.org/D54043
llvm-svn: 356163
Marshall Clow [Thu, 14 Mar 2019 16:25:55 +0000 (16:25 +0000)]
Add std::midpoint for integral and poiner types. Described in P0811, reviewed as D59099.
llvm-svn: 356162
Kristof Umann [Thu, 14 Mar 2019 16:10:29 +0000 (16:10 +0000)]
[analyzer] Fix an assertation failure for invalid sourcelocation, add a new debug checker
For a rather short code snippet, if debug.ReportStmts (added in this patch) was
enabled, a bug reporter visitor crashed:
struct h {
operator int();
};
int k() {
return h();
}
Ultimately, this originated from PathDiagnosticLocation::createMemberLoc, as it
didn't handle the case where it's MemberExpr typed parameter returned and
invalid SourceLocation for MemberExpr::getMemberLoc. The solution was to find
any related valid SourceLocaion, and Stmt::getBeginLoc happens to be just that.
Differential Revision: https://reviews.llvm.org/D58777
llvm-svn: 356161
Adrian Prantl [Thu, 14 Mar 2019 15:58:21 +0000 (15:58 +0000)]
Fix a double-overrelease in the TestDataFormatterObjC test program.
llvm-svn: 356160
Sam Parker [Thu, 14 Mar 2019 15:36:54 +0000 (15:36 +0000)]
[NFC][ARM] Update test
Change some regex to handle commutable instructions.
llvm-svn: 356159
Sanjay Patel [Thu, 14 Mar 2019 15:32:34 +0000 (15:32 +0000)]
[x86] prevent infinite looping from vselect commutation (PR41066)
This is an immediate fix for:
https://bugs.llvm.org/show_bug.cgi?id=41066
...but as noted there and the code comments, we should do better
by stubbing this out sooner.
llvm-svn: 356158
Pavel Labath [Thu, 14 Mar 2019 15:23:40 +0000 (15:23 +0000)]
YAMLIO: Improve template arg deduction for mapOptional
Summary:
The way c++ template argument deduction works, both arguments are used
to deduce the template type in the three-argument overload of
mapOptional. This is a problem if the types are slightly different, even
if they are implicitly convertible. This is fairly easy to trigger with
integral types, as the default type of most integral constants is int,
which then requires casting the constant to the type of the other
argument.
This patch fixes that by using a separate template type for the default
value, which is then cast to the type of the first argument. To avoid
this conversion triggerring conversions marged as explicit, we use
static_assert to check that the types are implicitly convertible.
Reviewers: zturner, sammccall
Subscribers: kristina, jdoerfert, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D59142
llvm-svn: 356157
Akira Hatanaka [Thu, 14 Mar 2019 15:17:37 +0000 (15:17 +0000)]
[CodeGen][ObjC] Remove the leading 'l' from symbols for protocol
metadata and protocol list
The leading 'l' tells ld64 to remove the symbol name, which can make
debugging difficult.
rdar://problem/
47256637
Differential Revision: https://reviews.llvm.org/D59234
llvm-svn: 356156
Louis Dionne [Thu, 14 Mar 2019 14:52:26 +0000 (14:52 +0000)]
[libc++][CMake] Fix typo introduced in r356150
That typo broke the build when the shared library build was disabled.
llvm-svn: 356155
Nico Weber [Thu, 14 Mar 2019 14:40:48 +0000 (14:40 +0000)]
Fix test after r356148
llvm-svn: 356154
Louis Dionne [Thu, 14 Mar 2019 14:38:38 +0000 (14:38 +0000)]
[libc++] Do not force building with -fPIC (re-applying)
Summary:
In r355746, we stopped forcing to build with -fPIC because that should
be specified by the CMAKE_POSITION_INDEPENDENT_CODE option at CMake
configure time (and by default -fPIC is used for shared libraries anyways).
However, r355746 had to be reverted in r355756 because we were not
actually building the shared library with -fPIC. The reason is that
we were sharing an object library between the static and the shared
library, which caused flags for static libraries to be used when
building object files that were going to be used for a shared library.
Since this was resolved by r356150, we can stop forcing -fPIC again.
Reviewers: EricWF, smeenai
Subscribers: mgorny, christof, jkorous, dexonsmith, libcxx-commits
Differential Revision: https://reviews.llvm.org/D59250
llvm-svn: 356153
Mikael Holmen [Thu, 14 Mar 2019 14:20:50 +0000 (14:20 +0000)]
Remove unused variable to silence compiler warning [NFC]
The only use of MI was removed in r356142.
llvm-svn: 356152
Balazs Keri [Thu, 14 Mar 2019 14:20:23 +0000 (14:20 +0000)]
[ASTImporter] Fix import of NestedNameSpecifierLoc.
Summary:
Import type location in case of TypeSpec and TypeSpecWithTemplate.
Without this fix the imported NespedNameSpecifierLoc will have an
invalid begin location.
Reviewers: a.sidorin, shafik, a_sidorin, martong
Reviewed By: a_sidorin
Subscribers: rnkovacs, jdoerfert, dkrupp, martong, Szelethus, gamesh411, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D55358
llvm-svn: 356151
Louis Dionne [Thu, 14 Mar 2019 14:19:08 +0000 (14:19 +0000)]
[libc++] Do not share an object library to create the static/shared libraries
Summary:
The problem with using an object library for doing this is that it prevents
the shared library and the static library from being built with the right
default flags. For example, CMake will build shared libraries with -fPIC
by default, but not static libraries. Using an object library to create
the shared library will prevent the right default flags for shared
libraries from being used.
As a side effect, this patch also localizes the logic related to building
a hermetic static library to the static library case, making clear that
this has no effect on the shared library.
Reviewers: phosek, EricWF
Subscribers: mgorny, christof, jkorous, dexonsmith, jdoerfert, libcxx-commits
Differential Revision: https://reviews.llvm.org/D59248
llvm-svn: 356150
Matt Arsenault [Thu, 14 Mar 2019 14:19:01 +0000 (14:19 +0000)]
AMDGPU: Scavenge register instead of findUnusedReg
llvm-svn: 356149
Nico Weber [Thu, 14 Mar 2019 14:18:56 +0000 (14:18 +0000)]
Objective-C++11: Support static_assert() in @interface/@implementation ivar lists and method declarations
This adds support for static_assert() (and _Static_assert()) in
@interface/@implementation ivar lists and in @interface method declarations.
It was already supported in @implementation blocks outside of the ivar lists.
The assert AST nodes are added at file scope, matching where other
(non-Objective-C) declarations at @interface / @implementation level go (cf
`allTUVariables`).
Also add a `__has_feature(objc_c_static_assert)` that's true in C11 (and
`__has_extension(objc_c_static_assert)` that's always true) and
`__has_feature(objc_cxx_static_assert)` that's true in C++11 modea fter this
patch, so it's possible to check if this is supported.
Differential Revision: https://reviews.llvm.org/D59223
llvm-svn: 356148
Matt Arsenault [Thu, 14 Mar 2019 14:18:56 +0000 (14:18 +0000)]
GlobalISel: Use multiple returns for intrinsic structs
This is consistent with what SelectionDAG does and is much easier to
work with than the extract sequence with an artificial wide register.
For the AMDGPU control flow intrinsics, this was producing an s128 for
the i64, i1 tuple return. Any legalization that should apply to a real
s128 value would badly obscure the direct values that need to be seen.
llvm-svn: 356147
Than McIntosh [Thu, 14 Mar 2019 13:56:49 +0000 (13:56 +0000)]
[SampleFDO] add suffix elision control for fcn names
Summary:
Add hooks for determining the policy used to decide whether/how
to chop off symbol 'suffixes' when locating a given function
in a sample profile.
Prior to this change, any function symbols of the form "X.Y" were
elided/truncated into just "X" when looking up things in a sample
profile data file.
With this change, the policy on suffixes can be changed by adding a
new attribute "sample-profile-suffix-elision-policy" to the function:
this attribute can have the value "all" (the default), "selected", or
"none". A value of "all" preserves the previous behavior (chop off
everything after the first "." character, then treat that as the
symbol name). A value of "selected" chops off only the rightmost
".llvm.XXXX" suffix (where "XXX" is any string not containing a "."
char). A value of "none" indicates that names should be left as is.
Subscribers: jdoerfert, wmi, mtrofin, danielcdh, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D58832
llvm-svn: 356146
Matt Arsenault [Thu, 14 Mar 2019 13:46:17 +0000 (13:46 +0000)]
Note ImmArg in documentation for adding intrinsics
llvm-svn: 356145
Matt Arsenault [Thu, 14 Mar 2019 13:46:14 +0000 (13:46 +0000)]
ARM: Add ImmArg to intrinsics
I found these by asserting in clang for any GCCBuiltin that doesn't
require mangling and requires a constant for the builtin. This means
that intrinsics are missing which don't use GCCBuiltin, don't have
builtins defined in clang, or were missing the constant annotation in
the builtin definition.
llvm-svn: 356144
Matt Arsenault [Thu, 14 Mar 2019 13:46:09 +0000 (13:46 +0000)]
AMDGPU: Don't add unnecessary convergent attributes
These are redundant with the intrinsic declaration.
llvm-svn: 356143
Kristof Umann [Thu, 14 Mar 2019 13:38:16 +0000 (13:38 +0000)]
[analyzer] Fix function macro crash
Re-commit D57893.
Differential Revision: https://reviews.llvm.org/D57893
llvm-svn: 356142
Hyrum Wright [Thu, 14 Mar 2019 13:38:16 +0000 (13:38 +0000)]
[clang-tidy] Add additional patterns to the abseil-duration-unnecessary-conversion check.
Differential Revision: https://reviews.llvm.org/D59183
llvm-svn: 356141
Eric Fiselier [Thu, 14 Mar 2019 12:31:10 +0000 (12:31 +0000)]
Properly constrain basic_string(Iter, Iter, Alloc = A())
llvm-svn: 356140