Hubert Tong [Mon, 6 Apr 2020 20:56:13 +0000 (16:56 -0400)]
[llvm-objdump][NFC] Declare command-line externs in headers with namespace
Summary:
This patch moves the forward declarations of command-line `cl::*`
externs in `MachODump.cpp` and `llvm-objdump.cpp` into the headers
corresponding to the file that defines the variable. At the same time,
these externs are moved into the `llvm::objdump` namespace. The externs
that are not referenced outside their defining translation unit are made
static.
This does not factor out uses of the Mach-O options from
`llvm-objdump.cpp`.
Reviewers: jhenderson, MaskRay, DiggerLin, jasonliu, daltenty
Reviewed By: jhenderson, MaskRay
Subscribers: rupprecht, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D77388
Nico Weber [Mon, 6 Apr 2020 20:50:02 +0000 (16:50 -0400)]
[gn build] (manually) port
6c1a9fb174ac3c
Leonard Chan [Fri, 3 Apr 2020 20:29:14 +0000 (13:29 -0700)]
[AsmPrinter] Do not define local aliases for global objects in a comdat
A global symbol that is defined in a comdat should not generate an alias since
call sites that would've referred to that symbol will refer to their own
independent local aliases rather than the surviving global comdat one. This
could result in something that looks like:
```
ld.lld: error: relocation refers to a discarded section: .text._ZN3fbl8internal18NullFunctionTargetIvJjjPjEED1Ev.stub
>>> defined in user-x64-clang/obj/system/ulib/minfs/libminfs.a(minfs._sources.file.cc.o)
>>> section group signature: _ZN3fbl8internal18NullFunctionTargetIvJjjPjEED1Ev.stub
>>> prevailing definition is in user-x64-clang/obj/system/ulib/minfs/libminfs.a(minfs._sources.vnode.cc.o)
>>> referenced by function.h:169 (../../zircon/system/ulib/fbl/include/fbl/function.h:169)
>>> minfs._sources.file.cc.o:(minfs::File::AllocateAndCommitData(std::__2::unique_ptr<minfs::Transaction, std::__2::default_delete<minfs::Transaction> >)) in archive user-x64-clang/obj/system/ulib/minfs/libminfs.a
```
We ran into this when experimenting with a new C++ ABI for fuchsia
(refer to D72959) which takes relative offsets between comdat'd functions
which is why the normal C++ user wouldn't run into this.
Differential Revision: https://reviews.llvm.org/D77429
Nico Weber [Mon, 6 Apr 2020 20:46:24 +0000 (16:46 -0400)]
Make llvm_source_root in llvm-lit relative too.
No intended behavior change.
Nick Desaulniers [Mon, 6 Apr 2020 20:34:06 +0000 (13:34 -0700)]
[SelectionDAG] fix predecessor list for INLINEASM_BRs' parent
Summary:
A bug report mentioned that LLVM was producing jumps off the end of a
function when using "asm goto with outputs". Further digging pointed to
MachineBasicBlocks that had their address taken and were indirect
targets of INLINEASM_BR being removed by BranchFolder, because their
predecessor list was empty, so they appeared to have no entry.
This was a cascading failure caused earlier, during Pre-RA instruction
scheduling. We have a few special cases in Pre-RA instruction scheduling
where we split a MachineBasicBlock in two. This requires careful
handing of predecessor and successor lists for a MachineBasicBlock that
was split, and careful handing of PHI MachineInstrs that referred to the
MachineBasicBlock before it was split.
The clue that led to this fix was the observation that many callers of
MachineBasicBlock::splice() frequently call
MachineBasicBlock::transferSuccessorsAndUpdatePHIs() to update their PHI
nodes after a splice. We don't want to reuse that method, as we have
custom successor transferring logic for this block split.
This patch fixes 2 pre-existing bugs, and adds tests.
The first bug was that MachineBasicBlock::splice() correctly handles
updating most successors and predecessors; we don't need to do anything
more than removing the previous fallthrough block from the first half of
the split block post splice. Previously, we were updating the successor
list incorrectly (updating successors updates predecessors).
The second bug was that PHI nodes that needed registers from the first
half of the split block were not having entries populated. The register
live out information was correct, and the FuncInfo->PHINodesToUpdate was
correct. Specifically, the check in SelectionDAGISel::FinishBasicBlock:
for (unsigned i = 0, e = FuncInfo->PHINodesToUpdate.size(); i != e; ++i) {
MachineInstrBuilder PHI(*MF, FuncInfo->PHINodesToUpdate[i].first);
if (!FuncInfo->MBB->isSuccessor(PHI->getParent()))
continue;
PHI.addReg(FuncInfo->PHINodesToUpdate[i].second).addMBB(FuncInfo->MBB);
was `continue`ing because FuncInfo->MBB tracks the second half of
the post-split block; no one was updating PHI entries for the first half
of the post-split block.
SelectionDAGBuilder::UpdateSplitBlock() already expects to perform
special handling for MachineBasicBlocks that were split post calls to
ScheduleDAGSDNodes::EmitSchedule(), so I'm confident that it's both
correct for ScheduleDAGSDNodes::EmitSchedule() to return the second half
of the split block `CopyBB` which updates `FuncInfo->MBB` (ie. the
current MachineBasicBlock being processed), and perform special handling
for this in SelectionDAGBuilder::UpdateSplitBlock().
Reviewers: void, craig.topper, efriedma
Reviewed By: void, efriedma
Subscribers: hfinkel, fhahn, MatzeB, efriedma, hiraditya, llvm-commits, srhines
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D76961
Dan Albert [Mon, 6 Apr 2020 20:34:27 +0000 (13:34 -0700)]
Upstream Bionic definitions of ctype_base/regex.
Summary:
This is a patch that Android has been carrying in its tree for several
years. This patch upstreams the existing ABI.
There's some historical cruft here. __regex_word used to be a part of
regex_traits rather than ctype_base. Bionic also used to use its own
ctype implementation because the libc++ builtin one wasn't available
yet. Bionic's ctype masks were 8 bits wide and already saturated, so a
wider type needed to be used for the regex mask, and the existing
value was already used so Android needed to specify its own.
Since then Android has migrated to the builtin ctype implementation
and this patch probably should have been dropped then. Unfortunately
that was not noticed at the time, so now we need to keep this to
maintain the current ABI.
Reviewers: EricWF, #libc, ldionne
Reviewed By: #libc, ldionne
Subscribers: dexonsmith, ldionne, libcxx-commits
Tags: #libc
Differential Revision: https://reviews.llvm.org/D76171
Davide Italiano [Thu, 2 Apr 2020 20:22:52 +0000 (13:22 -0700)]
[debugserver] Get rid of `else` after `return`. NFC.
Sergej Jaskiewicz [Mon, 6 Apr 2020 20:26:37 +0000 (23:26 +0300)]
[libunwind] Support the new libc++ test format
Reviewers: ldionne, #libunwind, mstorsjo
Reviewed By: ldionne, #libunwind, mstorsjo
Subscribers: mstorsjo, dexonsmith, llvm-commits, libcxx-commits
Tags: #llvm, #libunwind
Differential Revision: https://reviews.llvm.org/D77501
Chris Lattner [Mon, 6 Apr 2020 20:18:49 +0000 (13:18 -0700)]
Minor typo improvements in documentation, NFC.
Matt Arsenault [Thu, 6 Feb 2020 17:02:51 +0000 (12:02 -0500)]
AMDGPU: Remove dead paths for requiresUniformRegister
The extracts from control flow intrinsics are already properly handled
by divergence analysis. The inline asm case isn't dead, but has also
never really worked correctly so leave it as-is for now.
Erik Pilkington [Mon, 6 Apr 2020 14:17:30 +0000 (10:17 -0400)]
[CodeGenObjC] Fix a crash when attempting to copy a zero-sized bit-field in a non-trivial C struct
Zero sized bit-fields aren't included in the CGRecordLayout, so we shouldn't be
calling EmitLValueForField for them. rdar://
60695105
Differential revision: https://reviews.llvm.org/D76782
Kadir Cetinkaya [Mon, 6 Apr 2020 19:36:43 +0000 (21:36 +0200)]
[clangd] Fix bad include
Nico Weber [Mon, 6 Apr 2020 19:25:19 +0000 (15:25 -0400)]
Delete a variable that's been unused since r313407.
No intended behavior change.
LLVM GN Syncbot [Mon, 6 Apr 2020 19:22:43 +0000 (19:22 +0000)]
[gn build] Port
427c1dc4f42
Kadir Cetinkaya [Sun, 15 Mar 2020 20:43:00 +0000 (21:43 +0100)]
[clangd] Build ASTs only with fresh preambles or after building a new preamble
Summary:
This is another step for out-of-order preamble builds. To keep the
diagnostic behavior same, we only build ASTs either with "usable" preambles,
the ones that are fully applicable to a given ParseInput, or after building a
new preamble. Which is the same behaviour as what we do today. ASTs
built in the latter is called golden ASTs.
Reviewers: sammccall
Subscribers: ilya-biryukov, javed.absar, MaskRay, jkorous, arphaman, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D76725
Kadir Cetinkaya [Tue, 17 Mar 2020 18:08:23 +0000 (19:08 +0100)]
[clangd] Update TUStatus api to accommodate preamble thread
Summary:
TUStatus api had a single thread in mind. This introudces a section
action to represent state of the preamble thread. In the file status extension,
we keep old behavior almost the same. We only prepend current task with a
`parsing includes` if preamble thread is working. We omit the idle thread in the
output unless both threads are idle.
Reviewers: sammccall
Subscribers: ilya-biryukov, javed.absar, MaskRay, jkorous, arphaman, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D76304
Kadir Cetinkaya [Fri, 13 Mar 2020 10:52:19 +0000 (11:52 +0100)]
[clangd] Decouple preambleworker from astworker, NFCI
Summary:
First step to enable deferred preamble builds. Not intending to land it
alone, will have follow-ups that will implement full deferred build
functionality and will land after all of them are ready.
Reviewers: sammccall
Subscribers: ilya-biryukov, javed.absar, MaskRay, jkorous, arphaman, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D76125
Nathan James [Mon, 6 Apr 2020 19:19:12 +0000 (20:19 +0100)]
Fix mismatch from D77112 and D77499
Nathan James [Sun, 5 Apr 2020 14:33:34 +0000 (15:33 +0100)]
[ASTMatchers] Matchers that take enumerations args provide hints with invalid arguments
Summary:
This adds support for giving hints when using dynamic matchers with enum args. Take this query, I couldn't figure out why the matcher wasn't working:
(Turns out it needed to be "IntegralToBoolean", but thats another bug itself)
```
clang-query> match implicitCastExpr(hasCastKind("CK_IntegralToBoolean"))
1:1: Error parsing argument 1 for matcher implicitCastExpr.
1:18: Error building matcher hasCastKind.
1:30: Incorrect type for arg 1. (Expected = string) != (Actual = String)
```
With this patch the new behaviour looks like this:
```
clang-query> match implicitCastExpr(hasCastKind("CK_IntegralToBoolean"))
1:1: Error parsing argument 1 for matcher implicitCastExpr.
1:18: Error building matcher hasCastKind.
1:30: Unknown value 'CK_IntegralToBoolean' for arg 1; did you mean 'IntegralToBoolean'
```
There are no test cases for this yet as there simply isn't any infrastructure for testing errors reported when parsing args that I can see.
Reviewers: klimek, jdoerfert, aaron.ballman
Reviewed By: aaron.ballman
Subscribers: aaron.ballman, dexonsmith, mgorny, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D77499
Francesco Petrogalli [Mon, 6 Apr 2020 18:25:17 +0000 (19:25 +0100)]
[llvm][CodeGen] Avoid implicit cast of TypeSize to integer in `initActions`.
Reviewers: sdesmalen, efriedma
Reviewed By: efriedma
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D77317
Heejin Ahn [Sat, 4 Apr 2020 13:56:35 +0000 (06:56 -0700)]
[WebAssembly] Handle event exports
Summary: This handles exports of events, which was missing.
Reviewers: sbc100
Subscribers: dschuff, jgravelle-google, sunfish, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D77566
Reid Kleckner [Mon, 6 Apr 2020 18:14:59 +0000 (11:14 -0700)]
Remove math.h/cmath include from DataTypes.h
DataTypes.h is meant to wrap the integer type and limits headers, which
have some unfortunate variance. The FP math functions declared by math.h
are not unnecessary. math.h took a noticeable amount of time to parse
(~40ms), but that could be startup costs.
Anyway, we don't need to include it, so skipping it can't hurt.
This has been present since the initial CMake build was added in 2008.
Masoud Ataei jaliseh [Mon, 6 Apr 2020 18:16:48 +0000 (13:16 -0500)]
Add InjectTLIMappings pass to new pass manager
This pass is created in
d6de5f12d485a85504bc99d384a85634574a27e2 and tested
for new and legacy pass manager but never added to new pass manager pipeline.
I am adding it to new pass manager pipeline.
This pass is get used in Vector Function Database (VFDatabase) and without
this pass in new pass manager pipeline, none of the vector libraries are work
ing with new pass manager.
Related passes:
66c120f02560ef528a60924104ead66f330190f1
https://reviews.llvm.org/D74944
Differential revision: https://reviews.llvm.org/D75354
River Riddle [Mon, 6 Apr 2020 18:04:22 +0000 (11:04 -0700)]
[mlir][AsmPrinter] Change value numbering for local scope to be the next isolated operation.
Summary: This revision updates the value numbering when printing to number from the next parent operation that is isolated from above. This is the highest level to number from that still ensures thread-safety. This revision also changes the behavior of Operator::operator<< to use local scope to avoid thread races when numbering operations.
Differential Revision: https://reviews.llvm.org/D77525
Kadir Cetinkaya [Mon, 6 Apr 2020 17:13:08 +0000 (19:13 +0200)]
[clang][CodeComplete] Dont perform fallback completion for incomplete member ref
Summary:
Clang performs expression based completion whenever it can't figure out
base of a member reference expression. It might be quite confusing in cases like
incomplete types. This patch disables that fallback.
Unfortunately `ParsePostfixExpressionSuffix` is quite tangled and this patch
adds more to it.
Reviewers: sammccall
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D77570
Johannes Doerfert [Mon, 6 Apr 2020 17:39:40 +0000 (12:39 -0500)]
[OpenMP] Fix layering problem with FrontendOpenMP
Summary:
ASTMatchers is used in various places and it now exposes the
LLVMFrontendOpenMP library to its users without them needing to depend
on it explicitly.
Reviewers: lebedev.ri
Subscribers: mgorny, yaxunl, bollu, guansong, martong, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D77574
Craig Topper [Mon, 6 Apr 2020 17:22:50 +0000 (10:22 -0700)]
[SelectionDAGBuilder] Fix ISD::FREEZE creation for structs with fields of different types.
The previous code used the type of the first field for the VT
passed to getNode for every field.
I've based the implementation here off what is done in visitSelect
as it removes the need to special case aggregates.
Differential Revision: https://reviews.llvm.org/D77093
Yaxun (Sam) Liu [Mon, 6 Apr 2020 17:52:47 +0000 (13:52 -0400)]
[NFC] Minor fix for deferred diagnostics emitter
Differential Revision: https://reviews.llvm.org/D77028
Sid Manning [Sun, 5 Apr 2020 00:36:00 +0000 (19:36 -0500)]
[Hexagon] Make lld be the default linker for linux/musl
When the target is hexagon-unknown-linux-musl select lld as the default
linker.
Differential Revision: https://reviews.llvm.org/D77498
Louis Dionne [Fri, 3 Apr 2020 16:49:09 +0000 (12:49 -0400)]
[lit] Move the recursiveExpansionLimit setting to TestingConfig
The LitConfig is shared across the whole test suite. However, since
enabling recursive expansion can be a breaking change for some test
suites, it's important to confine the setting to test suites that
enable it explicitly.
Note that other issues were raised with the way recursiveExpansionLimit
operates. However, this commit simply moves the setting to the right
place -- the mechanism by which it works can be improved independently.
Differential Revision: https://reviews.llvm.org/D77415
LLVM GN Syncbot [Mon, 6 Apr 2020 17:54:02 +0000 (17:54 +0000)]
[gn build] Port
00a57558978
Konstantin Pyzhov [Mon, 6 Apr 2020 09:56:11 +0000 (05:56 -0400)]
Paula Toth [Mon, 6 Apr 2020 17:40:50 +0000 (10:40 -0700)]
[clang-tidy] Add check llvmlibc-implementation-in-namespace.
Summary:
This check makes sure all llvm-libc implementations falls within the `__llvm_libc` namespace.
Reviewers: alexfh, aaron.ballman, hokein, njames93
Reviewed By: aaron.ballman
Subscribers: Eugene.Zelenko, libc-commits, mgorny, xazax.hun, MaskRay, cfe-commits, sivachandra
Tags: #clang-tools-extra, #clang
Differential Revision: https://reviews.llvm.org/D76818
Kirill Naumov [Mon, 6 Apr 2020 16:53:10 +0000 (16:53 +0000)]
[CFGPrinter][CallPrinter][polly] Adding distinct structure for CFGDOTInfo
The patch introduces the system to distinctively store the information
needed for the Control Flow Graph as well as the instrumentary needed for
the follow-up changes: BlockFrequencyInfo and BranchProbabilityInfo.
The patch is a part of sequence of three patches, related to graphs Heat Coloring.
Reviewers: rcorcs, apilipenko, davidxl, sfertile, fedor.sergeev, eraman, bollu
Differential Revision: https://reviews.llvm.org/D76820
Reid Kleckner [Mon, 6 Apr 2020 17:32:16 +0000 (10:32 -0700)]
Remove llvm::Error include form Diagnostic.h
Saves ~400 related LLVM ADT. llvm/ADT/Error.h takes 90ms to parse.
$ diff -u <(sort thedeps-before.txt) <(sort thedeps-after.txt) \
| grep '^[-+] ' | sort | uniq -c | sort -nr
403 - /usr/local/google/home/rnk/llvm-project/llvm/include/llvm/Support/Error.h
403 - /usr/local/google/home/rnk/llvm-project/llvm/include/llvm-c/Error.h
397 - /usr/local/google/home/rnk/llvm-project/llvm/include/llvm/Support/Format.h
397 - /usr/local/google/home/rnk/llvm-project/llvm/include/llvm/Support/Debug.h
377 - /usr/local/google/home/rnk/llvm-project/llvm/include/llvm/ADT/StringExtras.h
158 - /usr/local/google/home/rnk/llvm-project/llvm/include/llvm-c/ExternC.h
138 - /usr/local/google/home/rnk/llvm-project/llvm/include/llvm/Support/ErrorOr.h
13 - /usr/local/google/home/rnk/llvm-project/llvm/include/llvm/Support/raw_ostream.h
13 - /usr/local/google/home/rnk/llvm-project/llvm/include/llvm/ADT/SmallString.h
5 - /usr/local/google/home/rnk/llvm-project/llvm/include/llvm/ADT/Twine.h
Jean-Michel Gorius [Mon, 6 Apr 2020 17:38:00 +0000 (19:38 +0200)]
[mlir] Fix typo in docs/DefiningAttributesAndTypes.md
Louis Dionne [Mon, 6 Apr 2020 16:43:55 +0000 (12:43 -0400)]
[libc++] Make sure we execute tests with the current environment
The new libc++ test format doesn't automatically do this (cause it
would be the wrong place to do it).
Artem Dergachev [Mon, 6 Apr 2020 17:27:40 +0000 (20:27 +0300)]
[analyzer] Fix NSErrorChecker false positives on constructors.
Constructors and delete operators cannot return a boolean value.
Therefore they cannot possibly follow the NS/CFError-related coding
conventions.
Patch by Valeriy Savchenko!
Differential Revision: https://reviews.llvm.org/D77551
Artem Dergachev [Mon, 6 Apr 2020 17:18:13 +0000 (20:18 +0300)]
[analyzer] Fix scan-build and exploded-graph-rewriter tests on Windows.
Detect script locations in a more straightforward way: we don't need to
search for them because we know exactly where they are anyway.
Fix a file path escaping issue in exploded-graph-rewriter with Windows
backslashes in the path.
'REQUIRES: shell' remains in scan-build tests for now, so that to
observe the buildbot reaction on removing it in a cleaner experiment.
Patch by Denys Petrov!
Differential Revision: https://reviews.llvm.org/D76768
Reid Kleckner [Mon, 6 Apr 2020 16:55:33 +0000 (09:55 -0700)]
[AST] Remove DeclCXX.h dep on ASTContext.h
Saves only 36 includes of ASTContext.h and related headers.
There are two deps on ASTContext.h:
- C++ method overrides iterator types (TinyPtrVector)
- getting LangOptions
For #1, duplicate the iterator type, which is
TinyPtrVector<>::const_iterator.
For #2, add an out-of-line accessor to get the language options. Getting
the ASTContext from a Decl is already an out of line method that loops
over the parent DeclContexts, so if it is ever performance critical, the
proper fix is to pass the context (or LangOpts) into the predicate in
question.
Other changes are just header fixups.
Yaxun (Sam) Liu [Thu, 2 Apr 2020 03:26:56 +0000 (23:26 -0400)]
Speed up deferred diagnostic emitter
Move function emitDeferredDiags from Sema to DeferredDiagsEmitter since it
is only used by DeferredDiagsEmitter.
Also skip visited functions to avoid exponential compile time.
Differential Revision: https://reviews.llvm.org/D77028
Konstantin Pyzhov [Mon, 6 Apr 2020 09:10:37 +0000 (05:10 -0400)]
[AMDGPU] Disable 'Skip Uniform Regions' optimization by default for AMDGPU.
Reviewers: sameerds, dstuttard
Differential Revision: https://reviews.llvm.org/D77228
Matt Morehouse [Mon, 6 Apr 2020 16:55:56 +0000 (09:55 -0700)]
[sanitizer_common] Update global_symbols.txt.
Matt Morehouse [Mon, 6 Apr 2020 16:55:03 +0000 (09:55 -0700)]
Revert "[sanitizer_common] Show new unexpected symbols."
This reverts commit
68d73dfa1a422fd045e25d06c3e8ff01621c377a.
Matt Morehouse [Mon, 6 Apr 2020 16:54:56 +0000 (09:54 -0700)]
Revert "[sanitizer_common] Update global_symbols.txt."
This reverts commit
98bb7fdbe586e7f95588c99c5363e94870da75f5.
Fangrui Song [Tue, 10 Mar 2020 00:35:50 +0000 (17:35 -0700)]
[AArch64] Allow logical immediates to have all-1 in top bits
So that constant expressions like the following are permitted:
and w0, w0, #~(0xfe<<24)
and w1, w1, #~(0xff<<24)
The behavior matches GNU as (opcodes/aarch64-opc.c:aarch64_logical_immediate_p).
Reviewed By: sdesmalen
Differential Revision: https://reviews.llvm.org/D75885
Florian Hahn [Mon, 6 Apr 2020 16:53:38 +0000 (17:53 +0100)]
[LV] Fix value that could be read uninitialized.
This should fix
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap-msan/builds/18569
Amy Huang [Tue, 31 Mar 2020 20:31:42 +0000 (13:31 -0700)]
[DebugInfo] Change to constructor homing debug info mode: skip literal types
Summary:
In constructor type homing mode sometimes complete debug info for constexpr
types was missing, because there was not a constructor emitted. This change
makes constructor type homing ignore constexpr types.
Reviewers: rnk, dblaikie
Subscribers: aprantl, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D77432
Fangrui Song [Wed, 1 Apr 2020 23:11:31 +0000 (16:11 -0700)]
[ELF] Make --version-script/--dynamic-list work for lazy symbols fetched by LTO libcalls
Fixes https://bugs.llvm.org/show_bug.cgi?id=45391
The LTO code generator happens after version script scanning and may
create references which will fetch some lazy symbols.
Currently a version script does not assign VER_NDX_LOCAL to lazy symbols
and such symbols will be made global after they are fetched.
Change findByVersion and findAllByVersion to work on lazy symbols.
For unfetched lazy symbols, we should keep them non-local (D35263).
Check isDefined() in computeBinding() as a compensation.
This patch fixes a companion bug that --dynamic-list does not export
libcall fetched symbols.
Reviewed By: grimar
Differential Revision: https://reviews.llvm.org/D77280
Matt Morehouse [Mon, 6 Apr 2020 16:42:32 +0000 (09:42 -0700)]
[sanitizer_common] Update global_symbols.txt.
Matt Morehouse [Mon, 6 Apr 2020 16:39:53 +0000 (09:39 -0700)]
[sanitizer_common] Show new unexpected symbols.
Louis Dionne [Mon, 6 Apr 2020 16:40:54 +0000 (12:40 -0400)]
[libc++] Mark two std::timed_mutex tests as flaky
Nikita Popov [Sat, 4 Apr 2020 22:46:20 +0000 (00:46 +0200)]
[RDA] Only store most recent reaching def from predecessors (NFCI)
When entering a basic block, RDA inserts reaching definitions coming
from predecessor blocks (which will be negative numbers) in a rather
peculiar way. If you have incoming reaching definitions -4, -3, -2, -1,
it will insert those. If you have incoming reaching definitions
-1, -2, -3, -4, it will insert -1, -1, -1, -1, as the max is taken
at each step. That's probably not what was intended...
However, RDA only actually cares about the most recent reaching
definition from a predecessor (to calculate clearance), so this
ends up working fine as far as behavior is concerned. It does
waste memory on unnecessary reaching definitions though.
This patch changes the implementation to first compute the most
recent reaching definition in one loop, and then insert only that
one in a separate loop.
Differential Revision: https://reviews.llvm.org/D77508
Sanjay Patel [Mon, 6 Apr 2020 16:34:59 +0000 (12:34 -0400)]
[x86] add size cost tests for casts and binops; NFC
Shows bugs for div/rem/fdiv and possibly others.
Nikita Popov [Sun, 5 Apr 2020 17:16:56 +0000 (19:16 +0200)]
[RDA] Don't adjust ReachingDefDefaultVal (NFCI)
At the end of a basic block, RDA adjusts all the reaching defs it
found to be relative to the end of the basic block, rather than the
start of it. However, it also does this to registers which don't
have a reaching def, indicated by ReachingDefDefaultVal. This means
that code checking against ReachingDefDefaultVal will not skip them,
and may insert them into the reaching definition list. This is
ultimately harmless, but causes unnecessary work and is logically
not right.
Differential Revision: https://reviews.llvm.org/D77506
Alexey Bataev [Mon, 6 Apr 2020 15:49:17 +0000 (11:49 -0400)]
[OPENMP]Fix PR45439: `omp for collapse(2) ordered(2)` generates invalid
IR.
Fixed a crash because of the not quite correct casting of the value of
iterations.
Kazuaki Ishizaki [Mon, 6 Apr 2020 16:06:02 +0000 (01:06 +0900)]
[lldb] NFC: Fix trivial typo in comments, documents, and messages
Differential Revision: https://reviews.llvm.org/D77460
Scott Linder [Fri, 3 Apr 2020 19:48:28 +0000 (15:48 -0400)]
Use in-tree clang-format-diff.py as Arcanist linter
Summary:
The only guarantee there seems to be in the clang-format packaging is
that an executable called `clang-format` is in the PATH. Use the
in-tree `clang-format-diff.py` to avoid assuming anything else.
Also remove dead code for SVN repo and switch to `git diff-index` which
is the git plumbing equivalent of `git diff` in this case.
Reviewers: starsid, mehdi_amini, vitalybuka, fhahn, kadircet
Subscribers: llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D77428
Jonathan Roelofs [Mon, 6 Apr 2020 15:37:14 +0000 (09:37 -0600)]
[llvm-objdump] Fix case of -Wmismatched-tags
Jonathan Roelofs [Thu, 2 Apr 2020 22:28:32 +0000 (16:28 -0600)]
[llvm] Fix missing FileCheck directive colons
https://reviews.llvm.org/D77352
Sanjay Patel [Mon, 6 Apr 2020 15:40:45 +0000 (11:40 -0400)]
[ValueTracking] enhance matching of umin/umax with 'not' operands
The cmyk test is based on the known regression that resulted from:
rGf2fbdf76d8d0
This improves on the equivalent signed min/max change:
rG867f0c3c4d8c
The underlying icmp equivalence is:
~X pred ~Y --> Y pred X
For an icmp with constant, canonicalization results in a swapped pred:
~X < C --> X > ~C
BoYao Zhang [Mon, 6 Apr 2020 15:49:51 +0000 (11:49 -0400)]
Fix a typo in an assert message; NFC.
Matt Arsenault [Mon, 6 Apr 2020 01:16:00 +0000 (21:16 -0400)]
AMDGPU/GlobalISel: Select llvm.amdgcn.div.scale
Matt Arsenault [Sun, 5 Apr 2020 23:49:09 +0000 (19:49 -0400)]
AMDGPU/GlobalISel: Fix llvm.amdgcn.div.fmas.ll
Jay Foad [Mon, 6 Apr 2020 15:44:08 +0000 (16:44 +0100)]
[AMDGPU] Fix inaccurate comments
Louis Dionne [Mon, 6 Apr 2020 15:04:13 +0000 (11:04 -0400)]
[libc++] Always use -fsyntax-only in .fail.cpp tests
We had a workaround because GCC 5 does not evaluate static assertions
that are dependent on template parameters. This commit removes the
workaround and marks the corresponding tests as unsupported with GCC 5.
This has the benefit of bringing the new and the old test formats closer
without having to carry a workaround for an old compiler in the new
test format.
Gabor Marton [Fri, 3 Apr 2020 15:01:00 +0000 (17:01 +0200)]
[analyzer] StdLibraryFunctionsChecker: match signature based on FunctionDecl
Summary:
Currently we match the summary signature based on the arguments in the CallExpr.
There are a few problems with this approach.
1) Variadic arguments are handled badly. Consider the below code:
int foo(void *stream, const char *format, ...);
void test_arg_constraint_on_variadic_fun() {
foo(0, "%d%d", 1, 2); // CallExpr
}
Here the call expression holds 4 arguments, whereas the function declaration
has only 2 `ParmVarDecl`s. So there is no way to create a summary that
matches the call expression, because the discrepancy in the number of
arguments causes a mismatch.
2) The call expression does not handle the `restrict` type qualifier.
In C99, fwrite's signature is the following:
size_t fwrite(const void *restrict, size_t, size_t, FILE *restrict);
However, in a call expression, like below, the type of the argument does not
have the restrict qualifier.
void test_fread_fwrite(FILE *fp, int *buf) {
size_t x = fwrite(buf, sizeof(int), 10, fp);
}
This can result in an unmatches signature, so the summary is not applied.
The solution is to match the summary against the referened callee
`FunctionDecl` that we can query from the `CallExpr`.
Further patches will continue with additional refactoring where I am going to
do a lookup during the checker initialization and the signature match will
happen there. That way, we will not check the signature during every call,
rather we will compare only two `FunctionDecl` pointers.
Reviewers: NoQ, Szelethus, gamesh411, baloghadamsoftware
Subscribers: whisperity, xazax.hun, kristof.beyls, szepet, rnkovacs, a.sidorin, mikhail.ramalho, donat.nagy, dkrupp, Charusso, steakhal, danielkiss, ASDenysPetrov, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D77410
Louis Dionne [Mon, 6 Apr 2020 14:25:51 +0000 (10:25 -0400)]
[libc++] Make sure we include %{flags} when building with the new format
Otherwise, we're missing some flags like the flags that are used by
sanitizer builds and the 32-bit builds. In the long term, I think it
would be better to have only %{compile_flags} and %{link_flags}, but
for the benefit of adopting the new format by default, I think it's OK
to add %{flags} to it.
Louis Dionne [Mon, 6 Apr 2020 14:46:14 +0000 (10:46 -0400)]
[libc++] Mark is_scalar test as unsupported in C++11 and C++14
That test requires std::optional. We never noticed that because our
test format was skipping Objective-C++ tests altogether.
Nicolas Vasilache [Mon, 6 Apr 2020 15:18:28 +0000 (11:18 -0400)]
[mlir][Linalg] Add a linalg.tensor_reshape to operate on tensors
Summary:
This revision adds a tensor_reshape operation that operates on tensors.
In the tensor world the constraints are less stringent and we can allow more
arbitrary dynamic reshapes, as long as they are contractions.
The expansion of a dynamic dimension into multiple dynamic dimensions is under-specified and is punted on for now.
Differential Revision: https://reviews.llvm.org/D77360
Sanjay Patel [Mon, 6 Apr 2020 15:12:16 +0000 (11:12 -0400)]
[ValueTracking] add/adjust tests for min/max; NFC
Martin Probst [Mon, 6 Apr 2020 13:20:54 +0000 (15:20 +0200)]
clang-format: [JS] handle pseudo-keywords.
Summary:
The previous change in https://reviews.llvm.org/D77311 attempted to
detect more C++ keywords. However it also precisely detected all
JavaScript keywords. That's generally correct, but many JavaScripy
keywords, e.g. `get`, are so-called pseudo-keywords. They can be used in
positions where a keyword would never be legal, e.g. in a dotted
expression:
x.type; // type is a pseudo-keyword, but can be used here.
x.get; // same for get etc.
This change introduces an additional parameter to
`IsJavaScriptIdentifier`, allowing clients to toggle whether they want
to allow `IdentifierName` tokens, i.e. pseudo-keywords.
Reviewers: krasimir
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D77548
Gabor Marton [Fri, 3 Apr 2020 15:56:28 +0000 (17:56 +0200)]
[analyzer] StdLibraryFunctionsChecker: Add test for function with default parameter
Reviewers: Szelethus, baloghadamsoftware, gamesh411, steakhal, balazske
Subscribers: whisperity, xazax.hun, szepet, rnkovacs, a.sidorin, mikhail.ramalho, donat.nagy, dkrupp, Charusso, ASDenysPetrov, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D77411
Florian Hahn [Mon, 6 Apr 2020 14:59:45 +0000 (15:59 +0100)]
[VPlan] Introduce new VPWidenCallRecipe (NFC).
This patch moves calls to their own recipe, to simplify the transition
to VPUser for operands of VPWidenRecipe, as discussed in D76992.
Subsequently additional information can be added to the recipe rather
than computing it during the execute step.
Reviewers: rengolin, Ayal, gilr, hsaito
Reviewed By: gilr
Differential Revision: https://reviews.llvm.org/D77467
Chris Bowler [Mon, 6 Apr 2020 14:41:48 +0000 (10:41 -0400)]
[AIX][PPC] Implement by-val caller arguments in multiple registers
Differential Revision: https://reviews.llvm.org/D76380
Matt Arsenault [Thu, 6 Feb 2020 19:44:56 +0000 (14:44 -0500)]
AMDGPU/GlobalISel: Add unmerge of concat tests
Guillaume Chatelet [Mon, 6 Apr 2020 10:53:56 +0000 (10:53 +0000)]
[Alignment][NFC] Assume AlignmentFromAssumptions::getNewAlignment is always set.
Summary:
In D77454 we explain that `LoadInst` and `StoreInst` always have their alignment defined.
This allows to work backward here and to infer that `getNewAlignment` does not need to return `0` in case of failure.
Returning `1` also works since it needs to be greater than the Load/Store alignment which is a least `1`.
This is patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790
Reviewers: courbet
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D77538
Nico Weber [Mon, 6 Apr 2020 14:47:41 +0000 (10:47 -0400)]
try to fix tsan bot
Chris Bowler [Mon, 6 Apr 2020 13:51:21 +0000 (09:51 -0400)]
[NFC][PPC][AIX] Test updates for byval args that fit in a single register
Differential Revision: https://reviews.llvm.org/D76875
diggerlin [Mon, 6 Apr 2020 14:09:12 +0000 (10:09 -0400)]
[llvm-objdump][XCOFF] Use symbol index+symbol name + storage mapping class as label for -D
SUMMARY:
For the llvm-objdump -D, the symbol name is used as a label in the disassembly for the specific address (when a symbol address is equal to the virtual address in the dump).
In XCOFF, multiple symbols may have the same name, being differentiated by their storage mapping class. It is helpful to print the QualName and not just the name when forming the output label for a csect symbol. The symbol index further removes any ambiguity caused by duplicate names.
To maintain compatibility with the binutils objdump, the XCOFF-specific --symbol-description option is added to enable the enhanced format.
Reviewers: hubert.reinterpretcast, James Henderson, Jason Liu ,daltenty
Subscribers: wuzish, nemanjai, hiraditya
Differential Revision: https://reviews.llvm.org/D72973
Konrad Kleine [Mon, 6 Apr 2020 12:37:58 +0000 (08:37 -0400)]
[lldb][nfc] remove overriden funcs with default impl
Summary:
These `SearchFilter` methods all return `true` by their default
implementation:
```lang=c++
virtual bool ModulePasses(const FileSpec &spec);
virtual bool ModulePasses(const lldb::ModuleSP &module_sp);
virtual bool AddressPasses(Address &addr);
virtual bool CompUnitPasses(FileSpec &fileSpec);
virtual bool CompUnitPasses(CompileUnit &compUnit);
```
That's why I've documented the default behavior and remove the overrides
(except for `AddressPasses`) in these `SearchFilter`-subclasses which all just
repeated the default implementation: `SearchFilterByModule`,
`SearchFilterByModuleList`.
Reviewers: jankratochvil, labath
Reviewed By: jankratochvil, labath
Subscribers: labath, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D77376
Hans Wennborg [Mon, 6 Apr 2020 14:01:48 +0000 (16:01 +0200)]
Make clang/test/Driver/cl-options.cu pass in 32-bit builds
Johannes Doerfert [Mon, 6 Apr 2020 13:59:47 +0000 (08:59 -0500)]
[OpenMP][FIX] Add missing cmake dependence needed after
931c0cd713ee
Louis Dionne [Mon, 6 Apr 2020 13:33:08 +0000 (09:33 -0400)]
[libc++] SSH: Fix tarring of dependencies on Windows
On Windows, we must make sure to close the temporary tar file before we
try to scp it.
This is an alternative approach to https://reviews.llvm.org/D77500.
Michael Kruse [Thu, 2 Apr 2020 15:06:17 +0000 (10:06 -0500)]
[Polly] Add -polly-isl-arg command line option.
The option is passed as argv to ISL's command line option parser.
Polly's own own command line options take precedence over options passed
as `-polly-isl-arg`. For instance,
`-polly-isl-arg=--schedule-outer-coincidence` will be ignored in favor
of `-polly-opt-outer-coincidence`.
Reviewed By: grosser
Differential Revision: https://reviews.llvm.org/D77303
Benjamin Kramer [Mon, 6 Apr 2020 13:21:16 +0000 (15:21 +0200)]
[MC] Use a byte_swap in emitIntValue instead of doing it in a loop. NFCI.
Florian Hahn [Mon, 6 Apr 2020 13:44:00 +0000 (14:44 +0100)]
[Matrix] Update load/storeMatrix to take indices as Value* (NFC).
This allows using the functions to be used with loop dependent indices.
James Henderson [Mon, 6 Apr 2020 09:47:13 +0000 (10:47 +0100)]
Make test more robust
llvm-readobj prints the file path as part of the output, so
--implicit-check-not patterns can accidentally match it. This patch
makes the test more robust by preventing failures if "foo" is in
somebody's path.
Reviewed by: grimar
Differential Revision: https://reviews.llvm.org/D77546
Jaroslav Sevcik [Mon, 6 Apr 2020 13:41:33 +0000 (15:41 +0200)]
[lldb-server] jThreadsInfo returns stack memory
This patch adds parts of the stack that should be useful for unwinding
to the jThreadsInfo reply from lldb-server. We return the top of the
stack (12 words), and we also try to walk the frame pointer linked list
and return the memory containing frame pointer and return address pairs.
The idea is to cover the cases with and without frame pointer omission.
Differential Revision: https://reviews.llvm.org/D74398
Chris Bowler [Mon, 6 Apr 2020 13:36:59 +0000 (09:36 -0400)]
test commit
Matt Arsenault [Fri, 20 Dec 2019 16:09:45 +0000 (21:39 +0530)]
AMDGPU: Use DAG patterns for div_fmas
Matt Arsenault [Thu, 21 Feb 2019 19:55:29 +0000 (14:55 -0500)]
AMDGPU: Remove DisableInst feature
I'm not sure why these were bothering to check the instruction
profile, since those profiles should only be used with these
instruction classes.
Matt Arsenault [Wed, 29 Aug 2018 06:25:36 +0000 (09:25 +0300)]
DAG: Combine extract_vector_elt of concat_vectors
Fixes extra canonicalize regressions when legalizing
vector fminnum/fmaxnum.
Nico Weber [Sun, 5 Apr 2020 00:25:27 +0000 (20:25 -0400)]
Make paths in generated llvm-lit relative as well.
This builds on top of D77184. With this, I can rename my build directory
to a different name and `bin/llvm-lit ../llvm-project/clang/test
../llvm-project/llvm/test` still succeeds.
I haven't tried copying the build dir to a different machine to run
tests there yet, but I tried something like it a few months ago and it
worked back then.
Changes:
- Make configure_lit_site_cfg() store the main / generated config pair
interleaved in the LLVM_LIT_CONFIG_FILES list and postpone converting
it to python code to llvm-lit's CMakeList.
- Pull the relpath code into a new function make_paths_relative() and
call that in llvm-lit's CMakeList, prior to converting the list to
python code.
- Pull the path() function into a variable and use that in llvm-lit's
CMakeList too.
Differential Revision: https://reviews.llvm.org/D77496
Sergej Jaskiewicz [Mon, 6 Apr 2020 13:12:44 +0000 (09:12 -0400)]
[libc++] [test] Add missing FILE_DEPENDENCIES to align.pass.sh.cpp
Differential Revision: https://reviews.llvm.org/D77541
Hans Wennborg [Mon, 6 Apr 2020 13:05:08 +0000 (15:05 +0200)]
Revert
43f031d3126 "Enable IBT(Indirect Branch Tracking) in JIT with CET(Control-flow Enforcement Technology)"
ExecutionEngine/MCJIT/cet-code-model-lager.ll is failing on 32-bit
windows, see llvm-commits thread for fef2dab.
This reverts commit
43f031d31264d20cfb8f1ebd606c66e57c231d4d
and the follow-ups
fef2dab100dfc7c49ccf0ce2bacea409324b54ba and
6a800f6f622a7ade275fa6cb1ef07803460d8bb3.
Djordje Todorovic [Sat, 4 Apr 2020 16:32:43 +0000 (18:32 +0200)]
[mlir][LowerToAffineLoops] Handle tensors of rank 0
This will fix the case:
$ toyc -emit=jit test.toy
$ cat test.toy
def main() {
var a = 1;
print(a);
}
Without this patch it would trigger an assertion.
Differential Revision: https://reviews.llvm.org/D77464
Hans Wennborg [Mon, 6 Apr 2020 12:18:35 +0000 (14:18 +0200)]
Add a triple to test/ExecutionEngine/MCJIT/cet-code-model-lager.ll
It was failing in 32-bit Windows builds with:
$ ":" "RUN: at line 1"
$ "c:\src\llvm_package_944db8a4\build32_stage0\bin\lli.exe" "-mtriple=i686-pc-windows-msvc-elf" "-code-model=large" "C:\src\llvm_package_944db8a4\llvm-project\llvm\test\ExecutionEngine\MCJIT\cet-code-model-lager.ll"
# command stderr:
Assertion failed: Is64Bit && "Large code model is only legal in 64-bit mode.", file C:\src\llvm_package_944db8a4\llvm-project\llvm\lib\Target\X86\X86ISelLowering.cpp, line 4212
Let's see if this helps.
Sourabh Singh Tomar [Fri, 3 Apr 2020 07:14:09 +0000 (12:44 +0530)]
[DWARF5] Added support for emission of debug_macro section.
Summary:
This patch adds support for emission of following DWARFv5 macro forms
in .debug_macro section.
1. DW_MACRO_start_file
2. DW_MACRO_end_file
3. DW_MACRO_define_strp
4. DW_MACRO_undef_strp.
Reviewed By: dblaikie, ikudrin
Differential Revision: https://reviews.llvm.org/D72828
Pavel Labath [Thu, 2 Apr 2020 12:48:12 +0000 (14:48 +0200)]
[llvm/Support] Don't crash on empty nullptr ranges when decoding LEBs
Summary:
If the decoding functions are called with both start and end pointers
being nullptr, the function will crash due to a nullptr dereference.
This happens because the function does not recognise nullptr as a valid
end pointer.
Obviously, nobody is going to pass null pointers here deliberately, but
it can happen indirectly (as it did for me), when calling these
functions on an ArrayRef, as a default-initialized empty ArrayRef will
have both begin() and end() pointers equal to nullptr.
The fix is to simply remove the nullptr check. Passing nullptr for "end"
with a valid "begin" pointer will still work, as one cannot reach
nullptr by incrementing a valid pointer without triggerring UB.
Reviewers: dblaikie
Subscribers: llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D77304