Louis Dionne [Fri, 1 Mar 2019 22:55:15 +0000 (22:55 +0000)]
[libc++abi] Specify unwind lib before other system libraries when linking
This matters on OSX because static linking orders is also the order dyld
uses to search for libs (the default - Two-level namespace). If system
libs (including unwind lib) are specified before local unwind lib, local
unwind lib would never be picked up by dyld.
Before:
$ otool -L lib/libc++abi.dylib
@rpath/libc++abi.1.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.200.5)
@rpath/libunwind.1.dylib (compatibility version 1.0.0, current version 1.0.0)
After:
$ otool -L lib/libc++abi.dylib
@rpath/libc++abi.1.dylib (compatibility version 1.0.0, current version 1.0.0)
@rpath/libunwind.1.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.200.5)
Thanks to Yuanfang Chen for the patch.
Differential Revision: https://reviews.llvm.org/D57496
llvm-svn: 355241
Sam Clegg [Fri, 1 Mar 2019 22:35:47 +0000 (22:35 +0000)]
[WebAssebmly] Allow __wasm_call_ctors to be GC'ed
Differential Revision: https://reviews.llvm.org/D58806
llvm-svn: 355240
Julian Lettner [Fri, 1 Mar 2019 22:35:40 +0000 (22:35 +0000)]
[NFC][Sanitizer] Test unexpectedly passes on ppc64be bot
llvm-svn: 355239
Adrian Prantl [Fri, 1 Mar 2019 22:30:31 +0000 (22:30 +0000)]
Delete commented-out code.
llvm-svn: 355238
Martin Storsjo [Fri, 1 Mar 2019 22:30:17 +0000 (22:30 +0000)]
[CMake] Don't use llvm_replace_compiler_option
Building compiler-rt standalone outside of the main llvm
tree is supported, and in this case, the llvm cmake modules
are unavailable. (And even if they are available, it requires
including LLVMProcessSources.cmake, which currently isn't
included.)
This fixes building compiler-rt standalone with MSVC/clang-cl.
Differential Revision: https://reviews.llvm.org/D58767
llvm-svn: 355237
Martin Storsjo [Fri, 1 Mar 2019 22:30:14 +0000 (22:30 +0000)]
[sanitizers] Don't use Windows Trace Logging on MinGW
mingw-w64 currently is lacking the headers for this feature.
Make the include lowercase at the same time. We consistently
use lowercase for windows header includes, as windows itself is
case insensitive, the SDK headers (in general, not necessarily
considering this particular header) aren't consistent among themselves
about what the proper canonical capitalization for headers are,
and MinGW uses all lowercase names for the headers (as it is often
used on case sensitive filesystems).
In case mingw-w64 later gets this header, we can revert this
(but keep the include lowercased).
Differential Revision: https://reviews.llvm.org/D58765
llvm-svn: 355236
Paul Robinson [Fri, 1 Mar 2019 22:28:13 +0000 (22:28 +0000)]
Try to fix Windows bots after r355226.
Windows has two path separator characters.
llvm-svn: 355235
Julian Lettner [Fri, 1 Mar 2019 22:26:45 +0000 (22:26 +0000)]
[NFC][Sanitizer][Windows] Fix refactoring oversight
Fix mistake in previous commit:
9fe3b4906f351292691cd594b30fe6cf7230b94d
llvm-svn: 355234
Jonas Devlieghere [Fri, 1 Mar 2019 22:14:24 +0000 (22:14 +0000)]
[DWARFFormValue] Cleanup DWARFFormValue interface. (2/2) (NFC)
Continues the work started in r354941. Changes (all but one) uses of the
extractValue to static createFromData.
llvm-svn: 355233
Julian Lettner [Fri, 1 Mar 2019 22:10:49 +0000 (22:10 +0000)]
[NFC][Sanitizer] Make GetStackTrace a private method of BufferedStackTrace
GetStackTrace is a implementation detail of BufferedStackTrace. Make it
a private method.
Reviewed By: vitalybuka
Differential-Revision: https://reviews.llvm.org/D58753
llvm-svn: 355232
Evgeniy Stepanov [Fri, 1 Mar 2019 21:59:18 +0000 (21:59 +0000)]
[sanitizer] Fix return type of __bzero and __aeabi_mem* interceptors.
llvm-svn: 355231
Evgeniy Stepanov [Fri, 1 Mar 2019 21:49:40 +0000 (21:49 +0000)]
Revert "[sanitizer] Fix return type of __bzero and __aeabi_mem* interceptors."
This change is incomplete.
llvm-svn: 355230
Stefan Pintilie [Fri, 1 Mar 2019 21:16:45 +0000 (21:16 +0000)]
[OPENMP] Deal with additional store inserted by Clang under -fno-PIC for PowerPC.
Changing the default from -fPIC to -fno-PIC on PowerPC exposed an issue in
OpenMP for PowerPC.
The issue is reported here:
https://bugs.llvm.org/show_bug.cgi?id=40082
This is a fix for that issue.
Also removed the XFAIL from the two tests that were failing under -fno-PIC.
Differential Revision: https://reviews.llvm.org/D56286
llvm-svn: 355229
Craig Topper [Fri, 1 Mar 2019 21:02:40 +0000 (21:02 +0000)]
[X86] Remove IntrArgMemOnly from target specific gather/scatter intrinsics
IntrArgMemOnly implies that only memory pointed to by pointer typed arguments will be accessed. But these intrinsics allow you to pass null to the pointer argument and put the full address into the index argument. Other passes won't be able to understand this.
A colleague found that ISPC was creating gathers like this and then dead store elimination removed some stores because it didn't understand what the gather was doing since the pointer argument was null.
Differential Revision: https://reviews.llvm.org/D58805
llvm-svn: 355228
Craig Topper [Fri, 1 Mar 2019 21:02:34 +0000 (21:02 +0000)]
[X86] Add test case for D58805. NFC
This demonstrates dead store elimination removing a store that may alias a gather that uses null as its base.
llvm-svn: 355227
Paul Robinson [Fri, 1 Mar 2019 20:58:04 +0000 (20:58 +0000)]
[DWARF] Make -g with empty assembler source work better.
This was sometimes causing clang or llvm-mc to crash, and in other
cases could emit a bogus DWARF line-table header. I did an interim
patch in r352541; this patch should be a cleaner and more complete
fix, and retains the test.
Addresses PR40538.
Differential Revision: https://reviews.llvm.org/D58750
llvm-svn: 355226
Evgeniy Stepanov [Fri, 1 Mar 2019 20:54:16 +0000 (20:54 +0000)]
[sanitizer] Fix return type of __bzero and __aeabi_mem* interceptors.
They return void, unlike memset/memcpy/memmove.
llvm-svn: 355225
Craig Topper [Fri, 1 Mar 2019 20:18:38 +0000 (20:18 +0000)]
[TableGen][SelectionDAG][X86] Add specific isel matchers for immAllZerosV/immAllOnesV. Remove bitcasts from X86 patterns that are no longer necessary.
Previously we had build_vector PatFrags that called ISD::isBuildVectorAllZeros/Ones. Internally the ISD::isBuildVectorAllZeros/Ones look through bitcasts, but we aren't able to take advantage of that in isel. Instead of we have to canonicalize the types of the all zeros/ones build_vectors and insert bitcasts. Then we have to pattern match those exact bitcasts.
By emitting specific matchers for these 2 nodes, we can make isel look through any bitcasts without needing to explicitly match them. We should also be able to remove the canonicalization to vXi32 from lowering, but I've left that for a follow up.
This removes something like 40,000 bytes from the X86 isel table.
Differential Revision: https://reviews.llvm.org/D58595
llvm-svn: 355224
Nikita Popov [Fri, 1 Mar 2019 20:07:04 +0000 (20:07 +0000)]
[ValueTracking] Known bits support for unsigned saturating add/sub
We have two sources of known bits:
1. For adds leading ones of either operand are preserved. For sub
leading zeros of LHS and leading ones of RHS become leading zeros in
the result.
2. The saturating math is a select between add/sub and an all-ones/
zero value. As such we can carry out the add/sub known bits
calculation, and only preseve the known one/zero bits respectively.
Differential Revision: https://reviews.llvm.org/D58329
llvm-svn: 355223
Philip Reames [Fri, 1 Mar 2019 19:50:36 +0000 (19:50 +0000)]
[InstCombine] Extend saturating idempotent atomicrmw transform to FP
I'm assuming that the nan propogation logic for InstructonSimplify's handling of fadd and fsub is correct, and applying the same to atomicrmw.
Differential Revision: https://reviews.llvm.org/D58836
llvm-svn: 355222
Sanjay Patel [Fri, 1 Mar 2019 19:42:40 +0000 (19:42 +0000)]
[InstCombine] move add after umin/umax
In the motivating cases from PR14613:
https://bugs.llvm.org/show_bug.cgi?id=14613
...moving the add enables us to narrow the
min/max which eliminates zext/trunc which
enables signficantly better vectorization.
But that bug is still not completely fixed.
https://rise4fun.com/Alive/5KQ
Name: umax
Pre: C1 u>= C0
%a = add nuw i8 %x, C0
%cond = icmp ugt i8 %a, C1
%r = select i1 %cond, i8 %a, i8 C1
=>
%c2 = icmp ugt i8 %x, C1-C0
%u2 = select i1 %c2, i8 %x, i8 C1-C0
%r = add nuw i8 %u2, C0
Name: umin
Pre: C1 u>= C0
%a = add nuw i32 %x, C0
%cond = icmp ult i32 %a, C1
%r = select i1 %cond, i32 %a, i32 C1
=>
%c2 = icmp ult i32 %x, C1-C0
%u2 = select i1 %c2, i32 %x, i32 C1-C0
%r = add nuw i32 %u2, C0
llvm-svn: 355221
Sanjay Patel [Fri, 1 Mar 2019 19:42:34 +0000 (19:42 +0000)]
[InstCombine] add tests for umin/umax narrowing (PR14613); NFC
llvm-svn: 355220
Vlad Tsyrklevich [Fri, 1 Mar 2019 18:58:22 +0000 (18:58 +0000)]
Revert "[MIPS GlobalISel] Fix mul operands"
This reverts commit r355178, it is causing ASan failures on the
sanitizer bots.
llvm-svn: 355219
Peter Collingbourne [Fri, 1 Mar 2019 18:53:41 +0000 (18:53 +0000)]
ELF: Change FileSize back to a uint64_t.
This lets us detect file size overflows when creating a 64-bit binary on
a 32-bit machine.
Differential Revision: https://reviews.llvm.org/D58840
llvm-svn: 355218
Philip Reames [Fri, 1 Mar 2019 18:45:05 +0000 (18:45 +0000)]
[LICM] Infer proper alignment from loads during scalar promotion
This patch fixes an issue where we would compute an unnecessarily small alignment during scalar promotion when no store is not to be guaranteed to execute, but we've proven load speculation safety. Since speculating a load requires proving the existing alignment is valid at the new location (see Loads.cpp), we can use the alignment fact from the load.
For non-atomics, this is a performance problem. For atomics, this is a correctness issue, though an *incredibly* rare one to see in practice. For atomics, we might not be able to lower an improperly aligned load or store (i.e. i32 align 1). If such an instruction makes it all the way to codegen, we *may* fail to codegen the operation, or we may simply generate a slow call to a library function. The part that makes this super hard to see in practice is that the memory location actually *is* well aligned, and instcombine knows that. So, to see a failure, you have to have a) hit the bug in LICM, b) somehow hit a depth limit in InstCombine/ValueTracking to avoid fixing the alignment, and c) then have generated an instruction which fails codegen rather than simply emitting a slow libcall. All around, pretty hard to hit.
Differential Revision: https://reviews.llvm.org/D58809
llvm-svn: 355217
Rong Xu [Fri, 1 Mar 2019 18:36:24 +0000 (18:36 +0000)]
[PGO] Remove the default parameter in ProfileSummary API. NFC
Remove the default parameter in setProfileSummary() and getSummary().
This is a follow-up of r355131.
llvm-svn: 355216
Philip Reames [Fri, 1 Mar 2019 18:24:05 +0000 (18:24 +0000)]
[Tests] More missing atomicrmw combines
llvm-svn: 355215
Evgeniy Stepanov [Fri, 1 Mar 2019 18:22:44 +0000 (18:22 +0000)]
[msan] Add an interceptor for ttyname().
llvm-svn: 355214
Jim Ingham [Fri, 1 Mar 2019 18:13:38 +0000 (18:13 +0000)]
Resubmit r354706 with a fix for process launch.
When the debugger is run in sync mode, you need to
be able to tell whether a hijacked resume is for some
special purpose (like waiting for the SIGSTOP on attach)
or just to perform a synchronous resume. Target::Launch was doing
that wrong, and that caused stop-hooks on process launch
in source files to behave incorrectly.
<rdar://problem/
48115661>
Differential Revision: https://reviews.llvm.org/D58727
llvm-svn: 355213
Philip Reames [Fri, 1 Mar 2019 18:10:37 +0000 (18:10 +0000)]
[Tests] Add tests for missed optimizations of saturating and idempotent FP atomicrmws
llvm-svn: 355212
Matt Davis [Fri, 1 Mar 2019 18:01:41 +0000 (18:01 +0000)]
[lld][test] Fix tests. llvm-readobj now emits symbol section names.
This is the result of patch
99e9c4cad08164b9c0ca565ab9ad48ce132e98e5
See the related patch https://reviews.llvm.org/D58796
llvm-svn: 355211
Philip Reames [Fri, 1 Mar 2019 18:00:07 +0000 (18:00 +0000)]
[InstCombine] Extend "idempotent" atomicrmw optimizations to floating point
An idempotent atomicrmw is one that does not change memory in the process of execution. We have already added handling for the various integer operations; this patch extends the same handling to floating point operations which were recently added to IR.
Note: At the moment, we canonicalize idempotent fsub to fadd when ordering requirements prevent us from using a load. As discussed in the review, I will be replacing this with canonicalizing both floating point ops to integer ops in the near future.
Differential Revision: https://reviews.llvm.org/D58251
llvm-svn: 355210
Rong Xu [Fri, 1 Mar 2019 17:50:20 +0000 (17:50 +0000)]
[PGO] Use the explicit parameter in ProfileSummary API. NFC
Use the explicit parameter in setProfileSummary() and getSummary().
This is a follow-up of r355131.
llvm-svn: 355209
Thomas Lively [Fri, 1 Mar 2019 17:43:55 +0000 (17:43 +0000)]
Revert "[WebAssembly] Lower SIMD shifts since they are fixed in V8"
They weren't fixed in V8. Oops.
llvm-svn: 355208
Matt Davis [Fri, 1 Mar 2019 17:31:32 +0000 (17:31 +0000)]
[llvm-readobj] Display section names for STT_SECTION symbols.
Summary:
This patch will obtain the section name for symbols that refer to a section. Prior to this patch the Name field for STT_SECTIONs was blank, now it is populated.
Before:
```
Symbol table '.symtab' contains 6 entries:
Num: Value Size Type Bind Vis Ndx Name
0:
0000000000000000 0 NOTYPE LOCAL DEFAULT UND
1:
0000000000000000 0 SECTION LOCAL DEFAULT 1
2:
0000000000000000 0 SECTION LOCAL DEFAULT 3
3:
0000000000000000 0 SECTION LOCAL DEFAULT 4
4:
0000000000000000 0 NOTYPE GLOBAL DEFAULT UND _GLOBAL_OFFSET_TABLE_
5:
0000000000000000 0 TLS GLOBAL DEFAULT UND sym
```
With this patch:
```
Symbol table '.symtab' contains 6 entries:
Num: Value Size Type Bind Vis Ndx Name
0:
0000000000000000 0 NOTYPE LOCAL DEFAULT UND
1:
0000000000000000 0 SECTION LOCAL DEFAULT 1 .text
2:
0000000000000000 0 SECTION LOCAL DEFAULT 3 .data
3:
0000000000000000 0 SECTION LOCAL DEFAULT 4 .bss
4:
0000000000000000 0 NOTYPE GLOBAL DEFAULT UND _GLOBAL_OFFSET_TABLE_
5:
0000000000000000 0 TLS GLOBAL DEFAULT UND sym
```
This fixes PR40788
Reviewers: jhenderson, rupprecht, espindola
Reviewed By: rupprecht
Subscribers: emaste, javed.absar, arichardson, MaskRay, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D58796
llvm-svn: 355207
Sanjay Patel [Fri, 1 Mar 2019 17:29:10 +0000 (17:29 +0000)]
[InstCombine] add tests for add+umin/umax canonicalization; NFC
Fixing this should solve the biggest part of the vector problems seen in:
https://bugs.llvm.org/show_bug.cgi?id=14613
llvm-svn: 355206
Jonas Hahnfeld [Fri, 1 Mar 2019 17:15:21 +0000 (17:15 +0000)]
Hide two unused debugging methods, NFCI.
GCC correctly moans that PlainCFGBuilder::isExternalDef(llvm::Value*) and
StackSafetyDataFlowAnalysis::verifyFixedPoint() are defined but not used
in Release builds. Hide them behind 'ifndef NDEBUG'.
llvm-svn: 355205
Clement Courbet [Fri, 1 Mar 2019 16:42:08 +0000 (16:42 +0000)]
Reland "[compiler-rt] Intercept the bcmp() function."
Fix test issues on darwin: The REQUIRES for the test should be the same as the
guard for whether we intercept bcmp.
llvm-svn: 355204
Kostya Kortchinsky [Fri, 1 Mar 2019 15:46:23 +0000 (15:46 +0000)]
[scudo][standalone] Fix tests makefile
Summary:
A missing `STATIC` entailed some annoying to debug failures wrt 32 vs 64
binaries. Additionally I noticed I was using the wrong variable (the Scudo
one as opposed to the Scudo Standalone one).
See https://reviews.llvm.org/D58184#
1412417 and below for discussion.
Reviewers: vitalybuka, eugenis, brzycki
Reviewed By: vitalybuka, brzycki
Subscribers: mgorny, delcypher, #sanitizers, llvm-commits
Tags: #llvm, #sanitizers
Differential Revision: https://reviews.llvm.org/D58794
llvm-svn: 355203
Manman Ren [Fri, 1 Mar 2019 15:25:24 +0000 (15:25 +0000)]
Try to fix NetBSD buildbot breakage introduced in D57463.
By including the header file in the source.
llvm-svn: 355202
Oliver Stannard [Fri, 1 Mar 2019 14:20:28 +0000 (14:20 +0000)]
[ARM] Fix FP16 stack loads/stores for Thumb2 with frame pointer
The new addressing mode added for the v8.2A FP16 instructions uses bit 8 of the
immediate to encode the sign of the offset, like the other FP loads/stores, so
need to be treated the same way.
Differential revision: https://reviews.llvm.org/D58816
llvm-svn: 355201
Eric Liu [Fri, 1 Mar 2019 14:17:55 +0000 (14:17 +0000)]
[clangd] Enable SuggestMissingIncludes by default.
Summary: This seems to work stably now. Turn on by default.
Reviewers: kadircet
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D58772
llvm-svn: 355200
Oliver Stannard [Fri, 1 Mar 2019 13:58:25 +0000 (13:58 +0000)]
[ARM] Consider undefined-on-NaN conditions in checkVSELConstraints
This function was not checking for the condition code variants which are
undefined if either input is NaN, so we were missing selection of the VSEL
instruction in some cases when using -fno-honor-nans or -ffast-math.
Differential revision: https://reviews.llvm.org/D58812
llvm-svn: 355199
Simon Pilgrim [Fri, 1 Mar 2019 13:13:40 +0000 (13:13 +0000)]
[X86] Regenerate legalize test files
Noticed while getting update_mir_test_checks.py to work on python3
llvm-svn: 355198
Simon Pilgrim [Fri, 1 Mar 2019 12:08:50 +0000 (12:08 +0000)]
[Thumb] Add some integer abs testcases for different typesizes.
Committed on behalf of @ikulagin (Ivan Kulagin)
Differential Revision: https://reviews.llvm.org/D52138
llvm-svn: 355197
George Rimar [Fri, 1 Mar 2019 10:58:45 +0000 (10:58 +0000)]
[LLD][ELF] - Convert 3 testcases to use yaml instead of binaries.
This change makes 3 tests to use yaml instead of binaries.
Differential revision: https://reviews.llvm.org/D58780
llvm-svn: 355196
Peter Smith [Fri, 1 Mar 2019 10:52:25 +0000 (10:52 +0000)]
[ELF][ARM] Fix clang-armv7-linux-build-cache builds of LLD [NFC]
r355153 introduced a build failure on a build bot that uses clang natively
on an armv7-a machine. This a temporary fix to use size_t rather than
uint64_t.
llvm-svn: 355195
George Rimar [Fri, 1 Mar 2019 10:37:51 +0000 (10:37 +0000)]
[LLD][ELF] - Convert invalid/undefined-local-symbol-in-dso.test to use YAML
This removes a binary from the inputs and reduces the test case.
Differential revision: https://reviews.llvm.org/D58783
llvm-svn: 355194
George Rimar [Fri, 1 Mar 2019 10:18:16 +0000 (10:18 +0000)]
[yaml2obj] - Allow setting custom sh_info for RawContentSection sections.
This is for tweaking SHT_SYMTAB sections.
Their sh_info contains the (number of symbols + 1) usually.
But for creating invalid inputs for test cases it would be convenient
to allow explicitly override this field from YAML.
Differential revision: https://reviews.llvm.org/D58779
llvm-svn: 355193
Alexey Lapshin [Fri, 1 Mar 2019 10:15:18 +0000 (10:15 +0000)]
Attempt to fix buildbot after r354972 [#2]. NFCI.
llvm-svn: 355192
Diana Picus [Fri, 1 Mar 2019 10:12:28 +0000 (10:12 +0000)]
[ARM GlobalISel] Support G_CTLZ for Thumb2
Same as ARM mode but with different opcode.
llvm-svn: 355191
Pierre Gousseau [Fri, 1 Mar 2019 10:05:15 +0000 (10:05 +0000)]
[Driver] Allow enum SanitizerOrdinal to represent more than 64 different sanitizer checks, NFC.
enum SanitizerOrdinal has reached maximum capacity, this change extends the capacity to 128 sanitizer checks.
This can eventually allow us to add gcc 8's options "-fsanitize=pointer-substract" and "-fsanitize=pointer-compare".
This is a recommit of r354873 but with a fix for unqualified lookup error in lldb cmake build bot.
Fixes: https://llvm.org/PR39425
Differential Revision: https://reviews.llvm.org/D57914
llvm-svn: 355190
Diana Picus [Fri, 1 Mar 2019 10:01:22 +0000 (10:01 +0000)]
[ARM GlobalISel] Check target flags in test. NFCI
There was a time when we couldn't dump target-specific flags such as
arm-sbrel etc, so the tests didn't check for them. We can now be more
specific in our tests.
llvm-svn: 355189
Fangrui Song [Fri, 1 Mar 2019 09:52:53 +0000 (09:52 +0000)]
Fix file headers. NFC
llvm-svn: 355188
Nicola Zaghen [Fri, 1 Mar 2019 09:46:29 +0000 (09:46 +0000)]
[Tablegen] Add support for the !mul operator.
This is a small addition to arithmetic operations that improves
expressiveness of the language.
Differential Revision: https://reviews.llvm.org/D58775
llvm-svn: 355187
Oliver Stannard [Fri, 1 Mar 2019 09:26:21 +0000 (09:26 +0000)]
[ARM] Add armv8a triple to test check updaters
llvm-svn: 355186
Igor Kudrin [Fri, 1 Mar 2019 09:22:42 +0000 (09:22 +0000)]
[CommandLine] Allow grouping options which can have values.
This patch allows all forms of values for options to be used at the end
of a group. With the fix, it is possible to follow the way GNU binutils
tools handle grouping options better. For example, the -j option can be
used with objdump in any of the following ways:
$ objdump -d -j .text a.o
$ objdump -d -j.text a.o
$ objdump -dj .text a.o
$ objdump -dj.text a.o
Differential Revision: https://reviews.llvm.org/D58711
llvm-svn: 355185
Igor Kudrin [Fri, 1 Mar 2019 09:20:56 +0000 (09:20 +0000)]
[CommandLine] Do not crash if an option has both ValueRequired and Grouping.
If an option, which requires a value, has a `cl::Grouping` formatting
modifier, it works well as far as it is used at the end of a group,
or as a separate argument. However, if the option appears accidentally
in the middle of a group, the program just crashes. This patch prints
an error message instead.
Differential Revision: https://reviews.llvm.org/D58499
llvm-svn: 355184
James Henderson [Fri, 1 Mar 2019 09:12:38 +0000 (09:12 +0000)]
[llvm-readobj]Add test showing behaviour of thin archive member path printing
This was a test requested in https://reviews.llvm.org/D58677.
Reviewed by: rupprecht, grimar, Higuoxing
Differential Revision: https://reviews.llvm.org/D5877
llvm-svn: 355183
Paul Hoad [Fri, 1 Mar 2019 09:09:54 +0000 (09:09 +0000)]
[clang-format] [NFC] clang-format the Format library
Previously revisions commited non-clang-formatted changes to the Format library, this means submitting any revision e.g. {D55170} can cause additional whitespace changes to potentially be included in a revision.
Commit a non functional change using latest build Windows clang-format r351376 with no other changes, to remove these differences
All FormatTests
pass [==========] 652 tests from 20 test cases ran.
llvm-svn: 355182
Alexander Potapenko [Fri, 1 Mar 2019 09:00:41 +0000 (09:00 +0000)]
CodeGen: Fix PR40605 by splitting constant struct initializers
When emitting initializers for local structures for code built with
-ftrivial-auto-var-init, replace constant structures with sequences of
stores.
This appears to greatly help removing dead initialization stores to those
locals that are later overwritten by other data.
This also removes a lot of .rodata constants (see PR40605), replacing most
of them with immediate values (for Linux kernel the .rodata size is
reduced by ~1.9%)
llvm-svn: 355181
Martin Storsjo [Fri, 1 Mar 2019 08:08:11 +0000 (08:08 +0000)]
[sanitizers] Explicitly use GetModuleFileNameW with wchar_t
Alternatively we could define the string as TCHAR.
Differential Revision: https://reviews.llvm.org/D58766
llvm-svn: 355180
Stanislav Mekhanoshin [Fri, 1 Mar 2019 07:59:17 +0000 (07:59 +0000)]
[AMDGPU] Mark ds instructions as meybeAtomic
These were not recognized as potential atomics by memory legalizer.
The test was working not because legalizer did a right thing, but
because it has skipped all these instructions. When I have fixed
DS desciption test started to fail because region address has
changed from 4 to 2 a while ago.
Differential Revision: https://reviews.llvm.org/D58802
llvm-svn: 355179
Petar Avramovic [Fri, 1 Mar 2019 07:35:57 +0000 (07:35 +0000)]
[MIPS GlobalISel] Fix mul operands
Unsigned mul high for MIPS32 is selected into two PseudoInstructions:
PseudoMULTu and PseudoMFHI that use accumulator register class ACC64 for
some of its operands. Registers in this class have appropriate hi and lo
register as subregisters: $lo0 and $hi0 are subregisters of $ac0 etc.
mul instruction implicit-defs $lo0 and $hi0 according to MipsInstrInfo.td.
In functions where mul and PseudoMULTu are present fastRegisterAllocator
will "run out of registers during register allocation" because
'calcSpillCost' for $ac0 will return spillImpossible because subregisters
$lo0 and $hi0 of $ac0 are reserved by mul instruction above. A solution is
to mark implicit-defs of $lo0 and $hi0 as dead in mul instruction.
Differential Revision: https://reviews.llvm.org/D58715
llvm-svn: 355178
Petar Avramovic [Fri, 1 Mar 2019 07:25:44 +0000 (07:25 +0000)]
[MIPS GlobalISel] Select G_UMULH
Legalize G_UMULO and select G_UMULH for MIPS32.
Differential Revision: https://reviews.llvm.org/D58714
llvm-svn: 355177
Fangrui Song [Fri, 1 Mar 2019 06:49:51 +0000 (06:49 +0000)]
Fix file headers. NFC
llvm-svn: 355176
Akira Hatanaka [Fri, 1 Mar 2019 06:43:20 +0000 (06:43 +0000)]
[Sema][ObjC] Allow silencing -Wobjc-designated-initializers warnings by
declaring an unavailable method in the subclass's extension that
overrides the designated initializer in the base class.
r243676 made changes to allow declaring the unavailable method in the
subclass interface to silence the warning. This commit additionally
allows declaring the unavailable method in the class extension.
rdar://problem/
42731306
llvm-svn: 355175
Fangrui Song [Fri, 1 Mar 2019 05:27:01 +0000 (05:27 +0000)]
[ConstantHoisting] Call cleanup() in ConstantHoistingPass::runImpl to avoid dangling elements in ConstIntInfoVec for new PM
Summary:
ConstIntInfoVec contains elements extracted from the previous function.
In new PM, releaseMemory() is not called and the dangling elements can
cause segfault in findConstantInsertionPoint.
Rename releaseMemory() to cleanup() to deliver the idea that it is
mandatory and call cleanup() in ConstantHoistingPass::runImpl to fix
this.
Reviewers: ormris, zzheng, dmgreen, wmi
Reviewed By: ormris, wmi
Subscribers: llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D58589
llvm-svn: 355174
Fangrui Song [Fri, 1 Mar 2019 04:49:42 +0000 (04:49 +0000)]
[ELF] Explain some options in ld.lld.1
Reviewers: ruiu, grimar
Reviewed By: ruiu
Subscribers: srhines, jdoerfert, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D58669
llvm-svn: 355173
Julian Lettner [Fri, 1 Mar 2019 04:03:38 +0000 (04:03 +0000)]
[NFC][Sanitizer] Add new BufferedStackTrace::Unwind API
Retrying without replacing call sites in sanitizer_common (which might
not have a symbol definition).
Add new Unwind API. This is the final envisioned API with the correct
abstraction level. It hides/slow fast unwinder selection from the caller
and doesn't take any arguments that would leak that abstraction (i.e.,
arguments like stack_top/stack_bottom).
GetStackTrace will become an implementation detail (private method) of
the BufferedStackTrace class.
Reviewers: vitalybuka
Differential Revision: https://reviews.llvm.org/D58741
> llvm-svn: 355168
llvm-svn: 355172
Julian Lettner [Fri, 1 Mar 2019 03:35:05 +0000 (03:35 +0000)]
Revert "[NFC][Sanitizer] Add new BufferedStackTrace::Unwind API"
This reverts commit
6112f37e758ebf2405955e091a745f5003c1f562.
llvm-svn: 355171
Jason Molenda [Fri, 1 Mar 2019 03:34:51 +0000 (03:34 +0000)]
Update com.apple.diagnosticd.diagnostic entitlement
name to the newer com.apple.private.logging.diagnostic.
<rdar://problem/
47183116>
llvm-svn: 355170
Jason Molenda [Fri, 1 Mar 2019 03:24:59 +0000 (03:24 +0000)]
Increase timeout in Symbols::DownloadObjectAndSymbolFile
from 30 seconds to 120 seconds. We've seen cases where
this symbol lookup can exceed 30 seconds for people
working remotely.
<rdar://problem/
48460476>
llvm-svn: 355169
Julian Lettner [Fri, 1 Mar 2019 03:08:34 +0000 (03:08 +0000)]
[NFC][Sanitizer] Add new BufferedStackTrace::Unwind API
Add new Unwind API. This is the final envisioned API with the correct
abstraction level. It hides/slow fast unwinder selection from the caller
and doesn't take any arguments that would leak that abstraction (i.e.,
arguments like stack_top/stack_bottom).
GetStackTrace will become an implementation detail (private method) of
the BufferedStackTrace class.
Reviewers: vitalybuka
Differential Revision: https://reviews.llvm.org/D58741
llvm-svn: 355168
Craig Topper [Fri, 1 Mar 2019 02:19:26 +0000 (02:19 +0000)]
[Subtarget] Remove static global constructor call from the tablegened subtarget feature tables
Subtarget features are stored in a std::bitset that has been subclassed. There is a special constructor to allow the tablegen files to provide a list of bits to initialize the std::bitset to. This constructor isn't constexpr and std::bitset doesn't support many constexpr operations either. This results in a static global constructor being used to initialize the feature bitsets in these files at startup.
To fix this I've introduced a new FeatureBitArray class that holds three 64-bit values representing the initial bit values and taught tablegen to emit hex constants for them based on the feature enum values. This makes the tablegen files less readable than they were before. I can add the list of features back as a comment if we think that's important.
I've added a method to convert from this class into the std::bitset subclass we had before. I considered making the new FeatureBitArray class just implement the std::bitset interface we need instead, but thought I'd see how others felts about that first.
I've simplified the interfaces to SetImpliedBits and ClearImpliedBits a little minimize the number of times we need to convert to the bitset.
This removes about 27K from my local release+asserts build of llc.
Differential Revision: https://reviews.llvm.org/D58520
llvm-svn: 355167
Volodymyr Sapsai [Fri, 1 Mar 2019 02:15:39 +0000 (02:15 +0000)]
[CodeGen] Fix calling llvm.var.annotation outside of a basic block.
When we have an annotated local variable after a function returns, we
generate IR that fails verification with the error
> Instruction referencing instruction not embedded in a basic block!
And it means that bitcast referencing alloca doesn't have a parent basic
block.
Fix by checking if we are at an unreachable point and skip emitting
annotations. This approach is similar to the way we emit variable
initializer and debug info.
rdar://problem/
46200420
Reviewers: rjmccall
Reviewed By: rjmccall
Subscribers: aprantl, jkorous, dexonsmith, cfe-commits
Differential Revision: https://reviews.llvm.org/D58147
llvm-svn: 355166
Evgeniy Stepanov [Fri, 1 Mar 2019 02:06:58 +0000 (02:06 +0000)]
[hwasan] Disable vfork code when building w/o interceptors.
Don't define vfork when OMPILER_RT_HWASAN_WITH_INTERCEPTORS=OFF.
llvm-svn: 355165
Evgeniy Stepanov [Fri, 1 Mar 2019 01:45:01 +0000 (01:45 +0000)]
[sanitizer] Build everything whereever possible with -z text.
Reviewers: pcc, phosek
Subscribers: mgorny, #sanitizers, llvm-commits
Tags: #sanitizers, #llvm
Differential Revision: https://reviews.llvm.org/D58755
llvm-svn: 355164
Thomas Lively [Fri, 1 Mar 2019 01:38:54 +0000 (01:38 +0000)]
[WebAssembly] Lower SIMD shifts since they are fixed in V8
Reviewers: sbc100
Subscribers: dschuff, jgravelle-google, hiraditya, aheejin, sunfish, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D58800
llvm-svn: 355163
Louis Dionne [Fri, 1 Mar 2019 01:32:44 +0000 (01:32 +0000)]
[libc++] Fix forgotten fclose() in unit test
Thanks to Andrey Maksimov for the patch.
Differential Revision: https://reviews.llvm.org/D58732
llvm-svn: 355162
Louis Dionne [Fri, 1 Mar 2019 01:26:35 +0000 (01:26 +0000)]
[pstl] Fix missing parallel policy guards
Thanks to @jerryct for the patch.
Differential Revision: https://reviews.llvm.org/D57638
llvm-svn: 355161
Louis Dionne [Fri, 1 Mar 2019 00:51:54 +0000 (00:51 +0000)]
[libc++] Increase portability of xalloc test
Do not assume that xalloc() starts at 0, which is not specified by the
Standard.
Thanks to Andrey Maksimov for the patch.
Differential Revision: https://reviews.llvm.org/D58299
llvm-svn: 355160
Tom Stellard [Fri, 1 Mar 2019 00:50:26 +0000 (00:50 +0000)]
AMDGPU/GlobalISel: Implement select for G_INSERT
Re-commit r344310.
Reviewers: arsenm
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, rovka, kristof.beyls, dstuttard, tpr, t-tye, llvm-commits
Differential Revision: https://reviews.llvm.org/D53116
llvm-svn: 355159
Jordan Rupprecht [Fri, 1 Mar 2019 00:12:18 +0000 (00:12 +0000)]
[clang-format][TableGen] Don't add spaces around items in square braces.
Summary:
clang-formatting wants to add spaces around items in square braces, e.g. [1, 2] -> [ 1, 2 ]. Based on a quick check [1], it seems like most cases are using the [1, 2] format, so make that the consistent one.
[1] in llvm `.td` files, the regex `\[[^ ]` (bracket followed by not-a-space) shows up ~400 times, but `\[\s[^ ]` (bracket followed by one space and one not-a-space) shows up ~40 times => ~90% uses this format.
Reviewers: djasper, krasimir, MyDeveloperDay
Reviewed By: MyDeveloperDay
Subscribers: MyDeveloperDay, arphaman, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D55964
llvm-svn: 355158
Thomas Lively [Fri, 1 Mar 2019 00:12:13 +0000 (00:12 +0000)]
[WebAssembly] Fix crash when @llvm.global_dtors is external
Reviewers: aheejin
Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D58799
llvm-svn: 355157
Tom Stellard [Thu, 28 Feb 2019 23:37:48 +0000 (23:37 +0000)]
AMDGPU/GlobalISel: Implement select for G_EXTRACT
Reviewers: arsenm
Subscribers: kzhuravl, wdng, nhaehnle, yaxunl, rovka, kristof.beyls, dstuttard, tpr, t-tye, llvm-commits
Differential Revision: https://reviews.llvm.org/D49714
llvm-svn: 355156
Jason Molenda [Thu, 28 Feb 2019 23:37:28 +0000 (23:37 +0000)]
Symbols.cpp in unittest moved too.
llvm-svn: 355155
Joerg Sonnenberger [Thu, 28 Feb 2019 23:33:09 +0000 (23:33 +0000)]
[PPC] Secure PLT only has meaning for PIC
llvm-svn: 355154
Peter Collingbourne [Thu, 28 Feb 2019 23:11:35 +0000 (23:11 +0000)]
ELF: Write .eh_frame_hdr explicitly after writing .eh_frame.
This lets us remove the special case from Writer::writeSections(), and also
fixes a bug where .eh_frame_hdr isn't necessarily written in the correct
order if a linker script moves .eh_frame and .eh_frame_hdr into the same
output section.
Differential Revision: https://reviews.llvm.org/D58795
llvm-svn: 355153
Reid Kleckner [Thu, 28 Feb 2019 22:54:30 +0000 (22:54 +0000)]
[sancov] Instrument reachable blocks that end in unreachable
Summary:
These sorts of blocks often contain calls to noreturn functions, like
longjmp, throw, or trap. If they don't end the program, they are
"interesting" from the perspective of sanitizer coverage, so we should
instrument them. This was discussed in https://reviews.llvm.org/D57982.
Reviewers: kcc, vitalybuka
Subscribers: llvm-commits, craig.topper, efriedma, morehouse, hiraditya
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D58740
llvm-svn: 355152
Peter Collingbourne [Thu, 28 Feb 2019 22:42:55 +0000 (22:42 +0000)]
llvm-readobj: Try the DWARF CFI dumper on all machines.
There's no reason to limit the DWARF CFI dumper to EM_386 and EM_X86_64;
ELF files could contain DWARF CFI on almost any platform (even 32-bit ARM;
NetBSD uses DWARF CFI on that platform). So start using the DWARF CFI dumper
unconditionally so that we can dump .eh_frame sections on the remaining ELF
platforms as well as in NetBSD binaries.
Differential Revision: https://reviews.llvm.org/D58761
llvm-svn: 355151
Adrian Prantl [Thu, 28 Feb 2019 22:26:00 +0000 (22:26 +0000)]
Update testcase since llvm-dwarfdump got more accurate in r355148.
llvm-svn: 355150
Alex Langford [Thu, 28 Feb 2019 22:24:18 +0000 (22:24 +0000)]
[CMake] Make liblldb depend on clang-headers
Summary:
The clang headers are useful when dealing with clang modules. There is also a
way to get to the clang headers from the SB API so it would be nice if they were
also available when we just build lldb.
Differential Revision: https://reviews.llvm.org/D58793
llvm-svn: 355149
Adrian Prantl [Thu, 28 Feb 2019 22:12:32 +0000 (22:12 +0000)]
dsymutil support for DW_OP_convert
Add support for cloning DWARF expressions that contain base type DIE
references in dsymutil.
<rdar://problem/
48167812>
Differential Revision: https://reviews.llvm.org/D58534
llvm-svn: 355148
Peter Collingbourne [Thu, 28 Feb 2019 22:12:09 +0000 (22:12 +0000)]
gn build: Merge r355133.
llvm-svn: 355147
Nico Weber [Thu, 28 Feb 2019 22:08:18 +0000 (22:08 +0000)]
gn build: Merge r355035
llvm-svn: 355146
Nico Weber [Thu, 28 Feb 2019 22:07:37 +0000 (22:07 +0000)]
gn build: Merge r355024
llvm-svn: 355145
Nico Weber [Thu, 28 Feb 2019 22:03:41 +0000 (22:03 +0000)]
cfi: Rename source file from cc to cpp
See discussion on https://reviews.llvm.org/D58620 for the review.
llvm-svn: 355144
Dan Liew [Thu, 28 Feb 2019 21:57:58 +0000 (21:57 +0000)]
[CMake][LibFuzzer] Match symbol visibility setting between LibFuzzer object files and unit tests.
Summary:
This fixes inconsistent symbol visibility. This shows up as a linker
warning if r336238 (
43f633564e338a6dde83d49a48e5bfcbfdce292c) is
reverted.
```
ld: warning: direct access in function 'fuzzer::CleanseCrashInput(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, fuzzer::fuzzer_allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, fuzzer::FuzzingOptions const&)' from file '/Volumes/data/dev/llvm/upstream/master/builds/projects/compiler-rt/lib/fuzzer/tests/libRTFuzzerTest.x86_64.a(FuzzerDriver.cpp.o)' to global weak symbol 'fuzzer::Command::ignoreRemainingArgs()::kIgnoreRemaining' from file 'FuzzerTestObjects.FuzzerUnittest.cpp.x86_64.o' means the weak symbol cannot be overridden
at runtime. This was likely caused by different translation units being compiled with different visibility settings.
```
r336238 just hid the issue rather than fixing the real issue. On macOS
and other platforms we usually compile with `-fvisibility=hidden` but
the unit tests were compiled without this flag.
Reviewers: george.karpenkov, kubamracek, kcc, yln
Subscribers: mgorny, #sanitizers, llvm-commits
Tags: #llvm, #sanitizers
Differential Revision: https://reviews.llvm.org/D58055
llvm-svn: 355143
Petr Hosek [Thu, 28 Feb 2019 21:38:59 +0000 (21:38 +0000)]
[CMake][libunwind] Define add_target_flags which is missing
It's use was introduced in r353084 but its definition is missing.
Differential Revision: https://reviews.llvm.org/D58745
llvm-svn: 355142