Heejin Ahn [Mon, 7 Oct 2019 21:14:45 +0000 (21:14 +0000)]
[WebAssembly] Add memory intrinsics handling to mayThrow()
Summary:
Previously, `WebAssembly::mayThrow()` assumed all inputs are global
addresses. But when intrinsics, such as `memcpy`, `memmove`, or `memset`
are lowered to external symbols in instruction selection and later
emitted as library calls. And these functions don't throw.
This patch adds handling to those memory intrinsics to `mayThrow`
function. But while most of libcalls don't throw, we can't guarantee all
of them don't throw, so currently we conservatively return true for all
other external symbols.
I think a better way to solve this problem is to embed 'nounwind' info
in `TargetLowering::CallLoweringInfo`, so that we can access the info
from the backend. This will also enable transferring 'nounwind'
properties of LLVM IR instructions. Currently we don't transfer that
info and we can only access properties of callee functions, if the
callees are within the module. Other targets don't need this info in the
backend because they do all the processing before isel, but it will help
us because that info will reduce code size increase in fixing unwind
destination mismatches in CFGStackify.
But for now we return false for these memory intrinsics and true for all
other libcalls conservatively.
Reviewers: dschuff
Subscribers: sbc100, jgravelle-google, hiraditya, sunfish, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D68553
llvm-svn: 373967
Alexander Shaposhnikov [Mon, 7 Oct 2019 21:14:22 +0000 (21:14 +0000)]
[llvm-lipo] Relax the check of the specified input file architecture
cctools lipo only compares the cputypes when it verifies that
the specified (via -arch) input file and the architecture match.
This diff adjusts the behavior of llvm-lipo accordingly.
Differential revision: https://reviews.llvm.org/D68319
Test plan: make check-all
llvm-svn: 373966
Johannes Doerfert [Mon, 7 Oct 2019 21:07:57 +0000 (21:07 +0000)]
[Attributor] Deduce memory behavior of functions and arguments
Deduce the memory behavior, aka "read-none", "read-only", or
"write-only", for functions and arguments.
Reviewers: sstefan1, uenoku
Subscribers: hiraditya, bollu, jfb, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D67384
llvm-svn: 373965
Roman Lebedev [Mon, 7 Oct 2019 20:53:27 +0000 (20:53 +0000)]
[InstCombine] Fold conditional sign-extend of high-bit-extract into high-bit-extract-with-signext (PR42389)
This can come up in Bit Stream abstractions.
The pattern looks big/scary, but it can't be simplified any further.
It only is so simple because a number of my preparatory folds had
happened already (shift amount reassociation / shift amount
reassociation in bit test, sign bit test detection).
Highlights:
* There are two main flavors: https://rise4fun.com/Alive/zWi
The difference is add vs. sub, and left-shift of -1 vs. 1
* Since we only change the shift opcode,
we can preserve the exact-ness: https://rise4fun.com/Alive/4u4
* There can be truncation after high-bit-extraction:
https://rise4fun.com/Alive/slHc1 (the main pattern i'm after!)
Which means that we need to ignore zext of shift amounts and of NBits.
* The sign-extending magic can be extended itself (in add pattern
via sext, in sub pattern via zext. not the other way around!)
https://rise4fun.com/Alive/NhG
(or those sext/zext can be sinked into `select`!)
Which again means we should pay attention when matching NBits.
* We can have both truncation of extraction and widening of magic:
https://rise4fun.com/Alive/XTw
In other words, i don't believe we need to have any checks on
bitwidths of any of these constructs.
This is worsened in general by the fact that we may have `sext` instead
of `zext` for shift amounts, and we don't yet canonicalize to `zext`,
although we should. I have not done anything about that here.
Also, we really should have something to weed out `sub` like these,
by folding them into `add` variant.
https://bugs.llvm.org/show_bug.cgi?id=42389
llvm-svn: 373964
Roman Lebedev [Mon, 7 Oct 2019 20:53:16 +0000 (20:53 +0000)]
[InstCombine][NFC] Tests for "conditional sign-extend of high-bit-extract" pattern (PR42389)
https://bugs.llvm.org/show_bug.cgi?id=42389
llvm-svn: 373963
Roman Lebedev [Mon, 7 Oct 2019 20:53:08 +0000 (20:53 +0000)]
[InstCombine] Move isSignBitCheck(), handle rest of the predicates
True, no test coverage is being added here. But those non-canonical
predicates that are already handled here already have no test coverage
as far as i can tell. I tried to add tests for them, but all the patterns
already get handled elsewhere.
llvm-svn: 373962
Roman Lebedev [Mon, 7 Oct 2019 20:53:00 +0000 (20:53 +0000)]
[InstCombine][NFC] dropRedundantMaskingOfLeftShiftInput(): change how we deal with mask
Summary:
Currently, we pre-check whether we need to produce a mask or not.
This involves some rather magical constants.
I'd like to extend this fold to also handle the situation
when there's also a `trunc` before outer shift.
That will require another set of magical constants.
It's ugly.
Instead, we can just compute the mask, and check
whether mask is a pass-through (all-ones) or not.
This way we don't need to have any magical numbers.
This change is NFC other than the fact that we now compute
the mask and then check if we need (and can!) apply it.
Reviewers: spatel
Reviewed By: spatel
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D68470
llvm-svn: 373961
Roman Lebedev [Mon, 7 Oct 2019 20:52:52 +0000 (20:52 +0000)]
[InstCombine] dropRedundantMaskingOfLeftShiftInput(): propagate undef shift amounts
Summary:
When we do `ConstantExpr::getZExt()`, that "extends" `undef` to `0`,
which means that for patterns a/b we'd assume that we must not produce
any bits for that channel, while in reality we simply didn't care
about that channel - i.e. we don't need to mask it.
Reviewers: spatel
Reviewed By: spatel
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D68239
llvm-svn: 373960
Cameron McInally [Mon, 7 Oct 2019 20:41:25 +0000 (20:41 +0000)]
[Bitcode] Update naming of UNOP_NEG to UNOP_FNEG
Differential Revision: https://reviews.llvm.org/D68588
llvm-svn: 373958
Davide Italiano [Mon, 7 Oct 2019 20:35:22 +0000 (20:35 +0000)]
[debugserver] Include the correct header.
<rdar://problem/
55916729>
llvm-svn: 373957
Jonas Devlieghere [Mon, 7 Oct 2019 20:33:20 +0000 (20:33 +0000)]
[AccelTable] Remove stale comment (NFC)
rdar://
55857228
llvm-svn: 373956
Jonas Devlieghere [Mon, 7 Oct 2019 20:31:28 +0000 (20:31 +0000)]
[test] Rename `Modules` to `ObjectFile` (NFC)
llvm-svn: 373955
Jonas Devlieghere [Mon, 7 Oct 2019 20:31:22 +0000 (20:31 +0000)]
[MachO] Shuffle some things around in ParseSymtab (NFC)
llvm-svn: 373954
Walter Erquinigo [Mon, 7 Oct 2019 20:26:49 +0000 (20:26 +0000)]
[gdb-remote] process properly effective uid
Summary:
Someone wrote SetEffectiveSetEffectiveGroupID instead of SetEffectiveUserID.
After this fix, the android process list can show user names, e.g.
```
PID PARENT USER GROUP EFF USER EFF GROUP TRIPLE ARGUMENTS
====== ====== ========== ========== ========== ========== ============================== ============================
529 1 root 0 root 0 /sbin/ueventd
```
Reviewers: labath,clayborg,aadsm,xiaobai
Subscribers:
llvm-svn: 373953
Alexey Bataev [Mon, 7 Oct 2019 19:57:40 +0000 (19:57 +0000)]
[OPENMP]Fix caonical->canonical, NFC.
Fixed typo.
llvm-svn: 373952
Nico Weber [Mon, 7 Oct 2019 19:54:19 +0000 (19:54 +0000)]
Attempt to fix a few clang-tidy tests on Windows, see PR43593.
llvm-svn: 373951
Amy Huang [Mon, 7 Oct 2019 19:41:53 +0000 (19:41 +0000)]
Fix for expanding __pragmas in macro arguments
Summary:
Avoid parsing __pragma into an annotation token when macro arguments are pre-expanded.
This is what clang currently does when parsing _Pragmas.
Fixes https://bugs.llvm.org/show_bug.cgi?id=41128, where clang crashed
when trying to get the length of an annotation token.
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D68114
llvm-svn: 373950
Louis Dionne [Mon, 7 Oct 2019 19:22:04 +0000 (19:22 +0000)]
[libc++abi] Introduce a LIBCXXABI_LIBRARY_VERSION option
That option controls the 'VERSION' attribute of the libc++abi shared
library, which in turn controls the name of the actual dylib being
produced.
llvm-svn: 373949
Nico Weber [Mon, 7 Oct 2019 19:17:02 +0000 (19:17 +0000)]
gn build: try to make system-libs.windows.test pass
llvm-svn: 373948
Matt Arsenault [Mon, 7 Oct 2019 19:16:26 +0000 (19:16 +0000)]
AMDGPU/GlobalISel: Handle more G_INSERT cases
Start manually writing a table to get the subreg index. TableGen
should probably generate this, but I'm not sure what it looks like in
the arbitrary case where subregisters are allowed to not fully cover
the super-registers.
llvm-svn: 373947
Matt Arsenault [Mon, 7 Oct 2019 19:13:27 +0000 (19:13 +0000)]
GlobalISel: Partially implement lower for G_INSERT
llvm-svn: 373946
Matt Arsenault [Mon, 7 Oct 2019 19:10:44 +0000 (19:10 +0000)]
AMDGPU/GlobalISel: Fix selection of 16-bit shifts
llvm-svn: 373945
Matt Arsenault [Mon, 7 Oct 2019 19:10:43 +0000 (19:10 +0000)]
AMDGPU/GlobalISel: Select VALU G_AMDGPU_FFBH_U32
llvm-svn: 373944
Matt Arsenault [Mon, 7 Oct 2019 19:07:19 +0000 (19:07 +0000)]
AMDGPU/GlobalISel: Use S_MOV_B64 for inline constants
This hides some defects in SIFoldOperands when the immediates are
split.
llvm-svn: 373943
Matt Arsenault [Mon, 7 Oct 2019 19:05:58 +0000 (19:05 +0000)]
AMDGPU/GlobalISel: Widen 16-bit G_MERGE_VALUEs sources
Continue making a mess of merge/unmerge legality.
llvm-svn: 373942
Louis Dionne [Mon, 7 Oct 2019 18:55:15 +0000 (18:55 +0000)]
[libc++abi] Do not define -Dcxxabi_shared_EXPORTS when building libc++abi
CMake sets adds that definition automatically, but we don't need
or use it.
llvm-svn: 373940
Alexey Bataev [Mon, 7 Oct 2019 18:54:57 +0000 (18:54 +0000)]
[OPENMP50]Treat range-based for as canonical loop.
According to OpenMP 5.0, range-based for is also considered as a
canonical form of loops.
llvm-svn: 373939
Matt Arsenault [Mon, 7 Oct 2019 18:43:31 +0000 (18:43 +0000)]
AMDGPU/GlobalISel: Select more G_INSERT cases
At minimum handle the s64 insert type, which are emitted in real cases
during legalization.
We really need TableGen to emit something to emit something like the
inverse of composeSubRegIndices do determine the subreg index to use.
llvm-svn: 373938
Matt Arsenault [Mon, 7 Oct 2019 18:43:29 +0000 (18:43 +0000)]
GlobalISel: Add target pre-isel instructions
Allows targets to introduce regbankselectable
pseudo-instructions. Currently the closet feature to this is an
intrinsic. However this requires creating a public intrinsic
declaration. This litters the public intrinsic namespace with
operations we don't necessarily want to expose to IR producers, and
would rather leave as private to the backend.
Use a new instruction bit. A previous attempt tried to keep using enum
value ranges, but it turned into a mess.
llvm-svn: 373937
Michal Gorny [Mon, 7 Oct 2019 18:14:56 +0000 (18:14 +0000)]
[clang] [cmake] Support LLVM_DISTRIBUTION_COMPONENTS in stand-alone build
Differential Revision: https://reviews.llvm.org/D68412
llvm-svn: 373936
Jordan Rose [Mon, 7 Oct 2019 18:14:24 +0000 (18:14 +0000)]
Second attempt to add iterator_range::empty()
Doing this makes MSVC complain that `empty(someRange)` could refer to
either C++17's std::empty or LLVM's llvm::empty, which previously we
avoided via SFINAE because std::empty is defined in terms of an empty
member rather than begin and end. So, switch callers over to the new
method as it is added.
https://reviews.llvm.org/D68439
llvm-svn: 373935
Louis Dionne [Mon, 7 Oct 2019 18:12:10 +0000 (18:12 +0000)]
[libc++abi] Remove redundant link flags on Apple platforms
These flags are already set when we create the cxxabi_shared target
using the SOVERSION and VERSION target properties, and the install_name
was already being overriden to '@rpath/libc++abi.1.dylib' by CMake
because no 'CMAKE_INSTALL_NAME_DIR' option was specified. So this is
effectively a removal of dead code with no intended functionality change.
The only think we're losing here is that we used to link against
libSystem.B.dylib instead of libSystem.dylib when building libc++abi
for macOS 10.6 -- however, I strongly suspect nobody's building
libc++abi from source for that target anymore.
llvm-svn: 373934
Nico Weber [Mon, 7 Oct 2019 17:55:05 +0000 (17:55 +0000)]
Try to get clangd tests passing on Windows.
Part of PR43592. See also r328645.
llvm-svn: 373932
Walter Erquinigo [Mon, 7 Oct 2019 17:49:32 +0000 (17:49 +0000)]
[platform process list] add a flag for showing the processes of all users
Summary:
For context: https://reviews.llvm.org/D68293
We need a way to show all the processes on android regardless of the user id.
When you run `platform process list`, you only see the processes with the same user as the user that launched lldb-server. However, it's quite useful to see all the processes, though, and it will lay a foundation for full apk debugging support from lldb.
Before:
```
PID PARENT USER TRIPLE NAME
====== ====== ========== ======================== ============================
3234 1 aarch64-unknown-linux-android adbd
8034 3234 aarch64-unknown-linux-android sh
9096 3234 aarch64-unknown-linux-android sh
9098 9096 aarch64-unknown-linux-android lldb-server
(lldb) ^D
```
Now:
```
(lldb) platform process list -x
205 matching processes were found on "remote-android"
PID PARENT USER TRIPLE NAME
====== ====== ========== ======================== ============================
1 0 init
524 1 init
525 1 init
531 1 ueventd
568 1 logd
569 1 aarch64-unknown-linux-android servicemanager
570 1 aarch64-unknown-linux-android hwservicemanager
571 1 aarch64-unknown-linux-android vndservicemanager
577 1 aarch64-unknown-linux-android qseecomd
580 577 aarch64-unknown-linux-android qseecomd
...
23816 979 com.android.providers.calendar
24600 979 com.verizon.mips.services
27888 979 com.hualai
28043 2378 com.android.chrome:sandboxed_process0
31449 979 com.att.shm
31779 979 com.samsung.android.authfw
31846 979 com.samsung.android.server.iris
32014 979 com.samsung.android.MtpApplication
32045 979 com.samsung.InputEventApp
```
Reviewers: labath,xiaobai,aadsm,clayborg
Subscribers:
llvm-svn: 373931
Kostya Kortchinsky [Mon, 7 Oct 2019 17:37:39 +0000 (17:37 +0000)]
[scudo][standalone] Correct releaseToOS behavior
Summary:
There was an issue in `releaseToOSMaybe`: one of the criteria to
decide if we should proceed with the release was wrong. Namely:
```
const uptr N = Sci->Stats.PoppedBlocks - Sci->Stats.PushedBlocks;
if (N * BlockSize < PageSize)
return; // No chance to release anything.
```
I meant to check if the amount of bytes in the free list was lower
than a page, but this actually checks if the amount of **in use** bytes
was lower than a page.
The correct code is:
```
const uptr BytesInFreeList =
Region->AllocatedUser -
(Region->Stats.PoppedBlocks - Region->Stats.PushedBlocks) * BlockSize;
if (BytesInFreeList < PageSize)
return 0; // No chance to release anything.
```
Consequences of the bug:
- if a class size has less than a page worth of in-use bytes (allocated
or in a cache), reclaiming would not occur, whatever the amount of
blocks in the free list; in real world scenarios this is unlikely to
happen and be impactful;
- if a class size had less than a page worth of free bytes (and enough
in-use bytes, etc), then reclaiming would be attempted, with likely
no result. This means the reclaiming was overzealous at times.
I didn't have a good way to test for this, so I changed the prototype
of the function to return the number of bytes released, allowing to
get the information needed. The test added fails with the initial
criteria.
Another issue is that `ReleaseToOsInterval` can actually be 0, meaning
we always try to release (side note: it's terrible for performances).
so change a `> 0` check to `>= 0`.
Additionally, decrease the `CanRelease` threshold to `PageSize / 32`.
I still have to make that configurable but I will do it at another time.
Finally, rename some variables in `printStats`: I feel like "available"
was too ambiguous, so change it to "total".
Reviewers: morehouse, hctim, eugenis, vitalybuka, cferris
Reviewed By: morehouse
Subscribers: delcypher, #sanitizers, llvm-commits
Tags: #llvm, #sanitizers
Differential Revision: https://reviews.llvm.org/D68471
llvm-svn: 373930
Erich Keane [Mon, 7 Oct 2019 17:28:03 +0000 (17:28 +0000)]
Fix Calling Convention through aliases
r369697 changed the behavior of stripPointerCasts to no longer include
aliases. However, the code in CGDeclCXX.cpp's createAtExitStub counted
on the looking through aliases to properly set the calling convention of
a call.
The result of the change was that the calling convention mismatch of the
call would be replaced with a llvm.trap, causing a runtime crash.
Differential Revision: https://reviews.llvm.org/D68584
llvm-svn: 373929
Yitzhak Mandelbaum [Mon, 7 Oct 2019 17:24:23 +0000 (17:24 +0000)]
[libTooling][NFC] Fix build break in r373916.
r373916 used raw strings inside macro calls, which breaks some builds.
llvm-svn: 373928
Vedant Kumar [Mon, 7 Oct 2019 17:22:53 +0000 (17:22 +0000)]
[DWARFASTParserClang] Factor out structure-like type parsing, NFC
Split out the logic to parse structure-like types into a separate
function, in an attempt to reduce the complexity of ParseTypeFromDWARF.
Inspired by discussion in https://reviews.llvm.org/D68130.
Differential Revision: https://reviews.llvm.org/D68422
llvm-svn: 373927
Vedant Kumar [Mon, 7 Oct 2019 17:22:50 +0000 (17:22 +0000)]
[DWARFASTParserClang] Delete commented-out typedef, NFC
(& group together all the protected members & typedefs)
llvm-svn: 373926
Pavel Labath [Mon, 7 Oct 2019 17:17:53 +0000 (17:17 +0000)]
ProcessInstanceInfoMatch: Don't match processes with no name if a name match was requested
Since D68289, a couple of tests on linux started being extremely flaky.
All of them were doing name-based attaching and were failing because
they couldn't find an unambiguous process to attach to.
The patch above changed the process finding logic, so that failure to
find a process name does not constitute an error. This meant that a lot
more transient processes showed up in the process list during the test
suite run. Previously, these processes would not appear as they would be
gone by the time we went to read their executable name, arguments, etc.
Now, this alone should not cause an issue were it not for the fact that
we were considering a process with no name as if it matched by default
(even if we were explicitly searching for a process with a specified
name). This meant that any of the "transient" processes with no name
would make the name match ambiguous. That clearly seems like a bug to me
so I fix that.
llvm-svn: 373925
Kadir Cetinkaya [Mon, 7 Oct 2019 17:12:18 +0000 (17:12 +0000)]
[clangd] Fix raciness in code completion tests
Reviewers: sammccall, ilya-biryukov
Subscribers: MaskRay, jkorous, arphaman, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D68273
llvm-svn: 373924
Florian Hahn [Mon, 7 Oct 2019 17:05:09 +0000 (17:05 +0000)]
[Remarks] Pass StringBlockValue as StringRef.
After changing the remark serialization, we now pass StringRefs to the
serializer. We should use StringRef for StringBlockVal, to avoid
creating temporary objects, which then cause StringBlockVal.Value to
point to invalid memory.
Reviewers: thegameg, anemet
Reviewed By: thegameg
Differential Revision: https://reviews.llvm.org/D68571
llvm-svn: 373923
Paul Hoad [Mon, 7 Oct 2019 17:03:44 +0000 (17:03 +0000)]
[clang-format] [PR27004] omits leading space for noexcept when formatting operator delete()
Summary:
clang-format is incorrectly thinking the parameter parens are part of a cast operation, this is resulting in there sometimes being not space between the paren and the noexcept (and other keywords like volatile etc..)
```
void operator++(int) noexcept;
void operator++(int &) noexcept;
void operator delete(void *, std::size_t, const std::nothrow_t &)noexcept;
```
Reviewers: klimek, owenpan, mitchell-stellar
Reviewed By: mitchell-stellar
Subscribers: cfe-commits
Tags: #clang-format, #clang
Differential Revision: https://reviews.llvm.org/D68481
llvm-svn: 373922
Paul Hoad [Mon, 7 Oct 2019 16:53:35 +0000 (16:53 +0000)]
[clang-format] [NFC] Ensure clang-format is itself clang-formatted.
Summary:
Before making a proposed change, ensure ClangFormat.cpp is fully clang-formatted,
no functional change just clang-formatting using the in tree .clang-format.
Reviewers: mitchell-stellar
Reviewed By: mitchell-stellar
Subscribers: Eugene.Zelenko, cfe-commits
Tags: #clang-format, #clang
Differential Revision: https://reviews.llvm.org/D68551
llvm-svn: 373921
Wei Mi [Mon, 7 Oct 2019 16:45:47 +0000 (16:45 +0000)]
Fix build errors caused by rL373914.
llvm-svn: 373919
Simon Pilgrim [Mon, 7 Oct 2019 16:42:25 +0000 (16:42 +0000)]
Codegen - silence static analyzer getAs<> null dereference warnings. NFCI.
The static analyzer is warning about potential null dereferences, but in these cases we should be able to use castAs<> directly and if not assert will fire for us.
llvm-svn: 373918
Wenlei He [Mon, 7 Oct 2019 16:30:31 +0000 (16:30 +0000)]
[llvm-profdata] Minor format fix
Summary: Minor format fix for output of "llvm-profdata -show"
Reviewers: wmi
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D68440
llvm-svn: 373917
Yitzhak Mandelbaum [Mon, 7 Oct 2019 16:20:22 +0000 (16:20 +0000)]
[libTooling] Add `toString` method to the Stencil class
Summary:
`toString` generates a string representation of the stencil.
Patch by Harshal T. Lehri.
Reviewers: gribozavr
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D68574
llvm-svn: 373916
Simon Pilgrim [Mon, 7 Oct 2019 16:15:20 +0000 (16:15 +0000)]
[X86][SSE] getTargetShuffleInputs - move VT.isSimple/isVector checks inside. NFCI.
Stop all the callers from having to check the value type before calling getTargetShuffleInputs.
llvm-svn: 373915
Wei Mi [Mon, 7 Oct 2019 16:12:37 +0000 (16:12 +0000)]
[SampleFDO] Add compression support for any section in ExtBinary profile format
Previously ExtBinary profile format only supports compression using zlib for
profile symbol list. In this patch, we extend the compression support to any
section. User can select some or all of the sections to compress. In an
experiment, for a 45M profile in ExtBinary format, compressing name table
reduced its size to 24M, and compressing all the sections reduced its size
to 11M.
Differential Revision: https://reviews.llvm.org/D68253
llvm-svn: 373914
Sanjay Patel [Mon, 7 Oct 2019 14:48:27 +0000 (14:48 +0000)]
[LoopVectorize] add test that asserted after cost model change (PR43582); NFC
llvm-svn: 373913
David Greene [Mon, 7 Oct 2019 14:37:20 +0000 (14:37 +0000)]
Allow update_test_checks.py to not scrub names.
Add a --preserve-names option to tell the script not to replace IR names.
Sometimes tests want those names. For example if a test is looking for a
modification to an existing instruction we'll want to make the names.
Differential Revision: https://reviews.llvm.org/D68081
llvm-svn: 373912
Simon Pilgrim [Mon, 7 Oct 2019 14:25:46 +0000 (14:25 +0000)]
Sema - silence static analyzer getAs<> null dereference warnings. NFCI.
The static analyzer is warning about potential null dereferences, but in these cases we should be able to use castAs<> directly and if not assert will fire for us.
llvm-svn: 373911
Utkarsh Saxena [Mon, 7 Oct 2019 14:20:46 +0000 (14:20 +0000)]
[clang] Add test for FindNextToken in Lexer.
Reviewers: ilya-biryukov
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D68565
llvm-svn: 373910
Kevin P. Neal [Mon, 7 Oct 2019 14:14:46 +0000 (14:14 +0000)]
Fix another sphinx warning.
Differential Revision: https://reviews.llvm.org/D64746
llvm-svn: 373909
Amaury Sechet [Mon, 7 Oct 2019 14:10:21 +0000 (14:10 +0000)]
Regenerate ptr-rotate.ll . NFC
llvm-svn: 373908
Simon Atanasyan [Mon, 7 Oct 2019 14:01:37 +0000 (14:01 +0000)]
[Mips] Always save RA when disabling frame pointer elimination
This ensures that frame-based unwinding will continue to work when
calling a noreturn function; there is not much use having the caller's
frame pointer saved if you don't also have the caller's program counter.
Patch by James Clarke.
Differential Revision: https://reviews.llvm.org/D68542
llvm-svn: 373907
Simon Atanasyan [Mon, 7 Oct 2019 14:01:22 +0000 (14:01 +0000)]
[Mips] Fix evaluating J-format branch targets
J/JAL/JALX/JALS are absolute branches, but stay within the current
256 MB-aligned region, so we must include the high bits of the
instruction address when calculating the branch target.
Patch by James Clarke.
Differential Revision: https://reviews.llvm.org/D68548
llvm-svn: 373906
Simon Pilgrim [Mon, 7 Oct 2019 13:58:15 +0000 (13:58 +0000)]
RewriteModernObjC - silence static analyzer getAs<> null dereference warnings. NFCI.
The static analyzer is warning about potential null dereferences, but in these cases we should be able to use castAs<> directly and if not assert will fire for us.
llvm-svn: 373905
Simon Pilgrim [Mon, 7 Oct 2019 13:58:05 +0000 (13:58 +0000)]
AST - silence static analyzer getAs<> null dereference warnings. NFCI.
The static analyzer is warning about potential null dereferences, but in these cases we should be able to use castAs<> directly and if not assert will fire for us.
llvm-svn: 373904
whitequark [Mon, 7 Oct 2019 13:57:13 +0000 (13:57 +0000)]
[LLVM-C] Add bindings to create macro debug info
Summary: The C API doesn't have the bindings to create macro debug information.
Reviewers: whitequark, CodaFi, deadalnix
Reviewed By: whitequark
Subscribers: aprantl, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D58334
llvm-svn: 373903
Kevin P. Neal [Mon, 7 Oct 2019 13:39:56 +0000 (13:39 +0000)]
Fix sphinx warnings.
Differential Revision: https://reviews.llvm.org/D64746
llvm-svn: 373902
Mirko Brkusanin [Mon, 7 Oct 2019 13:23:12 +0000 (13:23 +0000)]
Test commit
Fix comment.
llvm-svn: 373901
Kevin P. Neal [Mon, 7 Oct 2019 13:20:00 +0000 (13:20 +0000)]
[FPEnv] Add constrained intrinsics for lrint and lround
Earlier in the year intrinsics for lrint, llrint, lround and llround were
added to llvm. The constrained versions are now implemented here.
Reviewed by: andrew.w.kaylor, craig.topper, cameron.mcinally
Approved by: craig.topper
Differential Revision: https://reviews.llvm.org/D64746
llvm-svn: 373900
Nico Weber [Mon, 7 Oct 2019 13:13:31 +0000 (13:13 +0000)]
gn build: use better triple on windows
The CMake build uses "x86_64-pc-windows-msvc". The "-msvc" suffix is
important because e.g. clang/test/lit.cfg.py matches against the
suffix "windows-msvc" to compute the presence of the "ms-sdk" and
the absence of the "LP64" feature.
Differential Revision: https://reviews.llvm.org/D68572
llvm-svn: 373899
Nico Weber [Mon, 7 Oct 2019 11:46:26 +0000 (11:46 +0000)]
Revert r373888 "[IA] Recognize hexadecimal escape sequences"
It broke MC/AsmParser/directive_ascii.s on all bots:
Assertion failed: (Index < Length && "Invalid index!"), function operator[],
file ../../llvm/include/llvm/ADT/StringRef.h, line 243.
llvm-svn: 373898
Haojian Wu [Mon, 7 Oct 2019 11:37:25 +0000 (11:37 +0000)]
[clangd] Catch an unchecked "Expected<T>" in HeaderSourceSwitch.
Summary: Also fixes a potential user-after-scope issue of "Path".
Reviewers: kadircet
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D68564
llvm-svn: 373897
Gabor Marton [Mon, 7 Oct 2019 11:34:54 +0000 (11:34 +0000)]
[ASTImporter][NFC] Enable disabled but passing test
RedeclChainShouldBeCorrectAmongstNamespaces
llvm-svn: 373896
Gabor Marton [Mon, 7 Oct 2019 11:15:18 +0000 (11:15 +0000)]
[ASTImporter][NFC] Update ASTImporter internals docs
llvm-svn: 373895
Gabor Marton [Mon, 7 Oct 2019 11:14:53 +0000 (11:14 +0000)]
[ASTImporter][NFC] Fix typo in user docs
llvm-svn: 373894
Jay Foad [Mon, 7 Oct 2019 10:57:41 +0000 (10:57 +0000)]
[AMDGPU] Fix test checks
The GFX10-DENORM-STRICT checks were only passing by accident. Fix them
to make the test more robust in the face of scheduling or register
allocation changes.
llvm-svn: 373893
Sam McCall [Mon, 7 Oct 2019 10:53:56 +0000 (10:53 +0000)]
[clangd] If an undocumented definition exists, don't accept documentation from other forward decls.
Summary:
This fixes cases like:
foo.h
class Undocumented{}
bar.h
// break an include cycle. we should refactor this!
class Undocumented;
Where the comment doesn't describe the class.
Note that a forward decl that is *visible to the definition* will still have
its doc comment used, by SymbolCollector: Merge isn't involved here.
Reviewers: ilya-biryukov
Subscribers: MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D68467
llvm-svn: 373892
Konrad Kleine [Mon, 7 Oct 2019 10:32:16 +0000 (10:32 +0000)]
[lldb][ELF] Read symbols from .gnu_debugdata sect.
Summary:
If the .symtab section is stripped from the binary it might be that
there's a .gnu_debugdata section which contains a smaller .symtab in
order to provide enough information to create a backtrace with function
names or to set and hit a breakpoint on a function name.
This change looks for a .gnu_debugdata section in the ELF object file.
The .gnu_debugdata section contains a xz-compressed ELF file with a
.symtab section inside. Symbols from that compressed .symtab section
are merged with the main object file's .dynsym symbols (if any).
In addition we always load the .dynsym even if there's a .symtab
section.
For example, the Fedora and RHEL operating systems strip their binaries
but keep a .gnu_debugdata section. While gdb already can read this
section, LLDB until this patch couldn't. To test this patch on a
Fedora or RHEL operating system, try to set a breakpoint on the "help"
symbol in the "zip" binary. Before this patch, only GDB can set this
breakpoint; now LLDB also can do so without installing extra debug
symbols:
lldb /usr/bin/zip -b -o "b help" -o "r" -o "bt" -- -h
The above line runs LLDB in batch mode and on the "/usr/bin/zip -h"
target:
(lldb) target create "/usr/bin/zip"
Current executable set to '/usr/bin/zip' (x86_64).
(lldb) settings set -- target.run-args "-h"
Before the program starts, we set a breakpoint on the "help" symbol:
(lldb) b help
Breakpoint 1: where = zip`help, address = 0x00000000004093b0
Once the program is run and has hit the breakpoint we ask for a
backtrace:
(lldb) r
Process 10073 stopped
* thread #1, name = 'zip', stop reason = breakpoint 1.1
frame #0: 0x00000000004093b0 zip`help
zip`help:
-> 0x4093b0 <+0>: pushq %r12
0x4093b2 <+2>: movq 0x2af5f(%rip), %rsi ; + 4056
0x4093b9 <+9>: movl $0x1, %edi
0x4093be <+14>: xorl %eax, %eax
Process 10073 launched: '/usr/bin/zip' (x86_64)
(lldb) bt
* thread #1, name = 'zip', stop reason = breakpoint 1.1
* frame #0: 0x00000000004093b0 zip`help
frame #1: 0x0000000000403970 zip`main + 3248
frame #2: 0x00007ffff7d8bf33 libc.so.6`__libc_start_main + 243
frame #3: 0x0000000000408cee zip`_start + 46
In order to support the .gnu_debugdata section, one has to have LZMA
development headers installed. The CMake section, that controls this
part looks for the LZMA headers and enables .gnu_debugdata support by
default if they are found; otherwise or if explicitly requested, the
minidebuginfo support is disabled.
GDB supports the "mini debuginfo" section .gnu_debugdata since v7.6
(2013).
Reviewers: espindola, labath, jankratochvil, alexshap
Reviewed By: labath
Subscribers: rnkovacs, wuzish, shafik, emaste, mgorny, arichardson, hiraditya, MaskRay, lldb-commits
Tags: #lldb, #llvm
Differential Revision: https://reviews.llvm.org/D66791
llvm-svn: 373891
George Rimar [Mon, 7 Oct 2019 10:29:38 +0000 (10:29 +0000)]
[llvm-readelf/llvm-objdump] - Improve/refactor the implementation of SHT_LLVM_ADDRSIG section dumping.
This patch:
* Adds a llvm-readobj/llvm-readelf test file for SHT_LLVM_ADDRSIG sections. (we do not have any)
* Enables dumping of SHT_LLVM_ADDRSIG with --all.
* Changes the logic to report a warning instead of an error when something goes wrong during dumping
(allows to continue dumping SHT_LLVM_ADDRSIG and other sections on error).
* Refactors a piece of logic to a new toULEB128Array helper which might be used for GNU-style
dumping implementation.
Differential revision: https://reviews.llvm.org/D68383
llvm-svn: 373890
Haojian Wu [Mon, 7 Oct 2019 10:10:31 +0000 (10:10 +0000)]
[clangd] Collect missing macro references.
Summary: Semantic highlghting is missing a few macro references.
Reviewers: ilya-biryukov
Subscribers: MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D68458
llvm-svn: 373889
Bill Wendling [Mon, 7 Oct 2019 09:54:53 +0000 (09:54 +0000)]
[IA] Recognize hexadecimal escape sequences
Summary:
Implement support for hexadecimal escape sequences to match how GNU 'as'
handles them. I.e., read all hexadecimal characters and truncate to the
lower 16 bits.
Reviewers: nickdesaulniers
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D68483
llvm-svn: 373888
Hans Wennborg [Mon, 7 Oct 2019 09:30:15 +0000 (09:30 +0000)]
clang-cl: Ignore the new /ZH options
These were added to the MS docs in
https://github.com/MicrosoftDocs/cpp-docs/commit/
85b9b6967e58e485251450f7451673f6fc873e88
and are supposedly available in VS 2019 16.4 (though my 2019 Preview,
version 16.4.0-pre.1.0 don't seem to have them.)
llvm-svn: 373887
Fangrui Song [Mon, 7 Oct 2019 08:52:07 +0000 (08:52 +0000)]
[ELF][MIPS] De-template writeValue. NFC
Depends on D68561.
llvm-svn: 373886
Fangrui Song [Mon, 7 Oct 2019 08:31:18 +0000 (08:31 +0000)]
[ELF] Wrap things in `namespace lld { namespace elf {`, NFC
This makes it clear `ELF/**/*.cpp` files define things in the `lld::elf`
namespace and simplifies `elf::foo` to `foo`.
Reviewed By: atanasyan, grimar, ruiu
Differential Revision: https://reviews.llvm.org/D68323
llvm-svn: 373885
Fangrui Song [Mon, 7 Oct 2019 08:30:46 +0000 (08:30 +0000)]
[ELF][MIPS] Use lld::elf::{read,write}* instead of llvm::support::endian::{read,write}*
This allows us to delete `using namespace llvm::support::endian` and
simplify D68323. This change adds runtime config->endianness check but
the overhead should be negligible.
Reviewed By: ruiu
Differential Revision: https://reviews.llvm.org/D68561
llvm-svn: 373884
James Molloy [Mon, 7 Oct 2019 08:23:20 +0000 (08:23 +0000)]
[TableGen] Pacify gcc-5.4 more
Followup to a previous pacification, this performs the same workaround
to the TableGen generated code for tuple automata.
llvm-svn: 373883
Martin Storsjo [Mon, 7 Oct 2019 08:21:37 +0000 (08:21 +0000)]
Revert "[SLP] avoid reduction transform on patterns that the backend can load-combine"
This reverts SVN r373833, as it caused a failed assert "Non-zero loop
cost expected" on building numerous projects, see PR43582 for details
and reproduction samples.
llvm-svn: 373882
Djordje Todorovic [Mon, 7 Oct 2019 07:31:49 +0000 (07:31 +0000)]
[llvm-locstats] Fix a typo in the documentation; NFC
llvm-svn: 373880
Craig Topper [Mon, 7 Oct 2019 06:50:56 +0000 (06:50 +0000)]
[X86] Autogenerate checks in leaFixup32.mir and leaFixup64.mir. NFC
llvm-svn: 373878
Craig Topper [Mon, 7 Oct 2019 06:27:55 +0000 (06:27 +0000)]
[X86] Support LEA64_32r in processInstrForSlow3OpLEA and use INC/DEC when possible.
Move the erasing and iterator updating inside to match the
other slow LEA function.
I've adapted code from optTwoAddrLEA and basically rebuilt the
implementation here. We do lose the kill flags now just like
optTwoAddrLEA. This runs late enough in the pipeline that
shouldn't really be a problem.
llvm-svn: 373877
Yi-Hong Lyu [Mon, 7 Oct 2019 05:29:11 +0000 (05:29 +0000)]
[NFC][CGP] Tests for making ICMP_EQ use CR result of ICMP_S(L|G)T dominators
llvm-svn: 373876
Richard Smith [Mon, 7 Oct 2019 03:14:28 +0000 (03:14 +0000)]
[c++20] Check for a class-specific operator delete when deleting an
object of class type with a virtual destructor.
llvm-svn: 373875
Richard Smith [Mon, 7 Oct 2019 02:45:12 +0000 (02:45 +0000)]
Fix behavior of __builtin_bit_cast when the From and To types are the
same.
We were missing the lvalue-to-rvalue conversion entirely in this case,
and in fact still need the full CK_LValueToRValueBitCast conversion to
perform a load with no TBAA.
llvm-svn: 373874
Nico Weber [Mon, 7 Oct 2019 00:37:10 +0000 (00:37 +0000)]
gn build: no-op style tweak in sync script
llvm-svn: 373873
DeForest Richards [Sun, 6 Oct 2019 22:49:22 +0000 (22:49 +0000)]
[Docs] Removes Subsystem Documentation page
Removes Subsystem Documentation page. Also moves existing topics on Subsystem Documentation page to User Guides and Reference pages.
llvm-svn: 373872
Simon Pilgrim [Sun, 6 Oct 2019 21:11:45 +0000 (21:11 +0000)]
[X86][AVX] Access a scalar float/double as a free extract from a broadcast load (PR43217)
If a fp scalar is loaded and then used as both a scalar and a vector broadcast, perform the load as a broadcast and then extract the scalar for 'free' from the 0th element.
This involved switching the order of the X86ISD::BROADCAST combines so we only convert to X86ISD::BROADCAST_LOAD once all other canonicalizations have been attempted.
Adds a DAGCombinerInfo::recursivelyDeleteUnusedNodes wrapper.
Fixes PR43217
Differential Revision: https://reviews.llvm.org/D68544
llvm-svn: 373871
Simon Pilgrim [Sun, 6 Oct 2019 19:54:20 +0000 (19:54 +0000)]
Fix signed/unsigned warning. NFCI
llvm-svn: 373870
Amy Kwan [Sun, 6 Oct 2019 19:45:53 +0000 (19:45 +0000)]
[NFC][PowerPC] Reorganize CRNotPat multiclass patterns in PPCInstrInfo.td
This is patch aims to group together the `CRNotPat` multi class instantiations
within the `PPCInstrInfo.td` file.
Integer instantiations of the multi class are grouped together into a section,
and the floating point patterns are separated into its own section.
Differential Revision: https://reviews.llvm.org/D67975
llvm-svn: 373869
Simon Pilgrim [Sun, 6 Oct 2019 19:07:00 +0000 (19:07 +0000)]
[X86][SSE] Remove resolveTargetShuffleInputs and use getTargetShuffleInputs directly.
Move the resolveTargetShuffleInputsAndMask call to after the shuffle mask combine before the undef/zero constant fold instead.
llvm-svn: 373868
Simon Pilgrim [Sun, 6 Oct 2019 19:06:45 +0000 (19:06 +0000)]
[X86][SSE] Don't merge known undef/zero elements into target shuffle masks.
Replaces setTargetShuffleZeroElements with getTargetShuffleAndZeroables which reports the Zeroable elements but doesn't merge them into the decoded target shuffle mask (the merging has been moved up into getTargetShuffleInputs until we can get rid of it entirely).
This is part of the work to fix PR43024 and allow us to use SimplifyDemandedElts to simplify shuffle chains - we need to get to a point where the target shuffle mask isn't adjusted by its source inputs but instead we cache them in a parallel Zeroable mask.
llvm-svn: 373867
Richard Smith [Sun, 6 Oct 2019 18:50:40 +0000 (18:50 +0000)]
Implements CWG 1601 in [over.ics.rank/4.2]
Summary:
The overload resolution for enums with a fixed underlying type has changed in the C++14 standard. This patch implements the new rule.
Patch by Mark de Wever!
Reviewers: rsmith
Reviewed By: rsmith
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D65695
llvm-svn: 373866
Craig Topper [Sun, 6 Oct 2019 18:43:08 +0000 (18:43 +0000)]
[X86] Add custom type legalization for v16i64->v16i8 truncate and v8i64->v8i8 truncate when v8i64 isn't legal
Summary:
The default legalization for v16i64->v16i8 tries to create a multiple stage truncate concatenating after each stage and truncating again. But avx512 implements truncates with multiple uops. So it should be better to truncate all the way to the desired element size and then concatenate the pieces using unpckl instructions. This minimizes the number of 2 uop truncates. The unpcks are all single uop instructions.
I tried to handle this by just custom splitting the v16i64->v16i8 shuffle. And hoped that the DAG combiner would leave the two halves in the state needed to make D68374 do the job for each half. This worked for the first half, but the second half got messed up. So I've implemented custom handling for v8i64->v8i8 when v8i64 needs to be split to produce the VTRUNCs directly.
Reviewers: RKSimon, spatel
Reviewed By: RKSimon
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D68428
llvm-svn: 373864
Craig Topper [Sun, 6 Oct 2019 18:43:03 +0000 (18:43 +0000)]
[LegalizeTypes][X86] When splitting a vselect for type legalization, don't split a setcc condition if the setcc input is legal and vXi1 conditions are supported
Summary: The VSELECT splitting code tries to split a setcc input as well. But on avx512 where mask registers are well supported it should be better to just split the mask and use a single compare.
Reviewers: RKSimon, spatel, efriedma
Reviewed By: spatel
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D68359
llvm-svn: 373863
Richard Smith [Sun, 6 Oct 2019 18:40:59 +0000 (18:40 +0000)]
[Sema] Avoids an assertion failure when an invalid conversion declaration is used
Summary:
When using a user-defined conversion function template with a deduced return type the compiler gives a set of warnings:
```
bug.cc:252:44: error: cannot specify any part of a return type in the declaration of a conversion function; use an alias template to declare a conversion to 'auto (Ts &&...) const'
template <typename... Ts> operator auto()(Ts &&... xs) const;
^~~~~~~~~~~~~~~~~~~
bug.cc:252:29: error: conversion function cannot convert to a function type
template <typename... Ts> operator auto()(Ts &&... xs) const;
^
error: pointer to function type cannot have 'const' qualifier
```
after which it triggers an assertion failure. It seems the last error is incorrect and doesn't have any location information. This patch stops the compilation after the second warning.
Fixes bug 31422.
Patch by Mark de Wever!
Reviewers: rsmith
Reviewed By: rsmith
Subscribers: bbannier, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D64820
llvm-svn: 373862
Nico Weber [Sun, 6 Oct 2019 18:11:53 +0000 (18:11 +0000)]
gn build: make windows build less broken
llvm-svn: 373858