Davide Italiano [Fri, 15 Dec 2017 00:50:43 +0000 (00:50 +0000)]
[ExpressionParser] Fix evaluation failures due to mismatch in C++ versions.
Clang recently switched to C++14 (with GNU extensions) as the default
dialect, but LLDB didn't catch up. This causes failures as LLDB still
evaluates ObjectiveC expressions as Objective C++ using C++98 as standard.
There are things not available in C++98, including, e.g. nullptr.
In some cases Objective-C `nil` is defined as `nullptr` so this causes
an evaluation failure. Switch the default to overcome this issue
(actually, currently lldb evaluates both C++11 and C++14 as C++11,
but that seems a larger change and definitely could be re-evaluated
in the future).
No test as this is currently failing on the LLDB bots after the clang
switch (so, de facto, there's a test already for it).
This is a recommit, with a thinko fixed (the code was previously
placed incorrectly).
<rdar://problem/
36011995>
llvm-svn: 320778
Sam Clegg [Fri, 15 Dec 2017 00:34:32 +0000 (00:34 +0000)]
[WebAssembly] Remove extra semicolon. NFC.
llvm-svn: 320777
Saleem Abdulrasool [Fri, 15 Dec 2017 00:32:09 +0000 (00:32 +0000)]
FastISel: support no-PLT PIC calls on ELF x86_64
Add support for properly handling PIC code with no-PLT. This equates to
`-fpic -fno-plt -O0` with the clang frontend. External functions are
marked with nonlazybind, which must then be indirected through the GOT.
This allows code to be built without optimizations in PIC mode without
going through the PLT. Addresses PR35653!
llvm-svn: 320776
Zachary Turner [Fri, 15 Dec 2017 00:27:49 +0000 (00:27 +0000)]
Don't crash in llvm-pdbutil when dumping TypeIndexes with high bit set.
This is a special code that indicates that it's a function id.
While I'm still not certain how to interpret these, we definitely
should *not* be using these values as indices into an array directly.
For now, when we encounter one of these, just print the numeric value.
llvm-svn: 320775
Sam Clegg [Fri, 15 Dec 2017 00:17:10 +0000 (00:17 +0000)]
[WebAssembly] Implement @llvm.global_ctors and @llvm.global_dtors
Summary:
- lowers @llvm.global_dtors by adding @llvm.global_ctors
functions which register the destructors with `__cxa_atexit`.
- impements @llvm.global_ctors with wasm start functions and linker metadata
See [here](https://github.com/WebAssembly/tool-conventions/issues/25) for more background.
Subscribers: jfb, dschuff, mgorny, jgravelle-google, aheejin, sunfish
Differential Revision: https://reviews.llvm.org/D41211
llvm-svn: 320774
Rui Ueyama [Fri, 15 Dec 2017 00:17:04 +0000 (00:17 +0000)]
Do not create an unnecessary object file in a test.
llvm-svn: 320773
Rui Ueyama [Fri, 15 Dec 2017 00:07:15 +0000 (00:07 +0000)]
Fix error messages.
llvm-svn: 320772
Don Hinton [Fri, 15 Dec 2017 00:06:26 +0000 (00:06 +0000)]
[debuginfo] Remove obsolete test_debuginfo.pl that was moved to debuginfo-tests.
Summary:
Now that r320495, "[debuginfo-tests] Support moving
debuginfo-tests to llvm/projects," has landed, which includes a local
copy of test_debuginfo.pl, remove the obsolete copy.
Reviewers: zturner, aprantl
Reviewed By: aprantl
Subscribers: llvm-commits, JDevlieghere
Differential Revision: https://reviews.llvm.org/D41260
llvm-svn: 320771
Rui Ueyama [Fri, 15 Dec 2017 00:01:33 +0000 (00:01 +0000)]
Use warn() instead of error() to report a bad symbol in a DSO.
Specifically, libwidevinecdm.so in Chrome has such bad symbol.
It seems the BFD linker handles them as local symbols, so instead
of inserting them to the symbol table, we should skip them too.
Differential Revision: https://reviews.llvm.org/D41257
llvm-svn: 320770
Davide Italiano [Fri, 15 Dec 2017 00:00:17 +0000 (00:00 +0000)]
[ExpressionParser] Rollback C++98 as the standard for evaluating.
Some ubuntu bots are failing with this patch in, let me unblock
while I investigate.
llvm-svn: 320769
David Blaikie [Thu, 14 Dec 2017 23:45:58 +0000 (23:45 +0000)]
Remove a non-modular header (& inline it into its one use)
llvm-svn: 320768
Quentin Colombet [Thu, 14 Dec 2017 23:44:07 +0000 (23:44 +0000)]
[TableGen][GlobalISel] Add a common class for all PredicateMatcher
NFC.
llvm-svn: 320767
Alex Lorenz [Thu, 14 Dec 2017 23:40:42 +0000 (23:40 +0000)]
Remove duplicate python libclang changes from r320748
llvm-svn: 320766
Erich Keane [Thu, 14 Dec 2017 23:37:08 +0000 (23:37 +0000)]
Correct UnaryTransformTypeLoc to properly initialize.
The initializeLocal function of UnaryTransformTypeLoc missed
the UnderlyingTInfo member. This caused a null-dereference
issue, as reported in PR23421. This patch correctly initializss
the UnderlyingTInfo.
llvm-svn: 320765
George Burgess IV [Thu, 14 Dec 2017 23:32:57 +0000 (23:32 +0000)]
[ProfileData] Use a different data structure to save memory.
This change swaps FunctionSamples to a std::map. This saves us around
17% of the memory required to parse sample profiles. To put hard numbers
on this, clang now eats around 1.3GB of RAM instead of 1.6GB while
parsing a 50MB profile.
The CPU time taken by a large profile merge (3.1GB of data across 226
files) is also reduced by ~11% by this patch (1:09.08 vs 1:01.11).
This was split out at the request of reviewers in D41152.
llvm-svn: 320764
Vassil Vassilev [Thu, 14 Dec 2017 23:30:18 +0000 (23:30 +0000)]
D40901: Refactor lazy loading of template specializations. NFC
llvm-svn: 320763
Evandro Menezes [Thu, 14 Dec 2017 23:13:04 +0000 (23:13 +0000)]
[Unit][AArch64] Additional tests for target parsing
Add Exynos M2/M3 to extension check.
llvm-svn: 320762
Davide Italiano [Thu, 14 Dec 2017 23:11:15 +0000 (23:11 +0000)]
[ExpressionParser] Fix evaluation failures due to mismatch in C++ versions.
Clang recently switched to C++14 (with GNU extensions) as the default
dialect, but LLDB didn't catch up. This causes failures as LLDB still
evaluates ObjectiveC expressions as Objective C++ using C++98 as standard.
There are things not available in C++98, including, e.g. nullptr.
In some cases Objective-C `nil` is defined as `nullptr` so this causes
an evaluation failure. Switch the default to overcome this issue
(actually, currently lldb evaluates both C++11 and C++14 as C++11,
but that seems a larger change and definitely could be re-evaluated
in the future).
No test as this is currently failing on the LLDB bots after the clang
switch (so, de facto, there's a test already for it).
<rdar://problem/
36011995>
llvm-svn: 320761
Evandro Menezes [Thu, 14 Dec 2017 23:06:18 +0000 (23:06 +0000)]
[AArch64] Test patch
Fix formatting by adding a missing blank line to test new network setup.
llvm-svn: 320760
Davide Italiano [Thu, 14 Dec 2017 23:03:35 +0000 (23:03 +0000)]
[ClangASTContext] Remove dead stuff found fixing something else.
llvm-svn: 320759
Adrian Prantl [Thu, 14 Dec 2017 22:55:06 +0000 (22:55 +0000)]
EmitFuncArgumentDbgValue: Prefer stack slots over registers for stack arguments
While investigating LLVM PR22316 (http://llvm.org/bugs/show_bug.cgi?id=22316)
I started wondering if it were not always preferable to emit the
initial DBG_VALUEs for stack arguments as FI locations instead of
describing the first register they get copied into. The advantage of
doing this is that the arguments will be available as soon as the
stack is setup. As illustrated by the testcase in the PR, the first
copy of the FI into a register may be sunk by MachineSink.cpp into a
later basic block. By describing the argument on the stack, we nicely
circumvent this problem.
<rdar://problem/
19583723>
Differential Revision: https://reviews.llvm.org/D41135
llvm-svn: 320758
Craig Topper [Thu, 14 Dec 2017 22:50:10 +0000 (22:50 +0000)]
[X86] Remove an unnecessary SmallVector that was collecting chains for two SDNode's we're still holding SDValues for. NFCI
We can just get the chains from those SDValues to create the TokenFactor.
llvm-svn: 320757
Matt Arsenault [Thu, 14 Dec 2017 22:34:10 +0000 (22:34 +0000)]
TLI: Allow using PSV for intrinsic mem operands
llvm-svn: 320756
Dimitry Andric [Thu, 14 Dec 2017 22:32:24 +0000 (22:32 +0000)]
Don't trigger -Wuser-defined-literals for system headers
Summary:
In D41064, I proposed adding `#pragma clang diagnostic ignored
"-Wuser-defined-literals"` to some of libc++'s headers, since these
warnings are now triggered by clang's new `-std=gnu++14` default:
```
$ cat test.cpp
#include <string>
$ clang -std=c++14 -Wsystem-headers -Wall -Wextra -c test.cpp
In file included from test.cpp:1:
In file included from /usr/include/c++/v1/string:470:
/usr/include/c++/v1/string_view:763:29: warning: user-defined literal suffixes not starting with '_' are reserved [-Wuser-defined-literals]
basic_string_view<char> operator "" sv(const char *__str, size_t __len)
^
/usr/include/c++/v1/string_view:769:32: warning: user-defined literal suffixes not starting with '_' are reserved [-Wuser-defined-literals]
basic_string_view<wchar_t> operator "" sv(const wchar_t *__str, size_t __len)
^
/usr/include/c++/v1/string_view:775:33: warning: user-defined literal suffixes not starting with '_' are reserved [-Wuser-defined-literals]
basic_string_view<char16_t> operator "" sv(const char16_t *__str, size_t __len)
^
/usr/include/c++/v1/string_view:781:33: warning: user-defined literal suffixes not starting with '_' are reserved [-Wuser-defined-literals]
basic_string_view<char32_t> operator "" sv(const char32_t *__str, size_t __len)
^
In file included from test.cpp:1:
/usr/include/c++/v1/string:4012:24: warning: user-defined literal suffixes not starting with '_' are reserved [-Wuser-defined-literals]
basic_string<char> operator "" s( const char *__str, size_t __len )
^
/usr/include/c++/v1/string:4018:27: warning: user-defined literal suffixes not starting with '_' are reserved [-Wuser-defined-literals]
basic_string<wchar_t> operator "" s( const wchar_t *__str, size_t __len )
^
/usr/include/c++/v1/string:4024:28: warning: user-defined literal suffixes not starting with '_' are reserved [-Wuser-defined-literals]
basic_string<char16_t> operator "" s( const char16_t *__str, size_t __len )
^
/usr/include/c++/v1/string:4030:28: warning: user-defined literal suffixes not starting with '_' are reserved [-Wuser-defined-literals]
basic_string<char32_t> operator "" s( const char32_t *__str, size_t __len )
^
8 warnings generated.
```
Both @aaron.ballman and @mclow.lists felt that adding this workaround to
the libc++ headers was the wrong way, and it should be fixed in clang
instead.
Here is a proposal to do just that. I verified that this suppresses the
warning, even when -Wsystem-headers is used, and that the warning is
still emitted for a declaration outside of system headers.
Reviewers: aaron.ballman, mclow.lists, rsmith
Reviewed By: aaron.ballman
Subscribers: mclow.lists, aaron.ballman, andrew, emaste, cfe-commits
Differential Revision: https://reviews.llvm.org/D41080
llvm-svn: 320755
Rui Ueyama [Thu, 14 Dec 2017 22:31:29 +0000 (22:31 +0000)]
Add a missing build dependency.
Patch by Chen-Pang He.
llvm-svn: 320754
Yi Kong [Thu, 14 Dec 2017 22:24:45 +0000 (22:24 +0000)]
[ThreadSafetyAnalysis] Fix isCapabilityExpr
There are many more expr types that can be a capability expr, like
CXXThisExpr, CallExpr, MemberExpr. Instead of enumerating all of them,
just check typeHasCapability for any type given.
Also add & and * operators to allowed unary operators.
Differential Revision: https://reviews.llvm.org/D41224
llvm-svn: 320753
Aaron Ballman [Thu, 14 Dec 2017 22:17:09 +0000 (22:17 +0000)]
Harmonize GNU- and C++-style attribute spellings.
Most attributes will now use the Clang<"name"> construct to provide both __attribute__((name)) and [[clang::name]] syntaxes for the attribute. Attributes deviating from this should be marked with a comment explaining why they are not supported under both spellings. Common reasons are: the attribute is provided by some other specification that controls the syntax or the attribute cannot be exposed under a particular spelling for some given reason.
Because this is a mechanical change that only introduces new spellings, there are no test cases for the commit.
llvm-svn: 320752
Don Hinton [Thu, 14 Dec 2017 22:12:46 +0000 (22:12 +0000)]
[debuginfo] Remove temporary FIXME.
Summary:
Now that r320495, "[debuginfo-tests] Support moving
debuginfo-tests to llvm/projects," has landed, remove temporary FIXME
that supported the old mechanism.
Reviewers: zturner, aprantl
Reviewed By: aprantl
Subscribers: JDevlieghere, cfe-commits
Differential Revision: https://reviews.llvm.org/D41259
llvm-svn: 320751
Zachary Turner [Thu, 14 Dec 2017 22:07:03 +0000 (22:07 +0000)]
Fix many -Wsign-compare and -Wtautological-constant-compare warnings.
Most of the -Wsign-compare warnings are due to the fact that
enums are signed by default in the MS ABI, while the
tautological comparison warnings trigger on x86 builds where
sizeof(size_t) is 4 bytes, so N > numeric_limits<unsigned>::max()
is always false.
Differential Revision: https://reviews.llvm.org/D41256
llvm-svn: 320750
Sanjay Patel [Thu, 14 Dec 2017 22:05:20 +0000 (22:05 +0000)]
[SimplifyCFG] don't sink common insts too soon (PR34603)
This should solve:
https://bugs.llvm.org/show_bug.cgi?id=34603
...by preventing SimplifyCFG from altering redundant instructions before early-cse has a chance to run.
It changes the default (canonical-forming) behavior of SimplifyCFG, so we're only doing the
sinking transform later in the optimization pipeline.
Differential Revision: https://reviews.llvm.org/D38566
llvm-svn: 320749
Alex Lorenz [Thu, 14 Dec 2017 22:01:50 +0000 (22:01 +0000)]
[libclang] Add support for checking abstractness of records
This patch allows checking whether a C++ record declaration is abstract through
libclang and clang.cindex (Python).
Patch by Johann Klähn!
Differential Revision: https://reviews.llvm.org/D36952
llvm-svn: 320748
Ben Hamilton [Thu, 14 Dec 2017 21:44:11 +0000 (21:44 +0000)]
Revert "[ClangFormat] IndentWrappedFunctionNames should be true in the google ObjC style"
This reverts commit
37e69667f748e1458b46483b7c1b8f9ba33eec44.
We're going to discuss its ramifications further before making a
conclusion.
llvm-svn: 320747
Matt Arsenault [Thu, 14 Dec 2017 21:39:51 +0000 (21:39 +0000)]
DAG: Expose all MMO flags in getTgtMemIntrinsic
Rather than adding more bits to express every
MMO flag you could want, just directly use the
MMO flags. Also fixes using a bunch of bool arguments to
getMemIntrinsicNode.
On AMDGPU, buffer and image intrinsics should always
have MODereferencable set, but currently there is no
way to do that directly during the initial intrinsic
lowering.
llvm-svn: 320746
Kostya Kortchinsky [Thu, 14 Dec 2017 21:32:57 +0000 (21:32 +0000)]
[scudo] Refactor ScudoChunk
Summary:
The initial implementation used an ASan like Chunk class that was deriving from
a Header class. Due to potential races, we ended up working with local copies
of the Header and never using the parent class fields. ScudoChunk was never
constructed but cast, and we were using `this` as the pointer needed for our
computations. This was meh.
So we refactored ScudoChunk to be now a series of static functions within the
namespace `__scudo::Chunk` that take a "user" pointer as first parameter (former
`this`). A compiled binary doesn't really change, but the code is more sensible.
Clang tends to inline all those small function (in -O2), but GCC left a few not
inlined, so we add the `INLINE` keyword to all.
Since we don't have `ScudoChunk` pointers anymore, a few variables were renamed
here and there to introduce a clearer distinction between a user pointer
(usually `Ptr`) and a backend pointer (`BackendPtr`).
Reviewers: alekseyshl, flowerhack
Reviewed By: alekseyshl
Subscribers: #sanitizers, llvm-commits
Differential Revision: https://reviews.llvm.org/D41200
llvm-svn: 320745
Krzysztof Parzyszek [Thu, 14 Dec 2017 21:28:48 +0000 (21:28 +0000)]
[Hexagon] Generate HVX code for comparisons and selects
llvm-svn: 320744
Eric Liu [Thu, 14 Dec 2017 21:22:03 +0000 (21:22 +0000)]
[clangd] Put all #includes in one block in clangd source files. NFC
Clang-format categorizes and sorts #includes with style. It doesn't make sense
to manually managing #include blocks.
llvm-svn: 320743
Sam Clegg [Thu, 14 Dec 2017 21:10:03 +0000 (21:10 +0000)]
[WebAssembly] Add support for init functions linking metadata
Summary:
This change lays the groundwork lowering of @llvm.global_ctors
and @llvm.global_dtors for the wasm object format. Some parts
of this patch are subset of: https://reviews.llvm.org/D40759
See https://github.com/WebAssembly/tool-conventions/issues/25
Subscribers: jfb, dschuff, jgravelle-google, aheejin, sunfish
Differential Revision: https://reviews.llvm.org/D41208
llvm-svn: 320742
Sam Clegg [Thu, 14 Dec 2017 21:09:31 +0000 (21:09 +0000)]
Fix -Wreorder warning
Subscribers: aheejin, llvm-commits
Differential Revision: https://reviews.llvm.org/D41255
llvm-svn: 320741
Kamil Rytarowski [Thu, 14 Dec 2017 20:14:29 +0000 (20:14 +0000)]
[Sanitizers] Basic sanitizer Solaris support (PR 33274)
Summary:
This is the first mostly working version of the Sanitizer port to 32-bit Solaris/x86.
It is currently based on Solaris 11.4 Beta.
This part was initially developed inside libsanitizer in the GCC tree and should apply to
both. Subsequent parts will address changes to clang, the compiler-rt build system
and testsuite.
I'm not yet sure what the right patch granularity is: if it's profitable to split the patch
up, I'd like to get guidance on how to do so.
Most of the changes are probably straightforward with a few exceptions:
* The Solaris syscall interface isn't stable, undocumented and can change within an
OS release. The stable interface is the libc interface, which I'm using here, if possible
using the internal _-prefixed names.
* While the patch primarily target 32-bit x86, I've left a few sparc changes in. They
cannot currently be used with clang due to a backend limitation, but have worked
fine inside the gcc tree.
* Some functions (e.g. largefile versions of functions like open64) only exist in 32-bit
Solaris, so I've introduced a separate SANITIZER_SOLARIS32 to check for that.
The patch (with the subsequent ones to be submitted shortly) was tested
on i386-pc-solaris2.11. Only a few failures remain, some of them analyzed, some
still TBD:
AddressSanitizer-i386-sunos :: TestCases/Posix/concurrent_overflow.cc
AddressSanitizer-i386-sunos :: TestCases/init-order-atexit.cc
AddressSanitizer-i386-sunos :: TestCases/log-path_test.cc
AddressSanitizer-i386-sunos :: TestCases/malloc-no-intercept.c
AddressSanitizer-i386-sunos-dynamic :: TestCases/Posix/concurrent_overflow.cc
AddressSanitizer-i386-sunos-dynamic :: TestCases/Posix/start-deactivated.cc
AddressSanitizer-i386-sunos-dynamic :: TestCases/default_options.cc
AddressSanitizer-i386-sunos-dynamic :: TestCases/init-order-atexit.cc
AddressSanitizer-i386-sunos-dynamic :: TestCases/log-path_test.cc
AddressSanitizer-i386-sunos-dynamic :: TestCases/malloc-no-intercept.c
SanitizerCommon-Unit :: ./Sanitizer-i386-Test/MemoryMappingLayout.DumpListOfModules
SanitizerCommon-Unit :: ./Sanitizer-i386-Test/SanitizerCommon.PthreadDestructorIterations
Maybe this is good enough the get the ball rolling.
Reviewers: kcc, alekseyshl
Reviewed By: alekseyshl
Subscribers: srhines, jyknight, kubamracek, krytarowski, fedor.sergeev, llvm-commits, #sanitizers
Tags: #sanitizers
Differential Revision: https://reviews.llvm.org/D40898
llvm-svn: 320740
Zachary Turner [Thu, 14 Dec 2017 19:59:10 +0000 (19:59 +0000)]
Revert "Fix isPodLike for MSVC and use it in TypeHashing."
This reverts commit
ac5edc198eb612f82293850c3488042708b1c5fa.
Apparently this doesn't cover all the bases, so some compilers
and standard libraries still think this is not trivially copyable
even though it is. Reverting this back to an MSVC-only check for
now so that at least we have some coverage.
llvm-svn: 320739
Hans Wennborg [Thu, 14 Dec 2017 19:51:18 +0000 (19:51 +0000)]
Fix a -Wreorder warning
llvm-svn: 320738
Zachary Turner [Thu, 14 Dec 2017 19:41:28 +0000 (19:41 +0000)]
Fix isPodLike for MSVC and use it in TypeHashing.
This should be a better check than using is_trivially_copyable
behind an #ifdef _MSC_VER.
llvm-svn: 320737
Guozhi Wei [Thu, 14 Dec 2017 19:35:43 +0000 (19:35 +0000)]
[SLPVectorizer] Don't ignore scalar extraction instructions of aggregate value
In SLPVectorizer, the vector build instructions (insertvalue for aggregate type) is passed to BoUpSLP.buildTree, it is treated as UserIgnoreList, so later in cost estimation, the cost of these instructions are not counted.
For aggregate value, later usage are more likely to be done in scalar registers, either used as individual scalars or used as a whole for function call or return value. Ignore scalar extraction instructions may cause too aggressive vectorization for aggregate values, and slow down performance. So for vectorization of aggregate value, the scalar extraction instructions are required in cost estimation.
Differential Revision: https://reviews.llvm.org/D41139
llvm-svn: 320736
Alex Lorenz [Thu, 14 Dec 2017 19:22:41 +0000 (19:22 +0000)]
Commit missing tests for r320734
llvm-svn: 320735
Alex Lorenz [Thu, 14 Dec 2017 19:22:02 +0000 (19:22 +0000)]
[Preprocessor] Implement __is_target_{arch|vendor|os|environment} function-like
builtin macros
This patch implements the __is_target_arch, __is_target_vendor, __is_target_os,
and __is_target_environment Clang preprocessor extensions that were proposed by
@compnerd in Bob's cfe-dev post:
http://lists.llvm.org/pipermail/cfe-dev/2017-November/056166.html.
These macros can be used to examine the components of the target triple at
compile time. A has_builtin(is_target_???) preprocessor check can be used to
check for their availability.
__is_target_arch allows you to check if an arch is specified without worring
about a specific subarch, e.g.
__is_target_arch(arm) returns 1 for the target arch "armv7"
__is_target_arch(armv7) returns 1 for the target arch "armv7"
__is_target_arch(armv6) returns 0 for the target arch "armv7"
__is_target_vendor and __is_target_environment match the specific vendor
or environment. __is_target_os matches the specific OS, but
__is_target_os(darwin) will match any Darwin-based OS. "Unknown" can be used
to test if the triple's component is specified.
rdar://
35753116
Differential Revision: https://reviews.llvm.org/D41087
llvm-svn: 320734
Zachary Turner [Thu, 14 Dec 2017 19:11:28 +0000 (19:11 +0000)]
Only use is_trivially_copyable if we know it's safe to do so.
Apparently this isn't present on older versions of libstdc++, so
it causes some builds to fail.
llvm-svn: 320733
Krzysztof Parzyszek [Thu, 14 Dec 2017 19:05:21 +0000 (19:05 +0000)]
Add MVT::v128i1, NFC
Hexagon HVX has type v128i8, comparing two vectors of that type will
produce v128i1 types in SelectionDAG.
llvm-svn: 320732
Vedant Kumar [Thu, 14 Dec 2017 19:01:04 +0000 (19:01 +0000)]
[profile] Port the runtime to Solaris (retry)
This includes a few nice bits of refactoring (e.g splitting out the
exclusive locking code into a common utility).
Hopefully the Windows support is fixed now.
Patch by Rainer Orth!
Differential Revision: https://reviews.llvm.org/D40944
llvm-svn: 320731
Reid Kleckner [Thu, 14 Dec 2017 19:00:21 +0000 (19:00 +0000)]
[CodeGen][X86] Implement _InterlockedCompareExchange128 intrinsic
Summary:
InterlockedCompareExchange128 is a bit more complicated than the other
InterlockedCompareExchange functions, so it requires a bit more work. It
doesn't directly refer to 128bit ints, instead it takes pointers to
64bit ints for Destination and ComparandResult, and exchange is taken as
two 64bit ints (high & low). The previous value is written to
ComparandResult, and success is returned. This implementation does the
following in order to produce a cmpxchg instruction:
1. Cast everything to 128bit ints or int pointers, and glues together
the Exchange values
2. Reads from CompareandResult to get the comparand
3. Calls cmpxchg volatile (on X86 this will produce a lock cmpxchg16b
instruction)
1. Result 0 (previous value) is written back to ComparandResult
2. Result 1 (success bool) is zext'ed to a uchar and returned
Resolves bug https://llvm.org/PR35251
Patch by Colden Cullen!
Reviewers: rnk, agutowski
Reviewed By: rnk
Subscribers: majnemer, cfe-commits
Differential Revision: https://reviews.llvm.org/D41032
llvm-svn: 320730
Adam Nemet [Thu, 14 Dec 2017 18:55:33 +0000 (18:55 +0000)]
[opt-viewer] Render utf-8 characters properly in the generated HTML
llvm-svn: 320729
Vedant Kumar [Thu, 14 Dec 2017 18:50:13 +0000 (18:50 +0000)]
Revert "(HEAD -> master, origin/master, origin/HEAD) [profile] Port the runtime to Solaris"
This reverts commit r320726. It looks like flock isn't available on
Windows:
http://lab.llvm.org:8011/builders/sanitizer-windows/builds/21317/steps/build%20compiler-rt/logs/stdio
llvm-svn: 320728
Paul Robinson [Thu, 14 Dec 2017 18:46:43 +0000 (18:46 +0000)]
[MC] Allow .file directives to be out-of-order
llvm-svn: 320727
Vedant Kumar [Thu, 14 Dec 2017 18:43:14 +0000 (18:43 +0000)]
[profile] Port the runtime to Solaris
This includes a few nice bits of refactoring (e.g splitting out the
exclusive locking code into a common utility).
Patch by Rainer Orth!
Differential Revision: https://reviews.llvm.org/D40944
llvm-svn: 320726
Adam Nemet [Thu, 14 Dec 2017 18:42:42 +0000 (18:42 +0000)]
[opt-viewer] Support unicode characters in function names
This is a Swift feature. The output stream for the index page and the source
HTML page is utf-8 now.
The next patch will add the HTML magic to properly render these characters in
the browser.
llvm-svn: 320725
Shoaib Meenai [Thu, 14 Dec 2017 18:41:49 +0000 (18:41 +0000)]
[cmake] Only attempt to install MSVC system libraries on Windows
Newer versions of CMake (I'm on 3.10, but I believe 3.9 behaves the same
way) attempt to query the system for information about the VS 2017
install. Unfortunately, this query fails on non-Windows systems:
cmake_host_system_information does not recognize <key> VS_15_DIR
CMake isn't going to find these system libraries on non-Windows anyway
(and we were previously silencing the resultant warnings in our
cross-compilation toolchain), so it makes sense to just omit the
attempted installation entirely on non-Windows.
Differential Revision: https://reviews.llvm.org/D41220
llvm-svn: 320724
Craig Topper [Thu, 14 Dec 2017 18:35:25 +0000 (18:35 +0000)]
[X86] Don't zero the upper bits of the k-register before extracting a single bit from a vXi1.
This doesn't match the semantics of the extract_vector_elt operation. Nothing downstream knows the bits were zeroed so they still get masked or sign extended after the extrat anyway.
llvm-svn: 320723
Krzysztof Parzyszek [Thu, 14 Dec 2017 18:35:24 +0000 (18:35 +0000)]
[Hexagon] Remove vectors of i64 from valid HVX types
HVX does not support operations on 64-bit integers.
llvm-svn: 320722
John McCall [Thu, 14 Dec 2017 18:21:14 +0000 (18:21 +0000)]
In an ARC lambda-to-block conversion thunk, reclaim the return value of
the lambda so that we don't over-release it.
Patch by Dan Zimmerman!
llvm-svn: 320721
Zachary Turner [Thu, 14 Dec 2017 18:20:23 +0000 (18:20 +0000)]
Fix error due to missing includes.
While I'm pushing cleanup changes, this also fixes a few warnings
related to extraneous semicolons.
llvm-svn: 320720
Zachary Turner [Thu, 14 Dec 2017 18:07:04 +0000 (18:07 +0000)]
[COFF] Teach LLD to use the COFF .debug$H section.
This adds the /DEBUG:GHASH option to LLD which will look for
the existence of .debug$H sections in linker inputs and use them
to accelerate type merging. The clang-cl side has already been
added, so this completes the work necessary to begin experimenting
with this feature.
Differential Revision: https://reviews.llvm.org/D40980
llvm-svn: 320719
Geoff Berry [Thu, 14 Dec 2017 18:06:25 +0000 (18:06 +0000)]
[ARM] Fix isRenamable flag setting on expanded VSTMDIA opcode.
Fixes expensive-check ARM buildbot failure.
llvm-svn: 320718
Alexey Bataev [Thu, 14 Dec 2017 17:00:17 +0000 (17:00 +0000)]
[OPENMP] Add codegen for target data constructs with `nowait` clause.
Added codegen for the `nowait` clause in target data constructs.
llvm-svn: 320717
Gadi Haber [Thu, 14 Dec 2017 16:46:47 +0000 (16:46 +0000)]
[X86][AVX][AVX2]: Adding full coverage of MC encoding for the AVX, AVX2 isa set.<NFC>
NFC.
Adding MC regressions tests to cover the AVX and AVX2 ISA sets.
This patch is part of a larger task to cover MC encoding of all X86 ISA Sets.
See revision: https://reviews.llvm.org/D39952
Reviewers: zvi, RKSimon, aymanmus, m_zuckerman
Differential Revison: https://reviews.llvm.org/D40287
Change-Id: I304687a2b7abb473f79de99c31fc55c97b2662da
llvm-svn: 320716
Simon Dardis [Thu, 14 Dec 2017 16:42:04 +0000 (16:42 +0000)]
[mips] Update some tests before posting a patch, NFC.
llvm-svn: 320715
Ben Hamilton [Thu, 14 Dec 2017 16:17:38 +0000 (16:17 +0000)]
[ClangFormat] IndentWrappedFunctionNames should be true in the google ObjC style
Summary:
If we write the following code, it goes over 100 columns, so we need to wrap it:
```
- (VeryLongReturnTypeName)veryLongMethodParameter:(VeryLongParameterName)thisIsAVeryLongParameterName
longMethodParameter:(LongParameterName)thisIsAlsoAnotherLongParameterName;
```
Currently, clang-format with the google style aligns the method parameter names on the first column:
```
- (VeryLongReturnTypeName)
veryLongMethodParameter:(VeryLongParameterName)thisIsAVeryLongParameterName
longMethodParameter:(LongParameterName)thisIsAlsoAnotherLongParameterName;
```
We'd like clang-format in the google style to align these to column 4 for Objective-C:
```
- (VeryLongReturnTypeName)
veryLongMethodParameter:(VeryLongParameterName)thisIsAVeryLongParameterName
longMethodParameter:(LongParameterName)thisIsAlsoAnotherLongParameterName;
```
Test Plan: make -j12 FormatTests && ./tools/clang/unittests/Format/FormatTests
Reviewers: krasimir, djasper, klimek
Reviewed By: djasper
Subscribers: cfe-commits, thakis
Differential Revision: https://reviews.llvm.org/D41195
llvm-svn: 320714
Aaron Ballman [Thu, 14 Dec 2017 16:13:57 +0000 (16:13 +0000)]
Add support for NOLINT and NOLINTNEXTLINE comments mentioning specific check names.
Supports a comma-separated list of check names to be disabled on the given line. Also supports * as a wildcard to disable all lint diagnostic messages on that line.
Patch by Anton (xgsa).
llvm-svn: 320713
Yaxun Liu [Thu, 14 Dec 2017 16:12:04 +0000 (16:12 +0000)]
Revert CodeGen: Fix assertion in machine inst sheduler due to llvm.dbg.value
This commit might have caused regression on ppc64. Revert it to verify that.
llvm-svn: 320712
Sander de Smalen [Thu, 14 Dec 2017 16:09:48 +0000 (16:09 +0000)]
Re-commit: [TableGen] AsmMatcher: Fix bug with reported diagnostic for operand.
Summary:
The generated diagnostic by the AsmMatcher isn't always applicable to the AsmOperand.
This is because the code will only update the diagnostic if it is more
specific than the previous diagnostic. However, when having validated
operands and 'moved on' to a next operand (for some instruction/alias for
which all previous operands are valid), if the diagnostic is InvalidOperand,
than that should be set as the diagnostic, not the more specific message
about a previous operand for some other instruction/alias candidate.
(Re-committed with an extra whitespace in SVEInstrFormats.td to trigger rebuild
of AArch64GenAsmMatcher.inc, since the llvm-clang-x86_64-expensive-checks-win
builder does not seem to rebuild AArch64GenAsmMatcher.inc with the
newly built TableGen due to a missing dependency somewhere (see:
http://lists.llvm.org/pipermail/llvm-dev/2017-December/119555.html))
Reviewers: craig.topper, olista01, rengolin, stoklund
Reviewed By: olista01
Subscribers: javed.absar, llvm-commits
Differential Revision: https://reviews.llvm.org/D40011
llvm-svn: 320711
Eugene Leviant [Thu, 14 Dec 2017 15:59:05 +0000 (15:59 +0000)]
[LLVMgold] Use platform dependent extension in tests
Differential revision: https://reviews.llvm.org/D41238
llvm-svn: 320710
Richard Smith [Thu, 14 Dec 2017 15:40:16 +0000 (15:40 +0000)]
When attempting to complete an incomplete array bound type in an expression,
update the type from the definition even if we didn't instantiate a definition.
We may have instantiated the definition in an earlier stage of semantic
analysis, after creating the DeclRefExpr but before we reach a point where a
complete expression type is required.
llvm-svn: 320709
Ilya Biryukov [Thu, 14 Dec 2017 15:33:38 +0000 (15:33 +0000)]
[clangd] Changed tracing interfaces
Summary:
EventTracer interface now contains two methods:
- spanEvent for events that have duration,
- instant for events that are instant.
Reviewers: sammccall
Reviewed By: sammccall
Subscribers: klimek, luckygeck, cfe-commits
Differential Revision: https://reviews.llvm.org/D40489
llvm-svn: 320708
Richard Smith [Thu, 14 Dec 2017 15:16:18 +0000 (15:16 +0000)]
[c++20] P0515R3: Parsing support and basic AST construction for operator <=>.
Adding the new enumerator forced a bunch more changes into this patch than I
would have liked. The -Wtautological-compare warning was extended to properly
check the new comparison operator, clang-format needed updating because it uses
precedence levels as weights for determining where to break lines (and several
operators increased their precedence levels with this change), thread-safety
analysis needed changes to build its own IL properly for the new operator.
All "real" semantic checking for this operator has been deferred to a future
patch. For now, we use the relational comparison rules and arbitrarily give
the builtin form of the operator a return type of 'void'.
llvm-svn: 320707
Ilya Biryukov [Thu, 14 Dec 2017 15:04:59 +0000 (15:04 +0000)]
[clangd] Implemented tracing using Context
Reviewers: sammccall, ioeric, hokein
Reviewed By: sammccall
Subscribers: klimek, luckygeck, cfe-commits
Differential Revision: https://reviews.llvm.org/D40488
llvm-svn: 320706
Pavel Labath [Thu, 14 Dec 2017 14:56:45 +0000 (14:56 +0000)]
ObjectFile: remove ReadSectionData/MemoryMapSectionData mutual recursion
Summary:
These two functions were calling each other, while handling different
branches of the if(IsInMemory()). This had a reason at some point in the
past, but right now it's just confusing.
I resolve this by removing the MemoryMapSectionData function and
inlining the !IsInMemory branch into ReadSectionData. There isn't
anything mmap-related in this function anyway, as the decision whether
to mmap is handled at a higher level.
This is a preparatory step to make ObjectFileELF be able to decompress
compressed sections (I want to make sure that all calls reading section
data are routed through a single piece of code).
Reviewers: clayborg
Subscribers: emaste, JDevlieghere, lldb-commits
Differential Revision: https://reviews.llvm.org/D41169
llvm-svn: 320705
Pavel Labath [Thu, 14 Dec 2017 14:56:29 +0000 (14:56 +0000)]
Remove stderr message from GDBRemoteCommunicationServerLLGS
A similar error message is printed again in lldb-gdbserver.cpp, so the
user will see the message twice. Also, this is generic library code, we
shouldn't really be using stderr here.
llvm-svn: 320704
Simon Dardis [Thu, 14 Dec 2017 14:55:25 +0000 (14:55 +0000)]
[mips] Add partial support for R6 in the long branch pass
MIPSR6 introduced several new jump instructions and deprecated
the use of the 'j' instruction. For microMIPS32R6, 'j' was removed
entirely and it only has non delay slot jumps.
This patch adds support for MIPSR6 by using some R6 instructions--
'bc' instead of 'j', 'jic $reg, 0' instead of 'jalr $zero, $reg'--
and modifies the sequences not to use delay slots for R6.
Reviewers: atanasyan
Reviewed By: atanasyan
Subscribers: dschuff, arichardson, llvm-commits
Differential Revision: https://reviews.llvm.org/D40786
llvm-svn: 320703
Ilya Biryukov [Thu, 14 Dec 2017 14:51:17 +0000 (14:51 +0000)]
Renamed test file to use proper naming convention
Also changed the order of CHECK statements.
CHEKC-NOT must come before CHECK in skipped-function-bodies.cpp
llvm-svn: 320702
Eric Liu [Thu, 14 Dec 2017 14:50:58 +0000 (14:50 +0000)]
[clangd] Add a FileSymbols container that manages symbols from multiple files.
Reviewers: sammccall
Reviewed By: sammccall
Subscribers: klimek, mgorny, ilya-biryukov, cfe-commits
Differential Revision: https://reviews.llvm.org/D41232
llvm-svn: 320701
Bjorn Pettersson [Thu, 14 Dec 2017 14:47:52 +0000 (14:47 +0000)]
[ScalarEvolution] Fix base condition in isNormalAddRecPHI.
Summary:
The function is meant to recurse until it comes upon the
phi it's looking for. However, with the current condition,
it will recurse until it finds anything _but_ the phi.
The function will even fail for simple cases like:
%i = phi i32 [ %inc, %loop ], ...
...
%inc = add i32 %i, 1
because the base condition will not happen when the phi
is recursed to, and the recursion will end with a 'false'
result since the previous instruction is a phi.
Reviewers: sanjoy, atrick
Reviewed By: sanjoy
Subscribers: Ka-Ka, bjope, llvm-commits
Committing on behalf of: Bevin Hansson (bevinh)
Differential Revision: https://reviews.llvm.org/D40946
llvm-svn: 320700
Haicheng Wu [Thu, 14 Dec 2017 14:36:18 +0000 (14:36 +0000)]
[InlineCost] Tracking Values through PHI Nodes
This patch fix this FIXME in visitPHI()
FIXME: We should potentially be tracking values through phi nodes,
especially when they collapse to a single value due to deleted CFG edges
during inlining.
Differential Revision: https://reviews.llvm.org/D38594
llvm-svn: 320699
Benjamin Kramer [Thu, 14 Dec 2017 14:03:07 +0000 (14:03 +0000)]
Revert "[DAGCombine] Move AND nodes to multiple load leaves"
This reverts commit r320679. Causes miscompiles.
llvm-svn: 320698
Richard Smith [Thu, 14 Dec 2017 13:15:08 +0000 (13:15 +0000)]
Warn if we find a Unicode homoglyph for a symbol in an identifier.
Specifically, warn if:
* we find a character that the language standard says we must treat as an
identifier, and
* that character is not reasonably an identifier character (it's a punctuation
character or similar), and
* it renders identically to a valid non-identifier character in common
fixed-width fonts.
Some tools "helpfully" substitute the surprising characters for the expected
characters, and replacing semicolons with Greek question marks is a common
"prank".
llvm-svn: 320697
Ilya Biryukov [Thu, 14 Dec 2017 13:00:33 +0000 (13:00 +0000)]
[Frontend] Treat function with skipped body as definition
Summary:
This fixes an invalid warning about missing definition of a function when
parsing with SkipFunctionBodies=true
Reviewers: bkramer, sepavloff
Reviewed By: sepavloff
Subscribers: klimek, cfe-commits
Differential Revision: https://reviews.llvm.org/D41189
llvm-svn: 320696
Eric Liu [Thu, 14 Dec 2017 12:31:04 +0000 (12:31 +0000)]
[clangd] Fix a potential use-after-move bug.
llvm-svn: 320695
Haojian Wu [Thu, 14 Dec 2017 12:17:14 +0000 (12:17 +0000)]
[clangd] Construct SymbolSlab from YAML format.
Summary: This will be used together with D40548 for the global index source (experimental).
Reviewers: sammccall
Reviewed By: sammccall
Subscribers: klimek, mgorny, ilya-biryukov, cfe-commits, ioeric
Differential Revision: https://reviews.llvm.org/D41178
llvm-svn: 320694
Andrew V. Tischenko [Thu, 14 Dec 2017 12:07:11 +0000 (12:07 +0000)]
Any Target Asm comments should start from MachineInstr::TAsmComments value.
llvm-svn: 320693
Omer Paparo Bivas [Thu, 14 Dec 2017 12:00:04 +0000 (12:00 +0000)]
Inserting several lit tests to reflect current behaviour
Change-Id: I1b8188dc3c6c7c0f455715364ece7d35ef485f2f
llvm-svn: 320692
Michael Zuckerman [Thu, 14 Dec 2017 11:55:50 +0000 (11:55 +0000)]
[AVX512] Adding support for load truncate store of I1
store operation on a truncated memory (load) of vXi1 is poorly supported by LLVM and most of the time end with an assertion.
This patch fixes this issue.
Differential Revision: https://reviews.llvm.org/D39547
Change-Id: Ida5523dd09c1ad384acc0a27e9e59273d28cbdc9
llvm-svn: 320691
Simon Pilgrim [Thu, 14 Dec 2017 11:40:54 +0000 (11:40 +0000)]
[X86] Add FMA4 schedule tests
llvm-svn: 320690
Simon Pilgrim [Thu, 14 Dec 2017 11:30:01 +0000 (11:30 +0000)]
[X86] Add FMA3 schedule tests
Rewrote to use inline asm for full coverage
llvm-svn: 320689
Eric Liu [Thu, 14 Dec 2017 11:25:49 +0000 (11:25 +0000)]
[clangd] Symbol index interfaces and an in-memory index implementation.
Summary:
o Index interfaces to support using different index sources (e.g. AST index, global index) for code completion, cross-reference finding etc. This patch focuses on code completion.
The following changes in the original patch has been split out.
o Implement an AST-based index.
o Add an option to replace sema code completion for qualified-id with index-based completion.
o Implement an initial naive code completion index which matches symbols that have the query string as substring.
Reviewers: malaperle, sammccall
Reviewed By: sammccall
Subscribers: hokein, klimek, malaperle, mgorny, ilya-biryukov, cfe-commits
Differential Revision: https://reviews.llvm.org/D40548
llvm-svn: 320688
Fedor Sergeev [Thu, 14 Dec 2017 10:36:31 +0000 (10:36 +0000)]
[PM][InstCombine] fixing omission of AliasAnalysis in new-pass-manager's version of InstCombine
Summary:
Passing AliasAnalysis results instead of nullptr appears to work just fine.
A couple new-pass-manager tests updated to align with new order of analyses.
Reviewers: chandlerc, spatel, craig.topper
Reviewed By: chandlerc
Subscribers: mehdi_amini, eraman, llvm-commits
Differential Revision: https://reviews.llvm.org/D41203
llvm-svn: 320687
Fedor Sergeev [Thu, 14 Dec 2017 10:36:20 +0000 (10:36 +0000)]
Remove redundant includes from lib/Target/AArch64.
llvm-svn: 320686
Francis Visoiu Mistrih [Thu, 14 Dec 2017 10:03:23 +0000 (10:03 +0000)]
[CodeGen] Print MCSymbol operands as <mcsymbol sym> in both MIR and debug output
Work towards the unification of MIR and debug output by printing
`<mcsymbol sym>` instead of `<MCSym=sym>`.
Only debug syntax is affected.
llvm-svn: 320685
Francis Visoiu Mistrih [Thu, 14 Dec 2017 10:03:18 +0000 (10:03 +0000)]
[CodeGen] Move printing MO_Metadata operands to MachineOperand::print
Work towards the unification of MIR and debug output by refactoring the
interfaces.
llvm-svn: 320684
Francis Visoiu Mistrih [Thu, 14 Dec 2017 10:03:14 +0000 (10:03 +0000)]
[CodeGen] Print live-out register lists as liveout(...) in both MIR and debug output
Work towards the unification of MIR and debug output by printing
`liveout(...)` instead of `<regliveout>`.
Only debug syntax is affected.
llvm-svn: 320683
Francis Visoiu Mistrih [Thu, 14 Dec 2017 10:03:09 +0000 (10:03 +0000)]
[CodeGen] Print global addresses as @foo in both MIR and debug output
Work towards the unification of MIR and debug output by printing
`@foo` instead of `<ga:@foo>`.
Also print target flags in the MIR format since most of them are used on
global address operands.
Only debug syntax is affected.
llvm-svn: 320682
Francis Visoiu Mistrih [Thu, 14 Dec 2017 10:02:58 +0000 (10:02 +0000)]
[CodeGen] Print external symbols as $symbol in both MIR and debug output
Work towards the unification of MIR and debug output by printing
`$symbol` instead of `<es:symbol>`.
Only debug syntax is affected.
llvm-svn: 320681
Igor Laevsky [Thu, 14 Dec 2017 09:33:58 +0000 (09:33 +0000)]
[Verifier] Check that GEP indexes has correct types
Differential Revision: https://reviews.llvm.org/D40391
llvm-svn: 320680
Sam Parker [Thu, 14 Dec 2017 09:31:01 +0000 (09:31 +0000)]
[DAGCombine] Move AND nodes to multiple load leaves
Recommitting rL319773, which was reverted due to a recursive issue
causing timeouts. This happened because I failed to check whether
the discovered loads could be narrowed further. In the case of a tree
with one or more narrow loads, that could not be further narrowed, as
well as a node that would need masking, an AND could be introduced
which could then be visited and recombined again with the same load.
This could again create the masking load, with would be combined
again... We now check that the load can be narrowed so that this
process stops.
Original commit message:
Search from AND nodes to find whether they can be propagated back to
loads, so that the AND and load can be combined into a narrow load.
We search through OR, XOR and other AND nodes and all bar one of the
leaves are required to be loads or constants. The exception node then
needs to be masked off meaning that the 'and' isn't removed, but the
loads(s) are narrowed still.
Differential Revision: https://reviews.llvm.org/D41177
llvm-svn: 320679