Philip Reames [Fri, 10 Jan 2020 23:19:09 +0000 (15:19 -0800)]
[X86AsmBackend] Be consistent about placing definitions out of line [NFC]
Simon Pilgrim [Sat, 11 Jan 2020 16:42:41 +0000 (16:42 +0000)]
GlobalModuleIndex - Fix use-after-move clang static analyzer warning.
Shadow variable names meant we were referencing the Buffer input argument, not the GlobalModuleIndex member that its std::move()'d it.
Simon Pilgrim [Sat, 11 Jan 2020 16:01:46 +0000 (16:01 +0000)]
Fix "pointer is null" static analyzer warnings. NFCI.
Use castAs<> instead of getAs<> since the pointers are dereferenced immediately and castAs will perform the null assertion for us.
Simon Pilgrim [Sat, 11 Jan 2020 16:00:17 +0000 (16:00 +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 [Sat, 11 Jan 2020 15:41:31 +0000 (15:41 +0000)]
Fix "pointer is null" static analyzer warning. NFCI.
Use castAs<> instead of getAs<> since the pointer is dereferenced immediately within mangleCallingConvention and castAs will perform the null assertion for us.
Simon Pilgrim [Sat, 11 Jan 2020 15:33:25 +0000 (15:33 +0000)]
Fix "pointer is null" static analyzer warnings. NFCI.
Use castAs<> instead of getAs<> since the pointer is dereferenced immediately below and castAs will perform the null assertion for us.
Simon Pilgrim [Sat, 11 Jan 2020 14:47:17 +0000 (14:47 +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 [Sat, 11 Jan 2020 14:44:25 +0000 (14:44 +0000)]
Fix uninitialized value clang static analyzer warning. NFC.
Benjamin Kramer [Sat, 11 Jan 2020 15:50:55 +0000 (16:50 +0100)]
Remove copy ctors identical to the default one. NFC.
Those do nothing but make the type no longer trivial to the compiler.
Simon Pilgrim [Sat, 11 Jan 2020 14:36:46 +0000 (14:36 +0000)]
moveOperands - assert Src/Dst MachineOperands are non-null.
Fixes static-analyzer warnings.
Simon Pilgrim [Sat, 11 Jan 2020 12:57:21 +0000 (12:57 +0000)]
[X86] Fix outdated comment
The generic saturated math opcodes are no longer widened inside X86TargetLowering
Mark de Wever [Sat, 11 Jan 2020 09:16:40 +0000 (10:16 +0100)]
[Sema] Improve -Wrange-loop-analysis warnings.
No longer generate a diagnostic when a small trivially copyable type is
used without a reference. Before the test looked for a POD type and had no
size restriction. Since the range-based for loop is only available in
C++11 and POD types are trivially copyable in C++11 it's not required to
test for a POD type.
Since copying a large object will be expensive its size has been
restricted. 64 bytes is a common size of a cache line and if the object is
aligned the copy will be cheap. No performance impact testing has been
done.
Differential Revision: https://reviews.llvm.org/D72212
Simon Pilgrim [Sat, 11 Jan 2020 12:35:33 +0000 (12:35 +0000)]
Fix copy+paste typo in shuffle test name
Simon Pilgrim [Sat, 11 Jan 2020 12:28:27 +0000 (12:28 +0000)]
[X86][AVX] Add lowerShuffleAsLanePermuteAndSHUFP lowering
Add initial support for lowering v4f64 shuffles to SHUFPD(VPERM2F128(V1, V2), VPERM2F128(V1, V2)), eventually this could be used for v8f32 (and maybe v8f64/v16f32) but I'm being conservative for the initial implementation as only v4f64 can always succeed.
This currently is only called from lowerShuffleAsLanePermuteAndShuffle so only gets used for unary shuffles, and we limit this to cases where we use upper elements as otherwise concating 2 xmm shuffles is probably the better case.
Helps with poor shuffles mentioned in D66004.
Florian Hahn [Fri, 10 Jan 2020 18:08:56 +0000 (18:08 +0000)]
[X86] Add more complex tests for vector masks used with AND/OR/XOR.
Additional test cases for D72524.
Nuno Lopes [Sat, 11 Jan 2020 11:57:29 +0000 (11:57 +0000)]
DSE: fix bug where we would only check libcalls for name rather than whole decl
Nikita Popov [Thu, 9 Jan 2020 21:17:37 +0000 (22:17 +0100)]
[LoopRotate] Add tests for rotate with switch; NFC
For D72420.
Nikita Popov [Fri, 10 Jan 2020 17:20:32 +0000 (18:20 +0100)]
[LoopSimplify] Regenerate test checks; NFC
For D72519.
Nikita Popov [Wed, 1 Jan 2020 10:11:05 +0000 (11:11 +0100)]
[InstCombine] Preserve nuw on sub of geps (PR44419)
Fix https://bugs.llvm.org/show_bug.cgi?id=44419 by preserving the
nuw on sub of geps. We only do this if the offset has a multiplication
as the final operation, as we can't be sure the operations is nuw
in the other cases without more thorough analysis.
Differential Revision: https://reviews.llvm.org/D72048
Craig Topper [Sat, 11 Jan 2020 08:27:06 +0000 (00:27 -0800)]
[X86] Remove dead code from X86DAGToDAGISel::Select that is no longer needed now that we don't mutate strict fp nodes. NFC
Christian Sigg [Sat, 11 Jan 2020 07:47:41 +0000 (08:47 +0100)]
Add test for GDB pretty printers.
Reviewers: dblaikie, aprantl, davide, JDevlieghere
Reviewed By: aprantl
Subscribers: jmorse, aprantl, merge_guards_bot, mgorny, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D72321
Craig Topper [Sat, 11 Jan 2020 07:28:31 +0000 (23:28 -0800)]
[X86] Simplify code by removing an unreachable condition. NFCI
For X87<->SSE conversions, the SSE type is always smaller than
the X87 type. So we can always use the smallest type for the
memory type.
Craig Topper [Sat, 11 Jan 2020 05:14:47 +0000 (21:14 -0800)]
[X86] Preserve fpexcept property when turning strict_fp_extend and strict_fp_round into stack operations.
We use the stack for X87 fp_round and for moving from SSE f32/f64 to
X87 f64/f80. Or from X87 f64/f80 to SSE f32/f64.
Note for the SSE<->X87 conversions the conversion always happens in the
X87 domain. The load/store ops in the X87 instructions are able
to signal exceptions.
Fangrui Song [Sat, 11 Jan 2020 07:31:49 +0000 (23:31 -0800)]
[X86][Disassembler] Simplify readPrefixes
Craig Topper [Sat, 11 Jan 2020 04:30:54 +0000 (20:30 -0800)]
[X86] Use ReplaceAllUsesWith instead of ReplaceAllUsesOfValueWith to simplify some code. NFCI
Amara Emerson [Sat, 11 Jan 2020 04:17:34 +0000 (20:17 -0800)]
Mark the test/Feature/load_extension.ll test as unsupported on Darwin.
With plugins and examples enabled, this XPASSes. Mark it as unsupported until
the owner investigates what's going on.
Michael Bedy [Thu, 12 Dec 2019 03:31:32 +0000 (22:31 -0500)]
[AMDGPU] Remove unnecessary v_mov from a register to itself in WQM lowering.
Summary:
- SI Whole Quad Mode phase is replacing WQM pseudo instructions with v_mov instructions.
While this is necessary for the special handling of moving results out of WWM live ranges,
it is not necessary for WQM live ranges. The result is a v_mov from a register to itself after every
WQM operation. This change uses a COPY psuedo in these cases, which allows the register
allocator to coalesce the moves away.
Reviewers: tpr, dstuttard, foad, nhaehnle
Reviewed By: nhaehnle
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D71386
Qiu Chaofan [Sat, 11 Jan 2020 03:51:59 +0000 (11:51 +0800)]
[NFC] [PowerPC] Update mi-peephole-splat test
Use script to re-generate the test case, for easier comparison with
future patches.
Zheng Chen [Sat, 11 Jan 2020 03:43:29 +0000 (22:43 -0500)]
[SCEV] [NFC] add more test cases for range of addrecexpr with nsw flag
Craig Topper [Sat, 11 Jan 2020 02:35:43 +0000 (18:35 -0800)]
[TargetLowering][ARM][Mips][WebAssembly] Remove the ordered FP compare from RunttimeLibcalls.def and all associated usages
Summary:
This always just used the same libcall as unordered, but the comparison predicate was different. This change appears to have been made when targets were given the ability to override the predicates. Before that they were hardcoded into the type legalizer. At that time we never inverted predicates and we handled ugt/ult/uge/ule compares by emitting an unordered check ORed with a ogt/olt/oge/ole checks. So only ordered needed an inverted predicate. Later ugt/ult/uge/ule were optimized to only call a single libcall and invert the compare.
This patch removes the ordered entries and just uses the inverting logic that is now present. This removes some odd things in both the Mips and WebAssembly code.
Reviewers: efriedma, ABataev, uweigand, cameron.mcinally, kpn
Reviewed By: efriedma
Subscribers: dschuff, sdardis, sbc100, arichardson, jgravelle-google, kristof.beyls, hiraditya, aheejin, sunfish, atanasyan, Petar.Avramovic, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D72536
Tom Tan [Sat, 11 Jan 2020 02:55:56 +0000 (18:55 -0800)]
[COFF] Align ARM64 range extension thunks at instruction boundary
RangeExtensionThunkARM64 is created for out-of-range branches on Windows ARM64
because branch instructions has limited bits to encode target address.
Currently, RangeExtensionThunkARM64 is appended to its referencing COFF section
from object file at link time without any alignment requirement, so if size of
the preceding COFF section is not aligned to instruction boundary (4 bytes),
RangeExtensionThunkARM64 will emit thunk instructions at unaligned address
which is never a valid branch target on ARM64, and usually triggers invalid
instruction exception when branching to it.
This PR fixes it by requiring such thunks to align at 4 bytes.
Differential revision: https://reviews.llvm.org/D72473
Alexandre Ganea [Sat, 11 Jan 2020 02:05:59 +0000 (21:05 -0500)]
Remove umask tests
These tests were added in
18627115f4d2db5dc73207e0b5312f52536be7dd and
e08b59f81d950bd5c8b8528fcb3ac4230c7b736c for validating a refactoring.
Removing because they break on ACL-controlled folders on Ubuntu, and their added value is low.
Differential Revision: https://reviews.llvm.org/D70854
Saar Raz [Sat, 11 Jan 2020 01:12:04 +0000 (03:12 +0200)]
[Concepts] Fix MarkUsedTemplateParameters for exprs
D41910 introduced a recursive visitor to MarkUsedTemplateParameters, but
disregarded the 'Depth' parameter, and had incorrect assertions. This fixes
the visitor and removes the assertions.
Fangrui Song [Sat, 11 Jan 2020 01:06:40 +0000 (17:06 -0800)]
[Driver] Fix OptionClass of -fconvergent-functions and -fms-volatile (Joined -> Flag)
Nico Weber [Sat, 11 Jan 2020 00:18:11 +0000 (19:18 -0500)]
driver: Allow -fdebug-compilation-dir=foo in joined form.
All 130+ f_Group flags that take an argument allow it after a '=',
except for fdebug-complation-dir. Add a Joined<> alias so that
it behaves consistently with all the other f_Group flags.
(Keep the old Separate flag for backwards compat.)
Richard Smith [Fri, 10 Jan 2020 03:24:44 +0000 (19:24 -0800)]
Clean up and slightly generalize implementation of composite pointer
type computation, in preparation for P0388R4, which adds another few
cases here.
We now properly handle forming multi-level composite pointer types
involving nested Objective-C pointer types (as is consistent with
including them as part of the notion of 'similar types' on which this
rule is based). We no longer lose non-CVR qualifiers on nested pointer
types.
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