Saleem Abdulrasool [Wed, 3 Jun 2020 18:13:05 +0000 (18:13 +0000)]
lld: use `std::make_unique` (NFC)
The LLVM code base already uses C++14, use std::make_unique
to avoid the explicit constructor invocation via new and to avoid
spelling out the type twice.
Arnold Schwaighofer [Tue, 2 Jun 2020 14:19:22 +0000 (07:19 -0700)]
CoroSplit: Fix coroutine splitting for retcon and retcon.once
Summary:
For retcon and retcon.once coroutines we assume that all uses of spills
can be sunk past coro.begin. This simplifies handling of instructions
that escape the address of an alloca.
The current implementation would have issues if the address of the
alloca is escaped before coro.begin. (It also has issues with casts before and
uses of those casts after the coro.begin instruction)
%alloca_addr = alloca ...
%escape = ptrtoint %alloca_addr
coro.begin
store %escape to %alloca_addr
rdar://
60272809
Subscribers: hiraditya, modocache, mgrang, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D81023
Simon Pilgrim [Wed, 3 Jun 2020 18:41:56 +0000 (19:41 +0100)]
[VectorCombine] Add multi-use shl test for D80885
Florian Hahn [Wed, 3 Jun 2020 16:12:45 +0000 (17:12 +0100)]
[AArch64] Add ld3 test case for renaming in ldst-opt (NFC).
The test case highlights a mis-compile reported in PR46105, where
a consecutive register list is renamed, which invalidates some other
used registers.
Florian Hahn [Wed, 3 Jun 2020 11:24:56 +0000 (12:24 +0100)]
[NewGVN] Add test to ensure metadata is preserved for ssa_copy (NFC)
Add a new test that checks that metadata is preserved when ssa_copy
calls introduced by PredicateInfo are replaced by their original
values.
Lang Hames [Wed, 3 Jun 2020 04:31:26 +0000 (21:31 -0700)]
[JITLink] Skip debug sections in MachO objects.
Debug sections will not be linked into the final executable and may contain
ambiguous relocations*. Skipping them avoids both some unnecessary processing
cost and the hassle of dealing with the problematic relocations.
* E.g. __debug_ranges contains non-extern relocations to the end of functions
hat begin with named symbols. Under the usual rules for interpreting non-extern
relocations these will be incorrectly associated with the following block, or
no block at all (if there is a gap between one block and the next).
Simon Pilgrim [Wed, 3 Jun 2020 17:53:35 +0000 (18:53 +0100)]
[VectorCombine] Add multi-use multiply test for D80885
Richard Smith [Wed, 3 Jun 2020 17:52:55 +0000 (10:52 -0700)]
[doc] Fix use of ` where `` was intended in attribute docs.
`...` is rST syntax for hyperlinks etc. ``...`` should be used for code snippets.
Steven Wan [Wed, 3 Jun 2020 17:49:47 +0000 (13:49 -0400)]
[AIX] Change the default target CPU to power4 for AIX on Power
Summary: This patch changes the AIX default target CPU to power4 since this is the the lowest arch for the lowest OS level supported.
Reviewers: hubert.reinterpretcast, cebowleratibm, daltenty
Reviewed By: hubert.reinterpretcast
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D80835
Dorit Nuzman [Wed, 3 Jun 2020 17:11:54 +0000 (13:11 -0400)]
[InstSimplify] fix bug in matching or-with-not op (PR46083)
jasonliu [Wed, 3 Jun 2020 16:23:12 +0000 (16:23 +0000)]
[XCOFF][AIX] Use 'L..' instead of 'L' for PrivateGlobalPrefix
Without this change, names start with 'L' will get created as
temporary symbol in MCContext::createSymbol.
Some other potential prefix considered:
.L, does not work for AIX, as a function start with L will end
up with .L as prefix for its function entry point.
..L could work, but it does not play well with the convention
on AIX that anything start with '.' are considered as entry point.
L. could work, but not sure if it's safe enough, as it's possible
to have suffixes like .something append to a plain L, giving L.something
which is not necessarily a temporary.
That's why we picked L.. for now.
Differential Revision: https://reviews.llvm.org/D80831
Hiroshi Yamauchi [Tue, 2 Jun 2020 22:10:02 +0000 (15:10 -0700)]
[profile] Sync InstrProfData.inc with llvm.
Reviewers: davidxl
Subscribers: #sanitizers, llvm-commits
Tags: #sanitizers
Differential Revision: https://reviews.llvm.org/D81038
Louis Dionne [Wed, 3 Jun 2020 16:58:50 +0000 (12:58 -0400)]
[libc++] Fix test broken in C++03 due to requiring C++11 features from vector
Richard Smith [Wed, 3 Jun 2020 16:56:38 +0000 (09:56 -0700)]
[doc] Fix typo.
The absence of a space here caused this codeblock to be missing from the rendered output.
Jonas Devlieghere [Wed, 3 Jun 2020 16:31:15 +0000 (09:31 -0700)]
[lldb/Test] Don't print 'command invoked'
The different tools constructing dotest invocations (lit and
lldb-dotest) already print the command invocation so there's no need to
print it again in the dotest output.
My motivation for removing it is that it doesn't include the Python
interpreter and every time I accidentally copy it, the command fails
with an `ImportError`.
Differential revision: https://reviews.llvm.org/D81032
Frederik Gossen [Wed, 3 Jun 2020 16:14:42 +0000 (16:14 +0000)]
[MLIR] Shape to standard dialect lowering
Add a new pass to lower operations from the `shape` to the `std` dialect.
The conversion applies only to the `size_to_index` and `index_to_size`
operations and affected types.
Other patterns will be added as needed.
Differential Revision: https://reviews.llvm.org/D81091
Louis Dionne [Wed, 3 Jun 2020 15:51:59 +0000 (11:51 -0400)]
[libc++] Support move construction and assignment in <thread> in C++03
Libc++ provides support for <thread> in C++03 as an extension. Furthermore,
it does not support any compiler that doesn't have rvalue references. It
is hence possible to provide the move constructor and move assignment
operator in C++03.
Paul Pelzl [Wed, 3 Jun 2020 09:50:45 +0000 (12:50 +0300)]
[analyzer] ObjCAutoreleaseWriteChecker: Support explicit autoreleasepools.
The checker currently supports only a whitelist of block-enumeration
methods which are known to internally clear an autorelease pool.
Extend this checker to detect writes within the scope of explicit
@autoreleasepool statements.
rdar://
25301111
Differential Revision: https://reviews.llvm.org/D81072
Paul Pelzl [Wed, 3 Jun 2020 08:39:12 +0000 (11:39 +0300)]
[analyzer] Add support for ObjCIndirectCopyRestoreExpr.
Idiomatic objc using ARC will generate this expression regularly due to
NSError out-param passing. Providing an implementation for this
expression allows the analyzer to explore many more codepaths in ARC
projects.
The current implementation is not perfect but the differences are hopefully
subtle enough to not cause much problems.
rdar://
63918914
Differential Revision: https://reviews.llvm.org/D81071
Victor Huang [Wed, 3 Jun 2020 15:37:07 +0000 (10:37 -0500)]
[CodeGen] Enable tail call position check for speculatable functions
In the function "Analysis.cpp:isInTailCallPosition", it only checks whether
a call is in a tail call position if the call has side effects, access memory
or it is not safe to speculative execute. Therefore, a speculatable function
will not go through tail call position check and improperly tail called when
it is not in a tail-call position. This patch enables tail call position check
for speculatable functions.
Differential Revision: https://reviews.llvm.org/D80661
Saleem Abdulrasool [Tue, 2 Jun 2020 23:05:09 +0000 (23:05 +0000)]
lld: ignore the `-search_paths_first` option on MachO
ld64 provides the `-search_path_firsts` which will search each path in
the library search path order for both `lib[name].dylib`, `lib[name].a`
before moving on (searching all paths for the dylib and then falling
back to the static library if a shared library was not found).
This option has been the default for a long time, but the command line
flag still exists. Ignore it for compatibility.
David Zarzycki [Wed, 3 Jun 2020 15:23:27 +0000 (11:23 -0400)]
[libcxx testing] Fix bot failure in my last commit
Kang Zhang [Wed, 3 Jun 2020 15:25:30 +0000 (15:25 +0000)]
[LiveVariables] Don't set undef reg PHI used as live for FromMBB
Summary:
In the patch D73152, it adds a new function LiveVariables::addNewBlock.
This new function will add the reg which PHI used to the MBB which reg
is from.
But the new function may cause LiveVariable Verification failed when the
Src reg in PHI is undef.
Reviewed By: bjope
Differential Revision: https://reviews.llvm.org/D80077
Henry Kao [Wed, 3 Jun 2020 15:12:25 +0000 (11:12 -0400)]
[CodeGen][SVE] Replace deprecated calls in getCopyFromPartsVector()
Summary: Replaced getVectorNumElements() with getVectorElementCount(). Added operator overloads for class ElementCount. Fixes warning in several AArch64 unit tests.
Reviewers: sdesmalen, kmclaughlin, dancgr, efriedma, each, andwar, rengolin
Reviewed By: efriedma
Subscribers: tschuett, kristof.beyls, hiraditya, rkruppe, psnobl, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D80826
Yonghong Song [Tue, 2 Jun 2020 07:47:18 +0000 (00:47 -0700)]
[BPF] Remove unnecessary MOV_32_64 instructions
Commit
13f6c81c5d9a ("[BPF] simplify zero extension
with MOV_32_64") tried to use MOV_32_64 instructions
instead of lshift/rshift instructions for zero extension.
This has the benefit to remove the number of instructions
and may help verifier too.
But the same commit also removed the old MOV_32_64
pruning as it deems unsafe as MOV_32_64 does have the
side effect, zeroing out the top 32bit in the register.
This caused the following failure in kernel selftest
test_cls_redirect.o. In linux kernel, we have
struct __sk_buff {
__u32 data;
__u32 data_end;
};
The compiler will generate 32bit load for __sk_buff->data
and __sk_buff->data_end. But kernel verifier will actually
loads an address (64bit address on 64bit kernel) to the
result register. In this particular example, the explicit zext
was not optimized away and destroyed top 32bit
address and the verifier rejected the program :
w2 = *(u32 *)(r1 + 76)
...
r2 = w2 /* MOV_32_64: this will clear top 32bit */
Currently, if the load and the zext are next to each other, the
instruction pattern match can actually capture this to
avoid MOV_32_64, e.g., in BPFInstrInfo.td, we have
def : Pat<(i64 (zextloadi32 ADDRri:$src)),
(SUBREG_TO_REG (i64 0), (LDW32 ADDRri:$src), sub_32)>;
However, if they are not next to each other, LDW32 and
MOV_32_64 are generated, which may cause the above mentioned
problem.
BPF Backend already tried to optimize away pattern
mov_32_64 + lshift + rshift
Commit
13f6c81c5d9a may generate mov_32_64 not followed by shifts.
This patch added optimization for only mov_32_64 too.
Differential Revision: https://reviews.llvm.org/D81048
Simon Pilgrim [Wed, 3 Jun 2020 15:05:31 +0000 (16:05 +0100)]
Fix gcc -Wdocumentation warning. NFC.
gcc doesn't recognise @llvm.experimental.guard as a code snippet
Simon Pilgrim [Wed, 3 Jun 2020 14:56:28 +0000 (15:56 +0100)]
[DAG] SimplifyDemandedBits - peek through SHL if we only demand sign bits.
If we're only demanding the (shifted) sign bits of the shift source value, then we can use the value directly.
This handles SimplifyDemandedBits/SimplifyMultipleUseDemandedBits for both ISD::SHL and X86ISD::VSHLI.
Differential Revision: https://reviews.llvm.org/D80869
Yaxun (Sam) Liu [Wed, 25 Mar 2020 18:47:18 +0000 (14:47 -0400)]
[HIP] Change default --gpu-max-threads-per-block value to 1024
Differential Revision: https://reviews.llvm.org/D76795
Fangrui Song [Wed, 3 Jun 2020 14:59:28 +0000 (07:59 -0700)]
[ELF] Append " [--no-allow-shlib-undefined]" to the corresponding diagnostics
--no-allow-shlib-undefined (enabled by default when linking an
executable) rejects unresolved references in shared objects.
Users may be confused by the common diagnostics of unresolved symbols in
object files (LLD: "undefined symbol: foo"; GNU ld/gold: "undefined reference to")
Learn from GCC/clang " [-Wfoo]": append the option name to the
diagnostics. Users can find relevant information by searching
"--no-allow-shlib-undefined". It should also be obvious to them that
the positive form --allow-shlib-undefined can suppress the error.
Also downgrade the error to a warning if --noinhibit-exec is used (compatible
with GNU ld and gold).
Reviewed By: grimar, psmith
Differential Revision: https://reviews.llvm.org/D81028
David Tenty [Wed, 3 Jun 2020 14:54:56 +0000 (10:54 -0400)]
[AIX] Update data directives for AIX assembly
Summary:
The standard data emission directives (e.g. .short, .long) in the AIX assembler
have the unintended consequence of aligning their output to the natural byte
boundary. This cause problems because we aren't expecting behavior from the
Data*bitsDirectives, so the final alignment of data isn't correct in some cases
on AIX.
This patch updated the Data*bitsDirectives to use .vbyte pseudo-ops instead to emit the
data, since we will emit the .align directives as needed. We update the existing
testcases and add a test for emission of struct data.
Reviewers: hubert.reinterpretcast, Xiangling_L, jasonliu
Reviewed By: hubert.reinterpretcast, jasonliu
Subscribers: wuzish, nemanjai, hiraditya, kbarton, arphaman, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D80934
Francesco Petrogalli [Thu, 28 May 2020 02:17:45 +0000 (02:17 +0000)]
[SveEmitter] Add SVE ACLE for svld1ro.
Reviewers: sdesmalen, efriedma
Subscribers: tschuett, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D80740
Matt Arsenault [Thu, 12 Dec 2019 15:51:18 +0000 (21:21 +0530)]
ARM: Reduce debug info testcase
This had multiple functions and only one vague check. Reduce it.
David Zarzycki [Wed, 3 Jun 2020 14:20:37 +0000 (10:20 -0400)]
[libcxx testing] Fix more bogus timeouts: condvarany/notify_all.pass.cpp
On slow/busy machines, timing cannot be guaranteed.
Simon Pilgrim [Wed, 3 Jun 2020 14:03:26 +0000 (15:03 +0100)]
[X86][AVX] getFauxShuffleMask - fix sub vector size check in INSERT_SUBVECTOR(X,SHUFFLE(Y,Z))
We were bailing on subvector shuffle inputs that were smaller than the subvector type instead of larger than it.
Fixes PR46178
Nathan James [Wed, 3 Jun 2020 14:16:36 +0000 (15:16 +0100)]
second attempt to fix build after add51e1
Matt Arsenault [Wed, 3 Jun 2020 14:13:42 +0000 (10:13 -0400)]
AMDGPU: Switch test to generated checks
This is was a very frustrating test to update manually.
Louis Dionne [Wed, 3 Jun 2020 14:06:56 +0000 (10:06 -0400)]
[libc++abi] Fix incorrect XFAILs for mis-aligned _Unwind_Exception on Apple
The problem mentioned in the XFAILs has been resolved in macosx10.15, so
the test is now XPASSing on that platform.
rdar://
63640184
Francesco Petrogalli [Wed, 27 May 2020 19:58:04 +0000 (19:58 +0000)]
[llvm][SVE] IR intrinsic for LD1RO.
Reviewers: sdesmalen, efriedma
Subscribers: tschuett, hiraditya, rkruppe, psnobl, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D80738
Eduardo Caldas [Wed, 3 Jun 2020 13:34:25 +0000 (15:34 +0200)]
Add support for `nullptr` in SyntaxTrees
Reviewers: gribozavr2
Reviewed By: gribozavr2
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D81092
Andrew Wock [Tue, 2 Jun 2020 17:42:48 +0000 (13:42 -0400)]
[PowerPC] Replace subtract-from-zero float in version with fneg in PowerPC special fma compiler builtins
This is a re-revert with a corrected test.
This patch adds a test for the PowerPC fma compiler builtins, some variations
of which negate inputs and outputs. The code to generate IR for these
builtins was untested before this patch.
Originally, the code used the outdated method of subtracting floating point
values from -0.0 as floating point negation. This patch remedies that.
Patch by: Drew Wock <drew.wock@sas.com>
Differential Revision: https://reviews.llvm.org/D76949
Martin Boehme [Wed, 3 Jun 2020 11:07:13 +0000 (13:07 +0200)]
[clangd] Add std::move() to a return statement to please some compilers.
This has been causing build errors in Swift CI.
Differential Revision: https://reviews.llvm.org/D81079
Louis Dionne [Mon, 1 Jun 2020 14:38:23 +0000 (10:38 -0400)]
[libc++] Remove the c++98 Lit feature from the test suite
C++98 and C++03 are effectively aliases as far as Clang is concerned.
As such, allowing both std=c++98 and std=c++03 as Lit parameters is
just slightly confusing, but provides no value. It's similar to allowing
both std=c++17 and std=c++1z, which we don't do.
This was discovered because we had an internal bot that ran the test
suite under both c++98 AND c++03 -- one of which is redundant.
Differential Revision: https://reviews.llvm.org/D80926
Alex Zinenko [Tue, 2 Jun 2020 11:35:43 +0000 (13:35 +0200)]
[mlir] DialectConversion: remove vtable from TypeConverter
The original design of TypeConverter expected specific converters to derive the
class and override virtual functions for conversions and materializations. This
did not scale well to multi-dialect conversions, so the design was changed to
register a list of converter and materializer functions, removing the need for
virtual functions. The only remaining virtual function, `convertSignatureArg`
is never overridden in-tree. Make it non-virtual, drop the virtual destructor
and thus remove vtable from TypeConverter.
If there exist TypeConverter users that need custom `convertSignatureArg`
behavior, it should be implemented using the callback registration mechanism
similar to that of conversions and materializations.
Differential Revision: https://reviews.llvm.org/D80993
Alexey Bataev [Tue, 2 Jun 2020 18:26:28 +0000 (14:26 -0400)]
[OPENMP]Fix PR46170: partial mapping for array sections of data members.
Summary:
If the data member is mapped as an array section, need to emit the
pointer to the last element of this array section and use this pointer
as the highest element in partial struct data.
Reviewers: jdoerfert
Subscribers: yaxunl, guansong, sstefan1, cfe-commits, caomhin
Tags: #clang
Differential Revision: https://reviews.llvm.org/D81037
Dmitri Gribenko [Wed, 3 Jun 2020 12:53:59 +0000 (14:53 +0200)]
Replaced C++2a with C++20 in clang-tools-extra
Reviewers: hlopko, aaron.ballman
Reviewed By: aaron.ballman
Subscribers: wuzish, aaron.ballman, nemanjai, kbarton, jkorous, arphaman, kadircet, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D81087
David Zarzycki [Wed, 3 Jun 2020 12:44:45 +0000 (08:44 -0400)]
[libcxx testing] Fix lingering bugs in notify_one.pass.cpp
This test is arguably fatally flawed, at least as long as C++ condition
variables are just trivial wrappers around POSIX. I've added some notes
to the test for future authors to consider.
Sanjay Patel [Wed, 3 Jun 2020 12:00:35 +0000 (08:00 -0400)]
[InstSimplify] add/move tests for or with not op (PR46083); NFC
Kazushi (Jam) Marukawa [Wed, 3 Jun 2020 11:48:32 +0000 (13:48 +0200)]
[VE] Support a basic disassembler for Aurora VE target
Summary:
Add a basic disassember and regression tests of LEA/LD/ST
instructions. This patch also removes DecoderMethod declarations for
branch and call since those are not implemented in this patch. They
will be added again later. This patch also corrects DecoderMethod for
LD/ST instructions for one byte or two.
Differential Revision: https://reviews.llvm.org/D80912
Simon Pilgrim [Wed, 3 Jun 2020 11:37:31 +0000 (12:37 +0100)]
Fix gcc "enumeral and non-enumeral type in conditional expression" warning. NFCI.
Simon Pilgrim [Wed, 3 Jun 2020 11:30:27 +0000 (12:30 +0100)]
[DAG] GetDemandedBits - don't bother asserting for a non-null cast<> result. NFC.
cast<> will assert on failure anyhow.
This lets us fold the cast<> with the getAPIntValue() that uses it.
Bruno Ricci [Wed, 3 Jun 2020 11:35:12 +0000 (12:35 +0100)]
[clang][Sema] SequenceChecker: C++17 sequencing rule for call expressions.
In C++17 the postfix-expression of a call expression is sequenced before
each expression in the expression-list and any default argument.
Differential Revision: https://reviews.llvm.org/D58579
Reviewed By: rsmith
Tom Weaver [Wed, 3 Jun 2020 11:28:26 +0000 (12:28 +0100)]
Revert "[Dexter] Add DexLimitSteps command and ConditionalController"
This reverts commit
81e836a5a675f6a3d9d35560fddbbb87fdf66201.
Accidentally committed a diff file.
Pavel Labath [Wed, 3 Jun 2020 11:10:00 +0000 (13:10 +0200)]
[lldb/cmake] Tweak descriptions of swig rules
This descriptions are printed while running the command, and so the
continuous tense is more appropriate and consistent.
Andy Yankovsky [Wed, 3 Jun 2020 11:08:00 +0000 (13:08 +0200)]
[Scalar] Fix assignment operator for long long.
Summary:
Assignment operator `operator=(long long)` currently allocates `sizeof(long)`.
On some platforms it works as they have `sizeof(long) == sizeof(long long)`,
but on others (e.g. Windows) it's not the case.
Reviewed By: labath
Differential Revision: https://reviews.llvm.org/D80995
Muhammad Omair Javaid [Wed, 3 Jun 2020 09:46:20 +0000 (14:46 +0500)]
[LLDB] skip TestCreateDuringInstructionStep on arm/linux
There are sporadic failures in this test on arm. I am marking it
skipped as labath suggested flaky decorators no longer work.
Florian Hahn [Wed, 3 Jun 2020 10:30:06 +0000 (11:30 +0100)]
[VPlan] Support extracting lanes for defs managed in VPTransformState.
Currently extracting a lane for a VPValue def is not supported, if it is
managed directly by VPTransformState (e.g. because it is created by a
VPInstruction or an external VPValue def).
For now, simply extract the requested lane. In the future, we should
also cache the extracted scalar values, similar to LV.
Reviewers: Ayal, rengolin, gilr, SjoerdMeijer
Reviewed By: SjoerdMeijer
Differential Revision: https://reviews.llvm.org/D80787
LLVM GN Syncbot [Wed, 3 Jun 2020 10:50:20 +0000 (10:50 +0000)]
[gn build] Port
add51e152aa
Nico Weber [Wed, 3 Jun 2020 10:49:50 +0000 (06:49 -0400)]
attempt to fix build after
add51e152aa
Raphael Isemann [Wed, 3 Jun 2020 08:34:11 +0000 (10:34 +0200)]
[lldb] Pass fewer parameters by non-const reference to DWARFASTParserClang::ParseSingleMember
These parameters are only passed on by value or const reference, so we should
do the same when calling this function.
Jay Foad [Wed, 3 Jun 2020 10:36:09 +0000 (11:36 +0100)]
[AMDGPU] Fold llvm.amdgcn.cos and llvm.amdgcn.sin intrinsics (fix tests)
Try to fix Windows buildbots.
Lucas Prates [Tue, 5 May 2020 10:52:09 +0000 (11:52 +0100)]
[Clang][AArch64] Capturing proper pointer alignment for Neon vld1 intrinsicts
Summary:
During CodeGen for AArch64 Neon intrinsics, Clang was incorrectly
assuming all the pointers from which loads were being generated for vld1
intrinsics were aligned according to the intrinsics result type, causing
alignment faults on the code generated by the backend.
This patch updates vld1 intrinsics' CodeGen to properly capture the
correct load alignment based on the type of the pointer provided as
input for the intrinsic.
Reviewers: t.p.northover, ostannard, pcc, efriedma
Reviewed By: ostannard, efriedma
Subscribers: echristo, plotfi, nickdesaulniers, efriedma, kristof.beyls, danielkiss, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D79721
Braedy Kuzma [Wed, 3 Jun 2020 10:23:16 +0000 (11:23 +0100)]
[LangRef] Fix description of shape args for matrix.multiply.
Currently all code instances within the matrix lowering pass consider
matrix A to be MxN and B to be NxK, producing C which is MxK. Anyone
interacting with this API after reading the docs but without reading the pass
would expect A: MxK, B: KxN, and C: MxN. These changes bring the documentation
in line with the implementation.
One point of concern with this, the original signature as described in the docs
may be better or at least more expected. The interface as it was written
reflected other common matrix multiplication interfaces such as BLAS'[1], where
the matrices are MxK, KxN, MxN respectively. Choosing to honor this requires
changing code and tests instead, but should be mostly just renaming of variables.
Patch by Braedy Kuzma <braedy@ualberta.ca>
[1] http://www.netlib.org/lapack/explore-html/db/dc9/group__single__blas__level3_gafe51bacb54592ff5de056acabd83c260.html#gafe51bacb54592ff5de056acabd83c260
Reviewers: anemet, LuoYuanke, nicolasvasilache, fhahn
Reviewed By: fhahn
Differential Revision: https://reviews.llvm.org/D80663
Matthias Gehre [Wed, 2 Oct 2019 22:39:46 +0000 (00:39 +0200)]
[clang-tidy] add new check readability-use-anyofallof
Summary:
Finds range-based for loops that can be replaced by a call to ``std::any_of`` or
``std::all_of``. In C++ 20 mode, suggests ``std::ranges::any_of`` or
``std::ranges::all_of``.
For now, no fixits are produced.
Reviewers: aaron.ballman, alexfh, hokein
Subscribers: mgorny, xazax.hun, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D77572
Simon Pilgrim [Wed, 3 Jun 2020 10:10:18 +0000 (11:10 +0100)]
Fix MSVC "not all control paths return a value" warning. NFC.
Add llvm_unreachable after switch statement for CheckerRegistry::StateFromCmdLine enum
Simon Pilgrim [Tue, 2 Jun 2020 17:52:40 +0000 (18:52 +0100)]
TargetFrameLowering.h - remove unnecessary includes. NFC.
Move TargetFrameLowering.h include to the top of the TargetFrameLoweringImpl.cpp includes (clang-format doesn't do this by default as the filenames don't match).
Nicolas Vasilache [Tue, 2 Jun 2020 19:14:32 +0000 (15:14 -0400)]
[mlir][Linalg] NFC - Make markers use Identifier instead of StringRef
Summary: This removes string ownership worries by putting everything into the context and allows more constructing identifiers programmatically.
Reviewers: ftynse
Subscribers: mehdi_amini, rriddle, jpienaar, shauheen, antiagainst, arpith-jacob, mgester, lucyrfox, aartbik, liufengdb, stephenneuendorffer, Joonsoo, grosul1, frgossen, Kayjukh, jurahul
Tags: #mlir
Differential Revision: https://reviews.llvm.org/D81027
Kadir Cetinkaya [Wed, 3 Jun 2020 09:49:01 +0000 (11:49 +0200)]
[llvm] Fix unused variable warnings
Vitaly Buka [Wed, 3 Jun 2020 09:38:49 +0000 (02:38 -0700)]
[NFC,StackSafety] Fix template arg name
Djordje Todorovic [Wed, 3 Jun 2020 08:37:41 +0000 (10:37 +0200)]
[CSInfo][MIPS][DwarfDebug] Add support for delay slots
This adds call site info support for call instructions with delay slot.
Search for instructions inside call delay slot, which load value
into parameter forwarding registers.
Return address of the call points to instruction after call delay slot,
which is not the one, immediately after the call instruction.
Patch by Nikola Tesic
Differential revision: https://reviews.llvm.org/D78107
Dmitri Gribenko [Wed, 3 Jun 2020 09:17:10 +0000 (11:17 +0200)]
Split syntax tree tests into more granular ones
Summary:
Doing so allows us to increase test coverage by removing unnecessary
language restrictions.
Reviewers: hlopko, eduucaldas
Reviewed By: hlopko, eduucaldas
Subscribers: gribozavr2, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D81040
Dmitri Gribenko [Wed, 3 Jun 2020 08:50:57 +0000 (10:50 +0200)]
Syntax tree: ignore implicit expressions at the top level of statements
Summary:
I changed `markStmtChild` to ignore implicit expressions the same way as
`markExprChild` does it already. The test that I modified crashes
without this change.
Reviewers: hlopko, eduucaldas
Reviewed By: hlopko, eduucaldas
Subscribers: gribozavr2, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D81019
Jay Foad [Wed, 3 Jun 2020 08:44:00 +0000 (09:44 +0100)]
[AMDGPU] Fold llvm.amdgcn.cos and llvm.amdgcn.sin intrinsics (fix)
Try to fix Windows buildbots.
Serge Pavlov [Wed, 3 Jun 2020 08:40:12 +0000 (15:40 +0700)]
Revert "[Support] Add file lock/unlock functions"
This reverts commit
f51bc4fb60fbcef26d18eff549fc68307fd46489.
It broke the Solaris buildbots (Builder clang-solaris11-sparcv9 Build #5494
<http://lab.llvm.org:8014/builders/clang-solaris11-sparcv9/builds/54).
Vitaly Buka [Tue, 2 Jun 2020 09:51:35 +0000 (02:51 -0700)]
[StackSafety,NFC] Convert to template internal stuff
It's going to be usefull for ThinLTO.
Vitaly Buka [Tue, 2 Jun 2020 09:37:24 +0000 (02:37 -0700)]
[StackSafety,NFC] Rename internal class
Jay Foad [Thu, 28 May 2020 09:29:16 +0000 (10:29 +0100)]
[AMDGPU] Fold llvm.amdgcn.cos and llvm.amdgcn.sin intrinsics
Differential Revision: https://reviews.llvm.org/D80702
hsmahesha [Wed, 3 Jun 2020 08:31:17 +0000 (14:01 +0530)]
[AMDGPU/MemOpsCluster] Code clean-up around accessing of memory operand width
Summary:
Clean-up the width computing logic given a memory operand, and re-arrange code to avoid
code duplication.
Reviewers: foad, rampitec, arsenm, vpykhtin, javedabsar
Reviewed By: foad
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D80946
LLVM GN Syncbot [Wed, 3 Jun 2020 08:27:24 +0000 (08:27 +0000)]
[gn build] Port
755a8959152
Thomas Lively [Wed, 3 Jun 2020 08:26:53 +0000 (01:26 -0700)]
Revert "[WebAssembly] Eliminate range checks on br_tables"
This reverts commit
f99d5f8c32a822580a732d15a34e8197da55d22b.
The change was causing UBSan and other failures on some bots.
Nathan James [Wed, 3 Jun 2020 08:23:32 +0000 (09:23 +0100)]
[clang-tidy] Added MacroDefiniton docs for readability-identifier-naming
Updates the docs to include `MacroDefinition` documentation. The docs are still missing `ObjCIVar` however I don't have a clue about how that looks in code. If someone wants to show the code block needed for the example I'll add that in too.
Reviewed By: aaron.ballman
Differential Revision: https://reviews.llvm.org/D80877
Vitaly Buka [Mon, 1 Jun 2020 07:26:29 +0000 (00:26 -0700)]
[StackSafety] Skip non-pointer parameters
Summary: Depends on D80908.
Reviewers: eugenis, pcc
Reviewed By: eugenis
Subscribers: hiraditya, steven_wu, dexonsmith, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D80956
Vitaly Buka [Fri, 29 May 2020 22:10:50 +0000 (15:10 -0700)]
[NFC, StackSafety] Change type of internal container
Summary: Depends on D80771.
Reviewers: eugenis
Reviewed By: eugenis
Subscribers: mehdi_amini, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D80847
Shengchen Kan [Wed, 3 Jun 2020 06:54:56 +0000 (14:54 +0800)]
[Driver] Add negative option for -fkeep-static-consts
QingShan Zhang [Wed, 3 Jun 2020 06:32:53 +0000 (06:32 +0000)]
[NFC][PowerPC] Remove unused node PPCISD::VMADDFP and PPCISD::VNMSUBFP
These two nodes were added by
69caef2b781130a7d0eeaf8898eb346b6423ae03 in 2005
and they are not used by PowerPC backend anymore. And the ISD::FMA is a prefer
way for VMADDFP if we really want to create that node. For VNMSUBFP, we will
also add a more generic node FNMSUB in D76585 if we really want it.
Reviewed By: qiucf
Differential Revision: https://reviews.llvm.org/D80429
David Sherwood [Tue, 26 May 2020 15:33:06 +0000 (16:33 +0100)]
[CodeGen] Fix warnings in getPackedVectorTypeFromPredicateType
Use getVectorElementCount() instead of getVectorNumElements().
The code changed in this patch is covered by an existing test:
CodeGen/AArch64/sve-intrinsics-contiguous-prefetches.ll
Differential Revision: https://reviews.llvm.org/D80615
Craig Topper [Wed, 3 Jun 2020 05:21:12 +0000 (22:21 -0700)]
[X86] Add CLWB to Tremont CPU. Remove CLDEMOTE, MOVDIRI, MOVDIR64B, and WAITPKG to match gcc.
Serge Pavlov [Wed, 22 Apr 2020 16:00:12 +0000 (23:00 +0700)]
[Support] Add file lock/unlock functions
New functions `lockFile`, `tryLockFile` and `unlockFile` implement
simple file locking. They lock or unlock entire file. This must be
enough to support simulataneous writes to log files in parallel builds.
Differential Revision: https://reviews.llvm.org/D78896
Anchu Rajendran [Wed, 3 Jun 2020 04:56:10 +0000 (10:26 +0530)]
[flang] Implemented 2 Semantic checks for DATA statement and fixed a few bugs
Summary
- Implemented C876, C877
- Fixed IsConstantExpr to check C879
- Fixed bugs in few test cases - data01.f90, block-data01.f90,
pre-fir-tree02.f90
- Modified implementation of C8106 to identify all automatic objects
and modified equivalence01.f90 to reflect the changes
Differential Revision: https://reviews.llvm.org/D78424
Jonas Devlieghere [Wed, 3 Jun 2020 04:21:20 +0000 (21:21 -0700)]
[lldb/Interpreter] Remove redundant argument (NFC)
Mehdi Amini [Wed, 3 Jun 2020 04:05:47 +0000 (04:05 +0000)]
Fix build: TableGen uses `is<T>` instead of `isa<T>` as predicate
Carl Ritson [Wed, 3 Jun 2020 03:34:17 +0000 (12:34 +0900)]
[AMDGPU] Make SGPR spills exec mask agnostic
Explicitly set the exec mask for SGPR spills and reloads.
This fixes a bug where SGPR spills to memory could be incorrect
if the exec mask was 0 (or differed between spill and reload).
Additionally pack scalar subregisters (upto 16/32 per VGPR),
so that the majority of scalar types can be spilt or reloaded
with a simple memory access. This should amortize some of the
additional overhead of manipulating the exec mask.
Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D80282
Mehdi Amini [Wed, 3 Jun 2020 03:09:45 +0000 (03:09 +0000)]
Replace dyn_cast<>() with isa<>() when the result isn't used (NFC)
Fixed warning reported by some GCC version.
Mehdi Amini [Wed, 3 Jun 2020 03:02:28 +0000 (03:02 +0000)]
Revert "[NFC, StackSafety] Change type of internal container"
This reverts commit
f62813e7eae148a6175de28bfa384524a9f2bf94.
GCC 5.3 build is broken.
Jessica Paquette [Tue, 2 Jun 2020 00:23:20 +0000 (17:23 -0700)]
[AArch64][GlobalISel] Select zip1 and zip2
Port the code to recognize a zip1/zip2 shuffle mask from AArch64ISelLowering
and put it into the post-legalizer combiner.
Add G_ZIP1 and G_ZIP2 to AArch64InstrGISel.td and hook them up as equivalent
nodes to AArch64zip1 and AArch64zip2. This allows us to select them.
Minor code size improvements for SPECINT2000 at -O3 on 197.parser, 252.eon, and
186.crafty.
Differential Revision: https://reviews.llvm.org/D80969
Kazu Hirata [Wed, 3 Jun 2020 01:43:09 +0000 (18:43 -0700)]
[JumpThreading] Simplify FindMostPopularDest (NFC)
Summary:
This patch simplifies FindMostPopularDest without changing the
functionality.
Given a list of jump threading destinations, the function finds the
most popular destination. To ensure determinism when there are
multiple destinations with the highest popularity, the function picks
the first one in the successor list with the highest popularity.
Without this patch:
- The function populates DestPopularity -- a histogram mapping
destinations to their respective occurrence counts.
- Then we iterate over DestPopularity, looking for the highest
popularity while building a vector of destinations with the highest
popularity.
- Finally, we iterate the successor list, looking for the destination
with the highest popularity.
With this patch:
- We implement DestPopularity with MapVector instead of DenseMap. We
populate the map with popularity 0 for all successors in the order
they appear in the successor list.
- We build the histogram in the same way as before.
- We simply use std::max_element on DestPopularity to find the most
popular destination. The use of MapVector ensures determinism.
Reviewers: wmi, efriedma
Reviewed By: wmi
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D81030
Vitaly Buka [Fri, 29 May 2020 21:19:11 +0000 (14:19 -0700)]
[NFC,MTE] Drop unneeded attribute from test
Summary: Depends on D80847.
Reviewers: eugenis
Reviewed By: eugenis
Subscribers: hiraditya, steven_wu, dexonsmith, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D80954
Vitaly Buka [Fri, 29 May 2020 22:10:50 +0000 (15:10 -0700)]
[NFC, StackSafety] Change type of internal container
Summary: Depends on D80771.
Reviewers: eugenis
Reviewed By: eugenis
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D80847
Vitaly Buka [Fri, 29 May 2020 07:56:30 +0000 (00:56 -0700)]
[MTE] Move tagging in pipeline
Summary:
This removes two analyses from pipeline.
Depends on D80771.
Reviewers: eugenis
Reviewed By: eugenis
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D80780
Wei Mi [Thu, 14 May 2020 19:05:49 +0000 (12:05 -0700)]
[SampleFDO] Add use-sample-profile function attribute.
When sampleFDO is enabled, people may expect they can use
-fno-profile-sample-use to opt-out using sample profile for a certain file.
That could be either for debugging purpose or for performance tuning purpose.
However, when thinlto is enabled, if a function in file A compiled with
-fno-profile-sample-use is imported to another file B compiled with
-fprofile-sample-use, the inlined copy of the function in file B may still
get its profile annotated.
The inconsistency may even introduce profile unused warning because if the
target is not compiled with explicit debug information flag, the function
in file A won't have its debug information enabled (debug information will
be enabled implicitly only when -fprofile-sample-use is used). After it is
imported into file B which is compiled with -fprofile-sample-use, profile
annotation for the outline copy of the function will fail because the
function has no debug information, and that will trigger profile unused
warning.
We add a new attribute use-sample-profile to control whether a function
will use its sample profile no matter for its outline or inline copies.
That will make the behavior of -fno-profile-sample-use consistent.
Differential Revision: https://reviews.llvm.org/D79959
Adrian Prantl [Tue, 2 Jun 2020 23:37:59 +0000 (16:37 -0700)]
Remove redundant code (NFC)
This has no effect on the testsuite and was only needed in an early
prototype from before debugserver was able to report the correct
platform.