Richard Smith [Fri, 10 Jan 2020 03:22:52 +0000 (19:22 -0800)]
Add a FIXME and corresponding test coverage for some suspicious behavior
forming composite ObjC pointer types in comparisons.
Richard Smith [Fri, 10 Jan 2020 21:21:24 +0000 (13:21 -0800)]
Remove redundant implicit cast creation.
FindCompositePointerType has already cast the operands to the composite
type for us in the case where it succeeds.
Jessica Paquette [Fri, 10 Jan 2020 23:46:52 +0000 (15:46 -0800)]
[AArch64] Don't generate libcalls for wide shifts on Darwin
Similar to
cff90f07cb5cc3.
Darwin doesn't always use compiler-rt, and so we can't assume that these
functions are available (at least on arm64).
Richard Smith [Fri, 10 Jan 2020 23:47:29 +0000 (15:47 -0800)]
Improve precision of documentation comment.
Lei Zhang [Fri, 10 Jan 2020 16:24:47 +0000 (11:24 -0500)]
[mlir][ods] Support dialect specific content emission via hooks
Thus far we can only generate the same set of methods even for
operations in different dialects. This is problematic for dialects that
want to generate additional operation class methods programmatically,
e.g., a special builder method or attribute getter method. Apparently
we cannot update the OpDefinitionsGen backend every time when such
a need arises. So this CL introduces a hook into the OpDefinitionsGen
backend to allow dialects to emit additional methods and traits to
operation classes.
Differential Revision: https://reviews.llvm.org/D72514
Lei Zhang [Fri, 10 Jan 2020 16:18:08 +0000 (11:18 -0500)]
[mlir] NFC: put C++ code emission classes in their own files
This exposes thse classes so that they can be used in interfaces.
Differential Revision: https://reviews.llvm.org/D72514
Mircea Trofin [Fri, 10 Jan 2020 23:29:48 +0000 (15:29 -0800)]
[NFC][InlineCost] Factor cost modeling out of CallAnalyzer traversal.
Summary:
The goal is to simplify experimentation on the cost model. Today,
CallAnalyzer decides 2 things: legality, and benefit. The refactoring
keeps legality assessment in CallAnalyzer, and factors benefit
evaluation out, as an extension.
Reviewers: davidxl, eraman
Reviewed By: davidxl
Subscribers: kamleshbhalui, fedor.sergeev, hiraditya, baloghadamsoftware, haicheng, a.sidorin, Szelethus, donat.nagy, dkrupp, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D71733
Vedant Kumar [Fri, 10 Jan 2020 23:24:30 +0000 (15:24 -0800)]
[LockFileManager] Make default waitForUnlock timeout a parameter, NFC
Patch by Xi Ge!
Richard Smith [Fri, 10 Jan 2020 23:16:15 +0000 (15:16 -0800)]
Only destroy static locals if they have non-trivial destructors.
This fixes a regression introduced in
2b4fa5348ee157b6b1a1af44d0137ca8c7a71573 that caused us to emit
shutdown-time destruction for variables with ARC ownership, using
C++-specific functions that don't exist in C implementations.
Jonas Devlieghere [Fri, 10 Jan 2020 22:54:29 +0000 (14:54 -0800)]
[lldb/Reproducer] Add SBReproducer::Replay overload (again)
I modified the SBAPI under the assumption that nobody was using the old
API yet. However, that turns out to be false. So instead of adding the
deafault argument I've reintroduced the old API and made the new one an
overload.
Stanislav Mekhanoshin [Fri, 10 Jan 2020 20:28:37 +0000 (12:28 -0800)]
Let targets adjust operand latency of bundles
This reverts the AMDGPU DAG mutation implemented in D72487 and gives
a more general way of adjusting BUNDLE operand latency.
It also replaces FixBundleLatencyMutation with adjustSchedDependency
callback in the AMDGPU, fixing not only successor latencies but
predecessors' as well.
Differential Revision: https://reviews.llvm.org/D72535
Vedant Kumar [Thu, 12 Dec 2019 00:19:08 +0000 (16:19 -0800)]
lldbutil: Forward ASan launch info to test inferiors
This allows an unsanitized test process which loads a sanitized DSO (the
motivating example is a Swift runtime dylib) to launch on Darwin.
rdar://
57290132
Differential Revision: https://reviews.llvm.org/D71379
Jonas Devlieghere [Fri, 10 Jan 2020 22:40:42 +0000 (14:40 -0800)]
[lldb/Utils] Remove vim-lldb
The vim-lldb plugin is unmaintained and doesn't work with a recent vim
installation that uses Python 3. This removes it from the LLDB
repository. The code is still available under lldb-tools on GitHub like
we did with for lldb-mi. (https://github.com/lldb-tools/vim-lldb)
Differential revision: https://reviews.llvm.org/D72541
Jonas Devlieghere [Fri, 10 Jan 2020 22:38:19 +0000 (14:38 -0800)]
[lldb/Test] Bypass LLDB_TEST_COMMON_ARGS for certain dotest args (NFC)
Rather than serializing every argument through LLDB_TEST_COMMON_ARGS, we
can pass some of them directly using their CMake variable. Although this
does introduce some code duplication between lit's site config and the
lldb-dotest utility, it also means that it becomes easier to override
these values (WIP).
Vedant Kumar [Thu, 14 Nov 2019 21:11:34 +0000 (13:11 -0800)]
[AArch64] Add isAuthenticated predicate to MCInstDesc
Add a predicate to MCInstDesc that allows tools to determine whether an
instruction authenticates a pointer. This can be used by diagnostic
tools to hint at pointer authentication failures.
Differential Revision: https://reviews.llvm.org/D70329
rdar://
55089604
Jonas Devlieghere [Fri, 10 Jan 2020 21:54:31 +0000 (13:54 -0800)]
[lldb/Scripts] Move android script from underneath Python dir
The scripts root directory already contains python scripts. No need to
keep this one nested under a dedicated Python directory.
Jonas Devlieghere [Fri, 10 Jan 2020 21:53:10 +0000 (13:53 -0800)]
[lldb/Scripts] Remove remote-build.py
With Xcode gone this is no longer relevant.
Jonas Devlieghere [Fri, 10 Jan 2020 21:44:00 +0000 (13:44 -0800)]
[lldb/Scripts] Remove buildbot.py
This file is outdated and still references SVN. Buildbots are configured
through the zorg repository.
Lirong Yuan [Fri, 10 Jan 2020 21:18:55 +0000 (13:18 -0800)]
Summary: update macro for OFF_T so that sanitizer works on AARCH64.
Reviewers: vitalybuka, eugenis, MaskRay
Reviewed By: eugenis, MaskRay
Subscribers: MaskRay, kristof.beyls, #sanitizers, llvm-commits, jkz, scw
Tags: #sanitizers, #llvm
Differential Revision: https://reviews.llvm.org/D72367
Sylvestre Ledru [Fri, 10 Jan 2020 21:24:30 +0000 (22:24 +0100)]
clang-tidy doc: unbreak the CI
Craig Topper [Fri, 10 Jan 2020 21:11:14 +0000 (13:11 -0800)]
[TargetLowering] Use SelectionDAG::getSetCC and remove a repeated call to getSetCCResultType in softenSetCCOperands. NFCI
Sylvestre Ledru [Fri, 10 Jan 2020 17:50:05 +0000 (18:50 +0100)]
clang-tidy doc: Refresh the list of checkers and polish the script
Sylvestre Ledru [Fri, 10 Jan 2020 17:48:03 +0000 (18:48 +0100)]
MakeUniqueCheck.cpp: explicit the fact that there is an autofix for this checker
Reid [Fri, 10 Jan 2020 20:49:43 +0000 (15:49 -0500)]
Implement new AST matcher hasAnyCapture to match on LambdaExpr captures.
Accepts child matchers cxxThisExpr to match on capture of this and also on varDecl.
Raphael Isemann [Fri, 10 Jan 2020 20:33:54 +0000 (21:33 +0100)]
[lldb] Fix TestClangASTContext.TestFunctionTemplateInRecordConstruction in Debug builds
Summary:
In Debug builds we call VerifyDecl in ClangASTContext::CreateFunctionDeclaration which in turn
calls `getAccess` on the created FunctionDecl. As we passed in a RecordDecl as the DeclContext
for the FunctionDecl, we end up hitting the assert in `getAccess` that checks that we never have
a Decl inside a Record without a valid AccessSpecifier. FunctionDecls are never in RecordDecls
(that would be a CXXMethodDecl) so setting a access specifier would not be the correct way to
fix this.
Instead this patch does the same thing that DWARFASTParserClang::ParseSubroutine is doing:
We pass in the FunctionDecl with the TranslationUnit as the DeclContext. That's not ideal but
it is how we currently do it when creating our debug info AST, so the unit test should do
the same.
Reviewers: shafik
Reviewed By: shafik
Subscribers: aprantl, JDevlieghere, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D72359
Raphael Isemann [Fri, 10 Jan 2020 19:16:41 +0000 (20:16 +0100)]
[lldb] Make CompleteTagDeclsScope completion order deterministic
Summary:
We iterate over `m_decls_to_complete` to complete declarations. As
`m_decls_to_complete` is a set the iteration order can be non-deterministic.
The order is currently only non-deterministic when we have
a large set of decls that need to be completed (i.e. more than 32 decls,
as otherwise the SmallPtrSet is just a linear-searched list).
This doesn't really fix any specific bug or has any really observable
change in behavior as the order in which we import should not influence
any semantics. However the order we create decls/types is now always
deterministic which should make debugging easier.
Reviewers: labath, mib, shafik, davide
Reviewed By: shafik, davide
Subscribers: davide, abidh, JDevlieghere, lldb-commits, mgrang
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D72495
Philip Reames [Fri, 10 Jan 2020 19:53:14 +0000 (11:53 -0800)]
[Tests] Precommit tests showing default branch padding on skylake
A follow up patch will change the default for the compiler, but not the assembler, just making sure we have testing for each in place.
Stephen Kelly [Fri, 10 Jan 2020 19:39:57 +0000 (19:39 +0000)]
[ASTMatchers] Make test more clear about what it is verifying
Fangrui Song [Thu, 9 Jan 2020 04:43:57 +0000 (20:43 -0800)]
[Driver][PowerPC] Move powerpcspe logic from cc1 to Driver
Follow-up of D72014. It is more appropriate to use a target
feature instead of a SubTypeArch to express the difference.
Reviewed By: #powerpc, jhibbits
Differential Revision: https://reviews.llvm.org/D72433
Jan Korous [Fri, 10 Jan 2020 19:04:22 +0000 (11:04 -0800)]
[clang] Fix out-of-bounds memory access in ComputeLineNumbers
Differential Revision: https://reviews.llvm.org/D72409
Jonas Devlieghere [Fri, 10 Jan 2020 19:05:55 +0000 (11:05 -0800)]
[CMake] Fix modules build after DWARFLinker reorganization
Create a dedicate module for the DWARFLinker and make it depend on
intrinsics gen.
Sam Clegg [Fri, 20 Dec 2019 01:23:59 +0000 (17:23 -0800)]
[lld][WebAssembly] Add libcall symbols to the link when LTO is being used.
This code is copied almost verbatim from the equivalent change to the
ELF linker:
- https://reviews.llvm.org/D50017
- https://reviews.llvm.org/D50475
The upshot is that libraries containing libcall (such as compiler-rt
and libc) can be compiled with LTO.
Fixes PR41384
Differential Revision: https://reviews.llvm.org/D71738
Craig Topper [Fri, 10 Jan 2020 18:31:25 +0000 (10:31 -0800)]
[TargetLowering][ARM][X86] Change softenSetCCOperands handling of ONE to avoid spurious exceptions for QNANs with strict FP quiet compares
ONE is currently softened to OGT | OLT. But the libcalls for OGT and OLT libcalls will trigger an exception for QNAN. At least for X86 with libgcc. UEQ on the other hand uses UO | OEQ. The UO and OEQ libcalls will not trigger an exception for QNAN.
This patch changes ONE to use the inverse of the UEQ lowering. So we now produce O & UNE. Technically the existing behavior was correct for a signalling ONE, but since I don't know how to generate one of those from clang that seemed like something we can deal with later as we would need to fix other predicates as well. Also removing spurious exceptions seemed better than missing an exception.
There are also problems with quiet OGT/OLT/OLE/OGE, but those are harder to fix.
Differential Revision: https://reviews.llvm.org/D72477
Gabor Marton [Fri, 10 Jan 2020 18:21:47 +0000 (19:21 +0100)]
[analyzer] Move PlacementNewChecker to alpha
Daniel Sanders [Thu, 9 Jan 2020 18:32:32 +0000 (10:32 -0800)]
Update the attribution policy to use the 'Author' property of a git commit
Summary:
The older method of adding 'Patch by John Doe' is documented in the
`Attribution of Changes` section to support correct attribution of commits
that pre-date the adoption of git.
Reviewers: hfinkel, aaron.ballman, mehdi_amini
Subscribers: llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D72468
Jonas Devlieghere [Fri, 10 Jan 2020 18:21:15 +0000 (10:21 -0800)]
[lldb/Lua] Support loading Lua modules
Implements the command script import command for Lua.
Differential revision: https://reviews.llvm.org/D71825
Raphael Isemann [Fri, 10 Jan 2020 18:17:18 +0000 (19:17 +0100)]
[lldb] Remove FieldDecl stealing hack by rerouting indirect imports to the original AST
Summary:
This is a port of D67803 that was about preventing indirect importing to our scratch context when evaluating expressions.
D67803 already has a pretty long explanation of how this works, but the idea is that instead
of importing declarations indirectly over the expression AST (i.e., Debug info AST -> Expression AST -> scratch AST)
we instead directly import the declaration from the debug info AST to the scratch AST.
The difference from D67803 is that here we have to do this in the ASTImporterDelegate (which is our ASTImporter
subclass we use in LLDB). It has the same information as the ExternalASTMerger in D67803 as it can access the
ClangASTImporter (which also keeps track of where Decls originally came from).
With this patch we can also delete the FieldDecl stealing hack in the ClangASTSource (this was only necessary as the
indirect imports caused the creation of duplicate Record declarations but we needed the fields in the Record decl
we originally found in the scratch ASTContext).
This also fixes the current gmodules failures where we fail to find std::vector fields after an indirect import
over the expression AST (where it seems even our FieldDecl stealing hack can't save us from).
Reviewers: shafik, aprantl
Reviewed By: shafik
Subscribers: JDevlieghere, lldb-commits, mib, labath, friss
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D72507
Craig Topper [Fri, 10 Jan 2020 18:13:45 +0000 (10:13 -0800)]
[LegalizeVectorOps] Improve handling of multi-result operations.
This system wasn't very well designed for multi-result nodes. As
a consequence they weren't consistently registered in the
LegalizedNodes map leading to nodes being revisited for different
results.
I've removed the "Result" variable from the main LegalizeOp method
and used a SDNode* instead. The result number from the incoming
Op SDValue is only used for deciding which result to return to the
caller. When LegalizeOp is called it should always register a
legalized result for all of its results. Future calls for any other
result should be pulled for the LegalizedNodes map.
Legal nodes will now register all of their results in the map
instead of just the one we were called for.
The Expand and Promote handling to use a vector of results similar
to LegalizeDAG. Each of the new results is then re-legalized and
logged in the LegalizedNodes map for all of the Results for the
node being legalized. None of the handles register their own
results now. And none call ReplaceAllUsesOfValueWith now.
Custom handling now always passes result number 0 to LowerOperation.
This matches what LegalizeDAG does. Since the introduction of
STRICT nodes, I've encountered several issues with X86's custom
handling being called with an SDValue pointing at the chain and
our custom handlers using that to get a VT instead of result 0.
This should prevent us from having any more of those issues. On
return we will update the LegalizedNodes map for all results so
we shouldn't call the custom handler again for each result number.
I want to push SDNode* further into the Expand and Promote
handlers, but I've left that for a follow to keep this patch size
down. I've created a dummy SDValue(Node, 0) to keep the handlers
working.
Differential Revision: https://reviews.llvm.org/D72224
Fangrui Song [Thu, 9 Jan 2020 19:59:28 +0000 (11:59 -0800)]
[ELF] Make TargetInfo::writeIgotPlt a no-op
RELA targets don't read initial .got.plt entries.
REL targets (ARM, x86-32) write the address of the IFUNC resolver to the
entry (`write32le(buf, s.getVA())`).
The default writeIgotPlt() is not meaningful. Make it a no-op. AArch64
and x86-64 will have 0 as initial .got.plt entries associated with
IFUNC.
Reviewed By: peter.smith
Differential Revision: https://reviews.llvm.org/D72474
Fangrui Song [Sun, 5 Jan 2020 00:58:11 +0000 (16:58 -0800)]
[Driver][CodeGen] Add -fpatchable-function-entry=N[,0]
In the backend, this feature is implemented with the function attribute
"patchable-function-entry". Both the attribute and XRay use
TargetOpcode::PATCHABLE_FUNCTION_ENTER, so the two features are
incompatible.
Reviewed By: ostannard, MaskRay
Differential Revision: https://reviews.llvm.org/D72222
Fangrui Song [Sat, 4 Jan 2020 23:39:19 +0000 (15:39 -0800)]
Support function attribute patchable_function_entry
This feature is generic. Make it applicable for AArch64 and X86 because
the backend has only implemented NOP insertion for AArch64 and X86.
Reviewed By: nickdesaulniers, aaron.ballman
Differential Revision: https://reviews.llvm.org/D72221
Fangrui Song [Sun, 5 Jan 2020 03:52:36 +0000 (19:52 -0800)]
[X86] Support function attribute "patchable-function-entry"
For x86-64, we diverge from GCC -fpatchable-function-entry in that we
emit multi-byte NOPs.
Differential Revision: https://reviews.llvm.org/D72220
Fangrui Song [Fri, 3 Jan 2020 08:35:47 +0000 (00:35 -0800)]
[AArch64] Add function attribute "patchable-function-entry" to add NOPs at function entry
The Linux kernel uses -fpatchable-function-entry to implement DYNAMIC_FTRACE_WITH_REGS
for arm64 and parisc. GCC 8 implemented
-fpatchable-function-entry, which can be seen as a generalized form of
-mnop-mcount. The N,M form (function entry points before the Mth NOP) is
currently only used by parisc.
This patch adds N,0 support to AArch64 codegen. N is represented as the
function attribute "patchable-function-entry". We will use a different
function attribute for M, if we decide to implement it.
The patch reuses the existing patchable-function pass, and
TargetOpcode::PATCHABLE_FUNCTION_ENTER which is currently used by XRay.
When the integrated assembler is used, __patchable_function_entries will
be created for each text section with the SHF_LINK_ORDER flag to prevent
--gc-sections (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93197) and
COMDAT (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93195) issues.
Retrospectively, __patchable_function_entries should use a PC-relative
relocation type to avoid the SHF_WRITE flag and dynamic relocations.
"patchable-function-entry"'s interaction with Branch Target
Identification is still unclear (see
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92424 for GCC discussions).
Reviewed By: peter.smith
Differential Revision: https://reviews.llvm.org/D72215
Simon Pilgrim [Fri, 10 Jan 2020 17:40:34 +0000 (17:40 +0000)]
Fix "pointer is null" static analyzer warning. NFCI.
Use castAs<> instead of getAs<> since the pointer is dereferenced immediately below and castAs will perform the null assertion for us.
jasonliu [Fri, 10 Jan 2020 16:15:46 +0000 (16:15 +0000)]
[AIX] Allow vararg calls when all arguments reside in registers
Summary:
This patch pushes the AIX vararg unimplemented error diagnostic later
and allows vararg calls so long as all the arguments can be passed in register.
This patch extends the AIX calling convention implementation to initialize
GPR(s) for vararg float arguments. On AIX, both GPR(s) and FPR are allocated
for floating point arguments. The GPR(s) are only initialized for vararg calls,
otherwise the callee is expected to retrieve the float argument in the FPR.
f64 in AIX PPC32 requires special handling in order to allocated and
initialize 2 GPRs. This is performed with bitcast, SRL, truncation to
initialize one GPR for the MSW and bitcast, truncations to initialize
the other GPR for the LSW.
A future patch will follow to add support for arguments passed on the stack.
Patch provided by: cebowleratibm
Reviewers: sfertile, ZarkoCA, hubert.reinterpretcast
Differential Revision: https://reviews.llvm.org/D71013
Hiroshi Inoue [Fri, 10 Jan 2020 16:59:59 +0000 (01:59 +0900)]
[examples] Add missing dependency in llvm examples
To fix build failure with BUILD_SHARED_LIBS=ON
Simon Pilgrim [Fri, 10 Jan 2020 17:18:19 +0000 (17:18 +0000)]
Fix "pointer is null" static analyzer warning. NFCI.
Use castAs<> instead of getAs<> since the pointer is dereferenced immediately below and castAs will perform the null assertion for us.
Simon Pilgrim [Fri, 10 Jan 2020 17:10:35 +0000 (17:10 +0000)]
Fix "pointer is null" static analyzer warning. NFCI.
Use cast<> instead of dyn_cast<> since we know that the pointer should be valid (and is dereferenced immediately).
Simon Pilgrim [Fri, 10 Jan 2020 14:55:00 +0000 (14:55 +0000)]
[X86][AVX] lowerShuffleAsLanePermuteAndShuffle - consistently normalize multi-input shuffle elements
We only use lowerShuffleAsLanePermuteAndShuffle for unary shuffles at the moment, but we should consistently handle lane index calculations for multiple inputs in both the AVX1 and AVX2 paths.
Minor (almost NFC) tidyup as I'm hoping to use lowerShuffleAsLanePermuteAndShuffle for binary shuffles soon.
LLVM GN Syncbot [Fri, 10 Jan 2020 17:10:25 +0000 (17:10 +0000)]
[gn build] Port
5e7beb0a414
Sam McCall [Fri, 10 Jan 2020 09:40:30 +0000 (10:40 +0100)]
[clangd] Fix targetDecl() on certain usage of ObjC properties.
Summary:
In particular there's a common chain:
OpaqueValueExpr->PseudoObjectExpr->ObjCPropertyRefExpr->ObjCPropertyDecl
and we weren't handling the first two edges
Reviewers: dgoldman, kadircet
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, jfb, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D72494
Yonghong Song [Wed, 18 Dec 2019 00:24:23 +0000 (16:24 -0800)]
[BPF] extend BTF_KIND_FUNC to cover global, static and extern funcs
Previously extern function is added as BTF_KIND_VAR. This does not work
well with existing BTF infrastructure as function expected to use
BTF_KIND_FUNC and BTF_KIND_FUNC_PROTO.
This patch added extern function to BTF_KIND_FUNC. The two bits 0:1
of btf_type.info are used to indicate what kind of function it is:
0: static
1: global
2: extern
Differential Revision: https://reviews.llvm.org/D71638
Sanjay Patel [Fri, 10 Jan 2020 16:32:55 +0000 (11:32 -0500)]
[InstCombine] add tests for fsub; NFC
Conflicting/missing canonicalizations are visible in PR44509:
https://bugs.llvm.org/show_bug.cgi?id=44509
Denis Khalikov [Fri, 10 Jan 2020 16:56:10 +0000 (11:56 -0500)]
[mlir][spirv] Fix typos related to (de)serialization.
Fix typos related to (de)serialization of spv.selection.
Differential Revision: https://reviews.llvm.org/D72503
Gabor Marton [Fri, 10 Jan 2020 15:51:14 +0000 (16:51 +0100)]
[analyzer] Add PlacementNewChecker
Summary:
This checker verifies if default placement new is provided with pointers
to sufficient storage capacity.
Noncompliant Code Example:
#include <new>
void f() {
short s;
long *lp = ::new (&s) long;
}
Based on SEI CERT rule MEM54-CPP
https://wiki.sei.cmu.edu/confluence/display/cplusplus/MEM54-CPP.+Provide+placement+new+with+properly+aligned+pointe
This patch does not implement checking of the alignment.
Reviewers: NoQ, xazax.hun
Subscribers: mgorny, whisperity, xazax.hun, baloghadamsoftware, szepet,
rnkovacs, a.sidorin, mikhail.ramalho, donat
Tags: #clang
Differential Revision: https://reviews.llvm.org/D71612
Adrian Prantl [Wed, 8 Jan 2020 22:18:47 +0000 (14:18 -0800)]
Add missing nullptr checks.
GetPersistentExpressionStateForLanguage() can return a nullptr if it
cannot construct a typesystem. This patch adds missing nullptr checks
at all uses.
Inspired by rdar://problem/
58317195
Differential Revision: https://reviews.llvm.org/D72413
Andrew Paverd [Fri, 10 Jan 2020 11:08:18 +0000 (11:08 +0000)]
Add support for __declspec(guard(nocf))
Summary:
Avoid using the `nocf_check` attribute with Control Flow Guard. Instead, use a
new `"guard_nocf"` function attribute to indicate that checks should not be
added on indirect calls within that function. Add support for
`__declspec(guard(nocf))` following the same syntax as MSVC.
Reviewers: rnk, dmajor, pcc, hans, aaron.ballman
Reviewed By: aaron.ballman
Subscribers: aaron.ballman, tomrittervg, hiraditya, cfe-commits, llvm-commits
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D72167
Nemanja Ivanovic [Fri, 10 Jan 2020 15:55:19 +0000 (09:55 -0600)]
[PowerPC] Handle constant zero bits in BitPermutationSelector
We currently crash when analyzing an AssertZExt node that has some bits that are
constant zeros (i.e. as a result of an and with a constant).
This issue was reported in https://bugs.llvm.org/show_bug.cgi?id=41088 and this
patch fixes that.
Differential revision: https://reviews.llvm.org/D72038
Jonas Toth [Fri, 10 Jan 2020 15:10:55 +0000 (16:10 +0100)]
[NFC] format unittest for ExprMutAnalyzer
This formatting is a preparation for review in
https://reviews.llvm.org/D54943 to separate pure formatting changes from
actual testing changes.
James Henderson [Fri, 3 Jan 2020 15:29:21 +0000 (15:29 +0000)]
[DebugInfo][NFC] Remove unused variable/fix variable naming
Reviewed by: MaskRay
Differential Revision: https://reviews.llvm.org/D72159
James Henderson [Thu, 9 Jan 2020 12:20:18 +0000 (12:20 +0000)]
[DebugInfo] Improve error message text
Unlike most of our errors in the debug line parser, the "no end of
sequence" message was missing any reference to which line table it
refererred to. This change adds the offset to this message.
Reviewed by: dblaikie
Differential Revision: https://reviews.llvm.org/D72443
Alexey Bataev [Thu, 9 Jan 2020 19:54:44 +0000 (14:54 -0500)]
[LIBOMPTARGET]Ignore empty target descriptors.
Summary:
If the dynamically loaded module has been compiled with -fopenmp-targets
and has no target regions, it has empty target descriptor. It leads to a
crash at the runtime if another module has at least one target region
and at least one entry in its descriptor. The runtime library is unable
to load the empty binary descriptor and terminates the execution.
Caused by a clang-offload-wrapper.
Reviewers: grokos, jdoerfert
Subscribers: caomhin, kkwli0, openmp-commits
Tags: #openmp
Differential Revision: https://reviews.llvm.org/D72472
Matt Arsenault [Fri, 10 Jan 2020 14:06:47 +0000 (09:06 -0500)]
AMDGPU/GlobalISel: Clamp G_ZEXT source sizes
Also clamps G_SEXT/G_ANYEXT, but the implementation is more limited so
fewer cases actually work.
Tatyana Krasnukha [Thu, 12 Dec 2019 12:01:25 +0000 (15:01 +0300)]
[lldb][tests] Make it possible to expect failure for a whole category
There already are decorators and "--excluded" option to mark test-cases/files
as expected to fail. However, when a new test file is added and it which relates
to a feature that a target doesn't support, this requires either adding decorators
to that file or modifying the file provided as "--excluded" option value.
The purpose of this patch is to avoid any modifications in such cases.
E.g. if a target doesn't support "watchpoints" and passes "--xfail-category watchpoint"
to dotest, a testing job will not fail after a new watchpoint-related test file is added.
Differential Revision: https://reviews.llvm.org/D71906
Tatyana Krasnukha [Thu, 12 Dec 2019 11:17:14 +0000 (14:17 +0300)]
[lldb][tests][NFC] Unify variable naming convention
Ulrich Weigand [Fri, 10 Jan 2020 14:31:10 +0000 (15:31 +0100)]
[FPEnv] Invert sense of MIFlag::FPExcept flag
In D71841 we inverted the sense of the SDNode-level flag to ensure all nodes
default to potentially raising FP exceptions unless otherwise specified --
i.e. if we forget to propagate the flag somewhere, the effect is now only
lost performance, not incorrect code.
However, the related flag at the MI level still defaults to nodes not raising
FP exceptions unless otherwise specified. To be fully on the (conservatively)
safe side, we should invert that flag as well.
This patch does so by replacing MIFlag::FPExcept with MIFlag::NoFPExcept.
(Note that this does also introduce an incompatible change in the MIR format.)
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D72466
Sam Parker [Fri, 10 Jan 2020 13:08:30 +0000 (13:08 +0000)]
[ARM][MVE] Tail predicate VMAX,VMAXA,VMIN,VMINA
Add the MVE min and max instructions to our tail predication
whitelist.
Differential Revision: https://reviews.llvm.org/D72502
Jan Kratochvil [Fri, 10 Jan 2020 14:14:38 +0000 (15:14 +0100)]
RangeDataVector: Support custom sorting for D63540
As suggested by @labath extended RangeDataVector so that user can provide
custom sorting of the Entry's `data' field for D63540.
https://reviews.llvm.org/D63540
RangeData functions were used just by RangeDataVector (=after I removed them
LLDB still builds fine) which no longer uses them so I removed them.
Differential revision: https://reviews.llvm.org/D72460
Sjoerd Meijer [Fri, 10 Jan 2020 14:11:52 +0000 (14:11 +0000)]
ARMLowOverheadLoops: a few more dbg msgs to better trace rejected TP loops. NFC.
Benjamin Kramer [Fri, 10 Jan 2020 13:58:07 +0000 (14:58 +0100)]
Sprinkle some constexpr on default ctors so the compiler can diagnose unused instances. NFCI.
Diogo Sampaio [Fri, 10 Jan 2020 13:32:02 +0000 (13:32 +0000)]
Reverting, broke some bots. Need further investigation.
Summary: This reverts commit
8c12769f3046029e2a9b4e48e1645b1a77d28650.
Reviewers:
Subscribers:
Tatyana Krasnukha [Wed, 11 Dec 2019 16:33:19 +0000 (19:33 +0300)]
[lldb][tests] Cleanup '.categories'
Ulrich Weigand [Fri, 10 Jan 2020 13:29:24 +0000 (14:29 +0100)]
[FPEnv] Generate constrained FP comparisons from clang
Update the IRBuilder to generate constrained FP comparisons in
CreateFCmp when IsFPConstrained is true, similar to the other
places in the IRBuilder.
Also, add a new CreateFCmpS to emit signaling FP comparisons,
and use it in clang where comparisons are supposed to be signaling
(currently, only when emitting code for the <, <=, >, >= operators).
Note that there is currently no way to add fast-math flags to a
constrained FP comparison, since this is implemented as an intrinsic
call that returns a boolean type, and FMF are only allowed for calls
returning a floating-point type. However, given the discussion around
https://bugs.llvm.org/show_bug.cgi?id=42179, it seems that FCmp itself
really shouldn't have any FMF either, so this is probably OK.
Reviewed by: craig.topper
Differential Revision: https://reviews.llvm.org/D71467
Tatyana Krasnukha [Thu, 9 Jan 2020 15:38:31 +0000 (18:38 +0300)]
[lldb][test] NFC, re-use _getTestPath() function
Tatyana Krasnukha [Thu, 9 Jan 2020 13:55:45 +0000 (16:55 +0300)]
[lldb][tests] Take into account all parent's categories when traverse folders upwards
This is needed to not re-write parent's categories by categories of a nested folder,
e.g. commands/expression/completion specify "cmdline" category, however it still belongs
to parent's "expression" category.
The sentinel ".categories" in the test-suite root directory is no longer needed.
Differential Revision: https://reviews.llvm.org/D71905
Andrew Ng [Sat, 16 Mar 2019 19:36:29 +0000 (19:36 +0000)]
[Support] ThreadPoolExecutor fixes for Windows/MinGW
Changed ThreadPoolExecutor to no longer use detached threads and instead
to join threads on destruction. This is to prevent intermittent crashing
on Windows when doing a normal full exit, e.g. via exit().
Changed ThreadPoolExecutor to be a ManagedStatic so that it can be
stopped on llvm_shutdown(). Without this, it would only be stopped in
the destructor when doing a full exit. This is required to avoid
intermittent crashing on Windows due to a race condition between the
ThreadPoolExecutor starting up threads and the process doing a fast
exit, e.g. via _exit().
The Windows crashes appear to only occur with the MSVC static runtimes
and are more frequent with the debug static runtime.
These changes also prevent intermittent deadlocks on exit with the MinGW
runtime.
Differential Revision: https://reviews.llvm.org/D70447
Pavel Labath [Fri, 10 Jan 2020 12:38:03 +0000 (13:38 +0100)]
[lldb] Surpress "bitfield too small" gcc warning
Gcc produces this (technically correct) warning when storing an
explicitly-sized enum in a bitfield. Surpress that by changing the type
of the bitfield to an integer. The same approach is used elsewhere in
llvm (e.g.
56b5eab12).
Ilya Biryukov [Fri, 10 Jan 2020 10:50:27 +0000 (11:50 +0100)]
[CodeComplete] Suggest 'return nullptr' in functions returning pointers
Reviewers: kadircet
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D72497
Pavel Labath [Sat, 21 Dec 2019 14:29:57 +0000 (15:29 +0100)]
[lldb/DWARF] Don't automatically search dwo unit attributes
This patch removes the code (deep inside DWARFDebugInfoEntry) which
automagically returned the attributes of the dwo unit DIE when asking
for the attributes of the skeleton unit. This is fairly hacky, and not
consistent with how llvm DWARF parser operates.
Instead, I change the code the explicitly request (via
GetNonSkeletonUnit) the right unit to search (there were just two places
that needed this). If it turns out we need this more often, we can
create a utility function (external to DWARFUnit) for doing this.
Pavel Labath [Fri, 10 Jan 2020 12:01:34 +0000 (13:01 +0100)]
[lldb/lua] Make convenience_variables.test compatible with lua-5.1
Diogo Sampaio [Wed, 8 Jan 2020 10:26:28 +0000 (10:26 +0000)]
[ARM][Thumb2] Fix ADD/SUB invalid writes to SP
Summary:
This patch fixes pr23772 [ARM] r226200 can emit illegal thumb2 instruction: "sub sp, r12, #80".
The violation was that SUB and ADD (reg, immediate) instructions can only write to SP if the source register is also SP. So the above instructions was unpredictable.
To enforce that the instruction t2(ADD|SUB)ri does not write to SP we now enforce the destination register to be rGPR (That exclude PC and SP).
Different than the ARM specification, that defines one instruction that can read from SP, and one that can't, here we inserted one that can't write to SP, and other that can only write to SP as to reuse most of the hard-coded size optimizations.
When performing this change, it uncovered that emitting Thumb2 Reg plus Immediate could not emit all variants of ADD SP, SP #imm instructions before so it was refactored to be able to. (see test/CodeGen/Thumb2/mve-stacksplot.mir where we use a subw sp, sp, Imm12 variant )
It also uncovered a disassembly issue of adr.w instructions, that were only written as SUBW instructions (see llvm/test/MC/Disassembler/ARM/thumb2.txt).
Reviewers: eli.friedman, dmgreen, carwil, olista01, efriedma
Reviewed By: efriedma
Subscribers: john.brawn, efriedma, ostannard, kristof.beyls, hiraditya, dmgreen, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D70680
Simon Tatham [Fri, 10 Jan 2020 11:23:24 +0000 (11:23 +0000)]
[ARM,MVE] Make `vqrshrun` generate the right instruction.
Summary:
A copy-paste error in `arm_mve.td` meant that the MVE `vqrshrun`
intrinsic family was generating the `vqshrun` machine instruction,
because in the IR intrinsic call, the rounding flag argument was set
to 0 rather than 1.
Reviewers: dmgreen, MarkMurrayARM, miyuki, ostannard
Reviewed By: dmgreen
Subscribers: kristof.beyls, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D72496
Simon Pilgrim [Fri, 10 Jan 2020 11:00:06 +0000 (11:00 +0000)]
Fix "pointer is null" static analyzer warnings. NFCI.
Assert that the pointers are non-null before dereferencing them.
Jaroslav Sevcik [Fri, 10 Jan 2020 10:44:14 +0000 (11:44 +0100)]
Data formatters: Look through array element typedefs
Summary:
Motivation: When formatting an array of typedefed chars, we would like to display the array as a string.
The string formatter currently does not trigger because the formatter lookup does not resolve typedefs for array elements (this behavior is inconsistent with pointers, for those we do look through pointee typedefs). This patch tries to make the array formatter lookup somewhat consistent with the pointer formatter lookup.
Reviewers: teemperor, clayborg
Reviewed By: teemperor, clayborg
Subscribers: clayborg, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D72133
Simon Pilgrim [Fri, 10 Jan 2020 10:32:20 +0000 (10:32 +0000)]
Fix Wdocumentation warning. NFCI.
Simon Pilgrim [Fri, 10 Jan 2020 10:29:47 +0000 (10:29 +0000)]
Fix Wdocumentation warning. NFCI.
Simon Pilgrim [Fri, 10 Jan 2020 10:28:54 +0000 (10:28 +0000)]
[X86][AVX] Add tests for v8f32/v8i32
089abcde and
0189abcd shuffles
Mentioned in D66004
Simon Pilgrim [Thu, 9 Jan 2020 14:18:58 +0000 (14:18 +0000)]
Don't use dyn_cast_or_null if we know the pointer is nonnull.
Fix clang static analyzer null dereference warning by using dyn_cast instead.
Benjamin Kramer [Fri, 10 Jan 2020 10:21:27 +0000 (11:21 +0100)]
[LV] Silence unused variable warning in Release builds. NFC.
Peng Guo [Fri, 10 Jan 2020 10:18:11 +0000 (11:18 +0100)]
[MIR] Fix cyclic dependency of MIR formatter
Summary:
Move MIR formatter pointer from TargetMachine to TargetInstrInfo to
avoid cyclic dependency between target & codegen.
Reviewers: dsanders, bkramer, arsenm
Subscribers: wdng, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D72485
Serge Guelton [Fri, 10 Jan 2020 09:59:49 +0000 (04:59 -0500)]
XFAIL load_extension.ll test on macOS only
Other setup have been fixed by
346de9b67228f42eb9b55fa3b426b5dedfdb1d40
Sergej Jaskiewicz [Fri, 10 Jan 2020 09:58:39 +0000 (12:58 +0300)]
[CMake] Support running libc++abi tests in CrossWinToARMLinux cache file
Summary:
Now that D71894 has landed, we're able to run libc++abi tests remotely.
For that we can use the same CMake command as before. The tests can be run using `ninja check-cxxabi`.
Reviewers: andreil99, vvereschaka, aorlov
Reviewed By: vvereschaka, aorlov
Subscribers: mgorny, kristof.beyls, ldionne, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D72459
Sergej Jaskiewicz [Fri, 10 Jan 2020 09:54:49 +0000 (12:54 +0300)]
[libcxx] Force-cache LIBCXX_CXX_ABI_LIBRARY_PATH
Summary:
The `LIBCXX_CXX_ABI_LIBRARY_PATH` CMake variable is cached once in
libcxx/cmake/Modules/HandleLibCXXABI.cmake in the `setup_abi_lib` macro,
and then cached again in libcxx/test/CMakeLists.txt. There, if it is
not set to a value, it is by default set to `LIBCXX_LIBRARY_DIR`.
However, this new value is not actually cached, because the old (empty)
value has been already cached. Use the `FORCE` CMake flag so that it
is saved to the cache.
This should not break anything, because the code changed here previously
had no effect, when it should have.
Reviewers: jroelofs, bcraig, ldionne, EricWF, mclow.lists, vvereschaka, eastig
Reviewed By: vvereschaka
Subscribers: mgorny, christof, dexonsmith, libcxx-commits
Tags: #libc
Differential Revision: https://reviews.llvm.org/D69169
Sjoerd Meijer [Fri, 10 Jan 2020 09:41:41 +0000 (09:41 +0000)]
Follow up of
67bf9a6154d4b82c, minor fix in test case, removed duplicate option
Sjoerd Meijer [Fri, 10 Jan 2020 09:30:02 +0000 (09:30 +0000)]
[SVEV] Recognise hardware-loop intrinsic loop.decrement.reg
Teach SCEV about the @loop.decrement.reg intrinsic, which has exactly the same
semantics as a sub expression. This allows us to query hardware-loops, which
contain this @loop.decrement.reg intrinsic, so that we can calculate iteration
counts, exit values, etc. of hardwareloops.
This "int_loop_decrement_reg" intrinsic is defined as "IntrNoDuplicate". Thus,
while hardware-loops and tripcounts now become analysable by SCEV, this
prevents the usual loop transformations from applying transformations on
hardware-loops, which is what we want at this point, for which I have added
test cases for loopunrolling and IndVarSimplify and LFTR.
Differential Revision: https://reviews.llvm.org/D71563
serge-sans-paille [Fri, 10 Jan 2020 09:05:30 +0000 (10:05 +0100)]
Fix several issues with compiler extensions
- Update documentation now that the move to monorepo has been made
- Do not tie compiler extension testing to LLVM_BUILD_EXAMPLES
- No need to specify LLVM libraries for plugins
- Add NO_MODULE option to match Polly specific requirements (i.e. building the
module *and* linking it statically)
- Issue a warning when building the compiler extension with
LLVM_BYE_LINK_INTO_TOOLS=ON, as it modifies the behavior of clang, which only
makes sense for testing purpose.
Still mark llvm/test/Feature/load_extension.ll as XFAIL because of a
ManagedStatic dependency that's going to be fixed in a seperate commit.
Differential Revision: https://reviews.llvm.org/D72327
Kadir Cetinkaya [Thu, 9 Jan 2020 16:56:30 +0000 (17:56 +0100)]
[clangd] Fix markdown rendering in VSCode
Summary:
Eventough it is OK to have a new line without any preceding spaces in
some markdown specifications, VSCode requires two spaces before a new line to
break a line inside a paragraph.
Reviewers: sammccall, ilya-biryukov
Subscribers: MaskRay, jkorous, arphaman, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D72462
Kadir Cetinkaya [Tue, 7 Jan 2020 14:15:00 +0000 (15:15 +0100)]
[clangd] Improve type printing in hover
Summary:
Do not include tag keywords when printing types for symbol names, as it
will come from SymbolKind.
Also suppress them while printing definitions to prevent them occuring in
template arguments.
Make use of `getAsString`, instead of `print` in all places to have a consistent
style across the file.
Reviewers: sammccall
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D72450
Qiu Chaofan [Fri, 10 Jan 2020 08:43:43 +0000 (16:43 +0800)]
[NFC] [PowerPC] Add isPredicable for basic instrs
PowerPC uses a dedicated method to check if the machine instr is
predicable by opcode. However, there's a bit `isPredicable` in instr
definition. This patch removes the method and set the bit only to
opcodes referenced in it.
Differential Revision: https://reviews.llvm.org/D71921
serge-sans-paille [Thu, 5 Dec 2019 16:08:10 +0000 (17:08 +0100)]
Allow system header to provide their own implementation of some builtin
If a system header provides an (inline) implementation of some of their
function, clang still matches on the function name and generate the appropriate
llvm builtin, e.g. memcpy. This behavior is in line with glibc recommendation «
users may not provide their own version of symbols » but doesn't account for the
fact that glibc itself can provide inline version of some functions.
It is the case for the memcpy function when -D_FORTIFY_SOURCE=1 is on. In that
case an inline version of memcpy calls __memcpy_chk, a function that performs
extra runtime checks. Clang currently ignores the inline version and thus
provides no runtime check.
This code fixes the issue by detecting functions whose name is a builtin name
but also have an inline implementation.
Differential Revision: https://reviews.llvm.org/D71082