Dmitri Gribenko [Thu, 28 Feb 2019 10:58:13 +0000 (10:58 +0000)]
Fixed typos in a test: s/CEHCK/CHECK/
Reviewers: ilya-biryukov, serge-sans-paille
Subscribers: delcypher, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D58613
llvm-svn: 355080
Dmitri Gribenko [Thu, 28 Feb 2019 10:56:39 +0000 (10:56 +0000)]
Fixed a typo in the test s/CEHCK/CHECK/
Summary:
Turns out the test was not correct, I had to adjust the test to work. I
also added CHECK-LABELs for better error messages from FileCheck while
I'm here.
Reviewers: jsji
Subscribers: nemanjai, eraman, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D58614
llvm-svn: 355079
Simon Pilgrim [Thu, 28 Feb 2019 10:53:58 +0000 (10:53 +0000)]
[X86][AVX] Fold vf64 concat_vectors(movddup(x),movddup(x)) -> broadcast(x)
llvm-svn: 355078
Diana Picus [Thu, 28 Feb 2019 10:42:47 +0000 (10:42 +0000)]
[ARM GlobalISel] Support global variables for Thumb2
Add the same level of support as for ARM mode (i.e. still no TLS
support).
In most cases, it is sufficient to replace the opcodes with the
t2-equivalent, but there are some idiosyncrasies that I decided to
preserve because I don't understand the full implications:
* For ARM we use LDRi12 to load from constant pools, but for Thumb we
use t2LDRpci (I'm not sure if the ideal would be to use t2LDRi12 for
Thumb as well, or to use LDRcp for ARM).
* For Thumb we don't have an equivalent for MOV|LDRLIT_ga_pcrel_ldr, so
we have to generate MOV|LDRLIT_ga_pcrel plus a load from GOT.
The tests are in separate files because they're hard enough to read even
without doubling the number of checks.
llvm-svn: 355077
Clement Courbet [Thu, 28 Feb 2019 10:33:32 +0000 (10:33 +0000)]
[clang-tidy] misc-string-integer-assignment: fix false positive
Summary:
using CodePoint = uint32_t;
CodePoint cp;
basic_string<CodePoint> s;
s += cp;
See PR27723.
Reviewers: xazax.hun, alexfh
Subscribers: rnkovacs, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D58606
llvm-svn: 355076
George Rimar [Thu, 28 Feb 2019 09:24:12 +0000 (09:24 +0000)]
[LLD][ELF] - Stop using binary input in invalid/tls-symbol.s test. NFCI.
We can use yaml2obj instead, patch does this.
llvm-svn: 355075
George Rimar [Thu, 28 Feb 2019 08:21:50 +0000 (08:21 +0000)]
[llvm-objdump] - Improve the error message for "removing a section that is used by relocation" case.
This refines/improves the error message introduced in D58625
Differential revision: https://reviews.llvm.org/D58709
llvm-svn: 355074
George Rimar [Thu, 28 Feb 2019 08:15:59 +0000 (08:15 +0000)]
[llvm-readobj] - Fix the invalid dumping of the dynamic sections without terminating DT_NULL entry.
This is https://bugs.llvm.org/show_bug.cgi?id=40861,
Previously llvm-readobj would print the DT_NULL sometimes
for the dynamic section that has no terminator entry.
The logic of printDynamicTable was a bit overcomplicated.
I rewrote it slightly to fix the issue and commented.
Differential revision: https://reviews.llvm.org/D58716
llvm-svn: 355073
Nikita Popov [Thu, 28 Feb 2019 08:11:20 +0000 (08:11 +0000)]
[ValueTracking] More accurate unsigned add overflow detection
Part of D58593.
Compute precise overflow conditions based on all known bits, rather
than just the sign bits. Unsigned a + b overflows iff a > ~b, and we
can determine whether this always/never happens based on the minimal
and maximal values achievable for a and ~b subject to the known bits
constraint.
llvm-svn: 355072
Craig Topper [Thu, 28 Feb 2019 07:21:26 +0000 (07:21 +0000)]
[X86] Use PreprocessISelDAG to convert vector sra/srl/shl to the X86 specific variable shift ISD opcodes.
These allows use to use the same set of isel patterns for sra/srl/shl which are undefined for out of range shifts and intrinsic shifts which aren't undefined.
Doing this late allows DAG combine to have every opportunity to optimize the sra/srl/shl nodes.
This removes about 7000 bytes from the isel table and simplies the td files.
llvm-svn: 355071
Fangrui Song [Thu, 28 Feb 2019 05:16:01 +0000 (05:16 +0000)]
[Dominators] Avoid potentially quadratic std::is_permutation
Summary:
If the two sequences are not equal, std::is_permutation may be O(N^2)
and indeed the case in libstdc++ and libc++. Use SmallPtrSet to prevent
pessimizing cases. On my machine, SmallPtrSet starts to outperform
std::is_permutation when there are 16 elements.
Reviewers: kuhar
Reviewed By: kuhar
Subscribers: kristina, jdoerfert, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D58373
llvm-svn: 355070
Philip Reames [Thu, 28 Feb 2019 04:07:23 +0000 (04:07 +0000)]
[SelectionDAG] Strengthen assertions about usage of AtomicSDNodes
In D57601, I described the expectations around usage of AtomicSDNode and LoadSDNode/StoreSDNode w.r.t. atomic and volatiles. This patch simply embeds those expectations in assertions so that they can't be accidentally weakened.
Note: The reason only AtomicSDNodes of ATOMIC_LOAD and ATOMIC_STORE opcode are currently checked is that AMDGPU has an intrinsic which gets lowered to an ATOMIC_LOAD_FADD w/o a corresponding atomic MMO. This is suspicious, and I've brought it to the attention of the relevant developers. Once resolved, I'll strengthen that assertion.
Note 2: If this breaks your out-of-tree backend, go read the update instructions associated w/the previously mentioned patch. This will assert on (a subset of) things you need to update per those instructions.
Differential Revision: https://reviews.llvm.org/D58738
llvm-svn: 355069
Richard Trieu [Thu, 28 Feb 2019 04:00:55 +0000 (04:00 +0000)]
Fix IR/Analysis layering issue with OptBisect
OptBisect is in IR due to LLVMContext using it. However, it uses IR units from
Analysis as well. This change moves getDescription functions from OptBisect
to their respective IR units. Generating names for IR units will now be up
to the callers, keeping the Analysis IR units in Analysis. To prevent
unnecessary string generation, isEnabled function is added so that callers know
when the description needs to be generated.
Differential Revision: https://reviews.llvm.org/D58406
llvm-svn: 355068
Alexandre Ganea [Thu, 28 Feb 2019 03:42:07 +0000 (03:42 +0000)]
Fix SupportTests.exe/AllocationTests/MappedMemoryTest.AllocAndReleaseHuge when the machine doesn't have large pages enabled.
llvm-svn: 355067
Alexandre Ganea [Thu, 28 Feb 2019 03:03:07 +0000 (03:03 +0000)]
Fix non-Windows platforms build break introduced by r355065. Fixes:
In file included from /home/buildbots/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/llvm/lib/Support/Memory.cpp:14:
/home/buildbots/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/llvm/include/llvm/Support/Memory.h:38:14: error: private field 'Flags' is not used [-Werror,-Wunused-private-field]
unsigned Flags = 0;
^
1 error generated.
llvm-svn: 355066
Alexandre Ganea [Thu, 28 Feb 2019 02:47:34 +0000 (02:47 +0000)]
[Memory] Add basic support for large/huge memory pages
This patch introduces Memory::MF_HUGE_HINT which indicates that allocateMappedMemory() shall return a pointer to a large memory page.
However the flag is a hint because we're not guaranteed in any way that we will get back a large memory page. There are several restrictions:
- Large/huge memory pages aren't enabled by default on modern OSes (Windows 10 and Linux at least), and should be manually enabled/reserved.
- Once enabled, it should be kept in mind that large pages are physical only, they can't be swapped.
- Memory fragmentation can affect the availability of large pages, especially after running the OS for a long time and/or running along many other applications.
Memory::allocateMappedMemory() will fallback to 4KB pages if it can't allocate 2MB large pages (if Memory::MF_HUGE_HINT is provided)
Currently, Memory::MF_HUGE_HINT only works on Windows. The hint will be ignored on Linux, 4KB pages will always be returned.
Differential Revision: https://reviews.llvm.org/D58718
llvm-svn: 355065
Evgeniy Stepanov [Thu, 28 Feb 2019 01:54:55 +0000 (01:54 +0000)]
[sanitizer] Got rid of text relocations in i386 vfork interceptor.
llvm-svn: 355064
Jason Molenda [Thu, 28 Feb 2019 01:26:01 +0000 (01:26 +0000)]
Move Symbols.cpp files.
llvm-svn: 355063
Douglas Yung [Thu, 28 Feb 2019 01:20:38 +0000 (01:20 +0000)]
Add username to TODO comment in sanitizer to satisfy sanitizer lint check. NFC
llvm-svn: 355062
Jan Korous [Thu, 28 Feb 2019 01:12:27 +0000 (01:12 +0000)]
[clang][index-while-building][NFC] Comment about implementation detail in FileIndexRecord
llvm-svn: 355061
Eric Christopher [Thu, 28 Feb 2019 01:11:12 +0000 (01:11 +0000)]
Temporarily revert "ArgumentPromotion should copy all metadata to new Function" and the dependent patch "Refine ArgPromotion metadata handling" as they're causing segfaults in argument promotion.
This reverts commits r354032 and r353537.
llvm-svn: 355060
Craig Topper [Thu, 28 Feb 2019 01:00:31 +0000 (01:00 +0000)]
[X86] Use X86::LAST_VALID_COND instead of assuming X86::COND_S is the last encoding. NFC
llvm-svn: 355059
Joerg Sonnenberger [Thu, 28 Feb 2019 00:55:09 +0000 (00:55 +0000)]
Ensure that set constrained asm operands are not affected by truncation.
llvm-svn: 355058
Matt Arsenault [Thu, 28 Feb 2019 00:52:36 +0000 (00:52 +0000)]
AMDGPU/GlobalISel: Add regbankselect test for phis
Add baseline for future fixes. These mostly show how this is broken
and producing illegal situations.
llvm-svn: 355057
Matt Arsenault [Thu, 28 Feb 2019 00:52:33 +0000 (00:52 +0000)]
AMDGPU: Fix typo
llvm-svn: 355056
Jonas Devlieghere [Thu, 28 Feb 2019 00:49:57 +0000 (00:49 +0000)]
[Reprodicuers] Check initialization
If the reproducer is not initialzied, the call to ::Instance() will
result in an assertion.
llvm-svn: 355055
Erik Pilkington [Thu, 28 Feb 2019 00:47:55 +0000 (00:47 +0000)]
[CodeGen] Fix some broken IR generated by -fsanitize=unsigned-integer-overflow
I think the author of the function assumed that `GetInsertBlock()`
wouldn't change from where `atomicPHI` was created, but this isn't
true when `-fsanitize=unsigned-integer-overflow` is enabled (we
generate an overflow/continuation label). Fix by keeping track of the
block we want to return to to complete the cmpxchg loop.
rdar://
48406558
Differential revision: https://reviews.llvm.org/D58744
llvm-svn: 355054
Julian Lettner [Thu, 28 Feb 2019 00:43:43 +0000 (00:43 +0000)]
[NFC][TSan] Don't define GetStackTrace when compiling for Go
rdar://
48455255
llvm-svn: 355053
Julian Lettner [Thu, 28 Feb 2019 00:43:40 +0000 (00:43 +0000)]
[NFC][Sanitizer] Use correct WEAK annotation to make Windows work
The previous fix didn't work for Windows:
https://github.com/llvm/llvm-project/commit/
52b751088b11547e0f4ef0589ebbe5e57752c68c
llvm-svn: 355052
Matt Arsenault [Thu, 28 Feb 2019 00:40:32 +0000 (00:40 +0000)]
AMDGPU: Enable function calls by default
Fixes some crashes on illegal call situations which are unfortunately
still valid IR.
llvm-svn: 355051
Abderrazek Zaafrani [Thu, 28 Feb 2019 00:31:38 +0000 (00:31 +0000)]
[AArch64] Generate FP16 vector compare instructions.
https://reviews.llvm.org/D58561
llvm-svn: 355050
Matt Arsenault [Thu, 28 Feb 2019 00:28:44 +0000 (00:28 +0000)]
AMDGPU: Fix crashes in invalid call cases
We have to at least tolerate calls to kernels, possibly with a
mismatched calling convention on the callsite.
llvm-svn: 355049
Matt Arsenault [Thu, 28 Feb 2019 00:16:32 +0000 (00:16 +0000)]
GlobalISel: Implement fewerElementsVector for phi
llvm-svn: 355048
Matt Arsenault [Thu, 28 Feb 2019 00:01:05 +0000 (00:01 +0000)]
GlobalISel: Implement moreElementsVector for phi
llvm-svn: 355047
Julian Lettner [Wed, 27 Feb 2019 23:47:00 +0000 (23:47 +0000)]
[Sanitizer] Attempt to fix linker error on ARM variants
Previous commit:
https://github.com/llvm/llvm-project/commit/
a0884da62a471f08c65a03e337aea23203a43eb8
llvm-svn: 355046
Matthew G McGovern [Wed, 27 Feb 2019 23:43:50 +0000 (23:43 +0000)]
[compiler-rt] Windows Trace Logging for error reports.
Adds option for collecting sanitixer dumps via trace logging.
- Set log_to_syslog=1 to enable this output.
- Consult https://aka.ms/windowstracelogging for details on use.
llvm-svn: 355045
Reid Kleckner [Wed, 27 Feb 2019 23:38:44 +0000 (23:38 +0000)]
[InstrProf] Use separate comdat group for data and counters
Summary:
I hadn't realized that instrumentation runs before inlining, so we can't
use the function as the comdat group. Doing so can create relocations
against discarded sections when references to discarded __profc_
variables are inlined into functions outside the function's comdat
group.
In the future, perhaps we should consider standardizing the comdat group
names that ELF and COFF use. It will save object file size, since
__profv_$sym won't appear in the symbol table again.
Reviewers: xur, vsk
Subscribers: eraman, hiraditya, cfe-commits, #sanitizers, llvm-commits
Tags: #clang, #sanitizers, #llvm
Differential Revision: https://reviews.llvm.org/D58737
llvm-svn: 355044
Louis Dionne [Wed, 27 Feb 2019 23:36:22 +0000 (23:36 +0000)]
[NFC][libc++] Update comment about oldest supported macosx for back-deployment
llvm-svn: 355043
Adrian Prantl [Wed, 27 Feb 2019 22:54:47 +0000 (22:54 +0000)]
Remove unnecessary demangling operation (NFC)
This extra call to the demangler doesn't affect the performance of C++
because the result is being cached anyway; but I'm working on a patch
to the Swift branch that uses extra contextual information to provide
a more accurate demangling result. In that case this call would be
extra and unnecessary work.
Differential Revision: https://reviews.llvm.org/D58720
llvm-svn: 355042
Evgeniy Stepanov [Wed, 27 Feb 2019 22:23:51 +0000 (22:23 +0000)]
[sanitizer] Fix compilation errors in r355030.
Disable hwasan interceptor on non-linux, non-x86-or-arm platforms.
Add @plt to the asm call that clang intergrated-as infers but gcc does
not.
llvm-svn: 355041
Alina Sbirlea [Wed, 27 Feb 2019 22:20:22 +0000 (22:20 +0000)]
[MemorySSA] Make insertDef insert corresponding phi nodes.
Summary:
The original assumption for the insertDef method was that it would not
materialize Defs out of no-where, hence it will not insert phis needed
after inserting a Def.
However, when cloning an instruction (use case used in LICM), we do
materialize Defs "out of no-where". If the block receiving a Def has at
least one other Def, then no processing is needed. If the block just
received its first Def, we must check where Phi placement is needed.
The only new usage of insertDef is in LICM, hence the trigger for the bug.
But the original goal of the method also fails to apply for the move()
method. If we move a Def from the entry point of a diamond to either the
left or right blocks, then the merge block must add a phi.
While this usecase does not currently occur, or may be viewed as an
incorrect transformation, MSSA must behave corectly given the scenario.
Resolves PR40749 and PR40754.
Reviewers: george.burgess.iv
Subscribers: sanjoy, jlebar, Prazek, jdoerfert, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D58652
llvm-svn: 355040
Julian Lettner [Wed, 27 Feb 2019 22:16:02 +0000 (22:16 +0000)]
[NFC][Sanitizer] Pull up GetStackTrace into sanitizer_common
We already independently declare GetStackTrace in all (except TSan)
sanitizer runtime headers. Lets move it to sanitizer_stacktrace.h to
have one canonical way to fill in a BufferedStackFrame. Also enables us
to use it in sanitizer_common itself.
This patch defines GetStackTrace for TSan and moves the function from
ubsan_diag.cc to ubsan_diag_standalone.cc to avoid duplicate symbols
for the UBSan-ASan runtime.
Other than that this patch just moves the code out of headers and into
the correct namespace.
Reviewers: vitalybuka
Differential Revision: https://reviews.llvm.org/D58651
llvm-svn: 355039
Joerg Sonnenberger [Wed, 27 Feb 2019 21:53:14 +0000 (21:53 +0000)]
Default to Secure PLT on PPC for NetBSD and OpenBSD.
This matches the default settings of clang.
llvm-svn: 355038
Zachary Turner [Wed, 27 Feb 2019 21:53:08 +0000 (21:53 +0000)]
Remove dependency from Host -> Core.
I wasn't actually trying to eliminate this one, but looks like
it happened as a side effect of moving Symbols out of Host.
llvm-svn: 355037
Jan Korous [Wed, 27 Feb 2019 21:48:02 +0000 (21:48 +0000)]
[clang][index-while-building][NFC] FileIndexRecord - Comments, replace auto with type
Differential Revision: https://reviews.llvm.org/D58478
llvm-svn: 355036
Jan Korous [Wed, 27 Feb 2019 21:47:40 +0000 (21:47 +0000)]
[clang][index-while-building] FileIndexRecord
Basic data structures for index
Tests are missing from this patch - will be covered properly by tests for the whole feature.
I'm just trying to split into smaller patches to make it easier for reviewers.
Differential Revision: https://reviews.llvm.org/D58478
llvm-svn: 355035
James Y Knight [Wed, 27 Feb 2019 21:47:35 +0000 (21:47 +0000)]
Fixup compilation/test failures after r354960 and r355013.
llvm-svn: 355034
Joerg Sonnenberger [Wed, 27 Feb 2019 21:46:01 +0000 (21:46 +0000)]
Use Secure PLT as default on NetBSD/PowerPC.
llvm-svn: 355033
Zachary Turner [Wed, 27 Feb 2019 21:42:10 +0000 (21:42 +0000)]
Move Host/Symbols.cpp to Symbols/LocateSymbolFile.cpp
Given that we have a target named Symbols, one wonders why a
file named Symbols.cpp is not in this target. To be clear,
the functions exposed from this file are really focused on
*locating* a symbol file on a given host, which is where the
ambiguity comes in. However, it makes more sense conceptually
to be in the Symbols target. While some of the specific places
to search for symbol files might change depending on the Host,
this is not inherently true in the same way that, for example,
"accessing the file system" or "starting threads" is
fundamentally dependent on the Host.
PDBs, for example, recently became a reality on non-Windows platforms,
and it's theoretically possible that DSYMs could become a thing on non
MacOSX platforms (maybe in a remote debugging scenario). Other types of
symbol files, such as DWO, DWP, etc have never been tied to any Host
platform anyway.
After this patch, there is only one remaining dependency from
Host to Target.
Differential Revision: https://reviews.llvm.org/D58730
llvm-svn: 355032
Matt Davis [Wed, 27 Feb 2019 21:39:11 +0000 (21:39 +0000)]
[llvm-cxxfilt] Re-enable split and demangle stdin input on certain non-alphanumerics.
This restores the patch that splits demangled stdin input on
non-alphanumerics. I had reverted this patch earlier because it broke
Windows build-bots. I have updated the test so that it passes on
Windows.
I was running the test from powershell and never saw the issue until I
switched to the mingw shell.
This reverts commit
628ab5c6820bdf3bb5a8e494b0fd9e7312ce7150.
llvm-svn: 355031
Evgeniy Stepanov [Wed, 27 Feb 2019 21:11:50 +0000 (21:11 +0000)]
[hwasan, asan] Intercept vfork.
Summary:
Intercept vfork on arm, aarch64, i386 and x86_64.
Reviewers: pcc, vitalybuka
Subscribers: kubamracek, mgorny, javed.absar, krytarowski, kristof.beyls, #sanitizers, llvm-commits
Tags: #sanitizers, #llvm
Differential Revision: https://reviews.llvm.org/D58533
llvm-svn: 355030
Alexandre Ganea [Wed, 27 Feb 2019 20:53:50 +0000 (20:53 +0000)]
[LLD][COFF] Support /threads[:no] like the ELF driver
Differential review: https://reviews.llvm.org/D58594
llvm-svn: 355029
Evgeniy Stepanov [Wed, 27 Feb 2019 20:50:35 +0000 (20:50 +0000)]
[hwasan] Fix tests after .cc->.cpp renaming.
llvm-svn: 355028
Alexey Bataev [Wed, 27 Feb 2019 20:29:45 +0000 (20:29 +0000)]
[OPENMP]Delay emission of the error for unsupported types.
If the type is unsupported on the device side, it still must be emitted,
but we should emit errors for operations with such types.
llvm-svn: 355027
Jim Ingham [Wed, 27 Feb 2019 20:27:25 +0000 (20:27 +0000)]
Pass arguments correctly to the objc object checker on arm64
Traditionally objc had two entry points, objc_msgSend for scalar
return methods, and objc_msgSend_stret for struct return convention
methods. But on arm64 the second was not needed (since arm64 doesn't
use an argument register for the struct return pointer) so it was removed.
The code that dispatches to the objc object checker when it sees some
flavor of objc_msgSend was not aware of this change so was sending the
wrong arguments to the checker.
<rdar://problem/
48315890>
Differential Revision: https://reviews.llvm.org/D58699
llvm-svn: 355026
Philip Reames [Wed, 27 Feb 2019 20:20:08 +0000 (20:20 +0000)]
Seperate volatility and atomicity/ordering in SelectionDAG
At the moment, we mark every atomic memory access as being also volatile. This is unnecessarily conservative and prohibits many legal transforms (DCE, folding, etc..).
This patch removes MOVolatile from the MachineMemOperands of atomic, but not volatile, instructions. This should be strictly NFC after a series of previous patches which have gone in to ensure backend code is conservative about handling of isAtomic MMOs. Once it's in and baked for a bit, we'll start working through removing unnecessary bailouts one by one. We applied this same strategy to the middle end a few years ago, with good success.
To make sure this patch itself is NFC, it is build on top of a series of other patches which adjust code to (for the moment) be as conservative for an atomic access as for a volatile access and build up a test corpus (mostly in test/CodeGen/X86/atomics-unordered.ll)..
Previously landed
D57593 Fix a bug in the definition of isUnordered on MachineMemOperand
D57596 [CodeGen] Be conservative about atomic accesses as for volatile
D57802 Be conservative about unordered accesses for the moment
rL353959: [Tests] First batch of cornercase tests for unordered atomics.
rL353966: [Tests] RMW folding tests w/unordered atomic operations.
rL353972: [Tests] More unordered atomic lowering tests.
rL353989: [SelectionDAG] Inline a single use helper function, and remove last non-MMO interface
rL354740: [Hexagon, SystemZ] Be super conservative about atomics
rL354800: [Lanai] Be super conservative about atomics
rL354845: [ARM] Be super conservative about atomics
Attention Out of Tree Backend Owners: This patch may break you. If it does, you can use the TLI getMMOFlags hook to restore the MOVolatile to any instruction you need to. (See llvm-dev thread titled "PSA: Changes to how atomics are handled in backends" started Feb 27, 2019.)
Differential Revision: https://reviews.llvm.org/D57601
llvm-svn: 355025
Hyrum Wright [Wed, 27 Feb 2019 20:08:50 +0000 (20:08 +0000)]
[clang-tidy] Add the abseil-time-subtraction check
Differential Revision: https://reviews.llvm.org/D58137
llvm-svn: 355024
Rong Xu [Wed, 27 Feb 2019 20:01:14 +0000 (20:01 +0000)]
Fixed ubsan failures in r355005.
llvm-svn: 355023
Julian Lettner [Wed, 27 Feb 2019 20:01:04 +0000 (20:01 +0000)]
[NFC][Sanitizer] Hard-code fast/slow unwinder at call site
Also assert that the caller always gets what it requested.
This purely mechanical change simplifies future refactorings and
eventual removal of BufferedStackTrace::Unwind.
Reviewers: vitalybuka
Differential Revision: https://reviews.llvm.org/D58557
llvm-svn: 355022
Matt Davis [Wed, 27 Feb 2019 19:52:02 +0000 (19:52 +0000)]
Revert "[llvm-cxxfilt] Split and demangle stdin input on certain non-alphanumerics."
This reverts commit
5cd5f8f2563395f8767f94604eb4c4bea8dcbea0.
The test passes on linux, but fails on the windows build-bots.
This test failure seems to be a quoting issue between my test and
FileCheck on Windows. I'm reverting this patch until I can replicate
and fix in my Windows environment.
llvm-svn: 355021
Sanjay Patel [Wed, 27 Feb 2019 19:27:45 +0000 (19:27 +0000)]
[InstCombine] add tests for add+ext+add; NFC
llvm-svn: 355020
Jonathan Metzman [Wed, 27 Feb 2019 19:27:16 +0000 (19:27 +0000)]
[libFuzzer][Windows] Port fork mode to Windows
Summary:
Port libFuzzer's fork mode to Windows.
Implement Windows versions of MkDir, RmDir, and IterateDirRecursive to do this.
Don't print error messages under new normal uses of FileSize (on a non-existent file).
Implement portable way of piping output to /dev/null.
Fix test for Windows and comment fork-sigusr.test on why it won't be ported to Win.
Reviewers: zturner
Reviewed By: zturner
Subscribers: kcc, zturner, jdoerfert, #sanitizers, llvm-commits
Tags: #sanitizers, #llvm
Differential Revision: https://reviews.llvm.org/D58513
llvm-svn: 355019
Julian Lettner [Wed, 27 Feb 2019 19:06:20 +0000 (19:06 +0000)]
[Darwin][NFC] Refactor throttling of 64bit sanitizer tests on Darwin
Underlying condition for throttling is "has large mmap'd regions" (i.e.,
shadow memory) and not sanitizers in general (e.g., UBSan does not need
to be throttled).
Rename parallelism group `darwin-64bit-sanitizer` to `shadow-memory` and
apply it unconditionally to all tests which require it. We can then have
all the Darwin throttling logic in one place in the commen lit config.
Throttle sanitizer_common unit tests. Configuration was previously
missing from sanitizer_common/Unit/lit.site.cfg.
Reviewed by: kubamracek
Differential Revision: https://reviews.llvm.org/D58677
llvm-svn: 355018
Akira Hatanaka [Wed, 27 Feb 2019 18:59:52 +0000 (18:59 +0000)]
Add triples to the test I committed in r355012 to fix windows bots.
llvm-svn: 355017
Simon Pilgrim [Wed, 27 Feb 2019 18:46:32 +0000 (18:46 +0000)]
[X86][AVX] Pull out some INSERT_SUBVECTOR combines into a combineConcatVectorOps helper. NFCI
A lot of the INSERT_SUBVECTOR combines can be more generally handled as if they have come from a CONCAT_VECTORS node.
I've been investigating adding a CONCAT_VECTORS combine to X86, but this is a much easier first step that avoids the issue of handling a number of pre-legalization issues that I've encountered.
Differential Revision: https://reviews.llvm.org/D58583
llvm-svn: 355015
Matt Davis [Wed, 27 Feb 2019 18:39:17 +0000 (18:39 +0000)]
[llvm-readobj] Print section type values for unknown sections.
Summary:
This patch displays a hexadecimal section value (Elf_Shdr::sh_type) or section-relative offset when printing unknown sections.
Here is a subset of the output (ignoring the fields following "Type" when dumping an ELF's GNU `--section-headers` table).
Section Headers:
```
[Nr] Name Type
[16] android_rel LOOS+0x1
[17] android_rela LOOS+0x2
[27] unknown 0x1000: <unknown>
[28] loos LOOS+0
[30] hios VERSYM
[31] loproc LOPROC+0
[33] hiproc LOPROC+0xFFFFFFF
[34] louser LOUSER+0
[36] hiuser LOUSER+0x7FFFFFFF
```
As a comparison, the previous output looked something like the above, but with a blank "Type" field:
```
[Nr] Name Type
[27] unknown
[28] loos
[30] hios VERSYM
[31] loproc
[33] hiproc
[34] louser
[36] hiuser
```
This fixes PR40773
Reviewers: jhenderson, rupprecht, Bigcheese
Reviewed By: jhenderson, rupprecht, Bigcheese
Subscribers: MaskRay, Bigcheese, srhines, jdoerfert, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D58701
llvm-svn: 355014
Alexey Lapshin [Wed, 27 Feb 2019 18:36:46 +0000 (18:36 +0000)]
Attempt to fix buildbot after r354972 [#1]. NFCI.
llvm-svn: 355013
Akira Hatanaka [Wed, 27 Feb 2019 18:17:16 +0000 (18:17 +0000)]
Avoid needlessly copying a block to the heap when a block literal
initializes a local auto variable or is assigned to a local auto
variable that is declared in the scope that introduced the block
literal.
rdar://problem/
13289333
https://reviews.llvm.org/D58514
llvm-svn: 355012
Matt Davis [Wed, 27 Feb 2019 18:04:21 +0000 (18:04 +0000)]
[llvm-cxxfilt] Re-enable the delimiters test on Windows.
The original intent was to enable this test for Windows; however, that
initial patch broke one of the build-bots. I temporarily disabled this
test on Windows until that issue was resolved. It was resolved in my
previous patch (
cfd1d9742ee2d1b8dd6b7), and now I am re-enabling this
test.
llvm-svn: 355011
Louis Dionne [Wed, 27 Feb 2019 17:57:38 +0000 (17:57 +0000)]
[libc++] Add is_nothrow_convertible from P0758R1
Reviewed as https://reviews.llvm.org/D58019.
Thanks to Zoe Carver for the patch.
llvm-svn: 355010
Jonas Devlieghere [Wed, 27 Feb 2019 17:47:06 +0000 (17:47 +0000)]
[Reproducer] Make 'reproducer generate' a NOOP during replay.
Instead of filtering out the 'reproducer generate' command during
replay, just make the operation a NOOP.
llvm-svn: 355009
David Goldman [Wed, 27 Feb 2019 17:40:33 +0000 (17:40 +0000)]
Support framework import/include auto-completion
Frameworks filesystem representations:
UIKit.framework/Headers/%header%
Framework import format:
#import <UIKit/%header%>
Thus the completion code must map the input format of <UIKit/> to
the path of UIKit.framework/Headers as well as strip the
".framework" suffix when auto-completing the framework name.
llvm-svn: 355008
Matt Davis [Wed, 27 Feb 2019 17:39:36 +0000 (17:39 +0000)]
Clean up the delimiters test.
Ideally this is a NFCI, used single quotes in most cases. Hopefully
this will make the Windows bot happy.
I've marked this unsupported on windows, until I get my windows box
setup with this patch to test. I'll remove that constraint after I'm
confident this will pass on windows. I just want to silence the
buildbots for now.
llvm-svn: 355007
Louis Dionne [Wed, 27 Feb 2019 17:33:25 +0000 (17:33 +0000)]
[libc++] Remove visibility-related warnings with Clang 8
The attributes were placed incorrectly -- they need to be after the
"struct" keyword, not before.
llvm-svn: 355006
Rong Xu [Wed, 27 Feb 2019 17:24:33 +0000 (17:24 +0000)]
Recommit r354930 "[PGO] Context sensitive PGO (part 1)"
Fixed UBSan failures.
llvm-svn: 355005
James Henderson [Wed, 27 Feb 2019 16:41:59 +0000 (16:41 +0000)]
[llvm-readobj]Add additional testing for various ELF features
This patch adds testing of areas of the code that are not fully tested,
in particular dynamic table printing, ELF type printing, handling of
edge cases where things are missing/empty (relocations/program header
tables/section header table), and the --string-dump switch.
Reviewed by: grimar, higuoxing, rupprecht
Differential Revision: https://reviews.llvm.org/D58677
llvm-svn: 355003
Jonas Devlieghere [Wed, 27 Feb 2019 16:40:08 +0000 (16:40 +0000)]
[Reproducers] Add more logging to reproducer instrumentation
Debugging issues with instrumentation capture and replay can be
particularly tricky, especially because part of the process takes places
even before the debugger is initialized. This patch adds more logging
capabilities to these classes, hidden behind a macro define.
Differential revision: https://reviews.llvm.org/D58566
llvm-svn: 355002
Xing GUO [Wed, 27 Feb 2019 16:37:15 +0000 (16:37 +0000)]
[llvm-objdump] Should print strings when dumping DT_RPATH, DT_RUNPATH, DT_SONAME, DT_AUXILIARY and DT_FILTER tags in dynamic section.
Summary:
Before:
```
Dynamic Section:
NEEDED libpthread.so.0
...
NEEDED ld-linux-x86-64.so.2
RPATH 0x00000000001c2e61
```
After:
```
Dynamic Section:
NEEDED libpthread.so.0
...
NEEDED ld-linux-x86-64.so.2
RPATH $ORIGIN/../lib
```
Only a small problem here, I have no idea on choosing test case. I see there's a test
file(test/tools/llvm-objdump/private-headers-dynamic-section.test). But it has no DT_RPATH and DT_RUNPATH tags. Shall I replace the ELF file in the
Inputs dir by a new one?
Reviewers: jhenderson, grimar
Reviewed By: jhenderson
Subscribers: srhines, rupprecht, jfb, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D58707
llvm-svn: 355001
Balazs Keri [Wed, 27 Feb 2019 16:31:48 +0000 (16:31 +0000)]
[ASTImporter] Improve import of FileID.
Summary:
Even if the content cache has a directory and filename, it may be a virtual file.
The old code returned with error in this case, but it is worth to try to handle
the file as it were a memory buffer.
Reviewers: a.sidorin, shafik, martong, a_sidorin
Reviewed By: shafik
Subscribers: efriedma, rnkovacs, cfe-commits, dkrupp, martong, Szelethus, gamesh411
Tags: #clang
Differential Revision: https://reviews.llvm.org/D57590
llvm-svn: 355000
Kostya Kortchinsky [Wed, 27 Feb 2019 16:30:05 +0000 (16:30 +0000)]
[scudo][standalone] Add a standalone vector class
Summary:
This CL adds a standalone vector class that will be used by the scoped
strings when they land. We reimplement our own vector class because we
can't use the std library one.
It's mostly borrowed from the current sanitizer_common one, with LLVM
code style changes.
Additionnally a casing change in a function name that slipped through
the previous review (the function isn't used yet).
Reviewers: vitalybuka, eugenis, flowerhack, dmmoore415, mcgrathr, morehouse
Reviewed By: vitalybuka
Subscribers: mgorny, delcypher, #sanitizers, llvm-commits
Tags: #llvm, #sanitizers
Differential Revision: https://reviews.llvm.org/D58689
llvm-svn: 354999
Matt Davis [Wed, 27 Feb 2019 16:29:50 +0000 (16:29 +0000)]
[llvm-cxxfilt] Split and demangle stdin input on certain non-alphanumerics.
Summary:
This patch attempts to replicate GNU c++-filt behavior when splitting stdin input for demangling.
Previously, cxx-filt would split input only on spaces. Each delimited item is then demangled.
From what I have tested, GNU c++filt also splits input on any character that does not make
up the mangled name (notably commas, but also a large set of non-alphanumeric characters).
This patch splits stdin input on any character that does not belong to the Itanium mangling
format (since Itanium is currently the only supported format in llvm-cxxfilt).
This is an update to PR39990
Reviewers: jhenderson, tejohnson, compnerd
Reviewed By: compnerd
Subscribers: erik.pilkington, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D58416
llvm-svn: 354998
Nikita Popov [Wed, 27 Feb 2019 16:18:29 +0000 (16:18 +0000)]
[InstCombine] Add additional add.sat overflow tests; NFC
Baseline for D58593.
llvm-svn: 354996
Marshall Clow [Wed, 27 Feb 2019 16:09:35 +0000 (16:09 +0000)]
I changed a 'enable_if<...>::type to' 'enable_if_t<...>' but forgot to remove the preceding 'typename'
llvm-svn: 354995
Dmitri Gribenko [Wed, 27 Feb 2019 16:08:04 +0000 (16:08 +0000)]
Added documentation for clangd v9+ features
Reviewers: ilya-biryukov
Subscribers: ioeric, MaskRay, jkorous, arphaman, kadircet, jdoerfert, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D58717
llvm-svn: 354994
Sanjay Patel [Wed, 27 Feb 2019 15:59:30 +0000 (15:59 +0000)]
[InstCombine] regenerate complete checks; NFC
llvm-svn: 354993
Dmitri Gribenko [Wed, 27 Feb 2019 15:53:05 +0000 (15:53 +0000)]
Added more detailed documentation for clangd
Summary:
The text was written mostly by Sam McCall, screenshots are mostly made
by me.
Reviewers: ilya-biryukov
Subscribers: ioeric, MaskRay, jkorous, arphaman, kadircet, jdoerfert, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D58710
llvm-svn: 354992
Nico Weber [Wed, 27 Feb 2019 15:46:51 +0000 (15:46 +0000)]
gn build: Merge r354989
llvm-svn: 354991
Yaxun Liu [Wed, 27 Feb 2019 15:46:29 +0000 (15:46 +0000)]
[NFC] minor revision of r354929 [CUDA][HIP] Check calling convention based on function target
Add comments and move a variable to if block.
Differential Revision: https://reviews.llvm.org/D57716
llvm-svn: 354990
Nico Weber [Wed, 27 Feb 2019 15:44:03 +0000 (15:44 +0000)]
hwasan: Rename source files from cc to cpp
As discussed elsewhere: LLVM uses cpp as its C++ source extension; the
sanitizers should too. This updates files in hwasan.
Patch generated by
for f in lib/hwasan/*.cc ; do svn mv $f ${f%.cc}.cpp; done
followed by
for f in lib/hwasan/*.cpp ; do sed -i '' -e '1s/\.cc -/.cpp /' $f; done
CMakeLists.txt updated manually.
Differential Revision: https://reviews.llvm.org/D58620
llvm-svn: 354989
Marshall Clow [Wed, 27 Feb 2019 15:41:37 +0000 (15:41 +0000)]
Implment the last part of P1024: tuple-like interface to span. Reviewed as https://reviews.llvm.org/D58706.
llvm-svn: 354988
Nico Weber [Wed, 27 Feb 2019 15:29:14 +0000 (15:29 +0000)]
gn build: Merge r354692
llvm-svn: 354987
Eugene Leviant [Wed, 27 Feb 2019 14:46:59 +0000 (14:46 +0000)]
[DebugInfo] Apply subprogram attributes on behalf of owner CU
When using full LTO it is possible that template function definition DIE
is bound to one compilation unit and it's declaration to another. We should
add function declaration attributes on behalf of its owner CU otherwise
we may end up with malformed file identifier in function declaration
DW_AT_decl_file attribute.
Differential revision: https://reviews.llvm.org/D58538
llvm-svn: 354978
Pavel Labath [Wed, 27 Feb 2019 14:26:48 +0000 (14:26 +0000)]
Remove XFAIL-Linux from two asan tests
It turns out these tests actually succeed, if one has a clang with
address sanitizer support enabled (i.e., has enabled the compiler-rt
project). I guess none of the linux lldb devs have done that until now.
llvm-svn: 354976
Pavel Labath [Wed, 27 Feb 2019 14:16:48 +0000 (14:16 +0000)]
Insert blocks of python code with swig instead of modify-python-lldb.py
Summary:
Swig is perfectly capable of inserting blocks of python code into its
output (and we use those fascilities already), so there's no need for
this to be done in a post-process step.
lldb_iter is a general-purpose utility used from many classes, so I add
it to the main swig file. The other two blocks are tied to a specific
class, so I add it to the interface file of that class.
Reviewers: zturner, jingham, serge-sans-paille
Subscribers: jdoerfert, lldb-commits
Differential Revision: https://reviews.llvm.org/D58350
llvm-svn: 354975
Dmitry Preobrazhensky [Wed, 27 Feb 2019 13:58:48 +0000 (13:58 +0000)]
[AMDGPU][MC] Added register size check for VOP3/SDWA/DPP operands
See bug 37943: https://bugs.llvm.org/show_bug.cgi?id=37943
Reviewers: artem.tamazov, arsenm, rampitec
Differential Revision: https://reviews.llvm.org/D58287
llvm-svn: 354974
Alexey Lapshin [Wed, 27 Feb 2019 13:17:36 +0000 (13:17 +0000)]
[DebugInfo] add SectionedAddress to DebugInfo interfaces.
That patch is the fix for https://bugs.llvm.org/show_bug.cgi?id=40703
"wrong line number info for obj file compiled with -ffunction-sections"
bug. The problem happened with only .o files. If object file contains
several .text sections then line number information showed incorrectly.
The reason for this is that DwarfLineTable could not detect section which
corresponds to specified address(because address is the local to the
section). And as the result it could not select proper sequence in the
line table. The fix is to pass SectionIndex with the address. So that it
would be possible to differentiate addresses from various sections. With
this fix llvm-objdump shows correct line numbers for disassembled code.
Differential review: https://reviews.llvm.org/D58194
llvm-svn: 354972
Dmitry Preobrazhensky [Wed, 27 Feb 2019 13:12:12 +0000 (13:12 +0000)]
[AMDGPU][MC][GFX8+] Added syntactic sugar for 'vgpr index' operand of instructions s_set_gpr_idx_on and s_set_gpr_idx_mode
See bug 39331: https://bugs.llvm.org/show_bug.cgi?id=39331
Reviewers: artem.tamazov, arsenm
Differential Revision: https://reviews.llvm.org/D58288
llvm-svn: 354969
Hans Wennborg [Wed, 27 Feb 2019 13:11:37 +0000 (13:11 +0000)]
AttrDocs.td: fix broken bullet-point indentation
llvm-svn: 354968
Eric Liu [Wed, 27 Feb 2019 11:42:37 +0000 (11:42 +0000)]
[clangd] Improve global code completion when scope specifier is unresolved.
Summary:
Suppose `clangd::` is unresolved in the following example. Currently,
we simply use "clangd::" as the query scope. We can do better by combining with
accessible scopes in the context. The query scopes can be `{clangd::, clang::clangd::}`.
```
namespace clang { clangd::^ }
```
Reviewers: ilya-biryukov, sammccall, hokein, kadircet
Reviewed By: kadircet
Subscribers: MaskRay, jkorous, arphaman, kadircet, jdoerfert, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D58448
llvm-svn: 354963
George Rimar [Wed, 27 Feb 2019 11:18:27 +0000 (11:18 +0000)]
[llvm-objcopy] - Check for invalidated relocations when removing a section.
This is https://bugs.llvm.org/show_bug.cgi?id=40818
Removing a section that is used by relocation is an error
we did not report. The patch fixes that.
Differential revision: https://reviews.llvm.org/D58625
llvm-svn: 354962