David Carlier [Wed, 31 Oct 2018 09:04:15 +0000 (09:04 +0000)]
[clangd] fix non linux build
There is no SCHED_IDLE semantic equivalent in BSD systems.
Reviewers: kadircet, sammccall
Revieweed By: sammccall
Differential Revision: https://reviews.llvm.org/D53922
llvm-svn: 345700
Hans Wennborg [Wed, 31 Oct 2018 08:38:48 +0000 (08:38 +0000)]
[clang-cl] Inherit dllexport to static locals also in template instantiations (PR39496)
In the course of D51340, @takuto.ikuta discovered that Clang fails to put
dllexport/import attributes on static locals during template instantiation.
For regular functions, this happens in Sema::FinalizeDeclaration(), however for
template instantiations we need to do something in or around
TemplateDeclInstantiator::VisitVarDecl(). This patch does that, and extracts
the code to a utility function.
Differential Revision: https://reviews.llvm.org/D53870
llvm-svn: 345699
Martin Storsjo [Wed, 31 Oct 2018 08:14:09 +0000 (08:14 +0000)]
[AArch64] Mark condition flags and x16/x17 as clobbered when calling __chkstk
This is similar to SVN r311061 for ARM.
Differential Revision: https://reviews.llvm.org/D53878
llvm-svn: 345698
Kristina Brooks [Wed, 31 Oct 2018 05:45:01 +0000 (05:45 +0000)]
[llvm-objdump] support '--syms' as an alias of -t
This adds support for '--syms' as an alias of '-t' for llvm-objdump,
fixing PR39406 (https://bugs.llvm.org/show_bug.cgi?id=39406).
Patch by Higuoxing (Xing).
Differential Revision: https://reviews.llvm.org/D53803
llvm-svn: 345697
Lang Hames [Wed, 31 Oct 2018 05:16:14 +0000 (05:16 +0000)]
[ORC] Fix hex printing of uint64_t values.
A plain "%x" format string will drop the high 32-bits. Use the PRIx64 macro
instead.
llvm-svn: 345696
Bill Wendling [Wed, 31 Oct 2018 04:58:34 +0000 (04:58 +0000)]
Change "struct" to "class" to avoid warnings
llvm-svn: 345695
Kuba Mracek [Wed, 31 Oct 2018 04:43:09 +0000 (04:43 +0000)]
Fixup the Python-less build of ScriptedRecognizedStackFrame
llvm-svn: 345694
Kuba Mracek [Wed, 31 Oct 2018 04:00:22 +0000 (04:00 +0000)]
[lldb] Introduce StackFrameRecognizer [take 3]
This patch introduces a concept of "frame recognizer" and "recognized frame". This should be an extensible mechanism that retrieves information about special frames based on ABI, arguments or other special properties of that frame, even without source code. A few examples where that could be useful could be 1) objc_exception_throw, where we'd like to get the current exception, 2) terminate_with_reason and extracting the current terminate string, 3) recognizing Objective-C frames and automatically extracting the receiver+selector, or perhaps all arguments (based on selector).
Differential Revision: https://reviews.llvm.org/D44603
llvm-svn: 345693
Bill Wendling [Wed, 31 Oct 2018 03:48:47 +0000 (03:48 +0000)]
Create ConstantExpr class
A ConstantExpr class represents a full expression that's in a context where a
constant expression is required. This class reflects the path the evaluator
took to reach the expression rather than the syntactic context in which the
expression occurs.
In the future, the class will be expanded to cache the result of the evaluated
expression so that it's not needlessly re-evaluated
Reviewed By: rsmith
Differential Revision: https://reviews.llvm.org/D53475
llvm-svn: 345692
Richard Trieu [Wed, 31 Oct 2018 02:10:51 +0000 (02:10 +0000)]
Revert r345676 due to test failure.
This was causing CodeGen/mingw-long-double.c to start failing.
llvm-svn: 345691
Matthias Braun [Wed, 31 Oct 2018 01:58:00 +0000 (01:58 +0000)]
2nd attempt to fix ambiguities because of ADL
llvm-svn: 345690
Matthias Braun [Wed, 31 Oct 2018 01:30:41 +0000 (01:30 +0000)]
Try to fix ambiguities with C++17 headers in unittest
llvm-svn: 345689
Kuba Mracek [Wed, 31 Oct 2018 01:22:48 +0000 (01:22 +0000)]
Revert r345686 due to build failures
llvm-svn: 345688
Wolfgang Pieb [Wed, 31 Oct 2018 01:12:58 +0000 (01:12 +0000)]
[DWARF] Revert r345546: Refactor range list extraction and dumping
This patch caused some internal tests to break which are being investigated.
llvm-svn: 345687
Kuba Mracek [Wed, 31 Oct 2018 00:36:20 +0000 (00:36 +0000)]
[lldb] Introduce StackFrameRecognizer [take 2]
This patch introduces a concept of "frame recognizer" and "recognized frame". This should be an extensible mechanism that retrieves information about special frames based on ABI, arguments or other special properties of that frame, even without source code. A few examples where that could be useful could be 1) objc_exception_throw, where we'd like to get the current exception, 2) terminate_with_reason and extracting the current terminate string, 3) recognizing Objective-C frames and automatically extracting the receiver+selector, or perhaps all arguments (based on selector).
Differential Revision: https://reviews.llvm.org/D44603
llvm-svn: 345686
Reid Kleckner [Wed, 31 Oct 2018 00:35:46 +0000 (00:35 +0000)]
[asan] Remove stale -fno-exceptions flag in sanitizer_common as well
llvm-svn: 345685
Fangrui Song [Wed, 31 Oct 2018 00:31:07 +0000 (00:31 +0000)]
[llvm-objcopy] Delete a redundant override whose base is empty
llvm-svn: 345684
Fangrui Song [Wed, 31 Oct 2018 00:31:06 +0000 (00:31 +0000)]
Use llvm::any_of instead std::any_of. NFC
llvm-svn: 345683
Fangrui Song [Wed, 31 Oct 2018 00:31:06 +0000 (00:31 +0000)]
Use the container form llvm::sort(C)
llvm-svn: 345682
Fangrui Song [Wed, 31 Oct 2018 00:31:02 +0000 (00:31 +0000)]
Don't duplicate function/class name at the beginning of the comment. NFC
llvm-svn: 345681
Kuba Mracek [Wed, 31 Oct 2018 00:29:17 +0000 (00:29 +0000)]
Revert r345678 (build failure on Linux machines).
llvm-svn: 345680
Matthias Braun [Wed, 31 Oct 2018 00:23:23 +0000 (00:23 +0000)]
ADT/STLExtras: Introduce llvm::empty; NFC
This is modeled after C++17 std::empty().
Differential Revision: https://reviews.llvm.org/D53909
llvm-svn: 345679
Kuba Mracek [Wed, 31 Oct 2018 00:21:03 +0000 (00:21 +0000)]
[lldb] Introduce StackFrameRecognizer
This patch introduces a concept of "frame recognizer" and "recognized frame". This should be an extensible mechanism that retrieves information about special frames based on ABI, arguments or other special properties of that frame, even without source code. A few examples where that could be useful could be 1) objc_exception_throw, where we'd like to get the current exception, 2) terminate_with_reason and extracting the current terminate string, 3) recognizing Objective-C frames and automatically extracting the receiver+selector, or perhaps all arguments (based on selector).
Differential Revision: https://reviews.llvm.org/D44603
llvm-svn: 345678
Reid Kleckner [Wed, 31 Oct 2018 00:20:41 +0000 (00:20 +0000)]
[asan] Remove flags for clang-cl before it supported EH
Also remove -Wno-undefined-inline, which needed to work around PR19898,
which was fixed.
llvm-svn: 345677
Reid Kleckner [Tue, 30 Oct 2018 23:58:41 +0000 (23:58 +0000)]
[Win64] Handle passing i128 by value
For arguments, pass it indirectly, since the ABI doc says pretty clearly
that arguments larger than 8 bytes are passed indirectly. This makes
va_list handling easier, anyway.
When returning, GCC returns in XMM0, and we match them.
Fixes PR39492.
llvm-svn: 345676
Saleem Abdulrasool [Tue, 30 Oct 2018 23:45:27 +0000 (23:45 +0000)]
DWARFVerifier: make the verifier more comprehensive for objects
Make the code do what was mentioned in the comment: only skip the CU types.
This enables the lexical blocks to be verified as well.
llvm-svn: 345675
Matthias Braun [Tue, 30 Oct 2018 23:28:27 +0000 (23:28 +0000)]
MachineOperand/MIParser: Do not print debug-use flag, infer it
The debug-use flag must be set exactly for uses on DBG_VALUEs. This is
so obvious that it can be trivially inferred while parsing. This will
reduce noise when printing while omitting an information that has little
value to the user.
The parser will keep recognizing the flag for compatibility with old
`.mir` files.
Differential Revision: https://reviews.llvm.org/D53903
llvm-svn: 345671
Louis Dionne [Tue, 30 Oct 2018 23:24:02 +0000 (23:24 +0000)]
Correct ABI list change wrongly advertised as being in the 7.0 release
llvm-svn: 345670
Richard Trieu [Tue, 30 Oct 2018 23:01:15 +0000 (23:01 +0000)]
Silence unused variable warnings. NFC
llvm-svn: 345669
Davide Italiano [Tue, 30 Oct 2018 22:49:22 +0000 (22:49 +0000)]
[testsuite] Skip an already failing test on MacOS.
Due to some libcxx changes to inlining, this now also crashes,
so it gets reported as "failure" by the bot. This commit doesn't
really change the status quo, just placates the bots.
llvm-svn: 345668
Eric Fiselier [Tue, 30 Oct 2018 22:23:01 +0000 (22:23 +0000)]
Revert "Build with -fvisibility=hidden"
I messed it up somewhere and now the tests aren't linking.
Reverting while I investigate.
llvm-svn: 345667
Kamil Rytarowski [Tue, 30 Oct 2018 22:08:47 +0000 (22:08 +0000)]
Disable BufferOverflowAfterManyFrees for NetBSD
This test hangs in the i386 mode.
llvm-svn: 345666
David Bolvansky [Tue, 30 Oct 2018 22:08:13 +0000 (22:08 +0000)]
[ARM][NFC] Make tests immune to better div optimizations
Summary: Related to D52504
Reviewers: spatel
Reviewed By: spatel
Subscribers: javed.absar, kristof.beyls, chrib, llvm-commits
Differential Revision: https://reviews.llvm.org/D53901
llvm-svn: 345665
Eric Fiselier [Tue, 30 Oct 2018 22:07:52 +0000 (22:07 +0000)]
Build with -fvisibility=hidden
Summary:
This change changes the build to use -fvisibility=hidden
The exports this patch removes are symbols that should have never been exported
by the dylib in the first place, and should all be symbols which the linker
won't de-duplicate across SO boundaries, making them safe to remove.
After this change, we should be able to apply `_LIBCPP_HIDDEN` to the versioning namespace without changing the export lists.
Reviewers: ldionne, mclow.lists
Reviewed By: ldionne
Subscribers: smeenai, mgorny, libcxx-commits
Differential Revision: https://reviews.llvm.org/D53868
llvm-svn: 345664
Kamil Rytarowski [Tue, 30 Oct 2018 22:05:49 +0000 (22:05 +0000)]
Mark breaking asan tests on NetBSD
Failing ones:
- coverage-reset
- coverage
- dlclose-test
- interception-in-shared-lib-test
- stack-use-after-return
- tsd_dtor_leak
llvm-svn: 345663
Konstantin Zhuravlyov [Tue, 30 Oct 2018 22:02:40 +0000 (22:02 +0000)]
Revert r345542: AMDGPU: Enable code object v3 by default
It breaks mesa.
llvm-svn: 345662
Roman Lebedev [Tue, 30 Oct 2018 21:59:09 +0000 (21:59 +0000)]
[NFC][compiler-rt] Cleanup Implicit Conversion Sanitizer tests to use sized types
Summary: As requested by @filcab in https://reviews.llvm.org/D50251#1280267
Reviewers: filcab, vsk, #sanitizers, vitalybuka
Reviewed By: filcab, #sanitizers, vitalybuka
Subscribers: vitalybuka, kubamracek, dberris, llvm-commits, filcab
Tags: #sanitizers
Differential Revision: https://reviews.llvm.org/D53869
llvm-svn: 345661
Roman Lebedev [Tue, 30 Oct 2018 21:58:56 +0000 (21:58 +0000)]
[clang][ubsan] Implicit Conversion Sanitizer - integer sign change - clang part
This is the second half of Implicit Integer Conversion Sanitizer.
It completes the first half, and finally makes the sanitizer
fully functional! Only the bitfield handling is missing.
Summary:
C and C++ are interesting languages. They are statically typed, but weakly.
The implicit conversions are allowed. This is nice, allows to write code
while balancing between getting drowned in everything being convertible,
and nothing being convertible. As usual, this comes with a price:
```
void consume(unsigned int val);
void test(int val) {
consume(val);
// The 'val' is `signed int`, but `consume()` takes `unsigned int`.
// If val is negative, then consume() will be operating on a large
// unsigned value, and you may or may not have a bug.
// But yes, sometimes this is intentional.
// Making the conversion explicit silences the sanitizer.
consume((unsigned int)val);
}
```
Yes, there is a `-Wsign-conversion`` diagnostic group, but first, it is kinda
noisy, since it warns on everything (unlike sanitizers, warning on an
actual issues), and second, likely there are cases where it does **not** warn.
The actual detection is pretty easy. We just need to check each of the values
whether it is negative, and equality-compare the results of those comparisons.
The unsigned value is obviously non-negative. Zero is non-negative too.
https://godbolt.org/g/w93oj2
We do not have to emit the check *always*, there are obvious situations
where we can avoid emitting it, since it would **always** get optimized-out.
But i do think the tautological IR (`icmp ult %x, 0`, which is always false)
should be emitted, and the middle-end should cleanup it.
This sanitizer is in the `-fsanitize=implicit-conversion` group,
and is a logical continuation of D48958 `-fsanitize=implicit-integer-truncation`.
As for the ordering, i'we opted to emit the check **after**
`-fsanitize=implicit-integer-truncation`. At least on these simple 16 test cases,
this results in 1 of the 12 emitted checks being optimized away,
as compared to 0 checks being optimized away if the order is reversed.
This is a clang part.
The compiler-rt part is D50251.
Finishes fixing [[ https://bugs.llvm.org/show_bug.cgi?id=21530 | PR21530 ]], [[ https://bugs.llvm.org/show_bug.cgi?id=37552 | PR37552 ]], [[ https://bugs.llvm.org/show_bug.cgi?id=35409 | PR35409 ]].
Finishes partially fixing [[ https://bugs.llvm.org/show_bug.cgi?id=9821 | PR9821 ]].
Finishes fixing https://github.com/google/sanitizers/issues/940.
Only the bitfield handling is missing.
Reviewers: vsk, rsmith, rjmccall, #sanitizers, erichkeane
Reviewed By: rsmith
Subscribers: chandlerc, filcab, cfe-commits, regehr
Tags: #sanitizers, #clang
Differential Revision: https://reviews.llvm.org/D50250
llvm-svn: 345660
Roman Lebedev [Tue, 30 Oct 2018 21:58:54 +0000 (21:58 +0000)]
[compiler-rt][ubsan] Implicit Conversion Sanitizer - integer sign change - compiler-rt part
Summary:
This is a compiler-rt part.
The clang part is D50250.
See [[ https://bugs.llvm.org/show_bug.cgi?id=21530 | PR21530 ]], https://github.com/google/sanitizers/issues/940.
Reviewers: vsk, filcab, #sanitizers
Reviewed By: filcab, #sanitizers
Subscribers: mclow.lists, srhines, kubamracek, dberris, rjmccall, rsmith, llvm-commits, regehr
Tags: #sanitizers
Differential Revision: https://reviews.llvm.org/D50251
llvm-svn: 345659
Louis Dionne [Tue, 30 Oct 2018 21:50:11 +0000 (21:50 +0000)]
[libcxx] Correct link to code review for P1006
llvm-svn: 345658
Eric Fiselier [Tue, 30 Oct 2018 21:44:53 +0000 (21:44 +0000)]
Make libc++'s versioning namespace customizable
Summary:
This patch makes the versioning namespace libc++ uses customizable by the user using `-DLIBCXX_ABI_NAMESPACE=__foo`.
This allows users to build custom versions of libc++ which can be linked into binaries with other libc++ versions without causing symbol conflicts or ODR issues.
Reviewers: mclow.lists, ldionne
Reviewed By: ldionne
Subscribers: kristina, smeenai, mgorny, phosek, libcxx-commits
Differential Revision: https://reviews.llvm.org/D53879
llvm-svn: 345657
Marco Castelluccio [Tue, 30 Oct 2018 21:43:47 +0000 (21:43 +0000)]
[GCOV] Make test path generic so it passes on all machines
llvm-svn: 345656
Kamil Rytarowski [Tue, 30 Oct 2018 21:41:31 +0000 (21:41 +0000)]
Switch getline_nohang from XFAIL to UNSUPPORTED for NetBSD
This test sometimes works, usually breaks.
llvm-svn: 345655
Kamil Rytarowski [Tue, 30 Oct 2018 21:39:45 +0000 (21:39 +0000)]
Mark vptr-non-unique-typeinfo as a broken test for NetBSD/i386
llvm-svn: 345654
Marshall Clow [Tue, 30 Oct 2018 21:27:42 +0000 (21:27 +0000)]
Add link to implementation for P1006R0
llvm-svn: 345653
Eric Fiselier [Tue, 30 Oct 2018 21:23:31 +0000 (21:23 +0000)]
Update LLVM version used on Appveyor bot, remove MSVC 2015 bot
llvm-svn: 345652
Kamil Rytarowski [Tue, 30 Oct 2018 21:20:17 +0000 (21:20 +0000)]
Mark breaking sanitizer_common tests on NetBSD
Set XFAIL with appropriate configuration for:
- NetBSD/getgroupmembership
- Posix/dedup_token_length_test
- Posix/readlinkat
- get_module_and_offset_for_pc
llvm-svn: 345651
Cameron McInally [Tue, 30 Oct 2018 21:01:29 +0000 (21:01 +0000)]
[FPEnv] [FPEnv] Add constrained intrinsics for MAXNUM and MINNUM
Differential Revision: https://reviews.llvm.org/D53216
llvm-svn: 345650
Aaron Ballman [Tue, 30 Oct 2018 20:55:18 +0000 (20:55 +0000)]
Changing the command line parameters sent to diff for this test.
On some systems, -U 1 was being interpreted as -U -1. Trying -U1 to see if that's the universally accepted approach instead.
llvm-svn: 345649
Fangrui Song [Tue, 30 Oct 2018 20:54:54 +0000 (20:54 +0000)]
[ELF] Fallback to sh_link=0 if neither .dynsym nor .symtab exists
Summary: .rela.plt may only contain R_*_{,I}RELATIVE relocations and not need a symbol table link. bfd/gold fallbacks to sh_link=0 in this case. Without this patch, ld.lld --strip-all caused lld to dereference a null pointer.
Reviewers: ruiu, grimar, espindola
Reviewed By: ruiu
Subscribers: emaste, arichardson, llvm-commits
Differential Revision: https://reviews.llvm.org/D53881
llvm-svn: 345648
Sanjay Patel [Tue, 30 Oct 2018 20:52:25 +0000 (20:52 +0000)]
[InstCombine] use 'match' to reduce code; NFC
llvm-svn: 345647
Erik Pilkington [Tue, 30 Oct 2018 20:51:28 +0000 (20:51 +0000)]
NFC: Merge KEYOBJC and KEYARC
We used to only define ARC keywords in -fobjc-arc mode, but now that we define
them in ObjC mode, there isn't any reason to keep them seperate.
llvm-svn: 345646
Reid Kleckner [Tue, 30 Oct 2018 20:51:27 +0000 (20:51 +0000)]
[builtins] Re-enable x86-only long double tests
Summary:
In r81552, the HAS_80_BIT_LONG_DOUBLE macro was added to the unit test
only version of int_lib.h. One month later in r85260 the duplicate
int_lib.h was removed, but the tests still passed because we don't build
with -Werror.
This is the minimal change to bring it back, and I decided to put the
configuration macro next to our 128-bit integer support macro.
Reviewers: joerg, compnerd, mstorsjo
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D53838
llvm-svn: 345645
Quentin Colombet [Tue, 30 Oct 2018 20:51:04 +0000 (20:51 +0000)]
[InstCombine] Teach the move free before null test opti how to deal with noop casts
InstCombine features an optimization that essentially replaces:
if (a)
free(a)
into:
free(a)
Right now, this optimization is gated by the minsize attribute and therefore
we only perform it if we can prove that we are going to be able to eliminate
the branch and the destination block.
However when casts are involved the optimization would fail to apply, because
the optimization was not smart enough to realize that it is possible to also
move the casts away from the destination block and that is harmless to the
performance since they are just noops.
E.g.,
foo(int *a)
if (a)
free((char*)a)
Wouldn't be optimized by instcombine, because
- We would refuse to hoist the `bitcast i32* %a to i8` in the source block
- We would fail to see that `bitcast i32* %a to i8` and %a are the same value.
This patch fixes both these problems:
- It teaches the pattern matching of the comparison how to look
through casts.
- It checks that whether the additional instruction in the destination block
can be hoisted and are harmless performance-wise.
- It hoists all the code of the destination block in the source block.
Differential Revision: D53356
llvm-svn: 345644
Davide Italiano [Tue, 30 Oct 2018 20:46:29 +0000 (20:46 +0000)]
Revert "[ASTImporter] Reorder fields after structure import is finished"
This reverts commit r345545 because it breaks some lldb tests.
llvm-svn: 345643
Sanjay Patel [Tue, 30 Oct 2018 20:46:23 +0000 (20:46 +0000)]
[x86] try to make test immune to better div optimization; NFCI
llvm-svn: 345642
Mandeep Singh Grang [Tue, 30 Oct 2018 20:46:10 +0000 (20:46 +0000)]
[COFF, ARM64] Make sure to forward arguments from vararg to musttail vararg
Summary:
Thunk functions in Windows are varag functions that call a musttail function
to pass the arguments after the fixup is done. We need to make sure that we
forward the arguments from the caller vararg to the callee vararg function.
This is the same mechanism that is used for Windows on X86.
Reviewers: ssijaric, eli.friedman, TomTan, mgrang, mstorsjo, rnk, compnerd, efriedma
Reviewed By: efriedma
Subscribers: efriedma, kristof.beyls, chrib, javed.absar, llvm-commits
Differential Revision: https://reviews.llvm.org/D53843
llvm-svn: 345641
Sanjay Patel [Tue, 30 Oct 2018 20:44:54 +0000 (20:44 +0000)]
[x86] try to make test immune to better div optimization; NFCI
llvm-svn: 345640
Sanjay Patel [Tue, 30 Oct 2018 20:42:03 +0000 (20:42 +0000)]
[x86] try to make test immune to better div optimization; NFCI
llvm-svn: 345639
Craig Topper [Tue, 30 Oct 2018 20:33:58 +0000 (20:33 +0000)]
[ScalarizeMaskedMemIntrin] Limit the scope of some variables that are only used inside loops.
llvm-svn: 345638
Erik Pilkington [Tue, 30 Oct 2018 20:31:30 +0000 (20:31 +0000)]
NFC: Remove the ObjC1/ObjC2 distinction from clang (and related projects)
We haven't supported compiling ObjC1 for a long time (and never will again), so
there isn't any reason to keep these separate. This patch replaces
LangOpts::ObjC1 and LangOpts::ObjC2 with LangOpts::ObjC.
Differential revision: https://reviews.llvm.org/D53547
llvm-svn: 345637
Bjorn Pettersson [Tue, 30 Oct 2018 20:16:39 +0000 (20:16 +0000)]
[DAGCombiner] Fix for big endian in ForwardStoreValueToDirectLoad
Summary:
Normalize the offset for endianess before checking
if the store cover the load in ForwardStoreValueToDirectLoad.
Without this we missed out on some optimizations for big
endian targets. If for example having a 4 bytes store followed
by a 1 byte load, loading the least significant byte from the
store, the STCoversLD check would fail (see @test4 in
test/CodeGen/AArch64/load-store-forwarding.ll).
This patch also fixes a problem seen in an out-of-tree target.
The target has i40 as a legal type, it is big endian,
and the StoreSize for i40 is 48 bits. So when normalizing
the offset for endianess we need to take the StoreSize into
account (assuming that padding added when storing into
a larger StoreSize always is added at the most significant
end).
Reviewers: niravd
Reviewed By: niravd
Subscribers: javed.absar, kristof.beyls, llvm-commits, uabelho
Differential Revision: https://reviews.llvm.org/D53776
llvm-svn: 345636
Aaron Ballman [Tue, 30 Oct 2018 19:49:17 +0000 (19:49 +0000)]
Speculatively attempt to fix a failing testbot.
A testbot ( http://green.lab.llvm.org/green/job/clang-stage1-cmake-RA-incremental/54690/) was failing with a complaint about an obsolete option that wasn't present in the command line in the first place. This replaces my guess at the "obsolete option" with a different spelling that will hopefully be more acceptable to this bot without breaking other bots.
llvm-svn: 345635
Eli Friedman [Tue, 30 Oct 2018 19:24:51 +0000 (19:24 +0000)]
[AArch64] [Windows] SEH opcodes should be scheduling boundaries.
Prevents the post-RA scheduler from modifying the prologue sequences
emitting by frame lowering. This is roughly similar to what we do for
other targets: TargetInstrInfo::isSchedulingBoundary checks
isPosition(), which checks for CFI_INSTRUCTION.
isSEHInstruction is taken from D50288; it'll land with whatever patch
lands first.
Differential Revision: https://reviews.llvm.org/D53851
llvm-svn: 345634
Aaron Ballman [Tue, 30 Oct 2018 19:23:06 +0000 (19:23 +0000)]
Silencing a -Wunused-variable warning; NFC.
llvm-svn: 345633
Petr Hosek [Tue, 30 Oct 2018 19:19:47 +0000 (19:19 +0000)]
[CMake] Check -ffreestanding as C not C++ flag
When -ffreestanding is used, main() isn't considered special and
when compiled as C++ code it'll get mangled which makes the
compilation fail since main() will be undefined so this check will
never succeed.
Differential Revision: https://reviews.llvm.org/D49332
llvm-svn: 345632
David Greene [Tue, 30 Oct 2018 19:17:51 +0000 (19:17 +0000)]
[AArch64] Create proper memoperand for multi-vector stores
Re-apply r345315 with testcase fixes.
Include all of the store's source vector operands when creating the
MachineMemOperand. Previously, we were missing the first operand,
making the store size seem smaller than it really is.
Differential Revision: https://reviews.llvm.org/D52816
llvm-svn: 345631
Aaron Ballman [Tue, 30 Oct 2018 19:06:58 +0000 (19:06 +0000)]
Fixing some build bot failures from r345628; NFC intended.
llvm-svn: 345630
Zachary Turner [Tue, 30 Oct 2018 18:57:08 +0000 (18:57 +0000)]
[NativePDB] Add support for dumping global variables of class type.
Previous patches added support for dumping global variables of
primitive types, so we now do the same for class types.
For the most part, everything just worked, there was only one
minor bug needing fixed, which was that for variables of modified
types (e.g. const, volatile, etc) we can't resolve the forward
decl in CreateAndCacheType because the PdbSymUid must point to the
LF_MODIFIER which must point to the forward decl. So when it comes
time to call CompleteType, an assert was firing because we expected
to get a class, struct, union, or enum, but we were getting an
LF_MODIFIER instead.
The other issue is that one the newly added tests is for an array
member, which was not yet supported, so we add support for that
now in this patch.
There's probably room for other interesting layout test cases
here, but this at least should test the basics.
Differential Revision: https://reviews.llvm.org/D53822
llvm-svn: 345629
Aaron Ballman [Tue, 30 Oct 2018 18:55:38 +0000 (18:55 +0000)]
Add the ability to output static analysis results to SARIF.
This allows users to specify SARIF (https://github.com/oasis-tcs/sarif-spec) as the output from the clang static analyzer so that the results can be read in by other tools, such as extensions to Visual Studio and VSCode, as well as static analyzers like CodeSonar.
llvm-svn: 345628
Kamil Rytarowski [Tue, 30 Oct 2018 18:49:19 +0000 (18:49 +0000)]
Handle NetBSD alias for pthread_sigmask
Summary:
Add a new helper macro TSAN_INTERCEPTOR_NETBSD_ALIAS_THR2
that handles pthread(3)/libc aliases in scenarios when a name in both
libraries differs not just in prefix namespace.
Handle TSan pthread_sigmask mangling accordingly into __libc_thr_sigsetmask.
Reviewers: vitalybuka, joerg
Reviewed By: vitalybuka
Subscribers: kubamracek, jfb, llvm-commits, #sanitizers, mgorny
Tags: #sanitizers
Differential Revision: https://reviews.llvm.org/D53863
llvm-svn: 345627
Craig Topper [Tue, 30 Oct 2018 18:48:42 +0000 (18:48 +0000)]
[X86] In lowerVectorShuffleAsBroadcast, make peeking through CONCAT_VECTORS work correctly if we already walked through a bitcast that changed the element size.
The CONCAT_VECTORS case was using the original mask element count to determine how to adjust the broadcast index. But if we looked through a bitcast the original mask size doesn't tell us anything about the concat_vectors.
This patch switchs to using the concat_vectors input element count directly instead.
Differential Revision: https://reviews.llvm.org/D53823
llvm-svn: 345626
Calixte Denizet [Tue, 30 Oct 2018 18:41:41 +0000 (18:41 +0000)]
[GCOV] Add a test for function defined on one line (follow-up of https://reviews.llvm.org/D53600)
Summary: Add a test for coverage for function definition like void foo() { }.
Reviewers: marco-c
Reviewed By: marco-c
Subscribers: delcypher, llvm-commits, #sanitizers, sylvestre.ledru
Differential Revision: https://reviews.llvm.org/D53601
llvm-svn: 345625
Calixte Denizet [Tue, 30 Oct 2018 18:41:31 +0000 (18:41 +0000)]
[GCOV] Function counters are wrong when on one line
Summary:
After commit https://reviews.llvm.org/rL344228, the function definitions have a counter but when on one line the counter is wrong (e.g. void foo() { })
I added a test in: https://reviews.llvm.org/D53601
Reviewers: marco-c
Reviewed By: marco-c
Subscribers: llvm-commits, sylvestre.ledru
Differential Revision: https://reviews.llvm.org/D53600
llvm-svn: 345624
Nirav Dave [Tue, 30 Oct 2018 18:26:43 +0000 (18:26 +0000)]
[DAG] Add const variants for BaseIndexOffset functions.
llvm-svn: 345623
Zachary Turner [Tue, 30 Oct 2018 18:25:38 +0000 (18:25 +0000)]
Fix printing bug in pdb2yaml.
We were using the wrong enum table when mapping enum values
to strings for public symbol flags.
llvm-svn: 345622
Jonas Devlieghere [Tue, 30 Oct 2018 18:25:28 +0000 (18:25 +0000)]
[DebugInfo] Define base function on DWARFDie reverse iterators
This defines member function base on the specialization of
std::reverse_iterator for DWARFDie::iterator as required by C++
[reverse.iter.conv].
This fixes unit test DWARFDebugInfoTest.cpp under EXPENSIVE_CHECKS which
currently can't be built due to GNU C++ Library calling this member
function in debug mode.
This fixes https://llvm.org/PR38785
Patch by: Eugene Sharygin
Differential revision: https://reviews.llvm.org/D53792
llvm-svn: 345621
Kamil Rytarowski [Tue, 30 Oct 2018 18:25:12 +0000 (18:25 +0000)]
Cast the return value of _Unwind_GetIP() to uptr
This is needed for NetBSD to match the expected type in
Unwind_GetIP().
llvm-svn: 345620
Kamil Rytarowski [Tue, 30 Oct 2018 18:21:58 +0000 (18:21 +0000)]
Mark interception_failure_test with XFAIL for NetBSD
This test breaks also on FreeBSD.
llvm-svn: 345619
Ulrich Weigand [Tue, 30 Oct 2018 18:20:59 +0000 (18:20 +0000)]
[SystemZ] Simplify LRV/STRV ISD nodes
The LRV and STRV nodes carry an extra operand to indicate the
type of the memory access. This is redundant, since the nodes
are actually of class MemIntrinsicNode and therefore hold that
same information already as MemoryVT.
NFC intended.
llvm-svn: 345618
Simon Pilgrim [Tue, 30 Oct 2018 18:10:02 +0000 (18:10 +0000)]
[TTI] Fix uses of SK_ExtractSubvector shuffle costs (PR39368)
Correct costings of SK_ExtractSubvector requires the SubTy argument to indicate the type/size of the extracted subvector.
Unlike the rest of the shuffle kinds this means that the main Ty argument represents the source vector type not the destination!
I've done my best to fix a number of vectorizer uses:
SLP - the reduction epilogue costs should be using a SK_PermuteSingleSrc shuffle as these all occur at the hardware vector width - we're not extracting (illegal) subvector types. This is causing the cost model diffs as SK_ExtractSubvector costs are poorly handled and tend to just return 1 at the moment.
LV - I'm not clear on what the SK_ExtractSubvector should represents for recurrences - I've used a <1 x ?> subvector extraction as that seems to match the VF delta.
Differential Revision: https://reviews.llvm.org/D53573
llvm-svn: 345617
Volkan Keles [Tue, 30 Oct 2018 17:51:14 +0000 (17:51 +0000)]
[InstCombine] Add preliminary tests for nested min/max combines. NFC
Summary: As requested in D53774.
Reviewers: spatel
Reviewed By: spatel
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D53875
llvm-svn: 345616
Sanjay Patel [Tue, 30 Oct 2018 16:58:43 +0000 (16:58 +0000)]
[InstSimplify] add tests for fcmp folds; NFC
This is part of a problem noted in PR39475:
https://bugs.llvm.org/show_bug.cgi?id=39475
llvm-svn: 345615
Jordan Rupprecht [Tue, 30 Oct 2018 16:23:38 +0000 (16:23 +0000)]
[llvm-objcopy] Fix --keep-global-symbol/--globalize-symbol for undefined symbols.
Summary: --keep-global-symbol and --globalize-symbol don't make sense for undefined symbols, so it should be ignored for those symbols. This matches GNU objcopy behavior.
Reviewers: jhenderson, alexshap, jakehehrlich, espindola
Reviewed By: jhenderson, jakehehrlich
Subscribers: emaste, arichardson, llvm-commits
Differential Revision: https://reviews.llvm.org/D53733
llvm-svn: 345614
Sanjay Patel [Tue, 30 Oct 2018 16:21:56 +0000 (16:21 +0000)]
[InstCombine] use getFltSemantics() instead of duplicating it; NFC
llvm-svn: 345613
Fangrui Song [Tue, 30 Oct 2018 15:56:08 +0000 (15:56 +0000)]
[llvm-mca] Move namespace mca inside llvm::
Summary: This allows to remove `using namespace llvm;` in those *.cpp files
When we want to revisit the decision (everything resides in llvm::mca::*) in the future, we can move things to a nested namespace of llvm::mca::, to conceptually make them separate from the rest of llvm::mca::*
Reviewers: andreadb, mattd
Reviewed By: andreadb
Subscribers: javed.absar, tschuett, gbedwell, llvm-commits
Differential Revision: https://reviews.llvm.org/D53407
llvm-svn: 345612
Samuel Benzaquen [Tue, 30 Oct 2018 15:54:22 +0000 (15:54 +0000)]
Add more benchmarks for std::string.
Summary:
Added benchmarks for Construct, Copy, Move, Destroy, Relationals and
Read. On the ones that matter, the benchmarks tests hot and cold data,
and opaque and transparent inputs.
Reviewers: EricWF
Subscribers: christof, ldionne, libcxx-commits
Differential Revision: https://reviews.llvm.org/D53825
llvm-svn: 345611
Roman Lebedev [Tue, 30 Oct 2018 15:52:36 +0000 (15:52 +0000)]
[clang-tidy] cppcoreguidelines-macro-usage: print macro names
Summary:
The macro may not have location (or more generally, the location may not exist),
e.g. if it originates from compiler's command-line.
The check complains on all the macros, even those without the location info.
Which means, it only says it does not like it. What is 'it'? I have no idea.
If we don't print the name, then there is no way to deal with that situation.
And in general, not printing name here forces the user to try to understand,
given, the macro definition location, what is the macro name?
This isn't fun.
Also, ignores-by-default the macros originating from command-line,
with an option to not ignore those.
I suspect some more issues may crop up later.
Reviewers: JonasToth, aaron.ballman, hokein, xazax.hun, alexfh
Reviewed By: JonasToth, aaron.ballman
Subscribers: nemanjai, kbarton, rnkovacs, cfe-commits
Tags: #clang-tools-extra
Differential Revision: https://reviews.llvm.org/D53817
llvm-svn: 345610
Alexey Bataev [Tue, 30 Oct 2018 15:50:12 +0000 (15:50 +0000)]
[OPENMP] Support for mapping of the lambdas in target regions.
Added support for mapping of lambdas in the target regions. It scans all
the captures by reference in the lambda, implicitly maps those variables
in the target region and then later reinstate the addresses of
references in lambda to the correct addresses of the captured|privatized
variables.
llvm-svn: 345609
Alexey Bataev [Tue, 30 Oct 2018 15:42:12 +0000 (15:42 +0000)]
[LIBOMPTARGET] Add support for mapping of lambda captures.
Summary:
Added support for correct mapping of variables captured by reference in
lambdas. That kind of mapping may appear only in target-executable
regions and must follow the original lambda or another lambda capture
for the same lambda.
The expected data: base address - the address of the lambda, begin
pointer - pointer to the address of the lambda capture, size - size of
the captured variable.
When OMP_TGT_MAPTYPE_PTR_AND_OBJ mapping type is seen in
target-executable region, the target address of the last processed item
is taken as the address of the original lambda `tgt_lambda_ptr`. Then,
the pointer to capture on the device is calculated like `tgt_lambda_ptr
+ (host_begin_pointer - host_begin_base)` and the target-based address
of the original variable (which host address is
`*(void**)begin_pointer`) is written to that pointer.
Reviewers: kkwli0, gtbercea, grokos
Subscribers: openmp-commits
Differential Revision: https://reviews.llvm.org/D51107
llvm-svn: 345608
Sanjay Patel [Tue, 30 Oct 2018 15:26:39 +0000 (15:26 +0000)]
[InstCombine] try to turn shuffle into insertelement
shuffle (insert ?, Scalar, IndexC), V1, Mask --> insert V1, Scalar, IndexC'
The motivating case is at least a couple of steps away: I noticed that
SLPVectorizer does not analyze shuffles as well as sequences of
insert/extract in PR34724:
https://bugs.llvm.org/show_bug.cgi?id=34724
...so SLP may fail to vectorize when source code has shuffles to start
with or instcombine has converted insert/extract to shuffles.
Independent of that, an insertelement is always a simpler op for IR
analysis vs. a shuffle, so we should transform to insert when possible.
I don't think there's any codegen concern here - if a target can't insert
a scalar directly to some fixed element in a vector (x86?), then this
should get expanded to the insert+shuffle that we started with.
Differential Revision: https://reviews.llvm.org/D53507
llvm-svn: 345607
Jonas Paulsson [Tue, 30 Oct 2018 15:04:40 +0000 (15:04 +0000)]
[SchedModel] Fix for read advance cycles with implicit pseudo operands.
The SchedModel allows the addition of ReadAdvances to express that certain
operands of the instructions are needed at a later point than the others.
RegAlloc may add pseudo operands that are not part of the instruction
descriptor, and therefore cannot have any read advance entries. This meant
that in some cases the desired read advance was nullified by such a pseudo
operand, which still had the original latency.
This patch fixes this by making sure that such pseudo operands get a zero
latency during DAG construction.
Review: Matthias Braun, Ulrich Weigand.
https://reviews.llvm.org/D49671
llvm-svn: 345606
Bruno Ricci [Tue, 30 Oct 2018 14:40:49 +0000 (14:40 +0000)]
[AST] Only store data for the NRVO candidate in ReturnStmt if needed
Only store the NRVO candidate if needed in ReturnStmt.
A good chuck of all of the ReturnStmt have no NRVO candidate
(more than half when parsing all of Boost). For all of them
this saves one pointer. This has no impact on children().
Differential Revision: https://reviews.llvm.org/D53716
Reviewed By: rsmith
llvm-svn: 345605
Sean Fertile [Tue, 30 Oct 2018 14:37:17 +0000 (14:37 +0000)]
[PPC64] Handle powerpc64 in OUTPUT_FORMAT.
Differential Revision: https://reviews.llvm.org/D53652
llvm-svn: 345604
Jonas Paulsson [Tue, 30 Oct 2018 14:34:15 +0000 (14:34 +0000)]
[LoopVectorizer] Fix for cost values of memory accesses.
This commit is a combination of two patches:
* "Fix in getScalarizationOverhead()"
If target returns false in TTI.prefersVectorizedAddressing(), it means the
address registers will not need to be extracted. Therefore, there should
be no operands scalarization overhead for a load instruction.
* "Don't pass the instruction pointer from getMemInstScalarizationCost."
Since VF is always > 1, this is a cost query for an instruction in the
vectorized loop and it should not be evaluated within the scalar
context of the instruction.
Review: Ulrich Weigand, Hal Finkel
https://reviews.llvm.org/D52351
https://reviews.llvm.org/D52417
llvm-svn: 345603
Sanjay Patel [Tue, 30 Oct 2018 14:14:34 +0000 (14:14 +0000)]
[DAGCombiner] narrow vector binops when extraction is cheap
Narrowing vector binops came up in the demanded bits discussion in D52912.
I don't think we're going to be able to do this transform in IR as a canonicalization
because of the risk of creating unsupported widths for vector ops, but we already have
a DAG TLI hook to allow what I was hoping for: isExtractSubvectorCheap(). This is
currently enabled for x86, ARM, and AArch64 (although only x86 has existing regression
test diffs).
This is artificially limited to not look through bitcasts because there are so many
test diffs already, but that's marked with a TODO and is a small follow-up.
Differential Revision: https://reviews.llvm.org/D53784
llvm-svn: 345602
Diogo N. Sampaio [Tue, 30 Oct 2018 13:59:21 +0000 (13:59 +0000)]
[FIX][AArch64] Add support for UDF instruction
Fix: Simplify test files from rL345581 failing
in windows bots.
llvm-svn: 345601
Kamil Rytarowski [Tue, 30 Oct 2018 13:58:45 +0000 (13:58 +0000)]
Disable ASan test asan_and_llvm_coverage_test for NetBSD
Right now the LLVM profile feature is turned off for this OS.
llvm-svn: 345600
Kamil Rytarowski [Tue, 30 Oct 2018 13:49:15 +0000 (13:49 +0000)]
Adapt ASan test heavy_uar_test for NetBSD
The stack size is tight for the main thread in multithread
environment and follow the FreeBSD approach of reducing stack
usage.
llvm-svn: 345599
Sanjay Patel [Tue, 30 Oct 2018 13:47:19 +0000 (13:47 +0000)]
[SelectionDAG] fix build warning for mismatched signs in compare; NFC
llvm-svn: 345598