Commit Graph

360932 Commits

Author SHA1 Message Date
Logan Smith a58a8c0170 [NFC] Add another missing 'override'
This should be the last one needed to appease the -Werror bots (knock on wood).
2020-07-20 22:04:27 -07:00
Jonas Devlieghere 138244f099 [lldb] fix warnings in TestOptionValueFileColonLine.cpp 2020-07-20 21:43:17 -07:00
Jonas Devlieghere 43031a38ff [lldb] Fix OptionValueFileColonLine to compile with MSVC
This should fix error C4716:
'lldb_private::OptionValueFileColonLine::Clear': must return a value
2020-07-20 21:25:33 -07:00
Logan Smith 865ee64bf8 [NFC] Add missing 'override's 2020-07-20 19:52:49 -07:00
David Blaikie 38fbba4cb8 DebugInfo: Move getMD5AsBytes from DwarfUnit to DwarfDebug
It wasn't using any state from DwarfUnit anyway.
2020-07-20 19:21:39 -07:00
Matt Arsenault 1ef3ed0eb4 GlobalISel: Rewrite getLCMType
Try to make the behavior more consistent with getGCDType, and bias
towards returning something closer to the source type whenever there's
an ambiguity.
2020-07-20 21:06:30 -04:00
Matt Arsenault 12d5bec8c7 GlobalISel: Handle more cases in getGCDType
Try harder to find a canonical unmerge type when trying to cover the
desired target type. Handle finding a compatible unmerge type for two
vectors with different element types. This will return the largest
multiple of the source vector element that will evenly divide the
target vector type.

Also make the handling mixing scalars and vectors, and prefer the
source element type as the unmerge target type.
2020-07-20 20:53:35 -04:00
Matt Arsenault 107c954c13 AMDGPU/GlobalISel: Remove unnecessary parameter 2020-07-20 20:53:01 -04:00
Logan Smith 955f87f947 [compiler-rt] Disable -Wsuggest-override for unittests
This uses a special set of flags given to unittests to work around warnings raised by googletest and googlemock. This should bring the sanitizer bots back to green.
2020-07-20 17:42:51 -07:00
Jim Ingham bc0a9a17a4 Add an option (-y) to "break set" and "source list" that uses the same
file:line:column form that we use to print out locations.  Since we
print them this way it makes sense we also accept that form.

Differential Revision: https://reviews.llvm.org/D83975
2020-07-20 17:40:36 -07:00
Jonas Devlieghere b79dff0279 [lldb] Make sure we don't leak SBThreadPlan pointer (NFCI)
Make sure we don't accidentally leak the SBThreadPlan pointer when we
return before handing it off to Python to manage its lifetime.
2020-07-20 16:58:06 -07:00
Jonas Devlieghere 2ba7ce401e [lldb] Use weak_ptr to hold on to the underlying thread plan in SBThreadPlan
Use a weak pointer to hold on to the the underlying thread plan in
SBThreadPlan. When the process continues, all the popped ThreadPlans get
discarded, and you can’t reuse them, so you have to create them anew.
Therefore the SBThreadPlan doesn’t need to keep the ThreadPlan alive.

This fixes the cleanup error in TestThreadPlanCommands.py and
TestStepScripted.py caused by the thread plans never being deleted.

Differential revision: https://reviews.llvm.org/D84210
2020-07-20 16:55:17 -07:00
Logan Smith fc24d1eadd [clang][NFC] Add missing 'override's 2020-07-20 16:43:24 -07:00
Artem Belevich bf66003a4f [MC,NVPTX] Add MCAsmPrinter support for unsigned-only data directives.
PTX does not support negative values in .bNN data directives and we must
typecast such values to unsigned before printing them.

MCAsmInfo can now specify whether such casting is necessary for particular
target.

Differential Revision: https://reviews.llvm.org/D83423
2020-07-20 16:24:41 -07:00
Nithin Vadukkumchery Rajendrakumar a560910211 [Analyzer] Add checkRegionChanges for SmartPtrModeling
Summary:
    Implemented checkRegionChanges for SmartPtrModeling

    Reviewers: NoQ, Szelethus, vsavchenko, xazax.hun

    Reviewed By: NoQ, vsavchenko, xazax.hun

    Subscribers: martong, cfe-commits
    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D83836
2020-07-21 01:13:40 +02:00
shafik a54c42df9a Fix how we handle bit-fields for Objective-C when creating an AST
Currently expressions dealing with bit-fields in Objective-C objects is pretty broken. When generating debug-info for Objective-C bit-fields DW_AT_data_bit_offset has a different meaning than it does to C and C++.
When we parse the DWARF we validate bit offsets for C and C++ correctly but not for ObjC. For ObjC in some cases we end up incorrectly flagging an error and we don't generate further bit-fields in the AST.
Later on when we do a name lookup we don't find the ObjCIvarDecl in the ObjCInterfaceDecl in some cases since we never added it and then we don't go to the runtime to obtain the offset.

This will fix how we handle bit-fields for the Objective-C case and add tests to verify this fix but also to documents areas that still don't work and will be addressed in follow-up PRs.

Note: we can never correctly calculate offsets statically because of how Objective-C deals with the fragile base class issue. Which means the runtime may need to shift fields over.

Differential Revision: https://reviews.llvm.org/D83433
2020-07-20 16:12:29 -07:00
Logan Smith 8ed021382e Fix typo causing build failure
(facepalm)
2020-07-20 15:14:08 -07:00
Davide Italiano b1a6d373d5 [PlatformMacOSX] Remove unused variable. NFC. 2020-07-20 14:50:59 -07:00
Lang Hames 574713c307 [ExecutionEngine] Initialize near block hint in SectionMemoryManager.
When allocating a new memory block in SectionMemoryManager, initialize
the Near hint for the other memory groups if they have not been set
already.

Patch by Dana Koch. Thanks Dana!
2020-07-20 14:40:54 -07:00
Logan Smith 8b6179f48c [NFC] Add missing 'override's 2020-07-20 14:39:36 -07:00
Davide Italiano cd05406b10 [testsuite] Adapt lldb-server base test helper to run on arm64 2020-07-20 14:38:13 -07:00
Yitzhak Mandelbaum bd994b81d3 Revert "[libTooling] In Clang Transformer, change `Metadata` field to deferred evalutaion"
This reverts commit c0b8954ecb.

The commit has broken various builds. Reverting while I investigate the cause.
2020-07-20 21:24:58 +00:00
Yitzhak Mandelbaum c0b8954ecb [libTooling] In Clang Transformer, change `Metadata` field to deferred evalutaion
`Metadata` is being changed from an `llvm::Any` to a `MatchConsumer<llvm;:Any>`, so that it's evaluation can be be dependent on `MatchResult`s passed in.

Reviewed By: ymandel, gribozavr2

Differential Revision: https://reviews.llvm.org/D83820
2020-07-20 21:17:09 +00:00
AndreyChurbanov 917f842159 [OpenMP] libomp cleanup: add checks of bad memory access
Add check of frm to prevent array out-of-bound access;
add check of new_nproc to prevent access of unallocated hot_teams array;
add check of location info pointer to prevent NULL dereference;
add check of d_tn pointer to prevent NULL dereference in release build.
These checks make static analyzers happier.

This is second part of the patch from https://reviews.llvm.org/D84062.
2020-07-21 00:12:46 +03:00
Davide Italiano 001c8e1fd9 [PlatformDarwin] Add support for Apple Silicon.
Gets another large chunk of the testsuite to pass.
2020-07-20 14:11:19 -07:00
Roman Lebedev ce052110ac
[Reduce] Argument reduction: don't try to drop terminator instructions
Newly-added test previously crashed.

While it is up for debate whether or not instruction reduction
should be indiscriminate in instruction dropping (there you can
just ensure that the test case is still -verify'ies), here
if we drop terminator, CloneFunctionInto() will immediately crash.

So let's not do that :)
2020-07-21 00:06:03 +03:00
Vy Nguyen f5e49bd9de Disable trivial weak_ptr test on ARM because it is not expected to work.
Summary:
weak_ptr has two pointers (more than the 4 bytes limit), so it will not be returned in registers on ARM, even if it is trivial.
The test, therefore, will fail on ARM.

Reviewers: #libc!

Subscribers: kristof.beyls, danielkiss, libcxx-commits

Tags: #libc

Differential Revision: https://reviews.llvm.org/D84200
2020-07-20 17:02:49 -04:00
Logan Smith 308a127a38 [llvm][unittest] Add -Wno-suggest-override to more infrastructure that includes googletest/googlemock headers 2020-07-20 13:59:39 -07:00
AndreyChurbanov 787eb0c637 [OpenMP] libomp cleanup: add check of input global tid parameter
Add check of negative gtid before indexing __kmp_threads.
This makes static analyzers happier.
This is the first part of the patch split in two parts.

Differential Revision: https://reviews.llvm.org/D84062
2020-07-20 23:49:58 +03:00
Gabor Marton 3ff220de90 [analyzer][StdLibraryFunctionsChecker] Add POSIX networking functions
Summary:
Adding networking functions from the POSIX standard (2017). This includes
functions that deal with sockets from socket.h, netdb.h.

In 'socket.h' of some libc implementations (e.g. glibc) with C99, sockaddr
parameter is a transparent union of the underlying sockaddr_ family of pointers
instead of being a pointer to struct sockaddr. In these cases, the standardized
signature will not match, thus we try to match with another signature that has
the joker Irrelevant type. In the case of transparent unions, we also not add
those constraints which require pointer types for the sockaddr param.

Interestingly, in 'netdb.h' sockaddr is not handled as a transparent union.

Tags: #clang

Differential Revision: https://reviews.llvm.org/D83407
2020-07-20 22:46:24 +02:00
Louis Dionne 78f543e5a1 [NFC] Use std::free instead of ::free
Since we include <cstdlib> instead of <stdlib.h>, it makes sense to
use std::free.
2020-07-20 16:19:08 -04:00
Sanjay Patel 750f4c591d [InstCombine] allow peeking through zext of shift amount to match rotate idioms (PR45701)
We might want to also allow trunc of the shift amount, but that seems less likely?

  define i32 @src(i32 %x, i1 %y) {
  %0:
    %rem = and i1 %y, 1
    %cmp = icmp eq i1 %rem, 0
    %sh_prom = zext i1 %rem to i32
    %sub = sub nsw nuw i1 0, %rem
    %sh_prom1 = zext i1 %sub to i32
    %shr = lshr i32 %x, %sh_prom1
    %shl = shl i32 %x, %sh_prom
    %or = or i32 %shl, %shr
    %r = select i1 %cmp, i32 %x, i32 %or
    ret i32 %r
  }
  =>
  define i32 @tgt(i32 %x, i1 %y) {
  %0:
    %t = zext i1 %y to i32
    %r = fshl i32 %x, i32 %x, i32 %t
    ret i32 %r
  }

  Transformation seems to be correct!

https://alive2.llvm.org/ce/z/xgMvE3

http://bugs.llvm.org/PR45701
2020-07-20 16:18:11 -04:00
Sanjay Patel 92ec0c5da6 [InstCombine] add tests for funnel shift/rotate with narrow shift amount; NFC 2020-07-20 16:18:11 -04:00
Florian Hahn f13a59bcff [Matrix] Use TileInfo to create tiled loop nest for matrix multiply.
This patch uses the TileInfo introduced in D77550 to generate a loop
nest for tiled matrix multiplication, instead of generating the
unrolled code for the whole multiplication. This makes code-generation
more scalable for larger matrixes.

Initially loops are only used if both the number of rows and columns are
divisible by the tile size. Other cases will be added as follow-up.

Reviewers: anemet, Gerolf, hfinkel, andrew.w.kaylor, LuoYuanke, nicolasvasilache

Reviewed By: anemet

Differential Revision: https://reviews.llvm.org/D81308
2020-07-20 21:11:53 +01:00
Eli Friedman b8f765a1e1 [AArch64][SVE] Add support for trunc to <vscale x N x i1>.
This isn't a natively supported operation, so convert it to a
mask+compare.

In addition to the operation itself, fix up some surrounding stuff to
make the testcase work: we need concat_vectors on i1 vectors, we need
legalization of i1 vector truncates, and we need to fix up all the
relevant uses of getVectorNumElements().

Differential Revision: https://reviews.llvm.org/D83811
2020-07-20 13:11:02 -07:00
Martin Storsjö f07ddbc9c4 [LLDB] [COFF] Fix handling of symbols with more than one aux symbol
Differential Revision: https://reviews.llvm.org/D84070
2020-07-20 22:42:28 +03:00
Logan Smith 8b16e45f66 Enable -Wsuggest-override in the LLVM build
This patch adds Clang's new (and GCC's old) -Wsuggest-override to the warning flags for the LLVM build. The warning is a stronger form of -Winconsistent-missing-override which warns _everywhere_ that override is missing, not just in places where it's inconsistent within a class.

Some directories in the monorepo need the warning disabled for compatibility's, or sanity's, sake; in particular, libcxx/libcxxabi, and any code implementing or interoperating with googletest, googlemock, or google benchmark (which do not themselves use override). This patch adds -Wno-suggest-override to the relevant CMakeLists.txt's to accomplish this.

Differential Revision: https://reviews.llvm.org/D84126
2020-07-20 12:32:47 -07:00
Hiroshi Yamauchi 9f5d8e8a72 [PGO] Enable the extended value profile buckets for mem op sizes.
Following up D81682 and enable the new, extended value profile buckets for mem
op sizes.

Differential Revision: https://reviews.llvm.org/D83903
2020-07-20 12:05:09 -07:00
Aleksandr Platonov c911803d5d
[clangd] Remove TokenBuffer usage in TypeHierarchy
Summary:
This patch mostly reverts D74850.
We could not use `AST.getTokens()` here, because it does not have tokens from the preamble.

Reviewers: sammccall, kadircet

Reviewed By: kadircet

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, kbobyrev, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D84144
2020-07-20 21:00:49 +02:00
Anders Waldenborg 52ab7aa0ba [clang-format] Add BitFieldColonSpacing option
This new option allows controlling if there should be spaces around
the ':' in a bitfield declaration.

BitFieldColonSpacing accepts four different values:

  // "Both" - default
  unsigned bitfield : 5
  unsigned bf2      : 5  // AlignConsecutiveBitFields=true

  // "None"
  unsigned bitfield:5
  unsigned bf2     :5

  // "Before"
  unsigned bitfield :5
  unsigned bf2      :5

  // "After"
  unsigned bitfield: 5
  unsigned bf2     : 5

Differential Revision: https://reviews.llvm.org/D84090
2020-07-20 20:55:51 +02:00
Jonas Devlieghere f8df2e1a19 [lldb/Reproducers] Always record the current working directory
Setting the current working directory in the VFS will fail if the given
path doesn't exist in the YAML mapping or on disk.
2020-07-20 11:54:11 -07:00
Jonas Devlieghere 3f16114ddb [lldb] Fix method name to match LLDB code style (NFC)
recordInterestingDirectory -> RecordInterestingDirectory
2020-07-20 11:54:11 -07:00
Hiroshi Yamauchi e64afefdf8 [PGO][PGSO] Remove a temporary flag used for gradual rollout.
Remove the temporary flag PGSOIRPassOrTestOnly and the guard code which was used
for the staged rollout. This is a cleanup (NFC) as it's now false by default.

Differential Revision: https://reviews.llvm.org/D84057
2020-07-20 11:12:11 -07:00
Mircea Trofin 70f8d0ac8a [llvm] Development-mode InlineAdvisor
Summary:
This is the InlineAdvisor used in 'development' mode. It enables two
scenarios:

 - loading models via a command-line parameter, thus allowing for rapid
 training iteration, where models can be used for the next exploration
 phase without requiring recompiling the compiler. This trades off some
 compilation speed for the added flexibility.

 - collecting training logs, in the form of tensorflow.SequenceExample
 protobufs. We generate these as textual protobufs, which simplifies
 generation and testing. The protobufs may then be readily consumed by a
 tensorflow-based training algorithm.

To speed up training, training logs may also be collected from the
'default' training policy. In that case, this InlineAdvisor does not
use a model.

RFC: http://lists.llvm.org/pipermail/llvm-dev/2020-April/140763.html

Reviewers: jdoerfert, davidxl

Subscribers: mgorny, hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D83733
2020-07-20 11:01:56 -07:00
LLVM GN Syncbot c6f84ebf84 [gn build] Port e1270b16c9 2020-07-20 17:51:57 +00:00
Florian Hahn e1270b16c9 [Matrix] Add TileInfo abstraction for tiled matrix code-gen.
This patch adds a TileInfo abstraction and utilities to
create a 3-level loop nest for tiling.

Reviewers: anemet

Reviewed By: anemet

Differential Revision: https://reviews.llvm.org/D77550
2020-07-20 18:49:08 +01:00
Victor Huang 91cce1a2bc [PowerPC] Implement R_PPC64_REL24_NOTOC local calls, callee requires a TOC
The PC Relative code now allows for calls that are marked with the relocation
R_PPC64_REL24_NOTOC. This indicates that the caller does not have a valid TOC
pointer in R2 and does not require R2 to be restored after the call.

This patch is added to support local calls to callees that require a TOC

Reviewed By: sfertile, MaskRay, nemanjai, stefanp

Differential Revision: https://reviews.llvm.org/D83504
2020-07-20 17:46:49 +00:00
Sylvain Audi 3a108ab256 [LLD][COFF] Skip computation of the undefined symbols references that are not shown
The "undefined symbol" error message from lld-link displays up to 3 references to that symbol, and the number of extra references not shown.

This patch removes the computation of the strings for those extra references.

It fixes a freeze of lld-link we accidentally encountered when activating asan on a large project, without linking with the asan library.
In that case, __asan_report_load8 was referenced more than 2 million times, causing the computation of that many display strings, of which only 3 were used.

Differential Revision: https://reviews.llvm.org/D83510
2020-07-20 13:45:16 -04:00
Yuanfang Chen 877b2593c2 [NFC] remove unused llvm::deleter 2020-07-20 10:43:29 -07:00
Yuanfang Chen ca1e69a675 [NFC] remove unused includes of SelectionDAGISel.h 2020-07-20 10:43:29 -07:00