Richard Smith [Wed, 19 Feb 2020 02:39:57 +0000 (18:39 -0800)]
P0593R6: Pseudo-destructor expressions end object lifetimes.
This only has an observable effect on constant evaluation.
Wenlei He [Tue, 18 Feb 2020 23:05:37 +0000 (15:05 -0800)]
Fix test for profile remapper
Subscribers: llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D74799
Tim Shen [Fri, 14 Feb 2020 23:07:44 +0000 (15:07 -0800)]
[MLIR] change NVVM.mma.sync to the most useful variant.
Summary:
the .row.col variant turns out to be the popular one, contrary to what I
thought as .row.row. Since .row.col is so prevailing (as I inspect
cuDNN's behavior), I'm going to remove the .row.row support here, which
makes the patch a little bit easier.
Reviewers: ftynse
Subscribers: jholewinski, bixia, sanjoy.google, mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, liufengdb, Joonsoo, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D74655
Tim Shen [Tue, 11 Feb 2020 03:44:42 +0000 (19:44 -0800)]
[MLIR] Add std.assume_alignment op.
Reviewers: ftynse, nicolasvasilache, andydavis1
Subscribers: bixia, sanjoy.google, mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, arpith-jacob, mgester, lucyrfox, aartbik, liufengdb, Joonsoo, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D74378
Eric Christopher [Wed, 19 Feb 2020 01:49:22 +0000 (17:49 -0800)]
Fix a signed/unsigned warning promoted to error.
River Riddle [Wed, 19 Feb 2020 01:36:25 +0000 (17:36 -0800)]
[mlir][DialectConversion] Forward capture callback to fix build on older
GCC
Older GCC confuses the type of 'callback' after it gets captured, so
add a forward capture to move it properly.
Jonas Devlieghere [Wed, 19 Feb 2020 01:35:11 +0000 (17:35 -0800)]
[lldb/Core] Remove dead Get*PluginCreateCallbackForPluginName (NFC)
The plugin manager had dedicated Get*PluginCreateCallbackForPluginName
methods for each type of plugin, and only a small subset of those were
used. This removes the dead duplicated code.
Jim Lin [Wed, 19 Feb 2020 00:51:48 +0000 (08:51 +0800)]
[NFC] Update the testcase clang_f_opts.c for the removed options
Jonas Devlieghere [Wed, 19 Feb 2020 01:08:46 +0000 (17:08 -0800)]
[lldb/Core] Remove blatant code duplication by using a template (NFC)
Remove a bunch of duplicate code by using a templated base class.
Jim Lin [Wed, 19 Feb 2020 00:36:07 +0000 (08:36 +0800)]
Remove unused option that gcc ignored
Reviewers: efriedma, MaskRay
Reviewed By: efriedma, MaskRay
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D72825
River Riddle [Tue, 18 Feb 2020 23:56:33 +0000 (15:56 -0800)]
[mlir] Refactor TypeConverter to add conversions without inheritance
Summary:
This revision refactors the TypeConverter class to not use inheritance to add type conversions. It instead moves to a registration based system, where conversion callbacks are added to the converter with `addConversion`. This method takes a conversion callback, which must be convertible to any of the following forms(where `T` is a class derived from `Type`:
* Optional<Type> (T type)
- This form represents a 1-1 type conversion. It should return nullptr
or `llvm::None` to signify failure. If `llvm::None` is returned, the
converter is allowed to try another conversion function to perform
the conversion.
* Optional<LogicalResult>(T type, SmallVectorImpl<Type> &results)
- This form represents a 1-N type conversion. It should return
`failure` or `llvm::None` to signify a failed conversion. If the new
set of types is empty, the type is removed and any usages of the
existing value are expected to be removed during conversion. If
`llvm::None` is returned, the converter is allowed to try another
conversion function to perform the conversion.
When attempting to convert a type, the TypeConverter walks each of the registered converters starting with the one registered most recently.
Differential Revision: https://reviews.llvm.org/D74584
Richard Smith [Wed, 19 Feb 2020 00:13:23 +0000 (16:13 -0800)]
Add -std=c++20 flag, replace C++2a with C++20 throughout the Clang
user interface and documentation, and update __cplusplus for C++20.
WG21 considers the C++20 standard to be finished (even though it still
has some more steps to pass through in the ISO process).
The old flag names are accepted for compatibility, as usual, and we
still have lots of references to C++2a in comments and identifiers;
those can be cleaned up separately.
LLVM GN Syncbot [Wed, 19 Feb 2020 00:02:12 +0000 (00:02 +0000)]
[gn build] Port
ca9ba76481f
Thomas Lively [Fri, 7 Feb 2020 00:29:59 +0000 (16:29 -0800)]
[WebAssembly] Replace all calls with generalized multivalue calls
Summary:
Extends the multivalue call infrastructure to tail calls, removes all
legacy calls specialized for particular result types, and removes the
CallIndirectFixup pass, since all indirect call arguments are now
fixed up directly in the post-insertion hook.
In order to keep supporting pretty-printed defs and uses in test
expectations, MCInstLower now inserts an immediate containing the
number of defs for each call and call_indirect. The InstPrinter is
updated to query this immediate if it is present and determine which
MCOperands are defs and uses accordingly.
Depends on D72902.
Reviewers: aheejin
Subscribers: dschuff, mgorny, sbc100, jgravelle-google, hiraditya, sunfish, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D74192
Nick Desaulniers [Tue, 18 Feb 2020 23:33:42 +0000 (15:33 -0800)]
[Driver] -pg -mfentry should respect target specific decisions for -mframe-pointer=all
Summary:
$ clang -O2 -pg -mfentry foo.c
was adding frame pointers to all functions. This was exposed via
compiling the Linux kernel for x86_64 with CONFIG_FUNCTION_TRACER
enabled.
-pg was unconditionally setting the equivalent of -fno-omit-frame-pointer,
regardless of the presence of -mfentry or optimization level. After this
patch, frame pointers will only be omitted at -O0 or if
-fno-omit-frame-pointer is explicitly set for -pg -mfentry.
See also:
https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=
3c5273a96ba8dbf98c40bc6d9d0a1587b4cfedb2;hp=
c9d75a48c4ea63ab27ccdb40f993236289b243f2#patch2
(modification to ix86_frame_pointer_required())
Fixes: pr/44934
Reviewers: void, manojgupta, dberris, MaskRay, hfinkel
Reviewed By: MaskRay
Subscribers: cfe-commits, llozano, niravd, srhines
Tags: #clang
Differential Revision: https://reviews.llvm.org/D74698
Reid Kleckner [Tue, 18 Feb 2020 23:12:32 +0000 (15:12 -0800)]
Fix NDEBUG build after instruction ordering
Richard Smith [Tue, 18 Feb 2020 22:53:54 +0000 (14:53 -0800)]
PR44958: Allow member calls and typeid / dynamic_cast on mutable objects
and objects with mutable subobjects.
The standard wording doesn't really cover these cases; accepting all
such cases seems most in line with what we do in other cases and what
other compilers do. (Essentially this means we're assuming that objects
external to the evaluation are always in-lifetime.)
Thomas Lively [Tue, 14 Jan 2020 22:22:49 +0000 (14:22 -0800)]
[WebAssembly] Fix RegStackify and ExplicitLocals to handle multivalue
Summary:
There is still room for improvement in the handling of multivalue
nodes in both passes, but the current algorithm is at least correct
and optimizes some simpler cases. In order to make future
optimizations of these passes easier and build confidence that the
current algorithms are correct, this CL also adds a script that
automatically and exhaustively generates interesting multivalue test
cases.
Reviewers: aheejin, dschuff
Subscribers: sbc100, jgravelle-google, hiraditya, sunfish, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D72902
Aditya Nandakumar [Tue, 18 Feb 2020 22:42:49 +0000 (14:42 -0800)]
[GlobalISel]: Fix some non determinism exposed in CSE due to not notifying observers about mutations + add verification for CSE
https://reviews.llvm.org/D67133
While investigating some non determinism (CSE doesn't produce wrong
code, it just doesn't CSE some times) in GISel CSE on an out of tree
target, I realized that the core issue was that there were lots of code
that mutates (setReg, setRegClass etc), but doesn't notify observers
(CSE in this case but this could be any other observer). In order to
make the Observer be available in various parts of code and to avoid
having to thread it through various API, the MachineFunction now has the
observer as field. This allows it to be easily used in helper functions
such as constrainOperandRegClass.
Also added some invariant verification method in CSEInfo which can
catch these issues (when CSE is enabled).
Reid Kleckner [Tue, 18 Feb 2020 22:33:54 +0000 (14:33 -0800)]
[IR] Lazily number instructions for local dominance queries
Essentially, fold OrderedBasicBlock into BasicBlock, and make it
auto-invalidate the instruction ordering when new instructions are
added. Notably, we don't need to invalidate it when removing
instructions, which is helpful when a pass mostly delete dead
instructions rather than transforming them.
The downside is that Instruction grows from 56 bytes to 64 bytes. The
resulting LLVM code is substantially simpler and automatically handles
invalidation, which makes me think that this is the right speed and size
tradeoff.
The important change is in SymbolTableTraitsImpl.h, where the numbering
is invalidated. Everything else should be straightforward.
We probably want to implement a fancier re-numbering scheme so that
local updates don't invalidate the ordering, but I plan for that to be
future work, maybe for someone else.
Reviewed By: lattner, vsk, fhahn, dexonsmith
Differential Revision: https://reviews.llvm.org/D51664
Sid Manning [Tue, 18 Feb 2020 22:36:38 +0000 (16:36 -0600)]
[hexagon] Fix testcase issue with windows builder.
Reid Kleckner [Tue, 18 Feb 2020 21:11:39 +0000 (13:11 -0800)]
Add coding standard recommending use of qualifiers in cpp files
There is prior art for this in the code base itself, and a recent
example of this here:
c45f8d49897f
This came up in discussion on this review where @maskray was going the
opposite direction:
https://reviews.llvm.org/D68772
Given that there is disagreement, we should make a choice and document
it.
Thanks to John McCall for the precise wording.
Reviewed By: MaskRay, rjmccall
Differential Revision: https://reviews.llvm.org/D74515
Daniel Sanders [Tue, 18 Feb 2020 21:12:28 +0000 (13:12 -0800)]
Fix assertion on `!eq(?, 0)`
Instead of asserting, emit a proper error message
Thomas Lively [Thu, 6 Feb 2020 06:35:01 +0000 (22:35 -0800)]
[WebAssembly] Implement multivalue call_indirects
Summary:
Unlike normal calls, call_indirects have immediate arguments that
caused a MachineVerifier failure without a small tweak to loosen the
verifier's requirements for variadicOpsAreDefs instructions.
One nice thing about the new call_indirects is that they do not need
to participate in the PCALL_INDIRECT mechanism because their post-isel
hook handles moving the function pointer argument and adding the flags
and typeindex arguments itself.
Reviewers: aheejin
Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D74191
Thomas Lively [Thu, 6 Feb 2020 02:17:45 +0000 (18:17 -0800)]
Reland "[WebAssembly] Split and recombine multivalue calls for ISel"
This reverts commit
8acedb595d039f68ad15f9e5f2e6cb79729307e4 and
relands a prerequisite for the patch series culminating in
https://reviews.llvm.org/D74192.
Thomas Lively [Thu, 6 Feb 2020 02:17:11 +0000 (18:17 -0800)]
Reland "[WebAssembly][InstrEmitter] Foundation for multivalue call lowering"
This reverts commit
649aba93a27170cb03a4b17c98a19b9237a880b8, now that
the approach started there has been shown to be workable in the patch
series culminating in https://reviews.llvm.org/D74192.
Davide Italiano [Tue, 18 Feb 2020 21:39:37 +0000 (13:39 -0800)]
[TestTargetCommand] Remove another reference to a stale rdar.
The test passes, and the rdar is closed.
Davide Italiano [Tue, 18 Feb 2020 21:38:27 +0000 (13:38 -0800)]
[TestTargetCommand] `target var` without a process doesn't work on arm64e.
lldb needs to know about chains of authenticated relocations.
<rdar://problem/
37773624>
Davide Italiano [Tue, 18 Feb 2020 21:31:14 +0000 (13:31 -0800)]
[TestGlobalVariables] Remove a reference to a stale rdar.
The bug has been fixed and the rdar is closed. No need to
clutter the test.
Davide Italiano [Tue, 18 Feb 2020 21:30:35 +0000 (13:30 -0800)]
[TestGlobalVariables] `target var` without a process doesn't work on arm64e.
lldb needs to know about chains of authenticated relocations.
<rdar://problem/
37773624>
Jonas Devlieghere [Tue, 18 Feb 2020 20:49:03 +0000 (12:49 -0800)]
[lldb/Plugin] Reject WASM and Hexagon in DynamicLoaderStatic
The WASM and Hexagon plugin check the ArchType rather than the OSType,
so explicitly reject those in the DynamicLoaderStatic.
Differential revision: https://reviews.llvm.org/D74780
MaheshRavishankar [Tue, 18 Feb 2020 17:50:47 +0000 (09:50 -0800)]
[mlir][Linalg] Allow specifiying zero-rank shaped type operands to linalg.generic ops.
Fixing a bug where using a zero-rank shaped type operand to
linalg.generic ops hit an unrelated assert. This also meant that
lowering the operation to loops was not supported. Adding roundtrip
tests and lowering to loops test for zero-rank shaped type operand
with fixes to make the test pass.
Differential Revision: https://reviews.llvm.org/D74638
Alex Zinenko [Tue, 18 Feb 2020 15:55:52 +0000 (16:55 +0100)]
[mlir] NFC: rename LLVMOpLowering to ConvertToLLVMPattern
This better reflects the nature of the class and matches the current
naming scheme.
Differential Revision: https://reviews.llvm.org/D74774
David Tenty [Tue, 18 Feb 2020 21:02:43 +0000 (16:02 -0500)]
[clang][XCOFF] Indicate that XCOFF does not support COMDATs
Summary: XCOFF doesn't support COMDATs, so clang shouldn't emit them.
Reviewers: stevewan, sfertile, Xiangling_L
Reviewed By: sfertile
Subscribers: dschuff, aheejin, dexonsmith, cfe-commits, llvm-commits
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D74631
Reid Kleckner [Tue, 18 Feb 2020 20:59:34 +0000 (12:59 -0800)]
Remove "ELF Only" from -f*-sections help text
-ffunction-sections and -fdata-sections are well supported by many
object file formats:
- ELF
- COFF
- XCOFF
- wasm
Only MachO ignores this flag.
While here, remove it from -funique-section-names. Wasm honors this
option.
Addresses PR44910.
Reviewed By: hans, aaron.ballman
Differential Revision: https://reviews.llvm.org/D74634
Karasev Nikita [Tue, 18 Feb 2020 20:32:03 +0000 (15:32 -0500)]
Fix PR#44620 'readability-redundant-string-cstr quick-fix causes invalid code'
static void f2(std::string&&) {}
static void f() {
std::string const s;
f2(s.c_str()); // readability-redundant-string-cstr previously warning
}
Skips the problematic AST pattern in the matcher.
Sid Manning [Tue, 18 Feb 2020 19:35:00 +0000 (13:35 -0600)]
[Hexagon] clang driver should consider --sysroot option
Hexagon's clang driver should consider --sysroot option when setting
up include paths.
Differential Revision: https://reviews.llvm.org/D74776
Louis Dionne [Tue, 18 Feb 2020 20:04:33 +0000 (15:04 -0500)]
[libc++] Fix overly complicated test of std::span's extent
Thanks to Billy O'Neal for the patch.
Differential Revision: https://reviews.llvm.org/D73138
Jorge Gorbe Moya [Tue, 18 Feb 2020 19:48:02 +0000 (11:48 -0800)]
[libunwind] Fix memory leak in handling of DW_CFA_remember_state and DW_CFA_restore_state
parseInstructions() doesn't always process the whole set of DWARF
instructions for a frame. It will stop once the target PC is reached, or
if malformed instructions are found. So, for example, if we have an
instruction sequence like this:
```
<start>
...
DW_CFA_remember_state
...
DW_CFA_advance_loc past the location we're unwinding at (pcoffset in parseInstructions() main loop)
...
DW_CFA_restore_state
<end>
```
... the saved state will never be freed, even though the
DW_CFA_remember_state opcode has a matching DW_CFA_restore_state later
in the sequence.
This change adds code to free whatever is left on rememberStack after
parsing the CIE and the FDE instructions.
Differential Revision: https://reviews.llvm.org/D66904
serge-sans-paille [Tue, 18 Feb 2020 19:56:02 +0000 (20:56 +0100)]
Revert "Support -fuse-ld=lld for riscv"
This reverts commit
dd230142d8a00f5f30c3930a2407000e845dcfbf.
Failures:
http://lab.llvm.org:8011/builders/llvm-clang-win-x-armv7l/builds/4749
http://lab.llvm.org:8011/builders/llvm-clang-win-x-aarch64/builds/4752
Simon Pilgrim [Tue, 18 Feb 2020 16:52:01 +0000 (16:52 +0000)]
[TargetLowering] Add SimplifyMultipleUseDemandedBits 'all elements' helper wrapper. NFC.
Yaxun (Sam) Liu [Tue, 18 Feb 2020 19:28:45 +0000 (14:28 -0500)]
Revert "[CUDA][HIP][OpenMP] Add lib/Sema/UsedDeclVisitor.h after D70172"
This reverts commit
c7fa409bcadaf4ddba1862b2e52349e0ab03d1b4.
Yaxun (Sam) Liu [Tue, 18 Feb 2020 19:23:59 +0000 (14:23 -0500)]
Revert "[CUDA][HIP][OpenMP] Emit deferred diagnostics by a post-parsing AST travese"
This reverts commit
1b978ddba05cb15e22b4e75adb5e7362ad861987.
River Riddle [Tue, 18 Feb 2020 19:36:53 +0000 (11:36 -0800)]
[mlir] Add a TypeRange class that functions similar to ValueRange.
Summary: This class wraps around the various different ways to construct a range of Type, without forcing the materialization of that range into a contiguous vector.
Differential Revision: https://reviews.llvm.org/D74646
Jonas Devlieghere [Tue, 18 Feb 2020 19:25:42 +0000 (11:25 -0800)]
[lldb/Plugin] Generate LLDB_PLUGIN_DECLARE with CMake
Generate the LLDB_PLUGIN_DECLARE macros with CMake and a def file. I'm
landing D73067 in pieces so I can bisect what exactly is breaking the
Windows bot.
Alexandre Ganea [Tue, 18 Feb 2020 19:25:08 +0000 (14:25 -0500)]
Craig Topper [Tue, 18 Feb 2020 19:10:01 +0000 (11:10 -0800)]
[X86] Add a helper function to pull some repeated code out of combineGatherScatter. NFC
Fangrui Song [Tue, 18 Feb 2020 01:43:09 +0000 (17:43 -0800)]
[JumpThreading] Skip unconditional PredBB when threading jumps through two basic blocks
Fixes https://bugs.llvm.org/show_bug.cgi?id=44922 (caused by
4698bf145d583e26ed438026ef7fde031ef322b1)
ThreadThroughTwoBasicBlocks assumes PredBBBranch is conditional. The following code can segfault.
AddPHINodeEntriesForMappedBlock(PredBBBranch->getSuccessor(1), PredBB, NewBB,
ValueMapping);
We can also allow unconditional PredBB, but the produced code is not
better.
Reviewed By: kazu
Differential Revision: https://reviews.llvm.org/D74747
LLVM GN Syncbot [Tue, 18 Feb 2020 18:45:25 +0000 (18:45 +0000)]
[gn build] Port
c9e93c84f61
Tyker [Tue, 18 Feb 2020 18:06:30 +0000 (19:06 +0100)]
Add Query API for llvm.assume holding attributes
Reviewers: jdoerfert, sstefan1, uenoku
Reviewed By: jdoerfert
Subscribers: mgorny, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D72885
Huihui Zhang [Tue, 18 Feb 2020 18:35:36 +0000 (10:35 -0800)]
[NFC] Silence compiler warning [-Wmissing-braces].
Stanislav Mekhanoshin [Tue, 18 Feb 2020 01:22:28 +0000 (17:22 -0800)]
[AMDGPU] Use generated RegisterPressureSets enum
Differential Revision: https://reviews.llvm.org/D74671
Matt Arsenault [Tue, 18 Feb 2020 18:01:55 +0000 (13:01 -0500)]
CodeGen: Move undef_tied_input declaration
This doesn't belong in ARM specific code since it's generally
recognized by tablegen.
Jonas Devlieghere [Tue, 18 Feb 2020 18:29:23 +0000 (10:29 -0800)]
[lldb/Plugin] Unconditionally initialize DynamicLoaderDarwinKernel
Other plugins depend on DynamicLoaderDarwinKernel and which means we
cannot conditionally enable/build this plugin based on the target
platform. This means that it will be past of the list of plugins
initialized once that's autogenerated.
Nico Weber [Tue, 18 Feb 2020 18:29:13 +0000 (13:29 -0500)]
[gn build] (manually) port
fc69967a4b9
Stanislav Mekhanoshin [Fri, 14 Feb 2020 21:05:34 +0000 (13:05 -0800)]
[TBLGEN] Emit register pressure set enum
Differential Revision: https://reviews.llvm.org/D74649
Kostya Kortchinsky [Sun, 16 Feb 2020 23:29:46 +0000 (15:29 -0800)]
[scudo][standalone] Shift some data from dynamic to static
Summary:
Most of our larger data is dynamically allocated (via `map`) but it
became an hindrance with regard to init time, for a cost to benefit
ratio that is not great. So change the `TSD`s, `RegionInfo`, `ByteMap`
to be static.
Additionally, for reclaiming, we used mapped & unmapped a buffer each
time, which is costly. It turns out that we can have a static buffer,
and that there isn't much contention on it.
One of the other things changed here, is that we hard set the number
of TSDs on Android to the maximum number, as there could be a
situation where cores are put to sleep and we could miss some.
Subscribers: mgorny, #sanitizers, llvm-commits
Tags: #sanitizers, #llvm
Differential Revision: https://reviews.llvm.org/D74696
Miloš Stojanović [Tue, 18 Feb 2020 17:30:50 +0000 (18:30 +0100)]
Revert "[llvm-exegesis] Improve error reporting in Assembler.cpp"
This reverts https://reviews.llvm.org/rG63bb9fee525f
due to buildbot failures:
http://lab.llvm.org:8011/builders/clang-ppc64le-rhel/builds/1389
Mikhail Maltsev [Tue, 18 Feb 2020 17:31:21 +0000 (17:31 +0000)]
[ARM,MVE] Add vbrsrq intrinsics family
Summary:
This patch adds a new MVE intrinsics family, `vbrsrq`: vector bit
reverse and shift right. The intrinsics are compiled into the VBRSR
instruction. Two new LLVM IR intrinsics were also added: arm.mve.vbrsr
and arm.mve.vbrsr.predicated.
Reviewers: simon_tatham, dmgreen, ostannard, MarkMurrayARM
Reviewed By: simon_tatham
Subscribers: kristof.beyls, hiraditya, cfe-commits, llvm-commits
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D74721
Florian Hahn [Tue, 18 Feb 2020 16:23:01 +0000 (17:23 +0100)]
[SLPVectorizer] Do not assume extracelement idx is a ConstantInt.
The index of an ExtractElementInst is not guaranteed to be a
ConstantInt. It can be any integer value. Check explicitly for
ConstantInts.
The new test cases illustrate scenarios where we crash without
this patch. I've also added another test case to check the matching
of extractelement vector ops works.
Reviewers: RKSimon, ABataev, dtemirbulatov, vporpo
Reviewed By: ABataev
Differential Revision: https://reviews.llvm.org/D74758
Jan Kratochvil [Tue, 18 Feb 2020 17:08:10 +0000 (18:08 +0100)]
[lldb] [nfc] Separate DIERef vs. user_id_t: GetForwardDeclClangTypeToDie()
Reasons are the same as for D74637.
Differential Revision: https://reviews.llvm.org/D74690
Nikita Popov [Mon, 17 Feb 2020 20:59:46 +0000 (21:59 +0100)]
[VectorUtils] Accept IRBuilderBase; NFC
Nikita Popov [Mon, 17 Feb 2020 21:23:24 +0000 (22:23 +0100)]
[SimplifyLibCalls] Accept IRBuilderBase; NFC
Nikita Popov [Mon, 17 Feb 2020 20:56:28 +0000 (21:56 +0100)]
[LoopUtils] Accept IRBuilderBase; NFC
Nikita Popov [Mon, 17 Feb 2020 20:52:11 +0000 (21:52 +0100)]
[BuildLibCalls] Accept IRBuilderBase; NFC
Accept IRBuilderBase instead of IRBuilder<>. Remove dependency
on IRBuilder from header.
Nikita Popov [Sat, 11 Jan 2020 15:58:01 +0000 (16:58 +0100)]
[InstCombine] Fix worklist management when simplifying demanded bits
When simplifying demanded bits, we currently only report the
instruction on which SimplifyDemandedBits was called as changed.
However, this is a recursive call, and the actually modified
instruction will usually be further up the chain. Additionally,
all the intermediate instructions should also be revisited,
as additional combines may be possible after the demanded bits
simplification. We fix this by explicitly adding them back to the
worklist.
Differential Revision: https://reviews.llvm.org/D72944
Nikita Popov [Sun, 16 Feb 2020 10:00:22 +0000 (11:00 +0100)]
[InstCombine] Fix multi-use handling in cttz transform
The select-of-cttz transform can currently duplicate cttz intrinsics
and zext/trunc ops. The cause is that it unnecessarily duplicates
the intrinsic and the zext/trunc when setting the "undef_on_zero"
flag to false. However, it's always legal to set the flag from true
to false, so we can make this replacement even if there are extra users.
Differential Revision: https://reviews.llvm.org/D74685
Sean Fertile [Tue, 18 Feb 2020 16:19:16 +0000 (11:19 -0500)]
[PowerPC][NFC] Add defines to help creating the SpillSlot arrays.
Create preprocessor defines for callee saved floating-point register spill
slots, vector register spill slots, and both 32-bit and 64-bit general
purpose register spill slots. This is an NFC refactor to prepare for
adding ABI compliant callee saves and restores for AIX.
Nikita Popov [Sun, 9 Feb 2020 08:57:59 +0000 (09:57 +0100)]
[InstCombine] Relax preconditions for ashr+and+icmp fold (PR44754)
Fix for https://bugs.llvm.org/show_bug.cgi?id=44754. We already have
a fold that converts icmp (and (ashr X, C3), C2), C1 into
icmp (and C2'), C1', but it imposed overly strict requirements on the
transform.
Relax this by checking that both C2 and C1 don't shift out bits
(in a signed sense) when forming the new constants.
Alive proofs (https://rise4fun.com/Alive/PTz0):
Name: ashr_legal
Pre: ((C2 << C3) >> C3) == C2 && ((C1 << C3) >> C3) == C1
%a = ashr i16 %x, C3
%b = and i16 %a, C2
%c = icmp i16 %b, C1
=>
%d = and i16 %x, C2 << C3
%c = icmp i16 %d, C1 << C3
Name: ashr_shiftout_eq
Pre: ((C2 << C3) >> C3) == C2 && ((C1 << C3) >> C3) != C1
%a = ashr i16 %x, C3
%b = and i16 %a, C2
%c = icmp eq i16 %b, C1
=>
%c = false
Note that >> corresponds to ashr here. The case of an equality
comparison has some special handling in this transform, because
it will form to a true/false result if the condition on the comparison
constant it violated.
Differential Revision: https://reviews.llvm.org/D74294
Nikita Popov [Sun, 9 Feb 2020 08:52:38 +0000 (09:52 +0100)]
[InstCombine] Add more tests for icmp+and+ashr; NFC
Alexey Romanov [Tue, 18 Feb 2020 16:42:32 +0000 (11:42 -0500)]
Cover cases like (b && c && b) in the redundant expression check.
readability-redundant-expression now detects expressions where a logical
or bitwise operator had equivalent LHS and RHS where the equivalent
operands were separated by more operands.
Aaron Ballman [Tue, 18 Feb 2020 16:37:39 +0000 (11:37 -0500)]
Hopefully fixing a failing build bot.
Should fix the changes from
260b91f379c8f86d3d6008648b3f2a945a007888.
Jacques Pienaar [Mon, 17 Feb 2020 21:16:24 +0000 (13:16 -0800)]
[mlir] Add short readme.txt to docs directory
Summary:
Refer folks to the main website and make it explicit that the rendered
output is what is of interest and that the GitHub viewing experience may
not match (even though we are trying to keep it as close as possible, the
renderers do differ).
Differential Revision: https://reviews.llvm.org/D74739
John Marshall [Tue, 18 Feb 2020 16:18:35 +0000 (11:18 -0500)]
Use getLocation() in "too few/too many arguments" diagnostic
Use the more accurate location when emitting the location of the
function being called's prototype in diagnostics emitted when calling
a function with an incorrect number of arguments.
In particular, avoids showing a trace of irrelevant macro expansions
for "MY_EXPORT static int AwesomeFunction(int, int);". Fixes PR#23564.
Benjamin Kramer [Tue, 18 Feb 2020 16:04:42 +0000 (17:04 +0100)]
Drop a constexpr in favor of const, MSVC complains.
lib\Target\Hexagon\HexagonGenDFAPacketizer.inc(109): error C2131: expression did not evaluate to a constant
Andrew Wei [Tue, 18 Feb 2020 15:53:26 +0000 (23:53 +0800)]
[RISCV] Implement mayBeEmittedAsTailCall for tail call optimization
Implement TargetLowering callback mayBeEmittedAsTailCall for riscv in CodeGenPrepare,
which will duplicate return instructions to enable tailcall optimization.
Differential Revision: https://reviews.llvm.org/D73699
Sander de Smalen [Tue, 18 Feb 2020 14:32:26 +0000 (14:32 +0000)]
Add OffsetIsScalable to getMemOperandWithOffset
Summary:
Making `Scale` a `TypeSize` in AArch64InstrInfo::getMemOpInfo,
has the effect that all places where this information is used
(notably, TargetInstrInfo::getMemOperandWithOffset) will need
to consider Scale - and derived, Offset - possibly being scalable.
This patch adds a new operand `bool &OffsetIsScalable` to
TargetInstrInfo::getMemOperandWithOffset and fixes up all
the places where this function is used, to consider the
offset possibly being scalable.
In most cases, this means bailing out because the algorithm does not
(or cannot) support scalable offsets in places where it does some
form of alias checking for example.
Reviewers: rovka, efriedma, kristof.beyls
Reviewed By: efriedma
Subscribers: wuzish, kerbowa, MatzeB, arsenm, nemanjai, jvesely, nhaehnle, hiraditya, kbarton, javed.absar, asb, rbar, johnrusso, simoncook, sabuasal, niosHD, jrtc27, MaskRay, zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, PkmX, jocewei, jsji, Jim, lenary, s.egerton, pzheng, sameer.abuasal, apazos, luismarques, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D72758
Louis Dionne [Tue, 18 Feb 2020 15:49:19 +0000 (10:49 -0500)]
[libc++] Add ABI list for 9.0 release
I just took a snapshot of the current ABI lists on master, since I don't
think they changed since the actual 9.0 release.
Djordje Todorovic [Tue, 18 Feb 2020 15:37:16 +0000 (16:37 +0100)]
Revert "Reland "[DebugInfo] Enable the debug entry values feature by default""
This reverts commit rGa82d3e8a6e67.
serge-sans-paille [Sat, 15 Feb 2020 07:58:40 +0000 (08:58 +0100)]
Prevent gcc from issuing a warning upon coffnamecpy
This is a follow up to
d1262a6e9, more explicit to cope with GCC smartness.
Differential Revision: https://reviews.llvm.org/D74666
Kazushi (Jam) Marukawa [Tue, 18 Feb 2020 15:09:02 +0000 (16:09 +0100)]
[VE] TLS codegen
Summary:
Codegen and tests for thread-local storage.
This implements only the general dynamic model due to limitations in nld 2.26.
Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D74718
Alex Zinenko [Tue, 18 Feb 2020 14:49:13 +0000 (15:49 +0100)]
[mlir] NFC: Rename LLVMOpLowering::lowering to LLVMOpLowering::typeConverter
The existing name is an artifact dating back to the times when we did not have
a dedicated TypeConverter infrastructure. It is also confusing with with the
name of classes using it.
Differential revision: https://reviews.llvm.org/D74707
Luke Geeson [Tue, 11 Feb 2020 16:57:25 +0000 (16:57 +0000)]
[AArch64] Add Cortex-A34 Support for clang and llvm
This patch upstreams support for the AArch64 Armv8-A cpu Cortex-A34.
In detail adding support for:
- mcpu option in clang
- AArch64 Target Features in clang
- llvm AArch64 TargetParser definitions
details of the cpu can be found here:
https://developer.arm.com/ip-products/processors/cortex-a/cortex-a34
Reviewers: SjoerdMeijer
Reviewed By: SjoerdMeijer
Subscribers: SjoerdMeijer, kristof.beyls, hiraditya, cfe-commits,
llvm-commits
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D74483
Change-Id: Ida101fc544ca183a0a0e61a1277c8957855fde0b
Melanie Blower [Tue, 18 Feb 2020 11:55:31 +0000 (03:55 -0800)]
Reland D74436 "Change clang option -ffp-model=precise to select ffp-contract=on""
Change clang option -ffp-model=precise, the default, to select ffp-contract=on
The patch caused some problems for PowerPC but ibm has made
adjustments so I am resubmitting this patch. Additionally, Andy looked
at the performance regressions on LNT and it looks like a loop
unrolling decision that could be adjusted.
Reviewers: rjmccall, Andy Kaylor
Differential Revision: https://reviews.llvm.org/D74436
evgeny [Tue, 18 Feb 2020 14:49:54 +0000 (17:49 +0300)]
[Assembler] Emit summary index flags
Differential revision: https://reviews.llvm.org/D74420
Matt Arsenault [Sat, 15 Feb 2020 02:47:37 +0000 (21:47 -0500)]
AMDGPU/GlobalISel: Adjust branch target when lowering loop intrinsic
This needs to steal the branch target like the other control flow
intrinsics.
Pavel Labath [Tue, 18 Feb 2020 14:19:08 +0000 (15:19 +0100)]
[lldb] Merge RangeArray and RangeVector
The two classes are equivalent, except:
- the former uses a llvm::SmallVector (with a configurable size), while
the latter uses std::vector.
- the former has a typo in one of the functions name
This patch just leaves one class, using llvm::SmallVector, and defaults
the small size to zero. This is the same thing we did with the
RangeDataVector class in D56170.
Yitzhak Mandelbaum [Tue, 18 Feb 2020 14:04:44 +0000 (09:04 -0500)]
[libTooling] Add option for `buildAST` to report diagnostics.
Summary:
Currently, `buildAST[WithArgs]` either succeeds or fails. This patch adds
support for the caller to pass a `DiagnosticConsumer` to receive all relevant
diagnostics.
Reviewers: gribozavr
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D74763
Louis Dionne [Tue, 18 Feb 2020 14:05:36 +0000 (09:05 -0500)]
[libc++] Remove XFAILs for macOS 10.15, which were fixed in later dot releases
Djordje Todorovic [Tue, 18 Feb 2020 12:27:25 +0000 (13:27 +0100)]
Reland "[DebugInfo] Enable the debug entry values feature by default"
This patch enables the debug entry values feature.
- Remove the (CC1) experimental -femit-debug-entry-values option
- Enable it for x86, arm and aarch64 targets
- Resolve the test failures
- Leave the llc experimental option for targets that do not
support the CallSiteInfo yet
Differential Revision: https://reviews.llvm.org/D73534
Benjamin Kramer [Tue, 18 Feb 2020 13:36:56 +0000 (14:36 +0100)]
Move DFA tables into the read-only data segmant.
Miloš Stojanović [Mon, 10 Feb 2020 15:30:32 +0000 (16:30 +0100)]
[llvm-exegesis] Improve error reporting in Assembler.cpp
Followup to D74085.
Replace the use of `report_fatal_error()` with returning the error to
`llvm-exegesis.cpp` and handling it there.
Differential Revision: https://reviews.llvm.org/D74325
Brian Gesiak [Tue, 18 Feb 2020 04:10:30 +0000 (23:10 -0500)]
[IR] Set name when inserting 'llvm::Value*'
Summary:
I noticed a small regression in a toy project of mine after applying
D73835, in which instruction names weren't being set properly. In the
example test case included with this patch,
`llvm::IRBuilderBase::CreateAdd` returns an `llvm::Value *` that is then
passed as an argument to `llvm::IRBuilderBase::Insert`. The overloaded
function that is selected for that call then ignores the `Name`
parameter that is given. This patch addresses that issue.
Reviewers: nikic, Meinersbur, nhaehnle, fhahn, thakis, teemperor
Reviewed By: nikic, fhahn
Subscribers: llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D74754
James Clarke [Tue, 18 Feb 2020 13:21:23 +0000 (13:21 +0000)]
Use SETNE directly rather than SUB/SETNE 0 for stack guard check
Summary:
Backends should fold the subtraction into the comparison, but not all
seem to. Moreover, on targets where pointers are not integers, such as
CHERI, an integer subtraction is not appropriate. Instead we should just
compare the two pointers directly, as this should work everywhere and
potentially generate more efficient code.
Reviewers: bogner, lebedev.ri, efriedma, t.p.northover, uweigand, sunfish
Reviewed By: lebedev.ri
Subscribers: dschuff, sbc100, arichardson, jgravelle-google, hiraditya, aheejin, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D74454
Cristian Adam [Tue, 18 Feb 2020 12:42:19 +0000 (14:42 +0200)]
llvm: Use quotes around MSVC_DIA_SDK_DIR CMake variable
MSVC_DIA_SDK_DIR variable will point to a path which contains spaces,
and without quotes it will fail to configure the project.
Raphael Isemann [Tue, 18 Feb 2020 12:25:08 +0000 (13:25 +0100)]
[lldb] Fix another instance where we pass a nullptr as TypeSourceInfo to NonTypeTemplateParmDecl::Create
Summary:
Follow up to an issue pointed out in the review of D73808. We shouldn't just pass in a nullptr TypeSourceInfo
in case Clang decided to access it.
Reviewers: shafik, vsk
Reviewed By: shafik, vsk
Subscribers: kristof.beyls, JDevlieghere, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D73946
Tatyana Krasnukha [Tue, 18 Feb 2020 12:02:58 +0000 (15:02 +0300)]
[lldb][test] Remove expected failure decorator from test_copy_from_dummy_target (TestScriptedResolver)
This test case doesn't check that breakpoint's locations are resolved, and it passes on Windows too.
Florian Hahn [Mon, 17 Feb 2020 15:35:57 +0000 (16:35 +0100)]
[CGP] Add uaddo test with math used, SPARC/AArch64 variants.
Georgii Rymar [Wed, 12 Feb 2020 13:12:09 +0000 (16:12 +0300)]
[llvm-readobj] - Report a warning when an unexpected DT_SYMENT tag value is met.
There was a short discussion about this:
https://reviews.llvm.org/D73484#inline-676942
To summarize:
It is a bit unclear to me why the `DT_SYMENT` tag exist.
LLD has the code that does:
"addInt(DT_SYMENT, sizeof(Elf_Sym));" and I guess other linkers has the same logic.
It is unclear why it can be possible to have other values rather than values of
a size of platform symbol. Seems it is not possible, and atm for me it looks that
this tag should not be used. This patch starts reporting the warning when the
value it contains differs from a symbol size for a 32/64 bit platform for safety.
It keeps the rest of the logic we have unchanged. Before this patch we did not handle
the tag at all.
Differential review: https://reviews.llvm.org/D74479
serge-sans-paille [Tue, 18 Feb 2020 11:31:11 +0000 (12:31 +0100)]
Fix riscv/lld test interaction
Fix for
dd230142d8a00f5f30c3930a2407000e845dcfbf, in case ld.lld is not
available.