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
Lei Zhang [Tue, 13 Oct 2020 14:14:54 +0000 (10:14 -0400)]
[mlir-vulkan-runner] Clean up some stale CMake configurations
Raphael Isemann [Tue, 13 Oct 2020 14:05:00 +0000 (16:05 +0200)]
Fix all the CMake code that can only handle -stdlib= but not --stdlib=
There are several places in LLVM's CMake setup that try to remove the
`stdlib=...` flag from the CMake flags. All this code however only considered
the `-stdlib=` variant of the flag but not the alternative spelling with a
double dash. This causes that when one adds `--stdlib=...` to the user-provided
CMake flags that this gets transformed into just `-` which ends up causing the
build system to think it should read the source from stdin (which then lead to
very confusing build errors).
This just adds the alternative spelling before the`-stdlib=` variant in all
these places
Reviewed By: ldionne
Differential Revision: https://reviews.llvm.org/D87133
Raphael Isemann [Tue, 13 Oct 2020 14:02:47 +0000 (16:02 +0200)]
[lldb][NFC] Fix some invalid escapes sequences in Python strings
I recently had to run the test suite with a debug Python which got started
warning about some invalid escape sequences in LLDB's Python code. They all
attempt to add a backslash by doing a single backslash instead of a double
backslash in a normal string. This seems to work fine for now, but Python says
this behaviour is deprecated, so this patch turns all those strings into raw
strings (where a single backslash is actually a single backslash)
Reviewed By: JDevlieghere
Differential Revision: https://reviews.llvm.org/D88289
Paul C. Anagnostopoulos [Mon, 12 Oct 2020 22:17:02 +0000 (18:17 -0400)]
[TableGen] Add new section to the TableGen Programmer's Reference.
Fix typos in it and the TableGen Backend Developer's Guide.
Alexandre Ganea [Tue, 13 Oct 2020 13:57:48 +0000 (09:57 -0400)]
[ThinLTO][Documentation] Mention possible values for concurrency flags
Differential Revision: https://reviews.llvm.org/D89309
Simon Pilgrim [Tue, 13 Oct 2020 13:35:02 +0000 (14:35 +0100)]
[InstCombine] visitTrunc - pass through undefs for trunc(shift(trunc/ext(x),c)) patterns
Based on the recent patches D88475 and D88429 where we are losing undef values due to extension/comparisons.
I've added a Constant::mergeUndefsWith method that merges the undef scalar/elements from another Constant into a specific Constant.
Differential Revision: https://reviews.llvm.org/D88687
Simon Pilgrim [Tue, 13 Oct 2020 11:16:12 +0000 (12:16 +0100)]
[Analysis] findAffectedValues - remove unused ConstantInt argument. NFCI.
We can use m_ConstantInt without a result value as we don't ever use it.
Hans Wennborg [Tue, 13 Oct 2020 13:21:06 +0000 (15:21 +0200)]
Revert "Raise the timeout in DirectoryWatcherTest to 10 s"
It didn't help.
This reverts commit
bddef54c502811fa1406d1161d4baa15b56ebc32.
Nathan Ridge [Tue, 13 Oct 2020 00:41:13 +0000 (20:41 -0400)]
[clangd] Propagate CollectMainFileRefs to BackgroundIndex
This appears to have been an omission in D83536.
Differential Revision: https://reviews.llvm.org/D89284
Louis Dionne [Tue, 13 Oct 2020 13:16:40 +0000 (09:16 -0400)]
[libc++] Update the <version> header in-place from generate_feature_test_macro_components
This simplifies the workflow for adding new feature-test macros for
contributors. Previously, they would have to move the generated <version>
header from a temporary directory to libc++'s include directory by hand.
This makes the behavior for the <version> header consistent with what's
done for the tests and the documentation.
Jonas Paulsson [Tue, 8 Sep 2020 11:06:41 +0000 (13:06 +0200)]
[clang] Improve handling of physical registers in inline assembly operands.
Change EmitAsmStmt() to
- Not tie physregs with the "+r" constraint, but instead add the hard
register as an input constraint. This makes "+r" and "=r":"r" look the same
in the output.
Background: Macro intensive user code may contain inline assembly
statements with multiple operands constrained to the same physreg. Such a
case (with the operand constraints "+r" : "r") currently triggers the
TwoAddressInstructionPass assertion against any extra use of a tied
register. Furthermore, TwoAddress will insert a COPY to that physreg even
though isel has already done so (for the non-tied use), which may lead to a
second redundant instruction currently. A simple fix for this is to not
emit tied physreg uses in the first place for the "+r" constraint, which is
what this patch does.
- Give an error on multiple outputs to the same physical register.
This should be reported and this is also what GCC does.
Review: Ulrich Weigand, Aaron Ballman, Jennifer Yu, Craig Topper
Differential Revision: https://reviews.llvm.org/D87279
Raphael Isemann [Tue, 13 Oct 2020 13:08:20 +0000 (15:08 +0200)]
[lldb] Don't add no-sandbox entitlement when running tests on simulator
It seems that if codesigning the test executables with the
`com.apple.private.security.no-sandbox` entitlement then the simulator refuses
to launch them and every test fails with `Process launch failed: process exited
with status -1 (no such process.)`.
This patch checks if we're trying to run the test suite on the simulator and
then avoids signing the executable with `no-sandbox`.
Reviewed By: JDevlieghere
Differential Revision: https://reviews.llvm.org/D89052
Raphael Isemann [Tue, 13 Oct 2020 13:07:33 +0000 (15:07 +0200)]
[lldb] Don't let dotest silently fall back to default SDK if the specified one can't be found
If the SDK name passed to dotest can't be found by `xcrun` we silently fall back
to the default SDK. This leads to rather cryptic errors being reported later on
when linking the actual test executables.
Instead just directly log and abort when this situation is encountered and
inform the user about the invalid argument.
Reviewed By: JDevlieghere
Differential Revision: https://reviews.llvm.org/D89053
Raphael Isemann [Tue, 13 Oct 2020 12:35:55 +0000 (14:35 +0200)]
[lldb] Fill Watch/AppleTV simulator gaps in PlatformDarwin
When running the test suite against the Watch/AppleTV simulator we currently hitting
the unimplemented parts of PlatformDarwin for the respective simulator platforms.
This just adds the respective switch cases.
This whole code path depends on having a valid Target, so can't just unittest this code
without refactoring it. So instead this is tested by just running the testsuite against
the respective simulators (which is how I found this).
Reviewed By: aprantl
Differential Revision: https://reviews.llvm.org/D89106
Sanjay Patel [Tue, 13 Oct 2020 12:35:43 +0000 (08:35 -0400)]
[AArch64] add cost model test for scalable vector math; NFC
Testing for the various cost model "TargetCostKind" is limited,
and testing for scalable vectors is limited. The motivating
example of an intrinsic is not included here yet because that
just crashes.
Hans Wennborg [Tue, 13 Oct 2020 12:24:02 +0000 (14:24 +0200)]
Raise the timeout in DirectoryWatcherTest to 10 s
After D88666, which implemented DirectoryWatcher on Windows, we're
seeing test failures on Chromium's Windows bots.
Try raising the timeout in case the test is failing due to high load on
the machine.
Evgeny Leviant [Tue, 13 Oct 2020 12:24:58 +0000 (15:24 +0300)]
Fix Windows/MSVC build after
6e56046f65
Commit
6e56046f65 may trigger SEGV in llvm-tablegen if the latter
is built with -DLLVM_OPTIMIZED_TABLEGEN=OFF. The reason of SEGV was
accessing stale memory after expansion of std::vector.
Florian Hahn [Wed, 5 Aug 2020 14:21:52 +0000 (15:21 +0100)]
[ConstraintElimination] Add add/sub/and/or test cases.
This adds a new set of tests for upcoming constraint elimination
changes.
Sylvestre Ledru [Mon, 12 Oct 2020 21:32:40 +0000 (23:32 +0200)]
[clang-tidy] Add an example for misc-unused-alias-decls
Differential Revision: https://reviews.llvm.org/D89270
Bevin Hansson [Mon, 24 Aug 2020 08:19:29 +0000 (10:19 +0200)]
[AST] Change return type of getTypeInfoInChars to a proper struct instead of std::pair.
Followup to D85191.
This changes getTypeInfoInChars to return a TypeInfoChars
struct instead of a std::pair of CharUnits. This lets the
interface match getTypeInfo more closely.
Reviewed By: efriedma
Differential Revision: https://reviews.llvm.org/D86447
Bevin Hansson [Wed, 26 Aug 2020 14:46:57 +0000 (16:46 +0200)]
[Fixed Point] Add fixed-point to floating point cast types and consteval.
Reviewed By: leonardchan
Differential Revision: https://reviews.llvm.org/D86631
Mirko Brkusanin [Tue, 13 Oct 2020 10:54:59 +0000 (12:54 +0200)]
[GlobalISel] Avoid making G_PTR_ADD with nullptr
When the first operand is a null pointer we can avoid making a G_PTR_ADD and
make a G_INTTOPTR with the offset operand.
This helps us avoid making add with 0 later on for targets such as AMDGPU.
Differential Revision: https://reviews.llvm.org/D87140
Max Kazantsev [Tue, 13 Oct 2020 10:51:47 +0000 (17:51 +0700)]
[Test] Add test showing that SCEV cannot compute IV's range
Vinay Madhusudan [Tue, 13 Oct 2020 09:48:30 +0000 (15:18 +0530)]
[AArch64] Identify SAD pattern
(ABS (SUB (EXTEND a), (EXTEND b))) to ZERO_EXTEND((UABD a, b))
(ABS (SUB (SIGN_EXTEND a), (SIGN_EXTEND b))) to ZERO_EXTEND((SABD a, b))
This partially solves the bug: https://bugs.llvm.org/show_bug.cgi?id=46888
Meta ticket: https://bugs.llvm.org/show_bug.cgi?id=46929
Differential Revision: https://reviews.llvm.org/D88742
Vitaly Buka [Tue, 13 Oct 2020 10:02:30 +0000 (03:02 -0700)]
Revert " Enable LSAN for Android"
Breaks android build.
asan_malloc_dispatch_k needs memalign interceptor disabled in this patch.
This reverts commit
a2291a58bf1c860d026581fee6fe96019dc25440.