Kostya Serebryany [Fri, 31 Aug 2018 01:38:00 +0000 (01:38 +0000)]
[hwasan] make malloc(0) return nullptr, add basic address description for stack addresses
llvm-svn: 341156
Lang Hames [Fri, 31 Aug 2018 00:53:53 +0000 (00:53 +0000)]
[ORC] Remove a stray debugging output line left in a unit test.
llvm-svn: 341155
Lang Hames [Fri, 31 Aug 2018 00:53:17 +0000 (00:53 +0000)]
[ORC] Add utilities to RTDyldObjectLinkingLayer2 to simplify symbol flag
management and materialization responsibility registration.
The setOverrideObjectFlagsWithResponsibilityFlags method instructs
RTDyldObjectlinkingLayer2 to override the symbol flags produced by RuntimeDyld with
the flags provided by the MaterializationResponsibility instance. This can be used
to enable symbol visibility (hidden/exported) for COFF object files, which do not
currently support the SF_Exported flag.
The setAutoClaimResponsibilityForObjectSymbols method instructs
RTDyldObjectLinkingLayer2 to claim responsibility for any symbols provided by a
given object file that were not already in the MaterializationResponsibility
instance. Setting this flag allows higher-level program representations (e.g.
LLVM IR) to be added based on only a subset of the symbols they provide, without
having to write intervening layers to scan and add the additional symbols. This
trades diagnostic quality for convenience however: If all symbols are enumerated
up-front then clashes can be detected and reported early. If this option is set,
clashes for the additional symbols may not be detected until late, and detection
may depend on the flow of control through JIT'd code.
llvm-svn: 341154
Fangrui Song [Fri, 31 Aug 2018 00:33:16 +0000 (00:33 +0000)]
[PPC64] Improve a test ppc64_entry_point.s
Rename to ppc64-entry-point.s
Deduplicate .text dump of little-endian big-endian
llvm-svn: 341153
Fangrui Song [Fri, 31 Aug 2018 00:26:46 +0000 (00:26 +0000)]
Import lit.llvm after rL341130
llvm-svn: 341152
Fangrui Song [Fri, 31 Aug 2018 00:24:36 +0000 (00:24 +0000)]
Import lit.llvm after rC341132
llvm-svn: 341151
Fangrui Song [Fri, 31 Aug 2018 00:23:09 +0000 (00:23 +0000)]
Import lit.llvm after rLLD341134
llvm-svn: 341150
Fangrui Song [Fri, 31 Aug 2018 00:22:20 +0000 (00:22 +0000)]
Import lit.llvm after rL341135
llvm-svn: 341149
Fangrui Song [Fri, 31 Aug 2018 00:16:22 +0000 (00:16 +0000)]
[PPC64] Improve a test ppc64-toc-rel.s
Deduplicate dump of .text .data for little-endian and big-endian
Fix a RELOCS-NE check line typo
llvm-svn: 341148
Max Kazantsev [Fri, 31 Aug 2018 00:01:54 +0000 (00:01 +0000)]
Revert "[NFC] Add severe validation of InstructionPrecedenceTracking" for discussion
llvm-svn: 341147
Stephen Kelly [Thu, 30 Aug 2018 23:41:03 +0000 (23:41 +0000)]
Remove vestiges of configure buildsystem
Summary:
Subscribers: mgorny, cfe-commits
Differential Revision: https://reviews.llvm.org/D50738
llvm-svn: 341146
Stephen Kelly [Thu, 30 Aug 2018 23:25:44 +0000 (23:25 +0000)]
Add preload option to clang-query
Summary: This allows loading a file with pre-defined let commands for example.
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D51261
llvm-svn: 341145
Stephen Kelly [Thu, 30 Aug 2018 23:25:38 +0000 (23:25 +0000)]
Extract runCommandsInFile method
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D51260
llvm-svn: 341144
Kostya Serebryany [Thu, 30 Aug 2018 23:22:26 +0000 (23:22 +0000)]
[hwasan] fix the linux-only pthread_create interceptor and reinstate the two threaded tests
llvm-svn: 341143
Stephen Kelly [Thu, 30 Aug 2018 23:11:09 +0000 (23:11 +0000)]
Allow binding to NamedValue resulting from let expression
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D51259
llvm-svn: 341142
Stephen Kelly [Thu, 30 Aug 2018 23:11:01 +0000 (23:11 +0000)]
Extract parseBindID method
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D51258
llvm-svn: 341141
Stephen Kelly [Thu, 30 Aug 2018 23:10:52 +0000 (23:10 +0000)]
Add dump() method for SourceRange
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D50662
llvm-svn: 341140
Fangrui Song [Thu, 30 Aug 2018 23:01:00 +0000 (23:01 +0000)]
[PPC64] Remove unused -z notext from a test
llvm-svn: 341139
Michael Berg [Thu, 30 Aug 2018 22:43:34 +0000 (22:43 +0000)]
[NFC] adding initial intersect test for Node to Instruction association
llvm-svn: 341138
Krzysztof Parzyszek [Thu, 30 Aug 2018 22:26:43 +0000 (22:26 +0000)]
[Hexagon] Check validity of register class when generating bitsplit
llvm-svn: 341137
Eli Friedman [Thu, 30 Aug 2018 22:18:27 +0000 (22:18 +0000)]
[ARM] Enable GEP offset splitting for 32-bit ARM.
It has essentially the same benefit it has on 64-bit ARM: it
substantially reduces the number of constants used by large GEP
operations. Seems to be generally helpful across a few different
codebases I've tried.
Differential Revision: https://reviews.llvm.org/D51462
llvm-svn: 341136
Nico Weber [Thu, 30 Aug 2018 22:13:34 +0000 (22:13 +0000)]
Remove LIT_SITE_CFG_IN_FOOTER, llvm
It's always replaced with the same (short) static string, so just put that
there directly.
No intended behavior change.
https://reviews.llvm.org/D51357
llvm-svn: 341135
Nico Weber [Thu, 30 Aug 2018 22:12:16 +0000 (22:12 +0000)]
Remove LIT_SITE_CFG_IN_FOOTER, lld
It's always replaced with the same (short) static string, so just put that
there directly.
No intended behavior change.
https://reviews.llvm.org/D51357
llvm-svn: 341134
Kostya Serebryany [Thu, 30 Aug 2018 22:11:56 +0000 (22:11 +0000)]
[hwasan] use thread-local ring buffers to properly report heap-use-after-free
llvm-svn: 341133
Nico Weber [Thu, 30 Aug 2018 22:11:16 +0000 (22:11 +0000)]
Remove LIT_SITE_CFG_IN_FOOTER, clang
It's always replaced with the same (short) static string, so just put that
there directly.
No intended behavior change.
https://reviews.llvm.org/D51357
llvm-svn: 341132
Thomas Lively [Thu, 30 Aug 2018 22:10:43 +0000 (22:10 +0000)]
[WebAssembly] Update utility functions with SIMD types
Reviewers: aheejin, dschuff
Subscribers: sbc100, jgravelle-google, sunfish, llvm-commits
Differential Revision: https://reviews.llvm.org/D51516
llvm-svn: 341131
Nico Weber [Thu, 30 Aug 2018 22:10:13 +0000 (22:10 +0000)]
Remove LIT_SITE_CFG_IN_FOOTER, clang-tools-extra
It's always replaced with the same (short) static string, so just put that
there directly.
No intended behavior change.
https://reviews.llvm.org/D51357
llvm-svn: 341130
Kostya Serebryany [Thu, 30 Aug 2018 22:07:09 +0000 (22:07 +0000)]
[hwasan] temporarily remove two tests to silence the bots
llvm-svn: 341129
Thomas Lively [Thu, 30 Aug 2018 21:43:51 +0000 (21:43 +0000)]
[WebAssembly] Vector conversions
Summary:
Lowers away bitconverts between vector types. This CL depends
on D51383.
Reviewers: aheejin, dschuff
Subscribers: sbc100, jgravelle-google, sunfish, llvm-commits
Differential Revision: https://reviews.llvm.org/D51498
llvm-svn: 341128
Thomas Lively [Thu, 30 Aug 2018 21:36:48 +0000 (21:36 +0000)]
[WebAssembly] SIMD loads and stores
Summary: Reuse the patterns from WebAssemblyInstrMemory.td.
Reviewers: aheejin, dschuff
Subscribers: sbc100, jgravelle-google, sunfish, llvm-commits
Differential Revision: https://reviews.llvm.org/D51383
llvm-svn: 341127
Raphael Isemann [Thu, 30 Aug 2018 21:31:04 +0000 (21:31 +0000)]
Fixed comment for UserExpression::Complete [NFC]
llvm-svn: 341126
Charles Davis [Thu, 30 Aug 2018 21:29:00 +0000 (21:29 +0000)]
Add support for SEH unwinding on Windows.
Summary:
I've tested this implementation on x86-64 to ensure that it works. All
`libc++abi` tests pass, as do all `libc++` exception-related tests. ARM
still remains to be implemented (@compnerd?).
Special thanks to KJK::Hyperion for his excellent series of articles on
how EH works on x86-64 Windows. (Seriously, check it out. It's awesome.)
I'm actually not sure if this should go in as is. I particularly don't
like that I duplicated the UnwindCursor class for this special case.
Reviewers: mstorsjo, rnk, compnerd, smeenai, javed.absar
Subscribers: mgorny, kristof.beyls, christof, chrib, cfe-commits, compnerd, llvm-commits
Differential Revision: https://reviews.llvm.org/D50564
llvm-svn: 341125
Raphael Isemann [Thu, 30 Aug 2018 21:26:32 +0000 (21:26 +0000)]
Use a CompletionRequest in the expression command completion [NFC]
The patch was originally written before we had a CompletionRequest,
so it still used a StringList to pass back the completions to
the request.
llvm-svn: 341124
Adrian Prantl [Thu, 30 Aug 2018 21:21:16 +0000 (21:21 +0000)]
dsymutil: Avoid pruning non-type forward declarations inside DW_TAG_module
forward declarations.
Especially with template instantiations, there are legitimate reasons
why for declarations might be emitted into a DW_TAG_module skeleton /
forward-declaration sub-tree, that are not forward declarations in the
sense of that there is a more complete definition over in a .pcm file.
The example in the testcase is a constant DW_TAG_member of a
DW_TAG_class template instatiation.
rdar://problem/
43623196
llvm-svn: 341123
Zachary Turner [Thu, 30 Aug 2018 21:00:57 +0000 (21:00 +0000)]
Remove some debugging code that was accidentally left in.
llvm-svn: 341122
Raphael Isemann [Thu, 30 Aug 2018 20:56:58 +0000 (20:56 +0000)]
Move NoBuiltin=true closer to the other LangOpts code [NFC]
llvm-svn: 341121
Zachary Turner [Thu, 30 Aug 2018 20:53:48 +0000 (20:53 +0000)]
Add a utility script to stress test the demangler.
llvm-svn: 341120
Zachary Turner [Thu, 30 Aug 2018 20:53:29 +0000 (20:53 +0000)]
[MS Demangler] Add support for $$Z parameter pack separator.
$$Z appears between adjacent expanded parameter packs in the
same template instantiation. We don't need to print it, it's
only there to disambiguate between manglings that would otherwise
be ambiguous. So we just need to parse it and throw it away.
llvm-svn: 341119
Artem Belevich [Thu, 30 Aug 2018 20:53:15 +0000 (20:53 +0000)]
Revert the tests that should've been reverted in rL341115
llvm-svn: 341118
Zachary Turner [Thu, 30 Aug 2018 20:53:11 +0000 (20:53 +0000)]
[MS ABI] Fix mangling issue with dynamic initializer stubs.
There are two types of dynamic initializer stubs. There's
`dynamic initializer for 'x''(void)
and
`dynamic initializer for `static Foo::Bar StaticDataMember''(void)
The second case is disambiguated from the first by the presence of
a ? after the operator code. So the first will appear something like
?__E<name> while the second will appear something like ?__E?<name>.
clang-cl was mangling these both the same though. This patch
matches behavior with cl.
Differential Revision: https://reviews.llvm.org/D51500
llvm-svn: 341117
Vlad Tsyrklevich [Thu, 30 Aug 2018 20:44:51 +0000 (20:44 +0000)]
SafeStack: Prevent OOB reads with mem intrinsics
Summary:
Currently, the SafeStack analysis disallows out-of-bounds writes but not
out-of-bounds reads for mem intrinsics like llvm.memcpy. This could
cause leaks of pointers to the safe stack by leaking spilled registers/
frame pointers. Check for allocas used as source or destination pointers
to mem intrinsics.
Reviewers: eugenis
Reviewed By: eugenis
Subscribers: pcc, llvm-commits, kcc
Differential Revision: https://reviews.llvm.org/D51334
llvm-svn: 341116
Artem Belevich [Thu, 30 Aug 2018 20:43:39 +0000 (20:43 +0000)]
Reverted the "[CUDA/OpenMP] Define only some host macros during device compilation"
The changes were breaking CUDA compilation.
Reverted revisions:
r340681 D50845
[CUDA/OpenMP] Define only some host macros during device compilation
r340772 D51312
[OpenMP][NVPTX] Use appropriate _CALL_ELF macro when offloading
r340967 D51441
Add predefined macro __gnu_linux__ for proper aux-triple
llvm-svn: 341115
Sterling Augustine [Thu, 30 Aug 2018 20:42:49 +0000 (20:42 +0000)]
Revert r341107. That change breaks lto-android in a way is untested.
llvm-svn: 341114
Tim Northover [Thu, 30 Aug 2018 20:28:32 +0000 (20:28 +0000)]
Hashing: use 64-bit seed for hashing on all platforms.
get_execution_seed returns a size_t which varies across platforms, but its
users actually always feed it into a uint64_t role so it makes sense to be
consistent.
Mostly this is just a tidy-up, but it also apparently allows PCH files to be
shared between Clang compilers built for 32-bit and 64-bit hosts.
llvm-svn: 341113
Raphael Isemann [Thu, 30 Aug 2018 20:19:57 +0000 (20:19 +0000)]
Adjusting some comments in ClangExpressionParser.cpp
llvm-svn: 341112
Kostya Serebryany [Thu, 30 Aug 2018 20:15:39 +0000 (20:15 +0000)]
[hwasan] simplify the thread hangling: instead of the ThreadRegistry (too heavy) simply maintain a linked list of Threads
llvm-svn: 341111
Richard Smith [Thu, 30 Aug 2018 20:15:28 +0000 (20:15 +0000)]
[cxx_status] Use the correct color for a feature in "SVN" status
llvm-svn: 341110
Raphael Isemann [Thu, 30 Aug 2018 20:14:22 +0000 (20:14 +0000)]
Added missing include to <cctype> for 'std::isalnum'
Should fix the failing Windows bots.
llvm-svn: 341109
Craig Topper [Thu, 30 Aug 2018 20:10:10 +0000 (20:10 +0000)]
[X86] Add -x86-experimental-vector-widening-legalization command lines to vector-idiv-v2i32.ll
If we're legalizing via widening already, then the type legalizer will scalarize the divs/rems as i32.
llvm-svn: 341108
Sterling Augustine [Thu, 30 Aug 2018 20:07:23 +0000 (20:07 +0000)]
Refactor Addlibgcc to make the when and what logic more straightfoward.
No functional change. A forthcoming change will add support
for -shared-libgcc.
llvm-svn: 341107
Douglas Yung [Thu, 30 Aug 2018 19:52:57 +0000 (19:52 +0000)]
Change %clang++ to %clangxx in test run line as it was expanding to clang.exe++ on Windows.
llvm-svn: 341106
Raphael Isemann [Thu, 30 Aug 2018 19:47:53 +0000 (19:47 +0000)]
Fixed code style for the CodeCompletion members [NFC]
This code is in LLDB, so it should also follow the LLDB code style
and use the m_ prefix for members.
llvm-svn: 341105
Ana Pazos [Thu, 30 Aug 2018 19:43:19 +0000 (19:43 +0000)]
[RISCV] Fixed SmallVector.h Assertion `idx < size()'
Summary:
RISCVAsmParser needs to handle the case the error message is of specific type, other than the generic Match_InvalidOperand, and the corresponding
operand is missing.
This bug was uncovered by a LLVM MC Assembler Protocol Buffer Fuzzer for the RISC-V assembly language.
Reviewers: asb
Reviewed By: asb
Subscribers: llvm-commits, jocewei, asb, rbar, johnrusso, simoncook, sabuasal, niosHD, kito-cheng, shiva0217, zzheng, edward-jones, mgrang, rogfer01, MartinMosbeck, brucehoult, the_o, PkmX
Differential Revision: https://reviews.llvm.org/D50790
llvm-svn: 341104
Craig Topper [Thu, 30 Aug 2018 19:35:40 +0000 (19:35 +0000)]
[DAGCombiner] Fix bad identation. NFC
llvm-svn: 341103
Craig Topper [Thu, 30 Aug 2018 19:35:38 +0000 (19:35 +0000)]
[X86] Weaken an overly aggressive assert.
This assert tried to check that AND constants are only on the RHS. But its possible for both operands to be constants if one is opaque which will prevent the AND from being constant folded.
Fixes PR38771
llvm-svn: 341102
Evandro Menezes [Thu, 30 Aug 2018 19:22:00 +0000 (19:22 +0000)]
[ARM] Adjust the feature set for Exynos
Enable `FeatureUseAA` for all Exynos processors.
llvm-svn: 341101
Richard Smith [Thu, 30 Aug 2018 19:19:15 +0000 (19:19 +0000)]
Update FIXME as requested in code review.
llvm-svn: 341100
Richard Smith [Thu, 30 Aug 2018 19:17:11 +0000 (19:17 +0000)]
Add test file missed from r341097.
llvm-svn: 341099
Richard Smith [Thu, 30 Aug 2018 19:16:35 +0000 (19:16 +0000)]
Add missing -Wc++11-compat / -Wc++14-compat warnings for:
* generic lambdas
* return type deduction
* class template argument deduction
llvm-svn: 341098
Richard Smith [Thu, 30 Aug 2018 19:16:33 +0000 (19:16 +0000)]
Improve attribute documentation to list which spellings are used in which syntaxes.
Summary:
Instead of listing all the spellings (including attribute namespaces) in
the section heading, only list the actual attribute names there, and
list the spellings in the supported syntaxes table.
This allows us to properly describe things like [[fallthrough]], for
which we allow a clang:: prefix in C++ but not in C, and AlwaysInline,
which has one spelling as a GNU attribute and a different spelling as a
keyword, without needing to repeat the syntax description in the
documentation text.
Sample rendering: https://pste.eu/p/T1ZV.html
Reviewers: aaron.ballman
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D51473
llvm-svn: 341097
Pavel Labath [Thu, 30 Aug 2018 19:14:02 +0000 (19:14 +0000)]
Fix deadlock in gdb-client tests
Using a listen queue of length 0 caused a deadlock on my machine in the
gdb-client tests while attempting to establish the loopback socket
connection.
I am not sure if this is down to a different python or kernel version,
but in either case, having queue of length zero sounds like a bad idea,
so I'm bumping that to one (which also fixes the deadlock).
llvm-svn: 341096
Evandro Menezes [Thu, 30 Aug 2018 19:04:51 +0000 (19:04 +0000)]
[InstCombine] Expand the simplification of pow() into exp2()
Generalize the simplification of `pow(2.0, y)` to `pow(2.0 ** n, y)` for all
scalar and vector types.
This improvement helps some benchmarks in SPEC CPU2000 and CPU2006, such as
252.eon, 447.dealII, 453.povray. Otherwise, no significant regressions on
x86-64 or A64.
Differential revision: https://reviews.llvm.org/D49273
llvm-svn: 341095
Eli Friedman [Thu, 30 Aug 2018 18:59:24 +0000 (18:59 +0000)]
[SROA] Fix alignment for uses of PHI nodes.
Splitting an alloca can decrease the alignment of GEPs into the
partition. Normally, rewriting accounts for this, but the code was
missing for uses of PHI nodes and select instructions.
Fixes https://bugs.llvm.org/show_bug.cgi?id=38707 .
Differential Revision: https://reviews.llvm.org/D51335
llvm-svn: 341094
Alexey Bataev [Thu, 30 Aug 2018 18:56:11 +0000 (18:56 +0000)]
[OPENMP] Fix PR38710: static functions are not emitted as implicitly
'declare target'.
All the functions, referenced in implicit|explicit target regions must
be emitted during code emission for the device.
llvm-svn: 341093
Artem Dergachev [Thu, 30 Aug 2018 18:45:05 +0000 (18:45 +0000)]
[analyzer] InnerPointerChecker: Fix a segfault when checking symbolic strings.
Return value of dyn_cast_or_null should be checked before use.
Otherwise we may put a null pointer into the map as a key and eventually
crash in checkDeadSymbols.
Differential Revision: https://reviews.llvm.org/D51385
llvm-svn: 341092
Andrew Kaylor [Thu, 30 Aug 2018 18:37:18 +0000 (18:37 +0000)]
Reverting r340807.
This patch restores the old behavior of getAllocationDataForFunction in MemoryBuiltins.cpp.
llvm-svn: 341091
David Carlier [Thu, 30 Aug 2018 18:12:47 +0000 (18:12 +0000)]
[Xray] Darwin fix variable typo
llvm-svn: 341090
Raphael Isemann [Thu, 30 Aug 2018 17:51:10 +0000 (17:51 +0000)]
Move Predicate.h from Host to Utility
Summary:
This class was initially in Host because its implementation used to be
very OS-specific. However, with C++11, it has become a very simple
std::condition_variable wrapper, with no host-specific code.
It is also a general purpose utility class, so it makes sense for it to
live in a place where it can be used by everyone.
This has no effect on the layering right now, but it enables me to later
move the Listener+Broadcaster+Event combo to a lower layer, which is
important, as these are used in a lot of places (notably for launching a
process in Host code).
Reviewers: jingham, zturner, teemperor
Reviewed By: zturner
Subscribers: xiaobai, mgorny, lldb-commits
Differential Revision: https://reviews.llvm.org/D50384
llvm-svn: 341089
Craig Topper [Thu, 30 Aug 2018 17:51:02 +0000 (17:51 +0000)]
[X86] Add kshift test cases for D51401. NFC
llvm-svn: 341088
Vladimir Stefanovic [Thu, 30 Aug 2018 17:31:38 +0000 (17:31 +0000)]
Allow inconsistent offsets for 'noreturn' basic blocks when '-verify-cfiinstrs'
With r295105, some 'noreturn' blocks (those that don't return and have no
successors) may be merged.
If such blocks' predecessors have different outgoing offset or register, don't
report an error in CFIInstrInserter verify().
Thanks to Vlad Tsyrklevich for reporting the issue.
Differential Revision: https://reviews.llvm.org/D51161
llvm-svn: 341087
Raphael Isemann [Thu, 30 Aug 2018 17:29:37 +0000 (17:29 +0000)]
Added initial code completion support for the `expr` command
Summary:
This patch adds initial code completion support for the `expr` command.
We now have a completion handler in the expression CommandObject that
essentially just attempts to parse the given user expression with Clang with
an attached code completion consumer. We filter and prepare the
code completions provided by Clang and send them back to the completion
API.
The current completion is limited to variables that are in the current scope.
This includes local variables and all types used by local variables. We however
don't do any completion of symbols that are not used in the local scope (or
in some other way already in the ASTContext).
This is partly because there is not yet any code that manually searches for additiona
information in the debug information. Another cause is that for some reason the existing
code for loading these additional symbols when requested by Clang doesn't seem to work.
This will be fixed in a future patch.
Reviewers: jingham, teemperor
Reviewed By: teemperor
Subscribers: labath, aprantl, JDevlieghere, friss, lldb-commits
Differential Revision: https://reviews.llvm.org/D48465
llvm-svn: 341086
Robert Widmann [Thu, 30 Aug 2018 17:09:43 +0000 (17:09 +0000)]
[LLVM-C] Add Bindings For Named Metadata
Summary: Add a new type for named metadata nodes. Use this to implement iterators and accessors for NamedMDNodes and extend the echo test to use them to copy module-level debug information.
Reviewers: whitequark, deadalnix, aprantl, dexonsmith
Reviewed By: whitequark
Subscribers: Wallbraker, JDevlieghere, llvm-commits, harlanhaskins
Differential Revision: https://reviews.llvm.org/D47179
llvm-svn: 341085
Sanjay Patel [Thu, 30 Aug 2018 16:44:07 +0000 (16:44 +0000)]
[IR] fix declaration of shuffle mask
An address sanitizer bot flagged this as a potential bug.
llvm-svn: 341084
Sterling Augustine [Thu, 30 Aug 2018 16:37:06 +0000 (16:37 +0000)]
Test the cross-product of how libgcc-related arguments are passed to the linker.
llvm-svn: 341083
Matt Morehouse [Thu, 30 Aug 2018 15:54:44 +0000 (15:54 +0000)]
[libFuzzer] Port to Windows
Summary:
Port libFuzzer to windows-msvc.
This patch allows libFuzzer targets to be built and run on Windows, using -fsanitize=fuzzer and/or fsanitize=fuzzer-no-link. It allows these forms of coverage instrumentation to work on Windows as well.
It does not fix all issues, such as those with -fsanitize-coverage=stack-depth, which is not usable on Windows as of this patch.
It also does not fix any libFuzzer integration tests. Nearly all of them fail to compile, fixing them will come in a later patch, so libFuzzer tests are disabled on Windows until them.
Patch By: metzman
Reviewers: morehouse, rnk
Reviewed By: morehouse, rnk
Subscribers: #sanitizers, delcypher, morehouse, kcc, eraman
Differential Revision: https://reviews.llvm.org/D51022
llvm-svn: 341082
Wouter van Oortmerssen [Thu, 30 Aug 2018 15:40:53 +0000 (15:40 +0000)]
[WebAssembly] Made disassembler only use stack instructions.
Summary:
Now uses the StackBased bit from the tablegen defs to identify
stack instructions (and ignore register based or non-wasm instructions).
Also changed how we store operands, since we now have up to 16 of them
per instruction. To not cause static data bloat, these are compressed
into a tiny table.
+ a few other cleanups.
Tested:
- MCTest
- llvm-lit -v `find test -name WebAssembly`
Reviewers: dschuff, jgravelle-google, sunfish, tlively
Subscribers: sbc100, aheejin, llvm-commits
Differential Revision: https://reviews.llvm.org/D51320
llvm-svn: 341081
Adrian Prantl [Thu, 30 Aug 2018 15:39:08 +0000 (15:39 +0000)]
Remove redundant initialization
llvm-svn: 341080
Nicolai Haehnle [Thu, 30 Aug 2018 15:24:00 +0000 (15:24 +0000)]
Move test/Analysis/DivergenceAnalysis/AMDGPU/loads.ll
Should fix failures of buildbots that don't build the AMDGPU backend.
Change-Id: I01cb84b4b47803b10c5b21ea0353546239860a51
llvm-svn: 341079
Adrian Prantl [Thu, 30 Aug 2018 15:11:00 +0000 (15:11 +0000)]
Support setting a breakpoint by FileSpec+Line+Column in the SBAPI.
This patch extends the SBAPI to allow for setting a breakpoint not
only at a specific line, but also at a specific (minimum) column. When
a column is specified, it will try to find an exact match or the
closest match on the same line that comes after the specified
location.
Differential Revision: https://reviews.llvm.org/D51461
llvm-svn: 341078
Yaxun Liu [Thu, 30 Aug 2018 15:10:20 +0000 (15:10 +0000)]
[HIP] Add -fvisibility hidden option to clang
AMDGPU target need -fvisibility hidden option for clang to
work around a limitation of no PLT support, otherwise there is compilation
error at -O0.
Differential Revision: https://reviews.llvm.org/D51434
llvm-svn: 341077
Sam McCall [Thu, 30 Aug 2018 15:07:34 +0000 (15:07 +0000)]
[clangd] Run SignatureHelp using an up-to-date preamble, waiting if needed.
Summary:
After code completion inserts a header, running signature help using the old
preamble will usually fail. So we add support for consistent preamble reads.
Reviewers: ilya-biryukov
Subscribers: javed.absar, ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits
Differential Revision: https://reviews.llvm.org/D51438
llvm-svn: 341076
Sanjay Patel [Thu, 30 Aug 2018 15:05:38 +0000 (15:05 +0000)]
[IR] add shuffle queries for identity extend/extract
This was one of the potential follow-ups suggested in D48236,
and these will be used to make matching the patterns in PR38691 cleaner:
https://bugs.llvm.org/show_bug.cgi?id=38691
About the vocabulary: in the DAG, these would be concat_vector with an
undef operand or extract_subvector. Alternate names are discussed in the
review, but I think these are familiar/good enough to proceed. Once we
have uses of them in code, we might adjust if there are better options.
https://reviews.llvm.org/D51392
llvm-svn: 341075
Jan Korous [Thu, 30 Aug 2018 14:46:48 +0000 (14:46 +0000)]
[Sema][NFC] Trivial cleanup in ActOnCallExpr
Use logical or operator instead of a bool variable and if/else.
Differential Revision: https://reviews.llvm.org/D51485
llvm-svn: 341074
Alexey Bataev [Thu, 30 Aug 2018 14:45:24 +0000 (14:45 +0000)]
[OPENMP][NVPTX] Add options -f[no-]openmp-cuda-force-full-runtime.
Added options -f[no-]openmp-cuda-force-full-runtime to [not] force use
of the full runtime for OpenMP offloading to CUDA devices.
llvm-svn: 341073
Alexander Ivchenko [Thu, 30 Aug 2018 14:32:47 +0000 (14:32 +0000)]
Make TargetInstrInfo::isCopyInstr return true for regular COPY-instructions
..Move all target-dependent checks into new isCopyInstrImpl method.
This change allows us to treat MoveReg-type instructions and generic
COPY instruction in the same way
Differential Revision: https://reviews.llvm.org/D49913
llvm-svn: 341072
Nicolai Haehnle [Thu, 30 Aug 2018 14:21:36 +0000 (14:21 +0000)]
[NFC] Rename the DivergenceAnalysis to LegacyDivergenceAnalysis
Summary:
This is patch 1 of the new DivergenceAnalysis (https://reviews.llvm.org/D50433).
The purpose of this patch is to free up the name DivergenceAnalysis for the new generic
implementation. The generic implementation class will be shared by specialized
divergence analysis classes.
Patch by: Simon Moll
Reviewed By: nhaehnle
Subscribers: jvesely, jholewinski, arsenm, nhaehnle, mgorny, jfb, llvm-commits
Differential Revision: https://reviews.llvm.org/D50434
Change-Id: Ie8146b11be2c50d5312f30e11c7a3036a15b48cb
llvm-svn: 341071
Alexandre Ganea [Thu, 30 Aug 2018 14:05:49 +0000 (14:05 +0000)]
More build fix for r341064.
llvm-svn: 341070
Daniel Cederman [Thu, 30 Aug 2018 14:05:26 +0000 (14:05 +0000)]
[Sparc] Use ANDN instead of AND if constant can be encoded more efficiently
Summary:
In the case of (and reg, constant) or (or reg, constant), it can be
beneficial to use a ANDNrr/ORNrr instruction instead of ANDrr/ORrr,
if the complement of the constant can be encoded using a single SETHI
instruction instead of a SETHI/ORri pair.
If the constant has more than one use, it is probably better to keep it
in its original form.
Reviewers: jyknight, venkatra
Reviewed By: jyknight
Subscribers: fedor.sergeev, jrtc27, llvm-commits
Differential Revision: https://reviews.llvm.org/D50964
llvm-svn: 341069
Alexander Timofeev [Thu, 30 Aug 2018 13:55:04 +0000 (13:55 +0000)]
[AMDGPU] Preliminary patch for divergence driven instruction selection. Operands Folding 1.
Reviewers: rampitec
Differential revision: https://reviews/llvm/org/D51316
llvm-svn: 341068
Alexandre Ganea [Thu, 30 Aug 2018 13:36:07 +0000 (13:36 +0000)]
Build fix for r341064. Temporarily disable compile-time validation for createFileError().
llvm-svn: 341067
Kirill Bobyrev [Thu, 30 Aug 2018 13:30:34 +0000 (13:30 +0000)]
[clangd] Remove UB introduced in rL341057
llvm-svn: 341066
Ilya Biryukov [Thu, 30 Aug 2018 13:14:31 +0000 (13:14 +0000)]
[clangd] Report position of opening paren in singature help
Summary: Only accessible via the C++ API at the moment.
Reviewers: sammccall
Reviewed By: sammccall
Subscribers: ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits
Differential Revision: https://reviews.llvm.org/D51437
llvm-svn: 341065
Alexandre Ganea [Thu, 30 Aug 2018 13:10:42 +0000 (13:10 +0000)]
[Error] Add FileError helper; upgrade StringError behavior
FileError is meant to encapsulate both an Error and a file name/path. It should be used in cases where an Error occurs deep down the call chain, and we want to return it to the caller along with the file name.
StringError was updated to display the error messages in different ways. These can be:
1. display the error_code message, and convert to the same error_code (ECError behavior)
2. display an arbitrary string, and convert to a provided error_code (current StringError behavior)
3. display both an error_code message and a string, in this order; and convert to the same error_code
These behaviors can be triggered depending on the constructor. The goal is to use StringError as a base class, when a library needs to provide a explicit Error type.
Differential Revision: https://reviews.llvm.org/D50807
llvm-svn: 341064
Ilya Biryukov [Thu, 30 Aug 2018 13:08:03 +0000 (13:08 +0000)]
[CodeComplete] Report location of opening parens for signature help
Summary: Used in clangd.
Reviewers: sammccall
Reviewed By: sammccall
Subscribers: ioeric, kadircet, cfe-commits
Differential Revision: https://reviews.llvm.org/D51436
llvm-svn: 341063
Ties Stuij [Thu, 30 Aug 2018 12:52:35 +0000 (12:52 +0000)]
[CodeGen] emit inline asm clobber list warnings for reserved (cont)
Summary:
This is a continuation of https://reviews.llvm.org/D49727
Below the original text, current changes in the comments:
Currently, in line with GCC, when specifying reserved registers like sp or pc on an inline asm() clobber list, we don't always preserve the original value across the statement. And in general, overwriting reserved registers can have surprising results.
For example:
extern int bar(int[]);
int foo(int i) {
int a[i]; // VLA
asm volatile(
"mov r7, #1"
:
:
: "r7"
);
return 1 + bar(a);
}
Compiled for thumb, this gives:
$ clang --target=arm-arm-none-eabi -march=armv7a -c test.c -o - -S -O1 -mthumb
...
foo:
.fnstart
@ %bb.0: @ %entry
.save {r4, r5, r6, r7, lr}
push {r4, r5, r6, r7, lr}
.setfp r7, sp, #12
add r7, sp, #12
.pad #4
sub sp, #4
movs r1, #7
add.w r0, r1, r0, lsl #2
bic r0, r0, #7
sub.w r0, sp, r0
mov sp, r0
@APP
mov.w r7, #1
@NO_APP
bl bar
adds r0, #1
sub.w r4, r7, #12
mov sp, r4
pop {r4, r5, r6, r7, pc}
...
r7 is used as the frame pointer for thumb targets, and this function needs to restore the SP from the FP because of the variable-length stack allocation a. r7 is clobbered by the inline assembly (and r7 is included in the clobber list), but LLVM does not preserve the value of the frame pointer across the assembly block.
This type of behavior is similar to GCC's and has been discussed on the bugtracker: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=11807 . No consensus seemed to have been reached on the way forward. Clang behavior has briefly been discussed on the CFE mailing (starting here: http://lists.llvm.org/pipermail/cfe-dev/2018-July/058392.html). I've opted for following Eli Friedman's advice to print warnings when there are reserved registers on the clobber list so as not to diverge from GCC behavior for now.
The patch uses MachineRegisterInfo's target-specific knowledge of reserved registers, just before we convert the inline asm string in the AsmPrinter.
If we find a reserved register, we print a warning:
repro.c:6:7: warning: inline asm clobber list contains reserved registers: R7 [-Winline-asm]
"mov r7, #1"
^
Reviewers: efriedma, olista01, javed.absar
Reviewed By: efriedma
Subscribers: eraman, kristof.beyls, llvm-commits
Differential Revision: https://reviews.llvm.org/D51165
llvm-svn: 341062
Kirill Bobyrev [Thu, 30 Aug 2018 12:42:19 +0000 (12:42 +0000)]
[clang-tidy] Use simple string matching instead of Regex
Instead of parsing and compiling the `llvm::Regex` each time, it's
faster to use basic string matching for filename prefix check.
Reviewed by: hokein
Differential Revision: https://reviews.llvm.org/D51360
llvm-svn: 341061
Kirill Bobyrev [Thu, 30 Aug 2018 12:29:36 +0000 (12:29 +0000)]
[clangd] Fix tests after rL341057
Since OR iterator children are not longer sorted by the estimated size,
string representation should be different.
llvm-svn: 341060
David Green [Thu, 30 Aug 2018 11:55:16 +0000 (11:55 +0000)]
[AArch64] Optimise load(adr address) to ldr address
Providing that the load is known to be 4 byte aligned, we can optimise a
ldr(adr address) to just ldr address.
Differential Revision: https://reviews.llvm.org/D51030
llvm-svn: 341058
Kirill Bobyrev [Thu, 30 Aug 2018 11:23:58 +0000 (11:23 +0000)]
[clangd] Implement iterator cost
This patch introduces iterator cost concept to improve the performance
of Dex query iterators (mainly, AND iterator). Benchmarks show that the
queries become ~10% faster.
Before
```
-------------------------------------------------------
Benchmark Time CPU Iteration
-------------------------------------------------------
DexAdHocQueries 5883074 ns 5883018 ns 117
DexRealQ
959904457 ns
959898507 ns 1
```
After
```
-------------------------------------------------------
Benchmark Time CPU Iteration
-------------------------------------------------------
DexAdHocQueries 5238403 ns 5238361 ns 130
DexRealQ
873275207 ns
873269453 ns 1
```
Reviewed by: sammccall
Differential Revision: https://reviews.llvm.org/D51310
llvm-svn: 341057
Andrea Di Biagio [Thu, 30 Aug 2018 11:17:58 +0000 (11:17 +0000)]
[llvm-mca] correctly initialize field 'CycleRetired' in the TimelineView.
This fixes a [-Wmissing-field-initializers] warning reported by buildbot
lld-x86_64-darwin13, build #25152.
llvm-svn: 341056