Clement Courbet [Thu, 25 Oct 2018 07:44:01 +0000 (07:44 +0000)]
[MCSched] Bind PFM Counters to the CPUs instead of the SchedModel.
Summary:
The pfm counters are now in the ExegesisTarget rather than the
MCSchedModel (PR39165).
This also compresses the pfm counter tables (PR37068).
Reviewers: RKSimon, gchatelet
Subscribers: mgrang, llvm-commits
Differential Revision: https://reviews.llvm.org/D52932
llvm-svn: 345243
Krasimir Georgiev [Thu, 25 Oct 2018 07:39:30 +0000 (07:39 +0000)]
[clang-format] Break before next parameter after a formatted multiline raw string parameter
Summary:
Currently clang-format breaks before the next parameter after multiline parameters (also recursively for the parent expressions of multiline parameters). However, it fails to do so for formatted multiline raw string literals:
```
$ cat test.cc
// Examples
// Regular multiline tokens
int x = f(R"(multi
line)", 2);
}
int y = g(h(R"(multi
line)"), 2);
// Formatted multiline tokens
int z = f(R"pb(multi: 1 #
line: 2)pb", 2);
int w = g(h(R"pb(multi: 1 #
line: 2)pb"), 2);
$ clang-format -style=google test.cc
// Examples
// Regular multiline tokens
int x = f(R"(multi
line)",
2);
}
int y = g(h(R"(multi
line)"),
2);
// Formatted multiline tokens
int z = f(R"pb(multi: 1 #
line: 2)pb", 2);
int w = g(h(R"pb(multi: 1 #
line: 2)pb"), 2);
```
This patch addresses this inconsistency by forcing breaking after multiline formatted raw string literals. This requires a little tweak to the indentation chosen for the contents of a formatted raw string literal: in case when that's a parameter and not the last one, the indentation is based off of the uniform indentation of all of the parameters.
Reviewers: sammccall
Reviewed By: sammccall
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D52448
llvm-svn: 345242
Craig Topper [Thu, 25 Oct 2018 07:00:09 +0000 (07:00 +0000)]
[X86] Don't use the OriginalDemandedBits to calculate the DemandedMask for PMULUDQ/PMULDQ inputs.
Multiply a is complex operation so just because some bit of the output isn't used doesn't mean that bit of the input isn't used.
We might able to bound it, but it will require some more thought.
llvm-svn: 345241
Eric Christopher [Thu, 25 Oct 2018 06:43:56 +0000 (06:43 +0000)]
Revert "Fix use of __libcpp_deallocate in dynarray"
This reverts commit r345234 as it depended on the sized deallocation commit.
llvm-svn: 345240
Eric Christopher [Thu, 25 Oct 2018 06:20:12 +0000 (06:20 +0000)]
Temporarily Revert "Implement sized deallocation for std::allocator and friends."
This is breaking the bots here (and related): http://lab.llvm.org:8011/builders/libcxx-libcxxabi-x86_64-linux-ubuntu-asan/builds/1428
This reverts commit r345214.
llvm-svn: 345239
Simon Atanasyan [Thu, 25 Oct 2018 05:39:27 +0000 (05:39 +0000)]
[llvm-readobj] Print ELF header flags names in GNU output
GNU readelf tool prints hex value of the ELF header flags field and the
flags names. This change adds the same functionality to llvm-readobj.
Now llvm-readobj can print MIPS and RISCV flags.
New GNUStyle::printFlags() method is a copy of ScopedPrinter::printFlags()
routine. Probably we can escape code duplication and / or simplify the
printFlags() method. But it's a task for separate commit.
Differential revision: https://reviews.llvm.org/D52027
llvm-svn: 345238
Craig Topper [Thu, 25 Oct 2018 05:04:35 +0000 (05:04 +0000)]
[CodeGen] Always emit the 'min-legal-vector-width' attribute even when the value is 0.
The X86 backend will need to see the attribute to make decisions. If it isn't present the backend will have to assume large vectors may be present.
llvm-svn: 345237
Craig Topper [Thu, 25 Oct 2018 05:00:20 +0000 (05:00 +0000)]
[X86] Fix typo in comment. NFC
llvm-svn: 345236
Sam McCall [Thu, 25 Oct 2018 04:22:52 +0000 (04:22 +0000)]
[clangd] Clean up LSP structs around configuration. NFC, no protocol changes.
- align struct names/comments with LSP, remove redundant "clangd" prefixes.
- don't map config structs as Optional<> when their presence/absence
doesn't signal anything and all fields must have sensible "absent" values
- be more lax around parsing of 'any'-typed messages
llvm-svn: 345235
Eric Fiselier [Thu, 25 Oct 2018 02:36:31 +0000 (02:36 +0000)]
Fix use of __libcpp_deallocate in dynarray
llvm-svn: 345234
Sam McCall [Thu, 25 Oct 2018 02:25:44 +0000 (02:25 +0000)]
[clangd] Remove unused CDB function. NFC
llvm-svn: 345233
Sam McCall [Thu, 25 Oct 2018 02:22:53 +0000 (02:22 +0000)]
[clangd] Fix -compile-commands-dir flag, broken in r345031
llvm-svn: 345232
Sam McCall [Thu, 25 Oct 2018 02:04:30 +0000 (02:04 +0000)]
[clangd] Don't invalidate LSP-set compile commands when closing a file.
Summary:
It doesn't make much sense: setting them is not coupled to opening the file,
it's an asynchronous notification.
I don't think this is a breaking change - this behavior is hard to observe!
Reviewers: ilya-biryukov
Subscribers: ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits
Differential Revision: https://reviews.llvm.org/D53642
llvm-svn: 345231
Thomas Lively [Thu, 25 Oct 2018 01:46:07 +0000 (01:46 +0000)]
[WebAssembly] Set LoadExt and TruncStore actions for SIMD types
Summary: Fixes part of the problem reported in bug 39275.
Reviewers: aheejin, dschuff
Subscribers: sbc100, jgravelle-google, sunfish, llvm-commits, alexcrichton
Differential Revision: https://reviews.llvm.org/D53542
llvm-svn: 345230
Douglas Yung [Thu, 25 Oct 2018 01:21:08 +0000 (01:21 +0000)]
Fix test to work on Windows.
llvm-svn: 345229
Richard Trieu [Thu, 25 Oct 2018 01:08:00 +0000 (01:08 +0000)]
[Sema] Fix -Wcomma for C89
There is a small difference in the scope flags for C89 versus the other C/C++
dialects. This change ensures that the -Wcomma warning won't be duplicated or
issued in the wrong location. Also, the test case is refactored into C and C++
parts, with the C++ parts guarded by a #ifdef to allow the test to run in both
modes.
https://bugs.llvm.org/show_bug.cgi?id=32370
llvm-svn: 345228
Reid Kleckner [Wed, 24 Oct 2018 23:52:33 +0000 (23:52 +0000)]
[X86] Adjust MIR test case to pacify machine verifier
llvm-svn: 345227
Reid Kleckner [Wed, 24 Oct 2018 23:52:22 +0000 (23:52 +0000)]
[X86] Fix pipeline tests when enabling MIR verification, NFC
llvm-svn: 345226
Eric Fiselier [Wed, 24 Oct 2018 23:47:04 +0000 (23:47 +0000)]
Revert "[SemaCXX] Unconfuse Clang when std::align_val_t is unscoped in C++03"
This reverts commit
6f47cdd51341344c0e32630e19e72c94cd25f34e.
llvm-svn: 345225
David Blaikie [Wed, 24 Oct 2018 23:36:29 +0000 (23:36 +0000)]
DebugInfo: Reuse common addresses for rnglist base address selections
This makes the offsets larger (since they are further from the base
address) but those are in the .dwo - and allows removing addresses and
relocations from the .o file.
This could be built into the AddressPool more fundamentally, perhaps -
when you ask for an AddressPool entry you could say "or give me some
other entry and an offset I need to use" - though what to do about
situations where the first use of an address in a section is not the
earliest address in that section... is tricky.
At least with range addresses we can be fairly sure we've seen the
earliest address first because we see the start address for the
function.
llvm-svn: 345224
Heejin Ahn [Wed, 24 Oct 2018 23:31:24 +0000 (23:31 +0000)]
[WebAssembly] Fix immediate of rethrow when throwing to caller
Summary:
Currently when assigning depths 'rethrow' does not take the whole
control flow stack into accounts but only considers EH pad stacks. When
assigning depth immmediates to rethrows, in normal cases it is done
correctly but when a rethrow instruction throws up to a caller, i.e., we
convert a pseudo RETHROW_TO_CALLER instruction to a rethrow, it
mistakenly compute the whole stack depth.
Reviewers: dschuff
Subscribers: sbc100, jgravelle-google, sunfish, llvm-commits
Differential Revision: https://reviews.llvm.org/D53619
llvm-svn: 345223
Saleem Abdulrasool [Wed, 24 Oct 2018 23:28:28 +0000 (23:28 +0000)]
Driver,CodeGen: introduce support for Swift CFString layout
Add a new driver level flag `-fcf-runtime-abi=` that allows one to specify the
runtime ABI for CoreFoundation. This controls the language interoperability.
In particular, this is relevant for generating the CFConstantString classes
(primarily through the `__builtin___CFStringMakeConstantString` builtin) which
construct a reference to the "CFObject"'s `isa` field. This type differs
between swift 4.1 and 4.2+.
Valid values for the new option include:
- objc [default behaviour] - enable ObjectiveC interoperability
- swift-4.1 - enable interoperability with swift 4.1
- swift-4.2 - enable interoperability with swift 4.2
- swift-5.0 - enable interoperability with swift 5.0
- swift [alias] - target the latest swift ABI
Furthermore, swift 4.2+ changed the layout for the CFString when building
CoreFoundation *without* ObjectiveC interoperability. In such a case, a field
was added to the CFObject base type changing it from: <{ const int*, int }> to
<{ uintptr_t, uintptr_t, uint64_t }>.
In swift 5.0, the CFString type will be further adjusted to change the length
from a uint32_t on everything but BE LP64 targets to uint64_t.
Note that the default behaviour for clang remains unchanged and the new layout
must be explicitly opted into via `-fcf-runtime-abi=swift*`.
llvm-svn: 345222
Thomas Lively [Wed, 24 Oct 2018 23:27:40 +0000 (23:27 +0000)]
[WebAssembly] Retain shuffle types during custom lowering
Summary:
Changing the node type in lowering was violating assumptions made in
the DAG combiner, so don't change the node type any more. This fixes
one of the issues reported in bug 39275.
Reviewers: aheejin, dschuff
Subscribers: sbc100, jgravelle-google, sunfish, llvm-commits, alexcrichton
Differential Revision: https://reviews.llvm.org/D53537
llvm-svn: 345221
Thomas Lively [Wed, 24 Oct 2018 23:14:59 +0000 (23:14 +0000)]
Make fminimum/fmaximum SDNodes commutative and associative
Reviewers: aheejin, dschuff
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D53680
llvm-svn: 345220
Reid Kleckner [Wed, 24 Oct 2018 22:57:28 +0000 (22:57 +0000)]
[ELF] Fix large code model MIR verifier errors
Instead of using the MOVGOT64r pseudo, use the existing
MO_PIC_BASE_OFFSET support on symbol operands. Now I don't have to
create a "scratch register operand" for the pseudo to use, and the
register allocator can make better decisions.
Fixes some X86 verifier errors tracked in PR27481.
llvm-svn: 345219
Thomas Lively [Wed, 24 Oct 2018 22:49:55 +0000 (22:49 +0000)]
[NFC] Rename minnan and maxnan to minimum and maximum
Summary:
Changes all uses of minnan/maxnan to minimum/maximum
globally. These names emphasize that the semantic difference between
these operations is more than just NaN-propagation.
Reviewers: arsenm, aheejin, dschuff, javed.absar
Subscribers: jholewinski, sdardis, wdng, sbc100, jgravelle-google, jrtc27, atanasyan, llvm-commits
Differential Revision: https://reviews.llvm.org/D53112
llvm-svn: 345218
Alexander Shaposhnikov [Wed, 24 Oct 2018 22:49:06 +0000 (22:49 +0000)]
[llvm-objcopy] Introduce dispatch mechanism based on the input
In this diff we introduce dispatch mechanism based on
the type of the input (archive, object file, raw binary)
and the format (coff, elf, macho).
We also move the ELF-specific code into the namespace llvm::objcopy::elf.
Test plan: make check-all
Differential revision: https://reviews.llvm.org/D53311
llvm-svn: 345217
Alina Sbirlea [Wed, 24 Oct 2018 22:46:45 +0000 (22:46 +0000)]
Update MemorySSA in LoopRotate.
Summary:
Teach LoopRotate to preserve MemorySSA.
Enable tests for correctness, dependency disabled by default.
Subscribers: sanjoy, jlebar, Prazek, george.burgess.iv, llvm-commits
Differential Revision: https://reviews.llvm.org/D51718
llvm-svn: 345216
David Blaikie [Wed, 24 Oct 2018 22:44:54 +0000 (22:44 +0000)]
llvm-dwarfdump: Account for skeleton addr_base when dumping addresses in split unit in the same file
llvm-svn: 345215
Eric Fiselier [Wed, 24 Oct 2018 22:44:01 +0000 (22:44 +0000)]
Implement sized deallocation for std::allocator and friends.
Summary:
C++14 sized deallocation is disabled by default due to ABI concerns. However, when a user manually enables it then libc++ should take advantage of it since sized deallocation can provide a significant performance win depending on the underlying malloc implementation. (Note that libc++'s definitions of sized delete don't do anything special yet, but users are free to provide their own).
This patch updates __libcpp_deallocate to selectively call sized operator delete when it's available. `__libcpp_deallocate_unsized` should be used when the size of the allocation is unknown.
On Apple this patch makes no attempt to determine if the sized operator delete is unavailable, only that the language feature is enabled. This could cause a compile error when using `std::allocator`, but the same compile error would occur whenever the user calls `new`, so I don't think it's a problem.
Reviewers: ldionne, mclow.lists
Reviewed By: ldionne
Subscribers: rsmith, ckennelly, libcxx-commits, christof
Differential Revision: https://reviews.llvm.org/D53120
llvm-svn: 345214
Volodymyr Sapsai [Wed, 24 Oct 2018 22:40:54 +0000 (22:40 +0000)]
[VFS] Remove 'ignore-non-existent-contents' attribute for YAML-based VFS.
'ignore-non-existent-contents' stopped working after r342232 in a way
that the actual attribute value isn't used and it works as if it is
always `true`.
Common use case for VFS iteration is iterating through files in umbrella
directories for modules. Ability to detect if some VFS entries point to
non-existing files is nice but non-critical. Instead of adding back
support for `'ignore-non-existent-contents': false` I am removing the
attribute, because such scenario isn't used widely enough and stricter
checks don't provide enough value to justify the maintenance.
Change is done both in LLVM and Clang, corresponding Clang commit is r345212.
rdar://problem/
45176119
Reviewers: bruno
Reviewed By: bruno
Subscribers: hiraditya, dexonsmith, sammccall, cfe-commits
Differential Revision: https://reviews.llvm.org/D53228
llvm-svn: 345213
Volodymyr Sapsai [Wed, 24 Oct 2018 22:39:38 +0000 (22:39 +0000)]
[VFS] Remove 'ignore-non-existent-contents' attribute for YAML-based VFS.
'ignore-non-existent-contents' stopped working after r342232 in a way
that the actual attribute value isn't used and it works as if it is
always `true`.
Common use case for VFS iteration is iterating through files in umbrella
directories for modules. Ability to detect if some VFS entries point to
non-existing files is nice but non-critical. Instead of adding back
support for `'ignore-non-existent-contents': false` I am removing the
attribute, because such scenario isn't used widely enough and stricter
checks don't provide enough value to justify the maintenance.
rdar://problem/
45176119
Reviewers: bruno
Reviewed By: bruno
Subscribers: hiraditya, dexonsmith, sammccall, cfe-commits
Differential Revision: https://reviews.llvm.org/D53228
llvm-svn: 345212
Eric Fiselier [Wed, 24 Oct 2018 22:38:49 +0000 (22:38 +0000)]
[SemaCXX] Unconfuse Clang when std::align_val_t is unscoped in C++03
Summary:
When -faligned-allocation is specified in C++03 libc++ defines std::align_val_t as an unscoped enumeration type (because Clang didn't provide scoped enumerations as an extension until 8.0).
Unfortunately Clang confuses the `align_val_t` overloads of delete with the sized deallocation overloads which aren't enabled. This caused Clang to call the aligned deallocation function as if it were the sized deallocation overload.
For example: https://godbolt.org/z/xXJELh
This patch fixes the confusion.
Reviewers: rsmith, EricWF
Reviewed By: EricWF
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D53508
llvm-svn: 345211
Thomas Lively [Wed, 24 Oct 2018 22:18:54 +0000 (22:18 +0000)]
[SelectionDAG] DAG combiner for fminnan and fmaxnan
Summary: Depends on D52765.
Reviewers: aheejin, dschuff
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D52768
llvm-svn: 345210
Vedant Kumar [Wed, 24 Oct 2018 22:15:41 +0000 (22:15 +0000)]
[HotColdSplitting] Identify larger cold regions using domtree queries
The current splitting algorithm works in three stages:
1) Identify cold blocks, then
2) Use forward/backward propagation to mark hot blocks, then
3) Grow a SESE region of blocks *outside* of the set of hot blocks and
start outlining.
While testing this pass on Apple internal frameworks I noticed that some
kinds of control flow (e.g. loops) are never outlined, even though they
unconditionally lead to / follow cold blocks. I noticed two other issues
related to how cold regions are identified:
- An inconsistency can arise in the internal state of the hotness
propagation stage, as a block may end up in both the ColdBlocks set
and the HotBlocks set. Further inconsistencies can arise as these sets
do not match what's in ProfileSummaryInfo.
- It isn't necessary to limit outlining to single-exit regions.
This patch teaches the splitting algorithm to identify maximal cold
regions and outline them. A maximal cold region is defined as the set of
blocks post-dominated by a cold sink block, or dominated by that sink
block. This approach can successfully outline loops in the cold path. As
a side benefit, it maintains less internal state than the current
approach.
Due to a limitation in CodeExtractor, blocks within the maximal cold
region which aren't dominated by a single entry point (a so-called "max
ancestor") are filtered out.
Results:
- X86 (LNT + -Os + externals): 134KB of TEXT were outlined compared to
47KB pre-patch, or a ~3x improvement. Did not see a performance impact
across two runs.
- AArch64 (LNT + -Os + externals + Apple-internal benchmarks): 149KB
of TEXT were outlined. Ditto re: performance impact.
- Outlining results improve marginally in the internal frameworks I
tested.
Follow-ups:
- Outline more than once per function, outline large single basic
blocks, & try to remove unconditional branches in outlined functions.
Differential Revision: https://reviews.llvm.org/D53627
llvm-svn: 345209
Rui Ueyama [Wed, 24 Oct 2018 22:15:32 +0000 (22:15 +0000)]
Do not call computeIsPreemptible() if its result is discarded. NFC.
llvm-svn: 345208
Jonas Devlieghere [Wed, 24 Oct 2018 22:04:20 +0000 (22:04 +0000)]
[Settings] Add -force flag to "settings set"
The -force option allows you to pass an empty value to settings set to
reset the value to its default. This means that the following operations
are equivalent:
settings set -f <setting>
settings clear <setting>
The motivation for this change is the ability to export and import
settings from LLDB. Because of the way the dumpers work, we don't know
whether a value is going to be the default or not. Hence we cannot use
settings clear and use settings set -f, potentially providing an empty
value.
Differential revision: https://reviews.llvm.org/D52772
llvm-svn: 345207
Sanjay Patel [Wed, 24 Oct 2018 22:02:05 +0000 (22:02 +0000)]
[InstCombine] add test for fptrunc with vector with undef elt; NFC
This should be fixed with D53650.
llvm-svn: 345206
Rui Ueyama [Wed, 24 Oct 2018 21:59:58 +0000 (21:59 +0000)]
Add more blank lines so that code doesn't look too dense. NFC.
llvm-svn: 345205
Rui Ueyama [Wed, 24 Oct 2018 21:59:48 +0000 (21:59 +0000)]
Add a comment for PPC64 .toc and GNU relro.
llvm-svn: 345204
Paul Robinson [Wed, 24 Oct 2018 21:51:55 +0000 (21:51 +0000)]
Make llvm-dwarfdump -name work on type units.
Differential Revision: https://reviews.llvm.org/D53672
llvm-svn: 345203
Joel E. Denny [Wed, 24 Oct 2018 21:46:42 +0000 (21:46 +0000)]
[SourceMgr][FileCheck] Obey -color by extending WithColor
(Relands r344930, reverted in r344935, and now hopefully fixed for
Windows.)
While this change specifically targets FileCheck, it affects any tool
using the same SourceMgr facilities.
Previously, -color was documented in FileCheck's -help output, but
-color had no effect. Now, -color obeys its documentation: it forces
colors to be used in FileCheck diagnostics even when stderr is not a
terminal.
-color is especially helpful when combined with FileCheck's -v, which
can produce a long series of diagnostics that you might wish to pipe
to a pager, such as less -R. The WithColor extensions here will also
help to clean up color usage in FileCheck's annotated dump of input,
which is proposed in D52999.
Reviewed By: JDevlieghere, zturner
Differential Revision: https://reviews.llvm.org/D53419
llvm-svn: 345202
Evandro Menezes [Wed, 24 Oct 2018 21:40:43 +0000 (21:40 +0000)]
[AArch64] Refactor Exynos machine model
Effectively, NFC.
llvm-svn: 345201
Tim Northover [Wed, 24 Oct 2018 21:36:34 +0000 (21:36 +0000)]
[DAG] check more operands for cycles when merging stores.
Until now, we've only checked whether merging stores would cause a cycle via
the value argument, but the address and indexed offset arguments are also
capable of creating cycles in some situations.
The addresses are all base+offset with notionally the same base, but the base
SDNode may still be different (e.g. via an indexed load in one case, and an
ISD::ADD elsewhere). This allows cycles to creep in if one of these sources
depends on another.
The indexed offset is usually undef (representing a non-indexed store), but on
some architectures (e.g. 32-bit ARM-mode ARM) it can be an arbitrary value,
again allowing dependency cycles to creep in.
llvm-svn: 345200
Petr Hosek [Wed, 24 Oct 2018 21:29:15 +0000 (21:29 +0000)]
Revert "Teach __libcpp_is_floating_point that __fp16 and _Float16 are"
This reverts commits r333103 and r333108. _Float16 and __fp16 are C11
extensions and compilers other than Clang don't define these for C++.
Differential Revision: https://reviews.llvm.org/D53670
llvm-svn: 345199
Tim Renouf [Wed, 24 Oct 2018 21:19:02 +0000 (21:19 +0000)]
Add gfx909 to GPU Arch
Subscribers: jholewinski, cfe-commits
Differential Revision: https://reviews.llvm.org/D53558
llvm-svn: 345198
Reid Kleckner [Wed, 24 Oct 2018 21:09:34 +0000 (21:09 +0000)]
[X86] Add *SP to tailcall register class to fix verifier error
It's possible to do a tail call to a stack argument. LLVM already
calculates the right stack offset to call through.
Fixes the sibcall* and musttail* verifier failures tracked at PR27481.
llvm-svn: 345197
Sanjin Sijaric [Wed, 24 Oct 2018 21:07:38 +0000 (21:07 +0000)]
[MIR] Add hasWinCFI field
Adding hasWinCFI field so that I can add MIR test cases to
https://reviews.llvm.org/D50166.
Differential Revision: https://reviews.llvm.org/D51201
llvm-svn: 345196
Lang Hames [Wed, 24 Oct 2018 20:37:40 +0000 (20:37 +0000)]
[ExecutionEngine] Remove some dead code from JITEventListener.h.
llvm-svn: 345195
Stephen Kelly [Wed, 24 Oct 2018 20:33:55 +0000 (20:33 +0000)]
[clang-query] Refactor Output settings to booleans
Summary: This will make it possible to add non-exclusive mode output.
Reviewers: aaron.ballman
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D53501
llvm-svn: 345194
Stephen Kelly [Wed, 24 Oct 2018 20:33:45 +0000 (20:33 +0000)]
[clang-query] Add 'detailed-ast' output as an alias for 'dump'
Summary: Future development can then dump other content than AST.
Reviewers: aaron.ballman
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D53500
llvm-svn: 345193
Stephen Kelly [Wed, 24 Oct 2018 20:33:14 +0000 (20:33 +0000)]
[clang-query] Re-word command help
Summary:
This will make it possible to easily
* Add new commands which accept <feature> parameters
* Extend the list of features
Reviewers: aaron.ballman
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D53498
llvm-svn: 345192
Heejin Ahn [Wed, 24 Oct 2018 20:31:58 +0000 (20:31 +0000)]
[clant-tidy] abseil: Add clangTooling to CMakeLists.txt
Without this, builds with `-DBUILD_SHARED_LIBS=ON` fail.
llvm-svn: 345191
Matt Davis [Wed, 24 Oct 2018 20:27:47 +0000 (20:27 +0000)]
[llvm-mca] Replace InstRef::isValid with operator bool. NFC.
llvm-svn: 345190
Reid Kleckner [Wed, 24 Oct 2018 20:23:57 +0000 (20:23 +0000)]
[MC] Separate masm integer literal lexer support from inline asm
Summary:
This renames the IsParsingMSInlineAsm member variable of AsmLexer to
LexMasmIntegers and moves it up to MCAsmLexer. This is the only behavior
controlled by that variable. I added a public setter, so that it can be
set from outside or from the llvm-mc command line. We may need to
arrange things so that users can get this behavior from clang, but
that's future work.
I also put additional hex literal lexing functionality under this flag
to fix PR32973. It appears that this hex literal parsing wasn't intended
to be enabled in non-masm-style blocks.
Now, masm integers (0b1101 and 0ABCh) work in __asm blocks from clang,
but 0b label references work when using .intel_syntax in standalone .s
files.
However, 0b label references will *not* work from __asm blocks in clang.
They will work from GCC inline asm blocks, which it sounds like is
important for Crypto++ as mentioned in PR36144.
Essentially, we only lex masm literals for inline asm blobs that use
intel syntax. If the .intel_syntax directive is used inside a gnu-style
inline asm statement, masm literals will not be lexed, which is
compatible with gas and llvm-mc standalone .s assembly.
This fixes PR36144 and PR32973.
Reviewers: Gerolf, avt77
Subscribers: eraman, hiraditya, llvm-commits
Differential Revision: https://reviews.llvm.org/D53535
llvm-svn: 345189
Tim Northover [Wed, 24 Oct 2018 20:19:09 +0000 (20:19 +0000)]
AArch64: add a pass to compress jump-table entries when possible.
llvm-svn: 345188
Evandro Menezes [Wed, 24 Oct 2018 20:03:24 +0000 (20:03 +0000)]
[AArch64] Refactor Exynos machine model (NFC)
llvm-svn: 345187
Evandro Menezes [Wed, 24 Oct 2018 20:03:20 +0000 (20:03 +0000)]
[AArch64] Fix overlapping instructions
Fix overlapping instruction descriptions in the machine model for Exynos M3.
Effectively, NFC.
llvm-svn: 345186
Andrea Di Biagio [Wed, 24 Oct 2018 19:37:45 +0000 (19:37 +0000)]
[llvm-mca] Simplify the logic in FetchStage. NFCI
Only method 'getNextInstruction()' needs to interact with the SourceMgr.
llvm-svn: 345185
Simon Pilgrim [Wed, 24 Oct 2018 19:31:24 +0000 (19:31 +0000)]
Fix MSVC "truncation from 'double' to 'float'" warnings. NFCI.
llvm-svn: 345184
Craig Topper [Wed, 24 Oct 2018 19:24:44 +0000 (19:24 +0000)]
[X86] Explicitly list all KNL features of inheriting from IVB. NFC
I'm not sure all the microarchitectural tuning flags that have been added to IVBFeatures are relevant for KNL. Separating will allow us to see and audit them. There might even be some simplification opportunities in the Sandy Bridge through Icelake inheritance line without KNL using the same chain.
llvm-svn: 345183
Simon Pilgrim [Wed, 24 Oct 2018 19:11:28 +0000 (19:11 +0000)]
[X86][SSE] Add SimplifyDemandedBitsForTargetNode PMULDQ/PMULUDQ handling
Add X86 SimplifyDemandedBitsForTargetNode and use it to simplify PMULDQ/PMULUDQ target nodes.
This enables us to repeatedly simplify the node's arguments after the previous approach had to be reverted due to PR39398.
Differential Revision: https://reviews.llvm.org/D53643
llvm-svn: 345182
Konstantin Zhuravlyov [Wed, 24 Oct 2018 19:07:56 +0000 (19:07 +0000)]
AMDGPU: Handle gfx909 in AMDGPUTargetInfo::initFeatureMap
+ add required tests
llvm-svn: 345181
Alexey Bataev [Wed, 24 Oct 2018 19:06:37 +0000 (19:06 +0000)]
Do not always request an implicit taskgroup region inside the kmpc_taskloop function
Summary:
For the following code:
```
int i;
#pragma omp taskloop
for (i = 0; i < 100; ++i)
{}
#pragma omp taskloop nogroup
for (i = 0; i < 100; ++i)
{}
```
Clang emits the following LLVM IR:
```
...
call void @__kmpc_taskgroup(%struct.ident_t* @0, i32 %0)
%2 = call i8* @__kmpc_omp_task_alloc(%struct.ident_t* @0, i32 %0, i32 1, i64 80, i64 8, i32 (i32, i8*)* bitcast (i32 (i32, %struct.kmp_task_t_with_privates*)* @.omp_task_entry. to i32 (i32, i8*)*))
...
call void @__kmpc_taskloop(%struct.ident_t* @0, i32 %0, i8* %2, i32 1, i64* %8, i64* %9, i64 %13, i32 0, i32 0, i64 0, i8* null)
call void @__kmpc_end_taskgroup(%struct.ident_t* @0, i32 %0)
...
%15 = call i8* @__kmpc_omp_task_alloc(%struct.ident_t* @0, i32 %0, i32 1, i64 80, i64 8, i32 (i32, i8*)* bitcast (i32 (i32, %struct.kmp_task_t_with_privates.1*)* @.omp_task_entry..2 to i32 (i32, i8*)*))
...
call void @__kmpc_taskloop(%struct.ident_t* @0, i32 %0, i8* %15, i32 1, i64* %21, i64* %22, i64 %26, i32 0, i32 0, i64 0, i8* null)
```
The first set of instructions corresponds to the first taskloop construct. It is important to note that the implicit taskgroup region associated with the taskloop construct has been materialized in our IR: the `__kmpc_taskloop` occurs inside a taskgroup region. Note also that this taskgroup region does not exist in our second taskloop because we are using the `nogroup` clause.
The issue here is the 4th argument of the kmpc_taskloop call, starting from the end, is always a zero. Checking the LLVM OpenMP RT implementation, we see that this argument corresponds to the nogroup parameter:
```
void __kmpc_taskloop(ident_t *loc, int gtid, kmp_task_t *task, int if_val,
kmp_uint64 *lb, kmp_uint64 *ub, kmp_int64 st, int nogroup,
int sched, kmp_uint64 grainsize, void *task_dup);
```
So basically we always tell to the RT to do another taskgroup region. For the first taskloop, this means that we create two taskgroup regions. For the second example, it means that despite the fact we had a nogroup clause we are going to have a taskgroup region, so we unnecessary wait until all descendant tasks have been executed.
Reviewers: ABataev
Reviewed By: ABataev
Subscribers: rogfer01, cfe-commits
Differential Revision: https://reviews.llvm.org/D53636
llvm-svn: 345180
Simon Pilgrim [Wed, 24 Oct 2018 19:00:56 +0000 (19:00 +0000)]
[TargetLowering] Add SimplifyDemandedBitsForTargetNode callback
Add a SimplifyDemandedBitsForTargetNode callback to handle target nodes.
Differential Revision: https://reviews.llvm.org/D53643
llvm-svn: 345179
Teresa Johnson [Wed, 24 Oct 2018 18:53:47 +0000 (18:53 +0000)]
[hot-cold-split] Name split functions with ".cold" suffix
Summary:
The current default of appending "_"+entry block label to the new
extracted cold function breaks demangling. Change the deliminator from
"_" to "." to enable demangling. Because the header block label will
be empty for release compile code, use "extracted" after the "." when
the label is empty.
Additionally, add a mechanism for the client to pass in an alternate
suffix applied after the ".", and have the hot cold split pass use
"cold."+Count, where the Count is currently 1 but can be used to
uniquely number multiple cold functions split out from the same function
with D53588.
Reviewers: sebpop, hiraditya
Subscribers: llvm-commits, erik.pilkington
Differential Revision: https://reviews.llvm.org/D53534
llvm-svn: 345178
Alexey Bataev [Wed, 24 Oct 2018 18:53:12 +0000 (18:53 +0000)]
[OPENMP]Fix PR39366: do not try to private field if it is not captured.
The compiler is crashing if we trying to post-capture the fields
implicitly captured inside of the task constructs. Seems, this kind of
processing is not supported and such fields should not be
firstprivatized.
llvm-svn: 345177
Craig Topper [Wed, 24 Oct 2018 18:45:44 +0000 (18:45 +0000)]
[CodeGen] Update test checks missed in r345168.
These tests don't run unless the aarch64 target is registered and my testing had been on an x86 only build directory.
llvm-svn: 345176
Simon Pilgrim [Wed, 24 Oct 2018 18:44:12 +0000 (18:44 +0000)]
[CostModel][X86] Add vXi8 vector division by constants costs.
ISD::MULHS/ISD::MULHU lowering of vXi8 types means we expand these in TargetLowering BuildSDIV/BuildUDIV.
llvm-svn: 345175
Kuba Mracek [Wed, 24 Oct 2018 18:40:08 +0000 (18:40 +0000)]
[sanitizer] Avoid calling a nullptr in MonotonicNanoTime if interceptors are not yet initialized
There's a TSan startup crash on Linux when used in Swift programs, where MonotonicNanoTime will try to call real_clock_gettime and then jump to NULL because interceptors are not yet initialized. This is on Ubuntu 18.04. Looks like TSan's main Initialize() function is called at a point where __progname is already set, but interceptors aren't yet set up. Let's fix this by checking whether interceptors are initialized in MonotonicNanoTime.
Differential Revision: https://reviews.llvm.org/D53528
llvm-svn: 345174
Eric Fiselier [Wed, 24 Oct 2018 18:37:42 +0000 (18:37 +0000)]
Fix use of libc++ specific macro in support/test_macros.h
llvm-svn: 345173
Rui Ueyama [Wed, 24 Oct 2018 18:15:40 +0000 (18:15 +0000)]
Include input section name and output section name in an error message.
Differential Revision: https://reviews.llvm.org/D53645
llvm-svn: 345172
Peter Collingbourne [Wed, 24 Oct 2018 18:10:38 +0000 (18:10 +0000)]
ARM: Use BKPT instead of TRAP to implement llvm.debugtrap.
The BKPT instruction is specified to cause a software breakpoint,
and at least on Linux results in a SIGTRAP. This makes it more
suitable for implementing debugtrap than TRAP (aka UDF #254), which
is specified to cause an undefined instruction exception and results
in a SIGILL on Linux.
Moreover, BKPT is not marked as a terminator, which is not only
consistent with the IR instruction but allows the analyzeBlock
function to correctly analyze a basic block containing the instruction,
which fixes an assertion failure in the machine block placement pass
previously triggered by the included test case.
Because BKPT is only supported starting with ARMv5T, we continue to
use UDF #254 when targeting v4T.
Differential Revision: https://reviews.llvm.org/D53614
llvm-svn: 345171
Krzysztof Parzyszek [Wed, 24 Oct 2018 17:55:18 +0000 (17:55 +0000)]
[Hexagon] Flip hexagon-autohvx to be true by default
This will allow other generators of LLVM IR to use the auto-vectorizer
without having to change that flag.
Note: on its own, this patch will disable auto-vectorization on Hexagon
in all cases, regardless of the -fvectorize flag. There is a companion
LLVM patch that together with this one forms an NFC for clang users.
llvm-svn: 345170
Krzysztof Parzyszek [Wed, 24 Oct 2018 17:55:13 +0000 (17:55 +0000)]
[Hexagon] Flip hexagon-autohvx to be true by default
This will allow other generators of LLVM IR to use the auto-vectorizer
without having to change that flag.
Note: on its own, this patch will enable auto-vectorization on Hexagon
in all cases, regardless of the -fvectorize flag. There is a companion
clang patch that together with this one forms an NFC for clang users.
llvm-svn: 345169
Craig Topper [Wed, 24 Oct 2018 17:42:17 +0000 (17:42 +0000)]
[CodeGen] Update min-legal-vector width based on function argument and return types
This is a continuation of my patches to inform the X86 backend about what the largest IR types are in the function so that we can restrict the backend type legalizer to prevent 512-bit vectors on SKX when -mprefer-vector-width=256 is specified if no explicit 512 bit vectors were specified by the user.
This patch updates the vector width based on the argument and return types of the current function and from the types of any functions it calls. This is intended to make sure the backend type legalizer doesn't disturb any types that are required for ABI.
Differential Revision: https://reviews.llvm.org/D52441
llvm-svn: 345168
Jonas Toth [Wed, 24 Oct 2018 17:40:50 +0000 (17:40 +0000)]
[clang-tidy] Add the abseil-duration-factory-float check
Summary:
This check finds cases where calls to an absl::Duration factory could use the more efficient integer overload.
For example:
// Original - Providing a floating-point literal.
absl::Duration d = absl::Seconds(10.0);
// Suggested - Use an integer instead.
absl::Duration d = absl::Seconds(10);
Patch by hwright.
Reviewers: alexfh, hokein, aaron.ballman, JonasToth
Reviewed By: hokein, JonasToth
Subscribers: zturner, xazax.hun, Eugene.Zelenko, mgorny, cfe-commits
Tags: #clang-tools-extra
Differential Revision: https://reviews.llvm.org/D53339
llvm-svn: 345167
Michael Kruse [Wed, 24 Oct 2018 17:35:35 +0000 (17:35 +0000)]
[docs] Add rawspeed to test-suite proposals.
rawspeed was suggested by Simon Pilgrim and Roman Lebedev in
llvm.org/PR34216 and reviews.llvm.org/D46714.
llvm-svn: 345166
Craig Topper [Wed, 24 Oct 2018 17:32:09 +0000 (17:32 +0000)]
[X86] Bring back the MOV64r0 pseudo instruction
This patch brings back the MOV64r0 pseudo instruction for zeroing a 64-bit register. This replaces the SUBREG_TO_REG MOV32r0 sequence we use today. Post register allocation we will rewrite the MOV64r0 to a 32-bit xor with an implicit def of the 64-bit register similar to what we do for the various XMM/YMM/ZMM zeroing pseudos.
My main motivation is to enable the spill optimization in foldMemoryOperandImpl. As we were seeing some code that repeatedly did "xor eax, eax; store eax;" to spill several registers with a new xor for each store. With this optimization enabled we get a store of a 0 immediate instead of an xor. Though I admit the ideal solution would be one xor where there are multiple spills. I don't believe we have a test case that shows this optimization in here. I'll see if I can try to reduce one from the code were looking at.
There's definitely some other machine CSE(and maybe other passes) behavior changes exposed by this patch. So it seems like there might be some other deficiencies in SUBREG_TO_REG handling.
Differential Revision: https://reviews.llvm.org/D52757
llvm-svn: 345165
Simon Pilgrim [Wed, 24 Oct 2018 17:30:29 +0000 (17:30 +0000)]
[CostModel][X86] Enable non-uniform vector division by constants costs.
Non-uniform division/remainder handling was added back at D49248/D50765 - so share the 'mul+sub' costs that already exist for uniform cases.
llvm-svn: 345164
Robert Lougher [Wed, 24 Oct 2018 17:03:19 +0000 (17:03 +0000)]
[CodeGen] skip lifetime end marker in isInTailCallPosition
A lifetime end intrinsic between a tail call and the return should not
prevent the call from being tail call optimized.
Differential Revision: https://reviews.llvm.org/D53519
llvm-svn: 345163
Sanjay Patel [Wed, 24 Oct 2018 17:01:42 +0000 (17:01 +0000)]
[InstCombine] add test for ComputeNumSignBits with shuffle; NFC
llvm-svn: 345162
Andrea Di Biagio [Wed, 24 Oct 2018 16:56:43 +0000 (16:56 +0000)]
[llvm-mca] Remove dependency from InstrBuilder in class InstructionTables.
Also, removed the initialization of vectors used for processor resource masks.
Support function 'computeProcResourceMasks()' already calls method resize on
those vectors.
No functional change intended.
llvm-svn: 345161
Saleem Abdulrasool [Wed, 24 Oct 2018 16:56:36 +0000 (16:56 +0000)]
CodeGen: extract some local variables in CFConstantString creation (NFC)
Extract the reference to the ASTContext and Triple and use them throughout the
function. This is simply a cosmetic cleanup while in the area. NFC.
llvm-svn: 345160
Saleem Abdulrasool [Wed, 24 Oct 2018 16:38:16 +0000 (16:38 +0000)]
AST: unindent CFConstantStringDecl by inverting condition (NFC)
Unindent the body of the function by inverting check at the top. This is in
preparation for supporting CFString's new ABI with swift. NFC.
llvm-svn: 345159
Simon Pilgrim [Wed, 24 Oct 2018 16:35:01 +0000 (16:35 +0000)]
[LegalizeDAG] ExpandLegalINT_TO_FP - cleanup UINT_TO_FP i64 -> f32 expansion.
Use SrcVT/DestVT types and correct shift type.
Part of prep work for D52965
llvm-svn: 345158
George Rimar [Wed, 24 Oct 2018 16:21:56 +0000 (16:21 +0000)]
Revert rL345127: [LLDB] - Add support for DW_RLE_base_address and DW_RLE_offset_pair entries
It broke BB:
http://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/11671/consoleFull#
434797663d489585b-5106-414a-ac11-
3ff90657619c
llvm-svn: 345157
Sanjay Patel [Wed, 24 Oct 2018 16:21:23 +0000 (16:21 +0000)]
[InstCombine] add test for select with shuffled condition (PR37549); NFC
llvm-svn: 345156
Kuba Mracek [Wed, 24 Oct 2018 15:59:31 +0000 (15:59 +0000)]
[lldb] Remove enableThreadSanitizer from shared Xcode schemes
This was probably committed accidentally and default Xcode builds of LLDB now have TSan on. Let's turn it off.
llvm-svn: 345155
Rui Ueyama [Wed, 24 Oct 2018 15:47:46 +0000 (15:47 +0000)]
Refactor assignFileOffsets. NFC.
llvm-svn: 345154
Kadir Cetinkaya [Wed, 24 Oct 2018 15:24:29 +0000 (15:24 +0000)]
[clangd] Do not query index for new name completions.
Reviewers: sammccall
Reviewed By: sammccall
Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, cfe-commits
Differential Revision: https://reviews.llvm.org/D53192
llvm-svn: 345153
Kadir Cetinkaya [Wed, 24 Oct 2018 15:23:49 +0000 (15:23 +0000)]
[clang] Introduce new completion context types
Summary: New name suggestions were being used in places where existing names should have been used, this patch tries to fix some of those situations.
Reviewers: sammccall
Reviewed By: sammccall
Subscribers: arphaman, cfe-commits
Differential Revision: https://reviews.llvm.org/D53191
llvm-svn: 345152
Krasimir Georgiev [Wed, 24 Oct 2018 15:18:51 +0000 (15:18 +0000)]
IR: Optimize FunctionType::get to perform one hash lookup instead of two, NFCI
Summary: This function was performing two hash lookups when a new function type was requested: first checking if it exists and second to insert it. This patch updates the function to perform a single hash lookup in this case by updating the value in the hash table in-place in case the function type was not there before.
Reviewers: bkramer
Reviewed By: bkramer
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D53471
llvm-svn: 345151
Sam McCall [Wed, 24 Oct 2018 15:18:40 +0000 (15:18 +0000)]
[clangd] When replying, log the method name and latency.
Summary:
This information is strictly available in the log (you can find the original
call) but it makes the log easier to follow in practice.
Reviewers: kadircet
Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, cfe-commits
Differential Revision: https://reviews.llvm.org/D53647
llvm-svn: 345150
Sanjay Patel [Wed, 24 Oct 2018 15:17:56 +0000 (15:17 +0000)]
[InstCombine] try harder to form select from logic ops (2nd try)
The original patch was committed here:
rL344609
...and reverted:
rL344612
...because it did not properly check/test data types before calling
ComputeNumSignBits().
The tests that caused bot failures for the previous commit are
over-reaching front-end tests that run the entire -O optimizer
pipeline:
Clang :: CodeGen/builtins-systemz-zvector.c
Clang :: CodeGen/builtins-systemz-zvector2.c
I've added a negative test here to ensure coverage for that case.
The new early exit check also tests the type of the 'B' parameter,
so we don't waste time on matching if either value is unsuitable.
Original commit message:
This is part of solving PR37549:
https://bugs.llvm.org/show_bug.cgi?id=37549
The patterns shown here are a special case of something
that we already convert to select. Using ComputeNumSignBits()
catches that case (but not the more complicated motivating
patterns yet).
The backend has hooks/logic to convert back to logic ops
if that's better for the target.
llvm-svn: 345149
Mikhail Maltsev [Wed, 24 Oct 2018 15:09:08 +0000 (15:09 +0000)]
Adjust unsupported C++ versions in some tests
Summary:
Some tests (mainly the new C++20 calendar library) fail when libc++ is
tested with '--param=std=c++98'. The failures happen because the tests
actually don't support C++98, but don't mention C++98 in the
'UNSUPPORTED:' line.
This change fixes the issue.
Reviewers: mclow.lists, ldionne
Reviewed By: ldionne
Subscribers: arphaman, michaelplatings, libcxx-commits
Differential Revision: https://reviews.llvm.org/D53640
llvm-svn: 345148
Andrea Di Biagio [Wed, 24 Oct 2018 15:06:27 +0000 (15:06 +0000)]
[llvm-mca] Refactor class SourceMgr. NFCI
Added begin()/end() methods to allow the usage of SourceMgr in foreach loops.
With this change, method getMCInstFromIndex() (as well as a couple of other
methods) are now redundant, and can be removed from the public interface.
llvm-svn: 345147
Cameron McInally [Wed, 24 Oct 2018 14:45:18 +0000 (14:45 +0000)]
[FPEnv] Convert more BinaryOperator::isFNeg(...) to m_FNeg(...)
This work is to avoid regressions when we seperate FNeg from the FSub IR instruction.
Differential Revision: https://reviews.llvm.org/D53205
llvm-svn: 345146
Erich Keane [Wed, 24 Oct 2018 14:33:30 +0000 (14:33 +0000)]
Remove a pair of unused dispatch multiversion declarations.
These declarations somehow survived a cleanup that combined them with the target
multiversioning functions. This patch removes them as they are no
longer necessary or used.
Change-Id: I318286401ace63bef1aa48018dabb25be0117ca0
llvm-svn: 345145
Sam McCall [Wed, 24 Oct 2018 14:26:26 +0000 (14:26 +0000)]
[clangd] Ensure that we reply to each call exactly once. NFC (I think!)
Summary:
In debug builds, getting this wrong will trigger asserts.
In production builds, it will send an error reply if none was sent,
and drop redundant replies. (And log).
No tests because this is always a programming error.
(We did have some cases of this, but I fixed them with the new dispatcher).
Reviewers: ioeric
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, jfb, kadircet, cfe-commits
Differential Revision: https://reviews.llvm.org/D53399
llvm-svn: 345144