Aden Grue [Wed, 14 Oct 2020 08:06:20 +0000 (08:06 +0000)]
Fix typos in the documentation of dynamic values in subview ops
Reviewed By: nicolasvasilache
Differential Revision: https://reviews.llvm.org/D89338
Raphael Isemann [Wed, 14 Oct 2020 07:50:59 +0000 (09:50 +0200)]
[lldb] Reject redefinitions of persistent variables
Currently one can redefine a persistent variable and LLDB will just silently
ignore the second definition:
```
(lldb) expr int $i = 1
(lldb) expr int $i = 2
(lldb) expr $i
(int) $i = 1
```
This patch makes this an error and rejects the expression with the second
definition.
A nice follow up would be to refactor LLDB's persistent variables to not just be
a pair of type and name, but also contain some way to obtain the original
declaration and source code that declared the variable. That way we could
actually make a full diagnostic as we would get from redefining a variable twice
in the same expression.
Reviewed By: labath, shafik, JDevlieghere
Differential Revision: https://reviews.llvm.org/D89310
sstefan1 [Tue, 13 Oct 2020 21:01:20 +0000 (23:01 +0200)]
[Attributor][NFC] Make `createShallowWrapper()` available outside of Attributor
D85703 will need to create shallow wrappers in order to track the spmd icv. We need to make it available.
Differential Revision: https://reviews.llvm.org/D89342
Haojian Wu [Wed, 14 Oct 2020 07:57:55 +0000 (09:57 +0200)]
[clang-rename] Simplify the code of handling class paritial specializations, NFC.
Instead of collecting all specializations and doing a post-filterin, we
can just get all targeted specializations from getPartialSpecializationsizations.
Differential Revision: https://reviews.llvm.org/D89220
Luqman Aden [Wed, 14 Oct 2020 07:29:06 +0000 (00:29 -0700)]
[test][lld] Mark TLS tests as REQUIRES: x86.
Fixes http://lab.llvm.org:8011/#/builders/119/builds/92
Dominik Montada [Mon, 24 Aug 2020 09:01:05 +0000 (11:01 +0200)]
[libcxxabi,libunwind] support running tests in standalone mode
Remove check for standalone and shared library mode in libcxxabi to
allow including tests in said mode. This check prevented running the
tests in standalone mode with static libraries, which is the case for
baremetal targets.
Fix check-unwind target trying to use a non-existent llvm-lit executable
in standalone mode. Copy the HandleOutOfTreeLLVM logic from libcxxabi to
libunwind in order to make the tests work in standalone mode.
Reviewed By: ldionne, #libc_abi, #libc
Differential Revision: https://reviews.llvm.org/D86540
Evgeny Leviant [Wed, 14 Oct 2020 06:58:45 +0000 (09:58 +0300)]
[ARM.td] Make instruction definitions visible to sched models
Differential revision: https://reviews.llvm.org/D89308
Jonas Devlieghere [Wed, 14 Oct 2020 04:45:56 +0000 (21:45 -0700)]
[lldb] Remove lexical block and fix formatting LoadScriptingModule (NFC)
Jonas Devlieghere [Wed, 14 Oct 2020 04:08:37 +0000 (21:08 -0700)]
[lldb] Unconditionally strip the `.py(c)` extension when loading a module
Currently we only strip the Python extension when the file exists on
disk because we assumed that if it didn't exist it was a module.
However, with the change from D89334 this is no longer the case as we
want to be able to import a relative path to a .py as a module. Since we
always import a scripting module as a "python module" we should always
strip the extension if present.
Differential revision: https://reviews.llvm.org/D89352
Jonas Paulsson [Wed, 14 Oct 2020 06:35:38 +0000 (08:35 +0200)]
Revert "[clang] Improve handling of physical registers in inline assembly operands."
This reverts commit
c78da037783bda0f27f4d82060149166e6f0c796.
Temporarily reverted due to https://bugs.llvm.org/show_bug.cgi?id=47837.
Tony [Tue, 13 Oct 2020 02:06:33 +0000 (02:06 +0000)]
[AMDGPU] Cleanup memory legalizer interfaces
- Rename interfaces to be in terms of acquire and release.
- Improve comments.
Differential Revision: https://reviews.llvm.org/D89355
Arthur Eubanks [Wed, 7 Oct 2020 21:41:27 +0000 (14:41 -0700)]
[test][NewPM] Pin -mergereturn tests to legacy PM
Looks like this pass isn't really used and hasn't been worked on in a
loooong time.
Reviewed By: asbirlea
Differential Revision: https://reviews.llvm.org/D89010
Arthur Eubanks [Wed, 7 Oct 2020 21:40:35 +0000 (14:40 -0700)]
[LoopExtract][NewPM] Port -loop-extract to NPM
-loop-extract-single is just -loop-extract on one loop.
-loop-extract depended on -break-crit-edges and -loop-simplify in the
legacy PM, but the NPM doesn't allow specifying pass dependencies like
that, so manually add those passes to the RUN lines where necessary.
Reviewed By: asbirlea
Differential Revision: https://reviews.llvm.org/D89016
David Blaikie [Wed, 14 Oct 2020 05:00:34 +0000 (22:00 -0700)]
libDebugInfoDWARF: Don't try to parse loclist[.dwo] headers when parsing debug_info[.dwo]
There's no way to know whether there's a loclist contribution to parse
if there's no loclistx encoding - and if there is one, there's no need
to walk back from the loclist_base (or, uin the case of
info.dwo/loclist.dwo - starting at 0 in the contribution) to parse the
header, instead rely on the DWARF32/64 and address size in the CU
that's already available.
This would come up in split DWARF (non-split wouldn't try to read a
loclist header in the absence of a loclist_base) when one unit had
location lists and another does not (because the loclists.dwo section
would be non-empty in that case - in the case where it's empty the
parsing would silently skip).
Simplify the testing a bit, rather than needing a whole dwp, etc - by
creating a malformed loclists.dwo section (and use single file Split
DWARF) that would trip up any attempt to parse it - but no attempt
should be made.
Liu, Chen3 [Wed, 14 Oct 2020 02:12:59 +0000 (10:12 +0800)]
[X86][NFC] Fix RUN line bug in the testcase
Testcase added in D78699 doesn't work because the wrong RUN line in the
testcase.
Differential Revision: https://reviews.llvm.org/D89361
Dave Lee [Wed, 14 Oct 2020 00:50:02 +0000 (17:50 -0700)]
[cmake] Limit missing external lit warning to be shown once
When using a custom `LLVM_EXTERNAL_LIT`, it's possible the file may not exist at the CMake is generating the build. One example is LLDB standalone builds. When the external lit doesn't exist, a warning message is emitted, but the warning is printed once for every single lit target. This produces many redundant warnings.
This changes the warning to only be emitted once, controlled by a CACHE variable.
Other options are:
1. remove the warning
2. have callers pass an option to silence the warning if desired
See https://reviews.llvm.org/D76945 for some context.
Differential Revision: https://reviews.llvm.org/D89356
Luqman Aden [Wed, 7 Oct 2020 02:16:34 +0000 (19:16 -0700)]
[LLD] Add baseline test for TLS alignment. NFC.
Reviewed By: rnk
Differential Revision: https://reviews.llvm.org/D88646
Stella Laurenzo [Tue, 13 Oct 2020 16:54:22 +0000 (09:54 -0700)]
[mlir] Remove obsolete "Quantization" section from the rationale.
* It reads as more of a TODO for the future and has been long obsoleted by later work.
* One of the authors of the referenced paper called this out as "weird stuff from two years ago" when reviewing the more recent TOSA RFC.
Differential Revision: https://reviews.llvm.org/D89329
Vitaly Buka [Wed, 14 Oct 2020 03:38:56 +0000 (20:38 -0700)]
[sanitizer][NFC] Fix few cpplint warnings
David Tenty [Thu, 8 Oct 2020 18:43:19 +0000 (14:43 -0400)]
[NFC][compiler-rt] Add ppc32 to the list of arch
This should have been done when it was added to the symmetrical list in
the builtins config-ix in D87383, but it was overlooked.
Petr Hosek [Tue, 13 Oct 2020 03:40:33 +0000 (20:40 -0700)]
[CMake][Fuchsia] Start building arm64 Darwin runtimes
This enables arm64 Darwin support in Fuchsia toolchain.
Richard Smith [Wed, 14 Oct 2020 02:31:41 +0000 (19:31 -0700)]
Revert "PR47805: Use a single object for a function parameter in the caller and"
Breaks a clangd unit test.
This reverts commit
8f8b9f2cca0b73314342c721186ae9c860ca273c.
Kamil Rytarowski [Wed, 14 Oct 2020 00:13:29 +0000 (02:13 +0200)]
[compiler-rt] [lldb] Mark syscall_acquire and syscall_release as USED
Fixes build warnings on NetBSD.
Alexandre Ganea [Wed, 14 Oct 2020 01:54:00 +0000 (21:54 -0400)]
Re-land [ThinLTO] Re-order modules for optimal multi-threaded processing
This reverts
9b5b3050237db3642ed7ab1bdb3ffa2202511b99 and fixes the unwanted re-ordering when generating ThinLTO indexes.
The goal of this patch is to better balance thread utilization during ThinLTO in-process linking (in llvm-lto2 or in LLD). Before this patch, large modules would often be scheduled late during execution, taking a long time to complete, thus starving the thread pool.
We now sort modules in descending order, based on each module's bitcode size, so that larger modules are processed first. By doing so, smaller modules have a better chance to keep the thread pool active, and thus avoid starvation when the bitcode compilation is almost complete.
In our case (on dual Intel Xeon Gold 6140, Windows 10 version 2004, two-stage build), this saves 15 sec when linking `clang.exe` with LLD & -flto=thin, /opt:lldltojobs=all, no ThinLTO cache, -DLLVM_INTEGRATED_CRT_ALLOC=d:\git\rpmalloc.
Before patch: 100 sec
After patch: 85 sec
Inspired by the work done by David Callahan in D60495.
Differential Revision: https://reviews.llvm.org/D87966
Richard Smith [Tue, 13 Oct 2020 17:03:02 +0000 (10:03 -0700)]
PR47805: Use a single object for a function parameter in the caller and
callee in constant evaluation.
We previously made a deep copy of function parameters of class type when
passing them, resulting in the destructor for the parameter applying to
the original argument value, ignoring any modifications made in the
function body. This also meant that the 'this' pointer of the function
parameter could be observed changing between the caller and the callee.
This change completely reimplements how we model function parameters
during constant evaluation. We now model them roughly as if they were
variables living in the caller, albeit with an artificially reduced
scope that covers only the duration of the function call, instead of
modeling them as temporaries in the caller that we partially "reparent"
into the callee at the point of the call. This brings some minor
diagnostic improvements, as well as significantly reduced stack usage
during constant evaluation.
Erik Pilkington [Tue, 13 Oct 2020 16:40:55 +0000 (12:40 -0400)]
[SemaObjC] Fix a crash on an invalid ternary with ARC pointers
FindCompositeObjCPointerType nulls out the subexpressions on error, so bail out
instead of trying to deref them.
Vitaly Buka [Wed, 14 Oct 2020 01:08:19 +0000 (18:08 -0700)]
[sanitizer] Escape quotes in tests to fix android bot after D88361
Adrian Prantl [Wed, 14 Oct 2020 00:31:33 +0000 (17:31 -0700)]
Replace bool constants with named constants for improved readibility (NFC)
Mehdi Amini [Wed, 14 Oct 2020 00:37:10 +0000 (00:37 +0000)]
Revert "[DDR] Introduce implicit equality check for the source pattern operands with the same name."
This reverts commit
7271c1bcb96051bcd227d3fa6071a620fe238850.
This broke the gcc-5 build:
/usr/include/c++/5/ext/new_allocator.h:120:4: error: no matching function for call to 'std::pair<const std::__cxx11::basic_string<char>, mlir::tblgen::SymbolInfoMap::SymbolInfo>::pair(llvm::StringRef&, mlir::tblgen::SymbolInfoMap::SymbolInfo)'
{ ::new((void *)__p) _Up(std::forward<_Args>(__args)...); }
^
In file included from /usr/include/c++/5/utility:70:0,
from llvm/include/llvm/Support/type_traits.h:18,
from llvm/include/llvm/Support/Casting.h:18,
from mlir/include/mlir/Support/LLVM.h:24,
from mlir/include/mlir/TableGen/Pattern.h:17,
from mlir/lib/TableGen/Pattern.cpp:14:
/usr/include/c++/5/bits/stl_pair.h:206:9: note: candidate: template<class ... _Args1, long unsigned int ..._Indexes1, class ... _Args2, long unsigned int ..._Indexes2> std::pair<_T1, _T2>::pair(std::tuple<_Args1 ...>&, std::tuple<_Args2 ...>&, std::_Index_tuple<_Indexes1 ...>, std::_Index_tuple<_Indexes2 ...>)
pair(tuple<_Args1...>&, tuple<_Args2...>&,
^
John Demme [Tue, 13 Oct 2020 22:07:27 +0000 (22:07 +0000)]
[MLIR] Add support for defining Types in tblgen
Adds a TypeDef class to OpBase and backing generation code. Allows one
to define the Type, its parameters, and printer/parser methods in ODS.
Can generate the Type C++ class, accessors, storage class, per-parameter
custom allocators (for the storage constructor), and documentation.
Reviewed By: rriddle
Differential Revision: https://reviews.llvm.org/D86904
Aditya Nandakumar [Wed, 14 Oct 2020 00:19:28 +0000 (17:19 -0700)]
[GISel] Add combine for constant G_PTR_ADD offsets.
https://reviews.llvm.org/D88865
This adds a single combine for GlobalISel to fold:
ptradd (inttoptr C1) C2
Into:
C1 + C2
Additionally, a small test for AArch64 is added.
Patch by pnappa.
Louis Dionne [Tue, 13 Oct 2020 19:47:31 +0000 (15:47 -0400)]
[libc++/abi] Clean up uses of <iostream> in the test suite
We used <iostream> in several places where we don't actually need the
full power of <iostream>, and where using basic `std::printf` is enough.
This is better, since `std::printf` can be supported on systems that don't
have a notion of locales, while <iostream> can't.
Adrian Prantl [Wed, 14 Oct 2020 00:00:32 +0000 (17:00 -0700)]
Move initialization of Variable::m_loc_is_const_data into constructor (NFC)
This makes it symmetric with all other flags and makes it easier to
not forget to initialize it.
https://reviews.llvm.org/D89351
Vedant Kumar [Tue, 13 Oct 2020 21:22:12 +0000 (14:22 -0700)]
[cmake] Unconditionally set the force flag when codesigning
The Darwin linker now defaults to ad hoc signing binaries when targeting
Apple Silicon. This creates a problem when configuring targets that must
be built with entitlements: we either need to add -Wl,-no_adhoc_codesign
when building the target, or sign with the force flag set to allow
replacing a pre-existing signature.
Unconditionally force-signing is the more convenient solution. This
doesn't require a ld64 version check, and it's a much less invasive
cmake change.
Patch by Fred Riss!
rdar://
70237254
Differential Revision: https://reviews.llvm.org/D89343
Vedant Kumar [Tue, 13 Oct 2020 23:20:40 +0000 (16:20 -0700)]
[llvm-cov] Warn when -arch spec is missing/invalid for universal binary (reland)
llvm-cov reports a poor error message when the -arch specifier is
missing or invalid, and a binary has multiple slices. Make the error
message more specific.
(This version of the patch avoids using llvm::none_of -- the way I used
the utility caused compile errors on many bots, possibly because the
wrong overload of `none_of` was selected.)
rdar://
40312677
Jason Molenda [Tue, 13 Oct 2020 23:39:30 +0000 (16:39 -0700)]
Remove unused build configurations from debugserver xcode project
the xcode project file for debugserver exists only to make my
life easier when I'm working only on debugserver and don't need
to build the rest of llvm/lldb. It had many build configurations
to reflect our old lldb xcode project file, which is long gone.
Removing them to simplify the configurations.
Specifically dropping CustomSwift-Debug, DebugClang, DebugPresubmission,
CustomSwift-Release, BuildAndIntegration. Keeping Debug & Release.
Vedant Kumar [Tue, 13 Oct 2020 23:32:31 +0000 (16:32 -0700)]
Revert "[llvm-cov] Warn when -arch spec is missing/invalid for universal binary"
This reverts commit
b81d4bfb44c14575130bb06c047728b69c3213aa.
It's causing some bots to fail to build due to: "error: no matching
function for call to ‘__iterator_category".
Vedant Kumar [Tue, 13 Oct 2020 23:20:40 +0000 (16:20 -0700)]
[llvm-cov] Warn when -arch spec is missing/invalid for universal binary
llvm-cov reports a poor error message when the -arch specifier is
missing or invalid, and a binary has multiple slices. Make the error
message more specific.
rdar://
40312677
Jason Molenda [Tue, 13 Oct 2020 23:27:05 +0000 (16:27 -0700)]
Add a new launch flag option for watchos, WatchComplicationLaunch.
Link against CarouselServices on watchos, recognize the
WatchComplicationLaunch launch flag option when that framework
is available.
<rdar://problem/
62473967>, <rdar://problem/
61230088>
rdzhabarov [Tue, 13 Oct 2020 23:02:49 +0000 (16:02 -0700)]
[DDR] Introduce implicit equality check for the source pattern operands with the same name.
This CL allows user to specify the same name for the operands in the source pattern which implicitly enforces equality on operands with the same name.
E.g., Pat<(OpA $a, $b, $a) ... > would create a matching rule for checking equality for the first and the last operands. Equality of the operands is enforced at any depth, e.g., OpA ($a, $b, OpB($a, $c, OpC ($a))).
Example usage: Pat<(Reshape $arg0, (Shape $arg0)), (replaceWithValue $arg0)>
Note, this feature only covers operands but not attributes.
Current use cases are based on the operand equality and explicitly add the constraint into the pattern. Attribute equality will be worked out on the different CL.
Differential Revision: https://reviews.llvm.org/D89254
Richard Smith [Tue, 13 Oct 2020 22:59:00 +0000 (15:59 -0700)]
Revert "PR47805: Use a single object for a function parameter in the caller and"
The buildbots are displeased.
This reverts commit
8d03a972ce8e92815ffe3d5d86aa027605ed92e2.
Richard Smith [Tue, 13 Oct 2020 17:03:02 +0000 (10:03 -0700)]
PR47805: Use a single object for a function parameter in the caller and
callee in constant evaluation.
We previously made a deep copy of function parameters of class type when
passing them, resulting in the destructor for the parameter applying to
the original argument value, ignoring any modifications made in the
function body. This also meant that the 'this' pointer of the function
parameter could be observed changing between the caller and the callee.
This change completely reimplements how we model function parameters
during constant evaluation. We now model them roughly as if they were
variables living in the caller, albeit with an artificially reduced
scope that covers only the duration of the function call, instead of
modeling them as temporaries in the caller that we partially "reparent"
into the callee at the point of the call. This brings some minor
diagnostic improvements, as well as significantly reduced stack usage
during constant evaluation.
Geoffrey Martin-Noble [Tue, 13 Oct 2020 22:01:56 +0000 (15:01 -0700)]
Remove unused SideEffectInterfaces header
This change removes an unnecessary header introduced in
https://github.com/llvm/llvm-project/commit/
c0b3abd19a3e.
Differential Revision: https://reviews.llvm.org/D89347
Duncan P. N. Exon Smith [Tue, 13 Oct 2020 21:51:38 +0000 (17:51 -0400)]
Basic: Simplify SourceManager::getBuffer overload, NFC
Avoid duplicating code unnecessarily. No functionality change.
ahmedsabie [Tue, 13 Oct 2020 20:58:19 +0000 (20:58 +0000)]
[MLIR] Add a foldTrait() mechanism to allow traits to define folding and test it with an Involution trait
This is the same diff as https://reviews.llvm.org/D88809/ except side effect
free check is removed for involution and a FIXME is added until the dependency
is resolved for shared builds. The old diff has more details on possible fixes.
Reviewed By: rriddle, andyly
Differential Revision: https://reviews.llvm.org/D89333
Alberto Magni [Mon, 12 Oct 2020 23:18:44 +0000 (16:18 -0700)]
[mlir][Linalg] Lower padding attribute for pooling ops
Update linalg-to-loops lowering for pooling operations to perform
padding of the input when specified by the corresponding attribute.
Reviewed By: hanchung
Differential Revision: https://reviews.llvm.org/D88911
Jay Foad [Fri, 9 Oct 2020 15:37:01 +0000 (16:37 +0100)]
[AMDGPU] Add MC layer support for v_fmac_legacy_f32
This instruction was introduced in GFX10.3, reusing the opcode of
v_mac_legacy_f32 from GFX10.1.
Differential Revision: https://reviews.llvm.org/D89247
LLVM GN Syncbot [Tue, 13 Oct 2020 20:50:32 +0000 (20:50 +0000)]
[gn build] Port
f0875971249
Xiangling Liao [Thu, 8 Oct 2020 19:21:02 +0000 (15:21 -0400)]
[AIX] Support two itanium alignment LIT testcases for AIX using regex
AIX has different layout dumping format from other itanium ABIs.
And for these two cases, use regex to match AIX format.
Differential Revision: https://reviews.llvm.org/D89064
Duncan P. N. Exon Smith [Mon, 12 Oct 2020 22:00:55 +0000 (18:00 -0400)]
Support: Allow use of MemoryBufferRef with line_iterator
Split out from https://reviews.llvm.org/D66782, use `Optional<MemoryBufferRef>`
in `line_iterator` so you don't need access to a `MemoryBuffer*`. Follow up
patches in `clang/` will leverage this.
Differential Revision: https://reviews.llvm.org/D89280
Duncan P. N. Exon Smith [Mon, 12 Oct 2020 22:41:15 +0000 (18:41 -0400)]
Support: Add operator== for MemoryBufferRef and split out MemoryBufferRef.h
As preparation for changing `LineIterator` to work with `MemoryBufferRef`:
- Add an `operator==` that uses buffer pointer identity to ensure two buffers
are equivalent.
- Split out `MemoryBufferRef.h`, to avoid polluting `LineIterator.h` includers
with everything from `MemoryBuffer.h`. This also means moving the
`MemoryBuffer` constructor to a source file.
Differential Revision: https://reviews.llvm.org/D89279
Benjamin Kramer [Tue, 13 Oct 2020 20:36:08 +0000 (22:36 +0200)]
[mlir-cuda-runner] Unbreak the build
CMake Error at llvm/cmake/modules/AddLLVM.cmake:870 (add_dependencies):
The dependency target "Core" of target "mlir-cuda-runner" does not exist.
Call Stack (most recent call first):
llvm/cmake/modules/AddLLVM.cmake:1169 (add_llvm_executable)
mlir/tools/mlir-cuda-runner/CMakeLists.txt:69 (add_llvm_tool)
CMake Error at llvm/cmake/modules/AddLLVM.cmake:870 (add_dependencies):
The dependency target "LINK_COMPONENTS" of target "mlir-cuda-runner" does
not exist.
Call Stack (most recent call first):
llvm/cmake/modules/AddLLVM.cmake:1169 (add_llvm_executable)
mlir/tools/mlir-cuda-runner/CMakeLists.txt:69 (add_llvm_tool)
CMake Error at llvm/cmake/modules/AddLLVM.cmake:870 (add_dependencies):
The dependency target "Support" of target "mlir-cuda-runner" does not
exist.
Call Stack (most recent call first):
llvm/cmake/modules/AddLLVM.cmake:1169 (add_llvm_executable)
mlir/tools/mlir-cuda-runner/CMakeLists.txt:69 (add_llvm_tool)
Andrew Paverd [Thu, 1 Oct 2020 09:07:40 +0000 (10:07 +0100)]
Reland [CFGuard] Add address-taken IAT tables and delay-load support
This patch adds support for creating Guard Address-Taken IAT Entry Tables (.giats$y sections) in object files, matching the behavior of MSVC. These contain lists of address-taken imported functions, which are used by the linker to create the final GIATS table.
Additionally, if any DLLs are delay-loaded, the linker must look through the .giats tables and add the respective load thunks of address-taken imports to the GFIDS table, as these are also valid call targets.
Reviewed By: rnk
Differential Revision: https://reviews.llvm.org/D87544
Stella Laurenzo [Tue, 13 Oct 2020 04:19:13 +0000 (21:19 -0700)]
[mlir][Python] Add missing capsule->module and Context.create_module.
* Extends Context/Operation interning to cover Module as well.
* Implements Module.context, Attribute.context, Type.context, and Location.context back-references (facilitated testing and also on the TODO list).
* Adds method to create an empty Module.
* Discovered missing in npcomp.
Differential Revision: https://reviews.llvm.org/D89294
Nikita Popov [Tue, 13 Oct 2020 19:56:59 +0000 (21:56 +0200)]
[LICM] Don't require AST in LoopPromoter (NFC)
While promotion currently always has an AST available, it is only
relevant for invalidation purposes in LoopPromoter, so we do not
need to have it as a hard dependency.
Craig Topper [Tue, 13 Oct 2020 17:21:30 +0000 (10:21 -0700)]
[X86] Add test cases for PR47825. NFC
Nikita Popov [Fri, 2 Oct 2020 18:48:39 +0000 (20:48 +0200)]
[MemCpyOpt] Add test scaffolding for MSSA based MemCpyOpt
This adds an -enable-memcpyopt-memoryssa option that currently does
nothing apart from requiring MSSA as a dependency. The tests are
split to run both with the option disabled and enabled. I went with
this rather than the separate directory DSE uses, as I found it
convenient to have a direct side-by-side comparison of differences.
Differential Revision: https://reviews.llvm.org/D89206
Alexander Belyaev [Tue, 13 Oct 2020 19:31:40 +0000 (21:31 +0200)]
[mlir][nfc] Add a func to compute numElements of a shape in Std -> LLVM.
For some reason the variable `cumulativeSizeInBytes` in
`getCumulativeSizeInBytes` was actually storing number of elements. I decided
to fix it and refactor the function a bit.
Differential Revision: https://reviews.llvm.org/D89336
Nikita Popov [Sat, 3 Oct 2020 09:26:13 +0000 (11:26 +0200)]
[MemCpyOpt] Fix MemorySSA preservation
moveUp() moves instructions, so we should move the corresponding
memory accesses as well. We should also move the store instruction
itself: Even though we'll end up removing it later, this gives us
a correct MemoryDef to replace.
The implementation is somewhat more complicated than it should be,
because we also handle the case where P does not have a memory
access due to a degnerate AA pipeline. Hopefully, the need for this
will go away in the future, when the rest of the pass is based on
MSSA.
Differential Revision: https://reviews.llvm.org/D88778
Reid Kleckner [Tue, 13 Oct 2020 19:35:22 +0000 (12:35 -0700)]
Revert "DirectoryWatcher: add an implementation for Windows"
This reverts commit
5d74c435117526616d2c2665f030263b8f60da1b.
The gtest tests appear to be flaky, and are failing in various places.
Denis Antrushin [Tue, 13 Oct 2020 18:40:53 +0000 (01:40 +0700)]
[Statepoints] Update statepoint mir tests.
Update few tests after statepoint format change (D87154).
These tests exercise functionality not affected by the format change,
so they left unchanged.
Roman Lebedev [Tue, 13 Oct 2020 19:05:07 +0000 (22:05 +0300)]
[SCEV] BuildConstantFromSCEV(): actually properly handle SExt-of-pointer case
As being pointed out by @efriedma in
https://reviews.llvm.org/rGaaafe350bb65#inline-4883
of course we can't just call ptrtoint in sign-extending case
and be done with it, because it will zero-extend.
I'm not sure what i was thinking there.
This is very much not an NFC, however looking at the user of
BuildConstantFromSCEV() i'm not sure how to actually show that
it results in a different constant expression.
Nikita Popov [Sat, 10 Oct 2020 16:57:23 +0000 (18:57 +0200)]
[MemCpyOpt] Don't shorten memset if memcpy operands may be the same
If the memcpy operands are the same (which is allowed since D86815)
then the memcpy is effectively a no-op and the partially overlapping
memset is not dead.
Differential Revision: https://reviews.llvm.org/D89192
LLVM GN Syncbot [Tue, 13 Oct 2020 19:14:10 +0000 (19:14 +0000)]
[gn build] Port
77bb3ebebbc
LLVM GN Syncbot [Tue, 13 Oct 2020 19:14:09 +0000 (19:14 +0000)]
[gn build] Port
662ed9e67ad
Nikita Popov [Sat, 10 Oct 2020 15:47:20 +0000 (17:47 +0200)]
[MemCpyOpt] Don't shorten memset if destination observable through unwinding
MemCpyOpt can shorten a memset if it is later partially overwritten
by a memcpy. It checks that the destination is not read in between,
but we also need to make sure that the destination cannot be observed
via unwinding.
Differential Revision: https://reviews.llvm.org/D89190
Artem Dergachev [Tue, 13 Oct 2020 19:07:36 +0000 (12:07 -0700)]
Revert "[analyzer] NFC: Separate PathDiagnosticConsumer options from AnalyzerOptions."
This reverts commit
fd4b3f123d6e64769881e4c6351d5bbbdac30ce3.
Artem Dergachev [Tue, 13 Oct 2020 19:07:28 +0000 (12:07 -0700)]
Revert "[analyzer] NFC: Move IssueHash to libAnalysis."
This reverts commit
b76dc111dd02672488df794570d82e3edbbfa5d8.
Artem Dergachev [Tue, 13 Oct 2020 19:03:04 +0000 (12:03 -0700)]
Revert "[analyzer] NFC: Move path diagnostic consumer implementations to libAnalysis."
This reverts commit
44b7cf2983b6a8373c99a9b254f8c3f944e03f35.
Scott Linder [Tue, 13 Oct 2020 18:26:39 +0000 (18:26 +0000)]
[DebugInfo][docs] Document DILabel in LangRef
Add some minimal documentation for DILabel, originally introduced in
D45024. Update the name and semantics of the `variables:` field in the
documentation for `DISubprogram`; the field is now called
`retainedNodes:` and is a heterogeneous list of `DILocalVariable` and
`DILabel`.
Reviewed By: aprantl
Differential Revision: https://reviews.llvm.org/D89082
Ahsan Saghir [Fri, 2 Oct 2020 14:47:43 +0000 (09:47 -0500)]
[PowerPC] Add assemble disassemble intrinsics for MMA
This patch adds support for assemble disassemble intrinsics
for MMA.
Reviewed By: bsaleil, #powerpc
Differential Revision: https://reviews.llvm.org/D88739
LLVM GN Syncbot [Tue, 13 Oct 2020 17:53:40 +0000 (17:53 +0000)]
[gn build] Port
b76dc111dd0
LLVM GN Syncbot [Tue, 13 Oct 2020 17:53:39 +0000 (17:53 +0000)]
[gn build] Port
44b7cf2983b
Artem Dergachev [Thu, 30 Jul 2020 15:52:22 +0000 (08:52 -0700)]
[analyzer] NFC: Move path diagnostic consumer implementations to libAnalysis.
With this change, we're more or less ready to allow users outside
of the Static Analyzer to take advantage of path diagnostic consumers
for emitting their warnings in different formats.
Differential Revision: https://reviews.llvm.org/D67422
Artem Dergachev [Wed, 15 Jul 2020 03:26:38 +0000 (20:26 -0700)]
[analyzer] NFC: Move IssueHash to libAnalysis.
IssueHash is an attempt to introduce stable warning identifiers
that won't change when code around them gets moved around.
Path diagnostic consumers print issue hashes for the emitted diagnostics.
This move will allow us to ultimately move path diagnostic consumers
to libAnalysis.
Differential Revision: https://reviews.llvm.org/D67421
Artem Dergachev [Tue, 14 Jul 2020 04:13:31 +0000 (21:13 -0700)]
[analyzer] NFC: Separate PathDiagnosticConsumer options from AnalyzerOptions.
The AnalyzerOptions object contains too much information that's
entirely specific to the Analyzer. It is also being referenced by
path diagnostic consumers to tweak their behavior. In order for path
diagnostic consumers to function separately from the analyzer,
make a smaller options object that only contains relevant options.
Differential Revision: https://reviews.llvm.org/D67420
Xun Li [Tue, 13 Oct 2020 17:21:45 +0000 (10:21 -0700)]
[ASAN] Make sure we are only processing lifetime markers with offset 0 to alloca
This patch addresses https://bugs.llvm.org/show_bug.cgi?id=47787 (and hence https://bugs.llvm.org/show_bug.cgi?id=47767 as well).
In latter instrumentation code, we always use the beginning of the alloca as the base for instrumentation, ignoring any offset into the alloca.
Because of that, we should only instrument a lifetime marker if it's actually pointing to the beginning of the alloca.
Differential Revision: https://reviews.llvm.org/D89191
Nikita Popov [Tue, 13 Oct 2020 16:38:20 +0000 (18:38 +0200)]
[LoopVersioningLICM] Fix noalias metadata emission
The previous code added the scope on each iteration, so that the
same scope was represented many times in the same !noalias metadata.
That's legal, and semantically equivalent to only storing the scope
once, but it's also wasteful and may pessimize further optimization
if AATags get intersected naively, as done by the AliasSetTracker.
Stella Stamenova [Tue, 13 Oct 2020 16:53:07 +0000 (09:53 -0700)]
[mlir] Fix sporadic build failures due to missing dependency
The build of MLIR occasionally fails (especially on Windows) because there is missing dependency between MLIRLLVMIR and MLIROpenMPOpsIncGen.
1) LLVMDialect.cpp includes LLVMDialect.h
2) LLVMDialect.h includes OpenMPDialect.h
3) OpenMPDialect.h includes OpenMPOpsDialect.h.inc, OpenMPOpsEnums.h.inc and OpenMPOps.h.inc
The OpenMP .inc files are generated by MLIROpenMPOpsIncGen, so MLIRLLVMIR which builds LLVMDialect.cpp should depend on MLIROpenMPOpsIncGen
Reviewed By: mehdi_amini
Differential Revision: https://reviews.llvm.org/D89275
Nicolas Vasilache [Tue, 13 Oct 2020 12:30:08 +0000 (12:30 +0000)]
[mlir][Linalg] Fix TensorConstantOp bufferization in Linalg.
TensorConstantOp bufferization currently uses the vector dialect to store constant data into memory.
Due to natural vector size and alignment properties, this is problematic with n>1-D vectors whose most minor dimension is not naturally aligned.
Instead, this revision linearizes the constant and introduces a linalg.reshape to go back to the desired shape.
Still this is still to be considered a workaround and a better longer term solution will probably involve `llvm.global`.
Differential Revision: https://reviews.llvm.org/D89311
Louis Dionne [Tue, 13 Oct 2020 16:27:22 +0000 (12:27 -0400)]
[libc++] Allow passing relative paths to the Apple install script
Konstantin Zhuravlyov [Tue, 13 Oct 2020 15:54:30 +0000 (11:54 -0400)]
LLD/AMDGPU: Infer os abi based on input llvm bitcode
Differential Revision: https://reviews.llvm.org/D89042
Konstantin Zhuravlyov [Tue, 13 Oct 2020 15:52:57 +0000 (11:52 -0400)]
AMDGPU: Remove -mamdgpu-debugger-abi option
It has been unsupported for few years now.
Differential Revision: https://reviews.llvm.org/D89125
Hafiz Abid Qadeer [Tue, 13 Oct 2020 16:08:19 +0000 (17:08 +0100)]
[compiler-rt] Allow override of 'emulator' value from lit_config.
Currently the 'emulator' value is fixed at build time. This patch allows changing the emulator
at testing time and enables us to run the tests on different board or simulators without needing
to run CMake again to change the value of emulator.
With this patch in place, the value of 'emulator' can be changed at test time from the command
line like this:
$ llvm-lit --param=emulator="..."
Reviewed By: delcypher
Differential Revision: https://reviews.llvm.org/D84708
Mircea Trofin [Mon, 12 Oct 2020 16:36:01 +0000 (09:36 -0700)]
[NFC][Regalloc] Use MCRegister in MachineCopyPropagation
Differential Revision: https://reviews.llvm.org/D89250
Sanjay Patel [Tue, 13 Oct 2020 15:52:00 +0000 (11:52 -0400)]
[CostModel] rearrange basic intrinsic cost implementation
This is bigger/uglier than before, but it should allow fixing
all of the broken paths more easily. Test coverage added with
rGfab028b and other commits.
This is not NFC - the scalable vector test would crash
without this patch.
Sanjay Patel [Tue, 13 Oct 2020 14:55:06 +0000 (10:55 -0400)]
[x86] add cost model test for memcpy; NFC
This is treated as a special-case in the base class
implementation of getIntrinsicInstrCost().
Christian Sigg [Tue, 13 Oct 2020 15:21:59 +0000 (17:21 +0200)]
[mlir][gpu] Add `gpu.wait` op.
This combines two separate ops (D88972: `gpu.create_token`, D89043: `gpu.host_wait`) into one.
I do after all like the idea of combining the two ops, because it matches exactly the pattern we are
going to have in the other gpu ops that will implement the AsyncOpInterface (launch_func, copies, alloc):
If the op is async, we return a !gpu.async.token. Otherwise, we synchronize with the host and don't return a token.
The use cases for `gpu.wait async` and `gpu.wait` are further apart than those of e.g. `gpu.h2d async` and `gpu.h2d`,
but I like the consistent meaning of the `async` keyword in GPU ops.
Reviewed By: herhut
Differential Revision: https://reviews.llvm.org/D89160
Jay Foad [Tue, 13 Oct 2020 13:40:27 +0000 (14:40 +0100)]
[AMDGPU][GlobalISel] Compute known bits for zero-extending loads
Implement computeKnownBitsForTargetInstr for G_AMDGPU_BUFFER_LOAD_UBYTE
and G_AMDGPU_BUFFER_LOAD_USHORT. This allows generic combines to remove
some unnecessary G_ANDs.
Differential Revision: https://reviews.llvm.org/D89316
Raphael Isemann [Tue, 13 Oct 2020 15:13:23 +0000 (17:13 +0200)]
[lldb][cmake] Remove custom logic for finding VCS file to fix LLDB's VCSVersion.inc generation
We are still implementing our own logic for this that looks for a VCS file in
the place where it was before the monorepo migration. This removes this logic
and just uses the CMake function that LLVM/Clang are using.
Reviewed By: JDevlieghere, kastiglione
Differential Revision: https://reviews.llvm.org/D88950
Raphael Isemann [Tue, 13 Oct 2020 15:12:07 +0000 (17:12 +0200)]
[lldb] Allow limiting the number of error diagnostics when parsing an expression
While debugging another bug I found out that we currently don't set any limit
for the number of diagnostics Clang emits. If a user does something that
generates a lot of errors (like including some long header file from within the
expression function), then we currently spam the LLDB output with potentially
thousands of Clang error diagnostics.
Clang sets a default limit of 20 errors, but given that LLDB is often used
interactively for small expressions I would say a limit of 5 is enough. The
limit is implemented as a setting, so if a user cares about seeing having a
million errors printed to their terminal then they can just increase the
settings value.
Reviewed By: shafik, mib
Differential Revision: https://reviews.llvm.org/D88889
Raphael Isemann [Tue, 13 Oct 2020 15:10:10 +0000 (17:10 +0200)]
[lldb] Remove all the RegisterInfo name constification code
RegisterInfo's `reg_name`/`reg_alt_name` fields are C-Strings and are supposed
to only be generated from a ConstString. The reason for that is that
`DynamicRegisterInfo::GetRegisterInfo` and
`RegInfoBasedABI::GetRegisterInfoByName` try to optimise finding registers by
name by only comparing the C string pointer values instead of the underlying
strings. This only works if both C strings involved in the comparison come from
a ConstString. If one of the two C strings doesn't come from a ConstString the
comparison won't work (and most likely will silently fail).
I added an assert in
b0060c3a7868ef026d95d0cf8a076791ef74f474 which checks that
both strings come from a ConstString. Apparently not all ABI plugins are
generating their register names via ConstString, so this code is now not just
silently failing but also asserting.
In D88375 we did a shady fix for the MIPS plugins by just copying the
ConstString setup code to that plugin, but we still need to fix ABISysV_arc,
ABISysV_ppc and ABISysV_ppc64 plugins.
I would say we just fix the remaining plugins by removing the whole requirement
to have the register names coming from ConstStrings. I really doubt that we
actually save any time with the whole ConstString search trick (searching ~50
strings that have <4 characters doesn't sound more expensive than calling the
really expensive ConstString constructor + comparing the same amount of pointer
values). Also whatever small percentage of LLDB's runtime is actually spend in
this function is anyway not worth the complexity of this approach.
This patch just removes all this and just does a normal string comparison.
Reviewed By: JDevlieghere, labath
Differential Revision: https://reviews.llvm.org/D88490
Raphael Isemann [Tue, 13 Oct 2020 15:08:22 +0000 (17:08 +0200)]
[lldb][NFC] Remove property predicate matcher
That's supposed to be used to implement things such as `settings set target.run-args{basename==test&&arch==x86_64} arg1`
but it's not actually fully implemented or tested anywhere.
Reviewed By: JDevlieghere
Differential Revision: https://reviews.llvm.org/D88910
Raphael Isemann [Tue, 13 Oct 2020 14:50:40 +0000 (16:50 +0200)]
[lldb] Add targets for running test suite against Watch/TV/iPhone simulators
This patch adds several build system targets that run the normal test suite but
against the Watch/TV/iPhone simulators.
Reviewed By: JDevlieghere
Differential Revision: https://reviews.llvm.org/D89224
Paulo Matos [Tue, 13 Oct 2020 14:13:10 +0000 (07:13 -0700)]
[WebAssembly] Added .tabletype to asm and multiple table support in obj files
Adds more testing in basic-assembly.s and a new test tables.s.
Adds support to yaml reading and writing of tables as well.
Differential Revision: https://reviews.llvm.org/D88815
Eduardo Caldas [Fri, 9 Oct 2020 16:34:01 +0000 (16:34 +0000)]
[SyntaxTree] Fix rtti for `Expression`.
Differential Revision: https://reviews.llvm.org/D89146
Sanjay Patel [Tue, 13 Oct 2020 14:43:41 +0000 (10:43 -0400)]
[AArch64] fix spacing in test's RUN lines; NFC
Sjoerd Meijer [Tue, 13 Oct 2020 14:39:34 +0000 (15:39 +0100)]
[InstructionSimplify] Precommit tests for D89317. NFC.
Sanjay Patel [Tue, 13 Oct 2020 14:27:20 +0000 (10:27 -0400)]
[x86] add tests for cost model kinds of intrinsics; NFC
This provides coverage for existing special-cases and
a sampling of other intrinsics. Current output appears
to be wrong in several cases.
ergawy [Tue, 13 Oct 2020 13:52:20 +0000 (09:52 -0400)]
[MLIR][SPIRV] Support identified and recursive structs.
This PR adds support for identified and recursive structs.
This includes: parsing, printing, serializing, and
deserializing such structs.
The following C struct:
```C
struct A {
A* next;
};
```
which is translated to the following MLIR code as:
```mlir
!spv.struct<A, (!spv.ptr<!spv.struct<A>, Generic>)>
```
would be represented in the SPIR-V module as:
```spirv
OpName %A "A"
OpTypeForwardPointer %APtr Generic
%A = OpTypeStruct %APtr
%APtr = OpTypePointer Generic %A
```
In particular the following changes are included:
- SPIR-V structs can now be either identified or literal
(i.e. non-identified).
- All structs now have their members surrounded by a ()-pair.
- For recursive references,
(1) an OpTypeForwardPointer instruction is emitted before
the OpTypeStruct instruction defining the recursive struct
(2) an OpTypePointer instruction is emitted after the
OpTypeStruct instruction which actually defines the recursive
pointer to struct type.
Reviewed By: antiagainst, rriddle, ftynse
Differential Revision: https://reviews.llvm.org/D87206