Benjamin Kramer [Wed, 17 Jan 2018 13:00:58 +0000 (13:00 +0000)]
[X86] Constify DebugLoc parameters. No functionality change.
llvm-svn: 322643
Kamil Rytarowski [Wed, 17 Jan 2018 12:32:17 +0000 (12:32 +0000)]
Hotfix for test/asan/TestCases/alloca_constant_size.cc
Add missing endif.
llvm-svn: 322638
Ilya Biryukov [Wed, 17 Jan 2018 12:30:24 +0000 (12:30 +0000)]
[clangd] Don't crash on LSP calls for non-added files
Summary:
We will return errors for non-added files for now.
Another alternative for clangd would be to read non-added files from
disk and provide useful features anyway.
There are still some cases that fail with assertion (e.g., code
complete). We should address those too, but they require more subtle
changes to the code and therefore out of scope of this patch.
Reviewers: sammccall, ioeric, hokein
Reviewed By: sammccall
Subscribers: klimek, cfe-commits
Differential Revision: https://reviews.llvm.org/D42164
llvm-svn: 322637
Hiroshi Inoue [Wed, 17 Jan 2018 12:29:38 +0000 (12:29 +0000)]
[NFC] fix trivial typos in comments
"the the" -> "the"
llvm-svn: 322636
Kamil Rytarowski [Wed, 17 Jan 2018 12:26:04 +0000 (12:26 +0000)]
[Sanitizers, test] Fix sanitizer tests on Solaris (PR 33274)
Summary:
This patch (on top of the previous two (https://reviews.llvm.org/D40898 and
https://reviews.llvm.org/D40899) complete the compiler-rt side of the the Solaris
sanitizer port.
It contains the following sets of changes:
* For the time being, the port is for 32-bit x86 only, so reject the various tests on
x86_64.
* When compiling as C++, <setjmp.h> resp. <iso/setjmp_iso.h> only declares
_setjmp and _longjmp inside namespace std.
* MAP_FILE is a Windows feature. While e.g. Linux <sys/mman.h> provides a
no-op compat define, Solaris does not.
* test/asan/TestCases/Posix/coverage.cc was initially failing like this:
/vol/gcc/src/llvm/llvm/local/projects/compiler-rt/lib/sanitizer_common/scripts/sancov.py: 4 files merged; 2 PCs total
rm: cannot remove '/var/gcc/llvm/local/projects/compiler-rt/test/asan/I386SunOSConfig/TestCases/Posix/Output/coverage': Invalid argument
Further digging revealed that the rm was trying to remove the running test's working
directory which failed as observed. cd'ing out of the dir before let the test pass.
* Two tests needed a declaration of alloca. I've now copied the existing code from
test/asan/TestCases/alloca_constant_size.cc, but it may be more profitable and
maintainable to have a common testsuite header where such code is collected.
* Similarly, Solaris' printf %p format doesn't include the leading 0x.
* In test/asan/TestCases/malloc-no-intercept.c, I had to undef __EXTENSIONS__
(predefined by clang for no apparent reason) to avoid conflicting declarations
for memalign.
* test/ubsan/TestCases/Float/cast-overflow.cpp has different platform dependent
ways to define BYTE_ORDER and friends. Why not just use __BYTE_ORDER__ and
friends as predefined by clang and gcc?
Patch by Rainer Orth.
Reviewers: kcc, alekseyshl
Reviewed By: alekseyshl
Subscribers: srhines, kubamracek, mgorny, krytarowski, fedor.sergeev, JDevlieghere, llvm-commits, #sanitizers
Tags: #sanitizers
Differential Revision: https://reviews.llvm.org/D40900
llvm-svn: 322635
Krasimir Georgiev [Wed, 17 Jan 2018 12:24:59 +0000 (12:24 +0000)]
[clang-format] Reorganize RawStringFormat based on language
Summary:
This patch changes the structure for raw string formatting options by making it
language based (enumerate delimiters per language) as opposed to delimiter-based
(specify the language for a delimiter). The raw string formatting now uses an
appropriate style from the .clang-format file, if exists.
Reviewers: bkramer
Reviewed By: bkramer
Subscribers: cfe-commits, klimek
Differential Revision: https://reviews.llvm.org/D42098
llvm-svn: 322634
Pavel Labath [Wed, 17 Jan 2018 11:52:13 +0000 (11:52 +0000)]
Don't emit apple accelerator tables on non-darwin targets
Summary:
Currently -glldb turns on emission of apple tables on all targets, but
lldb is only really capable of consuming them on darwin. Furthermore,
making lldb consume these tables is not straight-forward because of the
differences in how the debug info is distributed on darwin vs. elf
targets.
The darwin debug model assumes that the debug info (along with
accelerator tables) will either remain in the .o files or it will be
linked into a dsym bundle by a linker that knows how to merge these
tables. In the elf world, all present linkers will simply concatenate
these accelerator tables into the shared object. Since the tables are
not self-terminating, this renders the tables unusable, as the debugger
cannot pry the individual tables apart anymore.
It might theoretically be possible to make the tables work with split
dwarf, as that is somewhat similar to the apple .o model, but
unfortunately right now the combination of -glldb and -gsplit-dwarf
produces broken object files.
Until these issues are resolved there is no point in emitting the apple
tables for these targets. At best, it wastes space; at worst, it breaks
compilation and prevents the user from getting other benefits of -glldb.
Reviewers: probinson, aprantl, dblaikie
Subscribers: emaste, dim, llvm-commits, JDevlieghere
Differential Revision: https://reviews.llvm.org/D41986
llvm-svn: 322633
Joachim Protze [Wed, 17 Jan 2018 11:13:11 +0000 (11:13 +0000)]
Partial revert of [OMPT] Rename ompt_mutex_impl_t to kmp_mutex_impl
The previous commit did not revert all replaced ompt_mutex_impl_unknown.
llvm-svn: 322631
Pavel Labath [Wed, 17 Jan 2018 11:11:53 +0000 (11:11 +0000)]
Rewrite debugger tuning test case to not depend on apple sections
Summary:
In a follow-up commit I'll change the rules for emission of accelerator
tables, which means we won't be able to use them as a litmus test for
the debugger tuning options. Instead of sections, I base the test on the
presence/absence of some debug info attributes and opcodes:
LLDB - prefers DW_OP_form_tls_address and uses DW_AT_APPLE_optimized
GDB - prefers DW_OP_GNU_push_tls_address and does not use the optimized
attribute
SCE - prefers DW_OP_form_tls_address and does not use the optimized
attribute
Reviewers: probinson, aprantl, dblaikie
Subscribers: JDevlieghere, llvm-commits
Differential Revision: https://reviews.llvm.org/D41985
llvm-svn: 322630
Javed Absar [Wed, 17 Jan 2018 11:03:06 +0000 (11:03 +0000)]
[SCEV] fix typo
llvm-svn: 322629
Simon Pilgrim [Wed, 17 Jan 2018 10:56:54 +0000 (10:56 +0000)]
[X86][AVX] Add extra 'interleaved+lanepermute' shuffle test
Possible missed opportunity to use 64-bit lane permute on AVX1 in lowerShuffleAsRepeatedMaskAndLanePermute
llvm-svn: 322628
George Rimar [Wed, 17 Jan 2018 10:33:05 +0000 (10:33 +0000)]
[ThinLTO] - Remove code duplication. NFC.
Refactors 3 copies of isExpected.
Splitted from D42107.
llvm-svn: 322627
Jonas Toth [Wed, 17 Jan 2018 10:27:41 +0000 (10:27 +0000)]
[clang-tidy] implement check for goto
The usage of `goto` is discourage in C++ since forever. This check implements
a warning for every `goto`. Even though there are (rare) valid use cases for
`goto`, better high level constructs should be used.
`goto` is used sometimes in C programs to free resources at the end of
functions in the case of errors. This pattern is better implemented with
RAII in C++.
Reviewers: aaron.ballman, alexfh, hokein
Reviewed By: aaron.ballman
Subscribers: lebedev.ri, jbcoe, Eugene.Zelenko, klimek, nemanjai, mgorny, xazax.hun, kbarton, cfe-commits
Differential Revision: https://reviews.llvm.org/D41815
llvm-svn: 322626
George Rimar [Wed, 17 Jan 2018 10:24:49 +0000 (10:24 +0000)]
[ELF] - Stop mixing order of -defsym/-script commands.
Previously we always handled -defsym after other commands in command line.
That made impossible to overload values set by -defsym from linker script:
test.script:
foo = 0x22;
-defsym=foo=0x11 -script t.script
would always set foo to 0x11.
That is inconstent with common logic which allows to override command line
options. it is inconsistent with bfd behavior and seems breaks assumption that
-defsym is the same as linker script assignment, as -defsyms always handled out of
command line order.
Patch fixes the handling order.
Differential revision: https://reviews.llvm.org/D42054
llvm-svn: 322625
Jonas Toth [Wed, 17 Jan 2018 10:23:50 +0000 (10:23 +0000)]
[clang-tidy] fix minor formatting issue
llvm-svn: 322624
Andrew V. Tischenko [Wed, 17 Jan 2018 10:12:06 +0000 (10:12 +0000)]
Allow usage of X86-prefixes as separate instrs.
Differential Revision: https://reviews.llvm.org/D42102
llvm-svn: 322623
Joachim Protze [Wed, 17 Jan 2018 10:06:06 +0000 (10:06 +0000)]
[OMPT] Add Workaround for Intel Compiler Bug
Add Workaround for Intel Compiler Bug with Case#:
03138964
A critical region within a nested task causes a segfault in icc 14-18:
int main()
{
#pragma omp parallel num_threads(2)
#pragma omp master
#pragma omp task
#pragma omp task
#pragma omp critical
printf("test\n");
}
When the critical region is in a separate function, the segault does not occur.
So we add noinline to make sure that the function call stays there.
Differential Revision: https://reviews.llvm.org/D41182
llvm-svn: 322622
Joachim Protze [Wed, 17 Jan 2018 10:06:01 +0000 (10:06 +0000)]
[OMPT] Rename ompt_mutex_impl_t to kmp_mutex_impl
The defintion is not part of the spec and thus should not have the prefix
"ompt_" but rather a prefix that indicates that this is implementation
specific.
Differential Revision: https://reviews.llvm.org/D41166
llvm-svn: 322621
Joachim Protze [Wed, 17 Jan 2018 10:05:55 +0000 (10:05 +0000)]
[OMPT] Return appropiate values for ompt runtime entry points for non-OpenMP threads
When the current thread is not an (initialized) OpenMP thread, the runtime
entry points return values that correspond to "not available" or similar
Differential Revision: https://reviews.llvm.org/D41167
llvm-svn: 322620
Sean Eveson [Wed, 17 Jan 2018 09:01:29 +0000 (09:01 +0000)]
[MC] Fix -stack-size-section on ARM
Change symbol values in the stack_size section from being 8 bytes, to being a target dependent size.
Differential Revision: https://reviews.llvm.org/D42108
llvm-svn: 322619
George Burgess IV [Wed, 17 Jan 2018 04:46:04 +0000 (04:46 +0000)]
[CodeGen] Fix a crash on mangling multiversioned functions
`multiVersionSortPriority` expects features to have no prefix. We
currently carry them around in the format "+${feature}".
llvm-svn: 322618
Peter Collingbourne [Wed, 17 Jan 2018 04:37:04 +0000 (04:37 +0000)]
libcxx: Stop using private MSVC macros in the exception implementation.
Inline the provided "fallback" definitions (which seem to always be
taken) that expand to __cdecl into users. The fallback definitions
for the *CRTIMP* macros were wrong in the case where the CRT is being
linked statically, so define our own macro as a replacement.
Differential Revision: https://reviews.llvm.org/D42158
llvm-svn: 322617
Craig Topper [Wed, 17 Jan 2018 03:58:21 +0000 (03:58 +0000)]
[X86] In LowerBUILD_VECTOR, rename ExtVT to EltVT so it makes sense.
llvm-svn: 322616
Craig Topper [Wed, 17 Jan 2018 03:50:21 +0000 (03:50 +0000)]
[X86] Remove duplicate lines from scheduler models. NFC
llvm-svn: 322615
Aaron Smith [Wed, 17 Jan 2018 03:48:07 +0000 (03:48 +0000)]
[pdbutil] Replace 0 byte PDB input with correct version to fix failing unit test
llvm-svn: 322614
George Burgess IV [Wed, 17 Jan 2018 03:12:06 +0000 (03:12 +0000)]
[Support] Return an enum instead of an unsigned; NFC.
We seem to be (logically) returning ArchExtKinds here in all cases, so
the return type should reflect that.
The static_cast is necessary because `A.ID` is actually an `unsigned`,
presumably since we use `decltype(A)` to represent extended attributes
for both ARM and AArch64, which use distinct `ArchExtKinds`.
We can't trivially make the same change for ARM, because one of the
values it returns is the bitwise-or of two `ARM::ArchExtKind`s.
llvm-svn: 322613
George Karpenkov [Wed, 17 Jan 2018 02:59:11 +0000 (02:59 +0000)]
[analyzer] support a mode to only show relevant lines in HTML diagnostics
HTML diagnostics can be an overwhelming blob of pages of code.
This patch adds a checkbox which filters this list down to only the
lines *relevant* to the counterexample by e.g. skipping branches which
analyzer has assumed to be infeasible at a time.
The resulting amount of output is much smaller, and often fits on one
screen, and also provides a much more readable diagnostics.
Differential Revision: https://reviews.llvm.org/D41378
llvm-svn: 322612
Nico Weber [Wed, 17 Jan 2018 02:55:27 +0000 (02:55 +0000)]
Make DiagnosticsEngine() take DiagOpts as DiagnosticsEngine.
No behavior change, but makes it a bit clearer that DiagnosticsEngine adds a
ref to DiagOpts.
llvm-svn: 322611
Aaron Smith [Wed, 17 Jan 2018 01:49:01 +0000 (01:49 +0000)]
Fix build error - 'default label in switch which covers all enumeration values'
llvm-svn: 322610
Sam Clegg [Wed, 17 Jan 2018 01:34:31 +0000 (01:34 +0000)]
[WebAssembly] Define __heap_base global
This is an immutable exported global representing
the start of the heap area. It is a page aligned.
Differential Revision: https://reviews.llvm.org/D42030
llvm-svn: 322609
Aaron Smith [Wed, 17 Jan 2018 01:22:03 +0000 (01:22 +0000)]
Fix pretty printing the unspecified param of a variadic function
Summary:
- Fix a bug in PrettyBuiltinDumper that returns "void" as the name for
an unspecified builtin type. Since the unspecified param of a variadic
function is considered a builtin of unspecified type in PDBs, we set
"..." for its name.
- Provide a method to determine if a PDBSymbolFunc is variadic in
PrettyFunctionDumper since PDBSymbolFunc::getArgument() doesn't return the
last unspecified-type param.
- Add a pretty-func-dumper.test to test pretty dumping of variadic
functions.
Reviewers: zturner, llvm-commits
Reviewed By: zturner
Differential Revision: https://reviews.llvm.org/D41801
llvm-svn: 322608
Peter Collingbourne [Wed, 17 Jan 2018 01:15:33 +0000 (01:15 +0000)]
cfi: Add a blacklist entry for MSVC's std::get_temporary_buffer function.
Differential Revision: https://reviews.llvm.org/D42150
llvm-svn: 322607
Sam Clegg [Wed, 17 Jan 2018 01:10:28 +0000 (01:10 +0000)]
[WebAssembly] Create synthetic __dso_handle symbol
This is used by __cxa_ataxit to determine the currently
executing DLL. Once we fully support DLLs this will need
to be set to some address within the DLL.
The ELF linker added support for this symbol here:
https://reviews.llvm.org/D33856
Differential Revision: https://reviews.llvm.org/D42024
llvm-svn: 322606
Rui Ueyama [Wed, 17 Jan 2018 01:08:02 +0000 (01:08 +0000)]
[LLD][COFF] Report error when file will exceed Windows maximum image size (4GB)
Patch by Colden Cullen.
Currently, when a large PE (>4 GiB) is to be produced, a crash occurs
because:
1. Calling setOffset with a number greater than UINT32_MAX causes the
PointerToRawData to overflow
2. When adding the symbol table to the end of the file, the last section's
offset was used to calculate file size. Because this had overflowed,
this number was too low, and the file created would not be large enough.
This lead to the actual crash I saw, which was a buffer overrun.
This change:
1. Adds comment to setOffset, clarifying that overflow can occur, but it's
somewhat safe because the error will be handled elsewhere
2. Adds file size check after all output data has been created This matches
the MS link.exe error, which looks prints as: "LINK : fatal error
LNK1248: image size (
10000EFC9) exceeds maximum allowable size
(
FFFFFFFF)"
3. Changes calculate of the symbol table offset to just use the existing
FileSize. This should match the previous calculations, but doesn't rely
on the use of a u32 that can overflow.
4. Removes trivial usage of a magic number that bugged me while I was
debugging the issue
I'm not sure how to add a test for this outside of adding 4GB of object
files to the repo. If there's an easier way, let me know and I'll be
happy to add a test.
Differential Revision: https://reviews.llvm.org/D42010
llvm-svn: 322605
Petr Hosek [Wed, 17 Jan 2018 00:42:48 +0000 (00:42 +0000)]
[libFuzzer] Support using libc++
This is needed in case the users of libFuzzer use libc++ in their
code, which the fuzz target (libFuzzer) will be linked against.
When libc++ source is available, we build a private version of it
and link it against libFuzzer which allows using the same static
library against codebases which use both libc++ and libstdc++.
Differential Revision: https://reviews.llvm.org/D37631
llvm-svn: 322604
Jason Molenda [Wed, 17 Jan 2018 00:22:27 +0000 (00:22 +0000)]
Remove the hardcoded macos deployment targets altogether
from the xcode project files. We'll build for the current
OS only, by default.
llvm-svn: 322603
Yan Zhang [Wed, 17 Jan 2018 00:19:35 +0000 (00:19 +0000)]
add ID as a special acronym to objc property declaration check for property names like bundleID.allow using acronyms as suffix.
Reviewers: benhamilton, hokein
Reviewed By: benhamilton
Subscribers: klimek, cfe-commits
Differential Revision: https://reviews.llvm.org/D42143
llvm-svn: 322602
Evgeniy Stepanov [Tue, 16 Jan 2018 23:15:08 +0000 (23:15 +0000)]
[hwasan] Rename sized load/store callbacks to be consistent with ASan.
Summary: __hwasan_load is now __hwasan_loadN.
Reviewers: kcc
Subscribers: hiraditya, llvm-commits
Differential Revision: https://reviews.llvm.org/D42138
llvm-svn: 322601
Simon Pilgrim [Tue, 16 Jan 2018 22:15:41 +0000 (22:15 +0000)]
[X86][BTVER2] Fix scheduling of VCMPSD/VCMPSS instructions
For some reason they don't have a trailing i like the packed equivalents.
llvm-svn: 322600
Florian Hahn [Tue, 16 Jan 2018 22:13:15 +0000 (22:13 +0000)]
[CallSiteSplitting] Pass list of (BB, Conditions) pairs to splitCallSite.
This removes some duplication from splitCallSite and makes it easier to
add additional code dealing with each predecessor. It also allows us to
split for more than 2 predecessors, although that is not enabled for
now.
Reviewers: junbuml, mcrosier, davidxl, davide
Reviewed By: junbuml
Differential Revision: https://reviews.llvm.org/D41858
llvm-svn: 322599
Simon Pilgrim [Tue, 16 Jan 2018 22:08:43 +0000 (22:08 +0000)]
[X86][BTVER2] Use instrs instead of instregex for low match counts (PR35955)
llvm-svn: 322598
Simon Pilgrim [Tue, 16 Jan 2018 21:44:48 +0000 (21:44 +0000)]
[X86][BTVER2] Use instrs instead of instregex for single use matches (PR35955)
llvm-svn: 322597
Martin Storsjo [Tue, 16 Jan 2018 20:54:10 +0000 (20:54 +0000)]
[PPC64] Added vector registers.
The Registers_ppc64 class needed a couple of changes, both to accommodate the
new registers as well as to handle the overlaps of VS register set
without wasting space.
The save/restore code of V and VS registers was added.
As VS registers depend on the VMX extension, they are processed only if
VMX support is detected (_ARCH_PWR8 for now).
Patch by Leandro Lupori!
Differential Revision: https://reviews.llvm.org/D41906
llvm-svn: 322596
Rui Ueyama [Tue, 16 Jan 2018 20:52:32 +0000 (20:52 +0000)]
Specify inline for isWhitespace in CommandLine.cpp
Patch by Takuto Ikuta.
In chromium's component build, there are many directive sections and
commandline parsing takes much time.
This patch is for speed up of lld in RelWithDebInfo build by forcing
inline heavily called isWhitespace function.
10 times link perf stats of blink_core.dll changed like below.
master:
TotalSeconds: 9.8764878
TotalSeconds: 10.1455242
TotalSeconds: 10.075279
TotalSeconds: 10.3397347
TotalSeconds: 9.8361665
TotalSeconds: 9.9544441
TotalSeconds: 9.8960686
TotalSeconds: 9.8877865
TotalSeconds: 10.0551879
TotalSeconds: 10.0492254
Avg: 10.
01159047
with this patch:
TotalSeconds: 8.8696762
TotalSeconds: 9.1021585
TotalSeconds: 9.0233893
TotalSeconds: 9.1886175
TotalSeconds: 9.156954
TotalSeconds: 9.0978564
TotalSeconds: 9.1316824
TotalSeconds: 8.8354606
TotalSeconds: 9.2549431
TotalSeconds: 9.4473085
Avg: 9.
11080465
llvm-svn: 322595
Lang Hames [Tue, 16 Jan 2018 20:39:51 +0000 (20:39 +0000)]
[ExecutionEngine] Rename JITSymbol::isStrongDefinition to isStrong.
For symmetry with isWeak, isCommon.
llvm-svn: 322594
Richard Trieu [Tue, 16 Jan 2018 19:53:06 +0000 (19:53 +0000)]
Add context to why test was disabled on Windows
test/Modules/odr_hash-Friend.cpp triggers an assertion in MicrosoftMangle.cpp
This has been reported in PR35939
llvm-svn: 322593
Erich Keane [Tue, 16 Jan 2018 19:49:52 +0000 (19:49 +0000)]
Move target MV resolver to COMDAT
As reported here: https://bugs.llvm.org/show_bug.cgi?id=35921
The resolver functions should be in their own
COMDAT regions. This patch sets that up.
Differential Revision: https://reviews.llvm.org/D42110
llvm-svn: 322592
Guozhi Wei [Tue, 16 Jan 2018 19:28:50 +0000 (19:28 +0000)]
[PPC] Add a new register XER aliased to CARRY
When "xer" is specified as clobbered register in inline assembler, clang can accept it, but llvm simply ignore it when lowered to machine instructions. It may cause problems later in scheduler.
This patch adds a new register XER aliased to CARRY, and adds it to register class CARRYRC. Now PPCTargetLowering::getRegForInlineAsmConstraint can return correct register number for inline asm constraint "{xer}", and scheduler behave correctly.
Differential Revision: https://reviews.llvm.org/D41967
llvm-svn: 322591
Rafael Espindola [Tue, 16 Jan 2018 19:28:28 +0000 (19:28 +0000)]
Inline foot gun into only valid use.
Symbol had both Visibility and getVisibility() and they had different
meanings. That is just too easy to get wrong.
getVisibility() would compute the visibility of a particular symbol
(foo in bar.o), and Visibility stores the computed value we will put
in the output.
There is only one case when we want what getVisibility() provides, so
inline it.
llvm-svn: 322590
Alexey Bataev [Tue, 16 Jan 2018 19:22:49 +0000 (19:22 +0000)]
[DOCS] Updated current status of OpenMP support, NFC.
llvm-svn: 322589
Evgeniy Stepanov [Tue, 16 Jan 2018 19:21:45 +0000 (19:21 +0000)]
[hwasan] Build runtime library with -fPIC, not -fPIE.
Summary: -fPIE can not be used when building a shared library.
Reviewers: alekseyshl, peter.smith
Subscribers: kubamracek, llvm-commits, mgorny
Differential Revision: https://reviews.llvm.org/D42121
llvm-svn: 322588
Alexey Bataev [Tue, 16 Jan 2018 19:18:24 +0000 (19:18 +0000)]
[OPENMP] Add support for `depend` clauses on `target teams distribute
parallel for simd` directives.
Added codegen for `depend` clauses on `#pragma omp target teams
distribute parallel for simd` directives.
llvm-svn: 322587
Rafael Espindola [Tue, 16 Jan 2018 19:02:46 +0000 (19:02 +0000)]
Fix another case we used the wrong visibility.
In here too we want the computed output visibility.
llvm-svn: 322586
Alexey Bataev [Tue, 16 Jan 2018 19:02:33 +0000 (19:02 +0000)]
[OPENMP] Add support for `depend` on `target teams distribute parallel
for` directives.
Added codegen for `depend` clauses on `#pragma omp target teams
distribute parallel for` directives.
llvm-svn: 322585
Francis Visoiu Mistrih [Tue, 16 Jan 2018 18:55:26 +0000 (18:55 +0000)]
[CodeGen] Skip some instructions that shouldn't affect shrink-wrapping
r320606 checked for MI.isMetaInstruction which skips all DBG_VALUEs.
This also skips IMPLICIT_DEFs and other instructions that may def / read
a register.
Differential Revision: https://reviews.llvm.org/D42119
llvm-svn: 322584
Rafael Espindola [Tue, 16 Jan 2018 18:53:09 +0000 (18:53 +0000)]
Add an extra test. NFC.
Without this all test would pass if the visibility checks were removed
from SymbolTable::addShared and SymbolTable::addUndefined.
llvm-svn: 322583
Volkan Keles [Tue, 16 Jan 2018 18:44:05 +0000 (18:44 +0000)]
[GlobalISel][TableGen] Add support for SDNodeXForm
Summary:
This patch adds CustomRenderer which renders the matched
operands to the specified instruction.
Targets can enable the matching of SDNodeXForm by adding
a definition that inherits from GICustomOperandRenderer and
GISDNodeXFormEquiv as follows.
def gi_imm8 : GICustomOperandRenderer<"renderImm8”>,
GISDNodeXFormEquiv<imm8_xform>;
Custom renderer functions should be of the form:
void render(MachineInstrBuilder &MIB, const MachineInstr &I);
Reviewers: dsanders, ab, rovka
Reviewed By: dsanders
Subscribers: kristof.beyls, javed.absar, llvm-commits, mgrang, qcolombet
Differential Revision: https://reviews.llvm.org/D42012
llvm-svn: 322582
Michael Kruse [Tue, 16 Jan 2018 18:39:42 +0000 (18:39 +0000)]
[IslTools] dumpPw: Dump same structure pieces together.
Print same or similar structure elements together. Previously, the
value could take more importance that the space structure if visited
first in the space nest tree.
Before:
{
Left[0] -> Right[i]: i >= 0;
Left[1] -> AnotherRight[i];
Left[2] -> Right[-1]
}
After:
{
Left[0] -> Right[i]: i >= 0;
Left[2] -> Right[-1];
Left[1] -> AnotherRight[i]
}
llvm-svn: 322581
Rafael Espindola [Tue, 16 Jan 2018 18:21:23 +0000 (18:21 +0000)]
Fix another case we were using the wrong visibility.
llvm-svn: 322580
Alexey Bataev [Tue, 16 Jan 2018 18:17:01 +0000 (18:17 +0000)]
[SLP] Fix for PR32164: Improve vectorization of reverse order of extract operations.
Summary: Sometimes vectorization of insertelement instructions with extractelement operands may produce an extra shuffle operation, if these operands are in the reverse order. Patch tries to improve this situation by the reordering of the operands to remove this extra shuffle operation.
Reviewers: mkuper, hfinkel, RKSimon, spatel
Subscribers: mzolotukhin, llvm-commits
Differential Revision: https://reviews.llvm.org/D33954
llvm-svn: 322579
Alexey Bataev [Tue, 16 Jan 2018 17:55:15 +0000 (17:55 +0000)]
[OPENMP] Add support for `depend` clauses on `target parallel for simd`
directives.
Added codegen for `depend` clauses on `#pragma omp target parallel for
simd` directives.
llvm-svn: 322578
Alexey Bataev [Tue, 16 Jan 2018 17:41:04 +0000 (17:41 +0000)]
[OPENMP] Add support for `depend` clauses on `target parallel for`
directives.
Added codegen for `depend` clause on `#pragma omp target parallel for`
directives.
llvm-svn: 322577
Rafael Espindola [Tue, 16 Jan 2018 17:34:26 +0000 (17:34 +0000)]
Use the combined visibility when computing dso_local.
We track both the combined visibility that will be used for the output
symbol and the original input visibility of the selected symbol.
Almost everything should use the computed visibility.
I will make the names less confusing an a followup patch.
llvm-svn: 322576
Alexey Bataev [Tue, 16 Jan 2018 17:22:50 +0000 (17:22 +0000)]
[OPENMP] Add support for `depend` clauses on `target teams distribute
simd` directives.
Added codegen for `depend` clauses on `#pragma omp target teams
distribute simd` directives.
llvm-svn: 322575
Simon Pilgrim [Tue, 16 Jan 2018 17:01:31 +0000 (17:01 +0000)]
[X86][MMX] Accept UNDEF upper bits for MOVD GR32->MMX
llvm-svn: 322574
Nico Weber [Tue, 16 Jan 2018 16:55:41 +0000 (16:55 +0000)]
Add va_start()/va_copy()/va_end to Builtins.def
That way, clang suggests including stdarg.h when these are used in C files.
https://reviews.llvm.org/D42085
llvm-svn: 322573
Rafael Espindola [Tue, 16 Jan 2018 16:49:05 +0000 (16:49 +0000)]
Set dso_local in lld.
We were already doing this in gold, but not in lld.
llvm-svn: 322572
Alexey Bataev [Tue, 16 Jan 2018 16:46:46 +0000 (16:46 +0000)]
[OPENMP] Add support for `depend` clause on `target teams distribute`.
Added codegen for `depend` clauses on `#pragma omp target teams
distribute` directives.
llvm-svn: 322571
Alexey Bataev [Tue, 16 Jan 2018 16:27:49 +0000 (16:27 +0000)]
[OPENMP] Add support for `depend` clauses on `target parallel` directive.
Added codegen for `depend` clauses on `#pragma omp target parallel`
directives.
llvm-svn: 322570
Alexey Bataev [Tue, 16 Jan 2018 15:57:07 +0000 (15:57 +0000)]
[OPENMP] Add support for `depend` clauses on `target teams`.
Added codegen for `depend` clause on `#pragma omp target teams`
directives.
llvm-svn: 322569
Petar Jovanovic [Tue, 16 Jan 2018 15:57:03 +0000 (15:57 +0000)]
[LiveDebugValues] update kill-after-spill test with target triple
Set target triple to "x86_64-unknown-linux-gnu".
llvm-svn: 322568
Marshall Clow [Tue, 16 Jan 2018 15:48:27 +0000 (15:48 +0000)]
More constexpr algorithms from P0202. search/search_n
llvm-svn: 322566
Ulrich Weigand [Tue, 16 Jan 2018 15:39:23 +0000 (15:39 +0000)]
[SystemZ] Support vector registers with inline asm
Allow using vector register names and the "v" constraint
in inline asm to ensure compatibility with GCC.
llvm-svn: 322562
Alexey Bataev [Tue, 16 Jan 2018 15:05:16 +0000 (15:05 +0000)]
[OPENMP] Add support for `depend` clauses on `target simd`.
Added codegen for `depend` clauses on `#pragma omp target simd`
directives.
llvm-svn: 322559
Marshall Clow [Tue, 16 Jan 2018 14:54:36 +0000 (14:54 +0000)]
Change an internal table of constants for the poisson distribution from
type 'result_type' to 'double'. The only thing that we ever do with
these numbers is to promote them to 'double' and use them in a division.
For small result_types, the values were getting truncated, skewing the
results. Thanks to James Nagurne for the suggestion.
llvm-svn: 322556
Petar Jovanovic [Tue, 16 Jan 2018 14:46:05 +0000 (14:46 +0000)]
[LiveDebugValues] recognize spilled reg killed in instruction after spill
Current condition for spill instruction recognition in LiveDebugValues does
not recognize case when register is spilled and killed in next instruction.
Patch by Nikola Prica.
Differential Revision: https://reviews.llvm.org/D41226
llvm-svn: 322554
Simon Pilgrim [Tue, 16 Jan 2018 14:21:28 +0000 (14:21 +0000)]
[X86][MMX] Improve MMX constant generation
Extend the MMX zero code to take any constant with zero'd upper 32-bits
llvm-svn: 322553
Hiroshi Inoue [Tue, 16 Jan 2018 13:19:48 +0000 (13:19 +0000)]
[NFC] fix trivial typos in documents
"the the" -> "the"
llvm-svn: 322552
Hiroshi Inoue [Tue, 16 Jan 2018 13:19:31 +0000 (13:19 +0000)]
[NFC] fix trivial typo in document
"the the" -> "the"
llvm-svn: 322551
Sam McCall [Tue, 16 Jan 2018 12:54:28 +0000 (12:54 +0000)]
Squash -Wcovered-switch-default wairning
llvm-svn: 322549
Sam McCall [Tue, 16 Jan 2018 12:33:46 +0000 (12:33 +0000)]
Ensure code complete with !LoadExternal sees all local decls.
Summary:
noload_lookups() was too lazy: in addition to avoiding external decls, it
avoided populating the lazy lookup structure for internal decls.
This is the right behavior for the existing callsite in ASTDumper, but I think
it's not a very useful default, so we populate it by default.
While here:
- remove an unused test file accidentally added in r322371.
- remove lookups_begin()/lookups_end() in favor of lookups().begin(), which is
more common and more efficient.
Reviewers: ilya-biryukov
Subscribers: cfe-commits, rsmith
Differential Revision: https://reviews.llvm.org/D42077
llvm-svn: 322548
Sam McCall [Tue, 16 Jan 2018 12:21:24 +0000 (12:21 +0000)]
[clangd] Avoid combinatorial explosion in CodeCompleteTests.
Summary:
This test dominates our unit test runtime, and the change speeds it up by 10x.
We lose coverage of some combinations of flags, but I'm not sure that's finding
many bugs.
3300 -> 300ms on my machine (3800 -> 800ms for the whole of CompletionTest).
Reviewers: ilya-biryukov
Subscribers: klimek, cfe-commits
Differential Revision: https://reviews.llvm.org/D42063
llvm-svn: 322547
Ivan Donchevskii [Tue, 16 Jan 2018 12:11:59 +0000 (12:11 +0000)]
Add missing CINDEX_LINKAGE
Follow up for [libclang] Add PrintingPolicy for pretty printing declarations
Differential Revision: https://reviews.llvm.org/D39903
llvm-svn: 322546
Gadi Haber [Tue, 16 Jan 2018 11:33:45 +0000 (11:33 +0000)]
[X86][I86,I186,I286,I386,I486,PPRO, MMX]: Adding full coverage of MC encoding for the I86, I186, I286, I386, I486, PPRO and MMX isa sets.<NFC>
NFC.
Adding MC regressions tests to cover the I86, I186, I286, I386, I486, PPRO and MMX isa sets.
This patch is part of a larger task to cover MC encoding of all X86 ISA Sets.
Started in revision: https://reviews.llvm.org/D39952
Reviewers: zvi, RKSimon, AndreiGrischenko, craig.topper
Differential Revision: https://reviews.llvm.org/D40879
Change-Id: I231a35861611bfd3d23c74cc59507373f021a629
llvm-svn: 322544
Jonas Devlieghere [Tue, 16 Jan 2018 11:17:57 +0000 (11:17 +0000)]
[DebugInfo] Unify dumping of address ranges
Summary:
This patch unifies the printing of address ranges as [0x0, 0x1).
rdar://
34822059
Reviewers: aprantl, dblaikie
Subscribers: mehdi_amini, llvm-commits
Differential Revision: https://reviews.llvm.org/D42056
llvm-svn: 322543
Francis Visoiu Mistrih [Tue, 16 Jan 2018 10:53:14 +0000 (10:53 +0000)]
[CodeGen] Remove special case of printing subRegIdx from MachineInstr::print
Support in MachineOperand has been added in r320209. No need to special
case this anymore.
llvm-svn: 322542
Francis Visoiu Mistrih [Tue, 16 Jan 2018 10:53:11 +0000 (10:53 +0000)]
[CodeGen][NFC] Correct case for printSubRegIdx
llvm-svn: 322541
Jonathan Coe [Tue, 16 Jan 2018 10:19:56 +0000 (10:19 +0000)]
[libclang] Add PrintingPolicy for pretty printing declarations
Summary:
Introduce clang_getCursorPrettyPrinted() for pretty printing
declarations. Expose also PrintingPolicy, so the user gets more
fine-grained control of the entities being printed.
The already existing clang_getCursorDisplayName() is pretty limited -
for example, it does not handle return types, parameter names or default
arguments for function declarations. Addressing these issues in
clang_getCursorDisplayName() would mean to duplicate existing code
(e.g. clang::DeclPrinter), so rather expose new API to access the
existing functionality.
Reviewed By: jbcoe
Subscribers: cfe-commits
Tags: #clang
Patch by nik (Nikolai Kosjar)
Differential Revision: https://reviews.llvm.org/D39903
llvm-svn: 322540
Clement Courbet [Tue, 16 Jan 2018 09:11:20 +0000 (09:11 +0000)]
Add a value_type to ArrayRef.
Summary: Not sure this needs a review or not. Erring on the safe side.
Reviewers: dblaikie
Differential Revision: https://reviews.llvm.org/D41666
llvm-svn: 322538
Gadi Haber [Tue, 16 Jan 2018 08:50:29 +0000 (08:50 +0000)]
[X86][XSAVE]: Adding full coverage of MC encoding for the XSAVE isa sets.<NFC>
NFC.
Adding MC regressions tests to cover the XSAVE ISA sets.
This patch is part of a larger task to cover MC encoding of all X86 ISA Sets started in revision: https://reviews.llvm.org/D39952
Reviewers: zvi, RKSimon, AndreiGrischenko, craig.topper
Differential Revision: https://reviews.llvm.org/D41282
Change-Id: I325bf8f421f78c80179a04fc39033366759cbe45
llvm-svn: 322537
George Rimar [Tue, 16 Jan 2018 08:09:24 +0000 (08:09 +0000)]
[FileCheck] - Fix possible buffer out of bounds access when parsing --check-prefix.
FileCheck tool crashes when trying to parse --check-prefix argument if there is no any
data after it.
For example test like following would crash if there are no symbols and no EOL mark after `boom`:
# REQUIRES: x86
# RUN: <skipped few lines>
# RUN: llvm-readobj -t %t | FileCheck %s --check-prefix=boom
Patch fixes the issue.
Differential revision: https://reviews.llvm.org/D42057
llvm-svn: 322536
Yonghong Song [Tue, 16 Jan 2018 07:27:20 +0000 (07:27 +0000)]
[BPF] Mark pseudo insn patterns as isCodeGenOnly
These pseudos are not supposed to be visible to user.
This patch reduced the auto-generated instruction matcher. For example,
the following words are removed from keyword list of LLVM BPF assembler.
- MCK__35_, // '#'
- MCK__COLON_, // ':'
- MCK__63_, // '?'
- MCK_ADJCALLSTACKDOWN, // 'ADJCALLSTACKDOWN'
- MCK_ADJCALLSTACKUP, // 'ADJCALLSTACKUP'
- MCK_PSEUDO, // 'PSEUDO'
- MCK_Select, // 'Select'
Acked-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Acked-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Jiong Wang <jiong.wang@netronome.com>
llvm-svn: 322535
Yonghong Song [Tue, 16 Jan 2018 07:27:19 +0000 (07:27 +0000)]
[BPF] Teach DAG2DAG AND elimination about load intrinsics
As commented on the existing code:
// The Reg operand should be a virtual register, which is defined
// outside the current basic block. DAG combiner has done a pretty
// good job in removing truncating inside a single basic block.
However, when the Reg operand comes from bpf_load_[byte | half | word]
intrinsics, the generic optimizer doesn't understand their results are
zero extended, so these single basic block elimination opportunities were
missed.
Acked-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Acked-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Jiong Wang <jiong.wang@netronome.com>
llvm-svn: 322534
Hiroshi Inoue [Tue, 16 Jan 2018 06:23:05 +0000 (06:23 +0000)]
[SROA] fix assetion failure
This patch fixes the assertion failure in SROA reported in PR35657.
PR35657 reports the assertion failure due to r319522 (splitting for non-whole-alloca slices), but this problem can happen even without r319522.
The problem exists in a check for reusing an existing alloca when rewriting partitions. As the original comment said, we can reuse the existing alloca if the new alloca has the same type and offset with the existing one. But the code checks only type of the alloca and then check the offset using an assert.
In a corner case with out-of-bounds access (e.g. @PR35657 function added in unit test), it is possible that the two allocas have the same type but different offsets.
This patch makes the check of the offset in the if condition, and re-enables the splitting for non-whole-alloca slices.
Differential Revision: https://reviews.llvm.org/D41981
llvm-svn: 322533
Craig Topper [Tue, 16 Jan 2018 06:07:16 +0000 (06:07 +0000)]
[X86] Revisit the fix I made years ago to make 'xchgl %eax, %eax' not encode using the 0x90 encoding in 64-bit mode.
Prior to this we had a separate instruction and register class that excluded eax to prevent matching the instruction that would encode with 0x90.
This patch changes this to just use an InstAlias to force xchgl %eax, %eax to use XCHG32rr instruction in 64-bit mode. This gets rid of the separate instruction and register class.
llvm-svn: 322532
Craig Topper [Tue, 16 Jan 2018 06:07:14 +0000 (06:07 +0000)]
[X86] Make 'xchgq %rax, %rax' an alias for the 0x90 nop encoding to match gas.
Previously we encoded it as 0x48 0x90.
llvm-svn: 322531
George Burgess IV [Tue, 16 Jan 2018 03:01:50 +0000 (03:01 +0000)]
[Sema] Fix a crash on invalid features in multiversioning
We were trying to emit a diag::err_bad_multiversion_option diagnostic,
which expects an int as its first argument, with a string argument. As
it happens, the string `Feature` that was causing this was shadowing an
int `Feature` from the surrounding scope. :)
llvm-svn: 322530
Marshall Clow [Tue, 16 Jan 2018 02:34:41 +0000 (02:34 +0000)]
More constexpr algorithms from P0202: lower_bound, upper_bound, equal_range, binary_search
llvm-svn: 322529
Marshall Clow [Tue, 16 Jan 2018 02:11:13 +0000 (02:11 +0000)]
Actually CALL the constexpr tests.
llvm-svn: 322528
Marshall Clow [Tue, 16 Jan 2018 02:04:10 +0000 (02:04 +0000)]
More constexpr (re P0202) - equal and mismatch
llvm-svn: 322527