Jay Foad [Tue, 17 Dec 2019 16:48:02 +0000 (16:48 +0000)]
[AMDGPU] Update autogenerated checks
Joel E. Denny [Tue, 17 Dec 2019 15:23:11 +0000 (10:23 -0500)]
[lit] Fix internal diff newlines for -w/-b
For example, without this patch:
```
$ python $LIT_BUILTINS/diff.py -b foo.txt bar.txt
*** /tmp/foo.txt
--- /tmp/bar.txt
***************
*** 1,2 ****
1! 2--- 1,2 ----
1! 20
```
With this patch:
```
$ python $LIT_BUILTINS/diff.py -b foo.txt bar.txt
*** /tmp/foo.txt
--- /tmp/bar.txt
***************
*** 1,2 ****
1
! 2
--- 1,2 ----
1
! 20
```
Reviewed By: rnk
Differential Revision: https://reviews.llvm.org/D71577
Sanjay Patel [Tue, 17 Dec 2019 15:21:32 +0000 (10:21 -0500)]
[AArch64] add tests for fcvtl2; NFC
Mitch Phillips [Tue, 17 Dec 2019 15:31:31 +0000 (07:31 -0800)]
Revert "Honor -fuse-init-array when os is not specified on x86"
This reverts commit
aa5ee8f244441a8ea103a7e0ed8b6f3e74454516.
This change broke the sanitizer buildbots. See comments at the patchset
(https://reviews.llvm.org/D71360) for more information.
Kadir Cetinkaya [Mon, 16 Dec 2019 13:22:48 +0000 (14:22 +0100)]
[clangd] Fix handling of inline/anon namespaces and names of deduced types in hover
Summary:
Clangd normally skips inline and anon namespaces while printing nested name
specifiers. It also drops any tag specifiers since we make use of `HoverInfo::Kind`
instead of some text in `HoverInfo::Name`
There was a bug causing us to print innermost inline/anon namespace, this patch
fixes that by skipping those.
Also changes printing and kind detection of deduced types to be similar to decl
case.
Also improves printing for lambdas, currently clangd prints lambdas as
`(anonymous class)`, we can improve it by at least printing `(lambda)`
instead.
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D71543
Kadir Cetinkaya [Tue, 17 Dec 2019 12:00:12 +0000 (13:00 +0100)]
[clangd][NFC] Make use of TagDecl inside type for hover on auto
Summary:
We were traversing AST twice to get the Decl in case of sugared
types(auto, decltype). They seem to be same in practice, so this patch gets rid
of the second traversal and makes use of TagDecl inside QualType instead.
Reviewers: ilya-biryukov
Subscribers: MaskRay, jkorous, arphaman, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D71597
LLVM GN Syncbot [Tue, 17 Dec 2019 15:28:35 +0000 (15:28 +0000)]
gn build: Merge
390c8baa544
Daniel Sanders [Tue, 17 Dec 2019 14:29:14 +0000 (14:29 +0000)]
[gicombiner] Add the MatchDag structure and parse instruction DAG's from the input
Summary:
The MatchDag structure is a representation of the checks that need to be
performed and the dependencies that limit when they can happen.
There are two kinds of node in the MatchDag:
* Instrs - Represent a MachineInstr
* Predicates - Represent a check that needs to be performed (i.e. opcode, is register, same machine operand, etc.)
and two kinds of edges:
* (Traversal) Edges - Represent a register that can be traversed to find one instr from another
* Predicate Dependency Edges - Indicate that a predicate requires a piece of information to be tested.
For example, the matcher:
(match (MOV $t, $s),
(MOV $d, $t))
with MOV declared as an instruction of the form:
%dst = MOV %src1
becomes the following MatchDag with the following instruction nodes:
__anon0_0 // $t=getOperand(0), $s=getOperand(1)
__anon0_1 // $d=getOperand(0), $t=getOperand(1)
traversal edges:
__anon0_1[src1] --[t]--> __anon0_0[dst]
predicate nodes:
<<$mi.getOpcode() == MOV>>:$__anonpred0_2
<<$mi.getOpcode() == MOV>>:$__anonpred0_3
and predicate dependencies:
__anon0_0 ==> __anonpred0_2[mi]
__anon0_0 ==> __anonpred0_3[mi]
The result of this parse is currently unused but can be tested
using -gicombiner-stop-after-parse as done in parse-match-pattern.td. The
dump for testing includes a graphviz format dump to allow the rule to be
viewed visually.
Later on, these MatchDag's will be used to generate code and to build an
efficient decision tree.
Reviewers: volkan, bogner
Reviewed By: volkan
Subscribers: arsenm, mgorny, mgrang, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D69077
Raphael Isemann [Tue, 17 Dec 2019 15:00:51 +0000 (16:00 +0100)]
[lldb][NFC] Use StringRef in CreateRecordType and CreateObjCClass
Kevin P. Neal [Wed, 16 Oct 2019 19:24:47 +0000 (15:24 -0400)]
This adds constrained intrinsics for the signed and unsigned conversions
of integers to floating point.
This includes some of Craig Topper's changes for promotion support from
D71130.
Differential Revision: https://reviews.llvm.org/D69275
Erich Keane [Mon, 16 Dec 2019 19:15:48 +0000 (11:15 -0800)]
Reland [NFC-I] Remove hack for fp-classification builtins
The FP-classification builtins (__builtin_isfinite, etc) use variadic
packs in the definition file to mean an overload set. Because of that,
floats were converted to doubles, which is incorrect. There WAS a patch
to remove the cast after the fact.
THis patch switches these builtins to just be custom type checking,
calls the implicit conversions for the integer members, and makes sure
the correct L->R casts are put into place, then does type checking like
normal.
A future direction (that wouldn't be NFC) would consider making
conversions for the floating point parameter legal.
Note: The initial patch for this missed that certain systems need to
still convert half to float, since they dont' support that type.
Raphael Isemann [Tue, 17 Dec 2019 13:34:17 +0000 (14:34 +0100)]
[lldb][NFC] Rename ClangASTImporter::InsertRecordDecl to SetRecordLayout and document it
This function is just setting the layout for the given RecordDecl so
the current name is not very descriptive. Also add some documentation for it.
Gabor Marton [Wed, 4 Dec 2019 16:12:08 +0000 (17:12 +0100)]
[ASTImporter] Friend class decl should not be visible in its context
Summary:
In the past we had to use DeclContext::makeDeclVisibleInContext to make
friend declarations available for subsequent lookup calls and this way
we could chain (redecl) the structurally equivalent decls.
By doing this we created an AST that improperly made declarations
visible in some contexts, so the AST was malformed.
Since we use the importer specific lookup this is no longer necessary,
because with that we can find every previous nodes.
Reviewers: balazske, a_sidorin, a.sidorin, shafik
Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411, teemperor, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D71020
Raphael Isemann [Tue, 17 Dec 2019 12:38:07 +0000 (13:38 +0100)]
[lldb][NFC] Allow creating ClangExpressionDeclMap and ClangASTSource without a Target and add basic unit test
The ClangExpressionDeclMap should be testable from a unit test. This is currently
impossible as they have both dependencies on Target/ExecutionContext from their
constructor. This patch allows constructing these classes without an active Target
and adds the missing tests for running without a target that we can do at least
a basic lookup test without crashing.
alex-t [Tue, 17 Dec 2019 12:20:32 +0000 (15:20 +0300)]
PostRA Machine Sink should take care of COPY defining register that is a sub-register by another COPY source operand
Differential Revision: https://reviews.llvm.org/D71132
JonChesterfield [Tue, 17 Dec 2019 12:18:55 +0000 (12:18 +0000)]
[libomptarget][nfc] Move omp locks under target_impl
Summary:
[libomptarget][nfc] Move omp locks under target_impl
These are likely to be target specific, even down to the lock_t which is
correspondingly moved out of interface.h. The alternative is to include
interface.h in target_impl which substantiatially increases the scope of
those symbols.
The current nvptx implementation deadlocks on amdgcn. The preferred
implementation for that arch is still under discussion - this change
leaves declarations in target_impl.
The functions could be inline for nvptx. I'd prefer to keep the internals
hidden in the target_impl translation unit, but will add the (possibly renamed)
macros to target_impl.h if preferred.
Reviewers: ABataev, jdoerfert, grokos
Reviewed By: jdoerfert
Subscribers: jvesely, mgorny, jfb, openmp-commits
Tags: #openmp
Differential Revision: https://reviews.llvm.org/D71574
James Henderson [Tue, 17 Dec 2019 12:02:54 +0000 (12:02 +0000)]
[DebugInfo] Only print a single blank line after an empty line table
Commit 84a9756 added an extra blank line at the end of any line table.
However, a blank line is also printed after the line table header, which
meant that two blank lines in a row were being printed after a header,
if there were no rows. This patch defers the post-header blank line
printing until it has been determined that there are rows to print.
Reviewed by: dblaikie
Differential Revision: https://reviews.llvm.org/D71540
Mikhail Maltsev [Tue, 17 Dec 2019 11:45:22 +0000 (11:45 +0000)]
[libcxx] Fix include paths in fuzzing/partial_sort.pass.cpp
Summary:
When testing an installed (out-of-tree) version of libc++, the
"libcxx/fuzzing/partial_sort.pass.cpp" test fails because of missing
include files "../fuzzing/fuzzing.{h,cpp}". This happens because in
the source tree "../fuzzing" can be accessed as
"libcxx/include/../fuzzing", but with the installed library this does
not work.
This patch fixes the issue by changing the path to be relative from
the `libcxx/test/fuzzing" directory.
Reviewers: mclow.lists, EricWF, christof, michaelplatings
Reviewed By: michaelplatings
Subscribers: merge_guards_bot, ldionne, libcxx-commits
Tags: #libc
Differential Revision: https://reviews.llvm.org/D71459
Luís Marques [Tue, 17 Dec 2019 11:42:32 +0000 (11:42 +0000)]
[RISCV][NFC] Trivial cleanup
Fix a typo. Remove two seemingly out-of-date TODO comments.
Raphael Isemann [Tue, 17 Dec 2019 11:22:34 +0000 (12:22 +0100)]
[lldb] Remove modern-type-lookup
Summary:
As discussed on the mailing list [1] we have to make a decision for how to proceed with the modern-type-lookup.
This patch removes modern-type-lookup from LLDB. This just removes all the code behind the modern-type-lookup
setting but it does *not* remove any code from Clang (i.e., the ExternalASTMerger and the clang-import-test stay around
for now).
The motivation for this is that I don't think that the current approach of implementing modern-type-lookup
will work out. Especially creating a completely new lookup system behind some setting that is never turned on by anyone
and then one day make one big switch to the new system seems wrong. It doesn't fit into the way LLVM is developed and has
so far made the transition work much more complicated than it has to be.
A lot of the benefits that were supposed to come with the modern-type-lookup are related to having a better organization
in the way types move across LLDB and having less dependencies on unrelated LLDB code. By just looking at the current code (mostly
the ClangASTImporter) I think we can reach the same goals by just incrementally cleaning up, documenting, refactoring
and actually testing the existing code we have.
[1] http://lists.llvm.org/pipermail/lldb-dev/2019-December/015831.html
Reviewers: shafik, martong
Subscribers: rnkovacs, christof, arphaman, JDevlieghere, usaxena95, lldb-commits, friss
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D71562
Sven van Haastregt [Tue, 17 Dec 2019 11:10:06 +0000 (11:10 +0000)]
[OpenCL] Add ExtVectorElementExpr constant evaluation (PR42387)
Add constexpr evaluation for ExtVectorElementExpr nodes by evaluating
the underlying vector expression. Add basic folding for the case that
Evaluate does not return an LValue.
Differential Revision: https://reviews.llvm.org/D71133
Kristof Beyls [Wed, 11 Dec 2019 14:45:48 +0000 (14:45 +0000)]
Fix assertion failure in getMemOperandWithOffsetWidth
This fixes an assertion failure that triggers inside
getMemOperandWithOffset when Machine Sinking calls it on a MachineInstr
that is not a memory operation.
Different backends implement getMemOperandWithOffset differently: some
return false on non-memory MachineInstrs, others assert.
The Machine Sinking pass in at least SinkingPreventsImplicitNullCheck
relies on getMemOperandWithOffset to return false on non-memory
MachineInstrs, instead of asserting.
This patch updates the documentation on getMemOperandWithOffset that it
should return false on any MachineInstr it cannot handle, instead of
asserting. It also adapts the in-tree backends accordingly where
necessary.
Differential Revision: https://reviews.llvm.org/D71359
Thomas Preud'homme [Thu, 12 Dec 2019 11:39:57 +0000 (11:39 +0000)]
[lit] Remove lit's REQUIRES-ANY directive
Summary:
Remove REQUIRES-ANY alias lit directive since it is hardly used and can
be easily implemented using an OR expression using REQUIRES. Fixup
remaining testcases still using REQUIRES-ANY.
Reviewers: probinson, jdenny, gparker42
Reviewed By: gparker42
Subscribers: eugenis, asb, rbar, johnrusso, simoncook, sabuasal, niosHD, delcypher, jrtc27, zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, PkmX, jocewei, lenary, s.egerton, pzheng, sameer.abuasal, apazos, luismarques, cfe-commits, #sanitizers, llvm-commits
Tags: #llvm, #clang, #sanitizers
Differential Revision: https://reviews.llvm.org/D71408
Raphael Isemann [Tue, 17 Dec 2019 10:06:01 +0000 (11:06 +0100)]
[lldb][NFC] Remove all unnecessary includes for ClangASTSourceCommon.h
These files only need the definition of ClangASTMetadata (which was
previously in the ClangASTSourceCommon.h) or don't need the include at all.
Pavel Labath [Mon, 16 Dec 2019 13:15:11 +0000 (14:15 +0100)]
[lldb-vscode] Centrally skip debug info variants for vscode tests
Previously each test was annotated manually. This does the same thing.
Raphael Isemann [Tue, 17 Dec 2019 08:55:51 +0000 (09:55 +0100)]
[lldb][NFC] Remove implementation of GetOriginalDecl and just call GetDeclOrigin instead
Those functions have the same semantics beside some small optimization of not creating
a new empty ASTContextMetadataSP value in the metadata map. We never actually hit this
optimization according to test coverage so let's just call GetDeclOrigin instead.
Raphael Isemann [Tue, 17 Dec 2019 08:48:54 +0000 (09:48 +0100)]
[lldb] Add support for calling objc_direct methods from LLDB's expression evaluator.
Summary:
D69991 introduced `__attribute__((objc_direct))` that allows directly calling methods without message passing.
This patch adds support for calling methods with this attribute to LLDB's expression evaluator.
The patch can be summarised in that LLDB just adds the same attribute to our module AST when we find a
method with `__attribute__((objc_direct))` in our debug information.
Reviewers: aprantl, shafik
Reviewed By: shafik
Subscribers: JDevlieghere, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D71196
Guillaume Chatelet [Mon, 16 Dec 2019 14:24:13 +0000 (15:24 +0100)]
Resubmit "[Alignment][NFC] Deprecate CreateMemCpy/CreateMemMove"
Summary:
This is a resubmit of D71473.
This patch introduces a set of functions to enable deprecation of IRBuilder functions without breaking out of tree clients.
Functions will be deprecated one by one and as in tree code is cleaned up.
This is patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790
Reviewers: aaron.ballman, courbet
Subscribers: llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D71547
Russell Gallop [Tue, 17 Dec 2019 08:59:05 +0000 (08:59 +0000)]
Revert "[Support] Fix time trace multi threaded support with LLVM_ENABLE_THREADS=OFF"
This reverts commit
2bbcf156acc157377e814fbb1828a9fe89367ea2.
This was failing on systems which use __thread such as
http://lab.llvm.org:8011/builders/clang-atom-d525-fedora-rel/builds/30851
Russell Gallop [Mon, 16 Dec 2019 15:01:22 +0000 (15:01 +0000)]
[Support] Fix time trace multi threaded support with LLVM_ENABLE_THREADS=OFF
Following on from
8ddcd1dc26ba, which added the support. As pointed out
on D71059 this does not build on some systems with LLVM_ENABLE_THREADS=OFF.
Differential Revision: https://reviews.llvm.org/D71548
Raphael Isemann [Tue, 17 Dec 2019 08:36:57 +0000 (09:36 +0100)]
[ObjC][DWARF] Emit DW_AT_APPLE_objc_direct for methods marked as __attribute__((objc_direct))
Summary:
With DWARF5 it is no longer possible to distinguish normal methods and methods with `__attribute__((objc_direct))` by just looking at the debug information
as they are both now children of the of the DW_TAG_structure_type that defines them (before only the `__attribute__((objc_direct))` methods were children).
This means that in LLDB we are no longer able to create a correct Clang AST of a module by just looking at the debug information. Instead we would
need to call the Objective-C runtime to see which of the methods have a `__attribute__((objc_direct))` and then add the attribute to our own Clang AST
depending on what the runtime returns. This would mean that we either let the module AST be dependent on the Objective-C runtime (which doesn't
seem right) or we retroactively add the missing attribute to the imported AST in our expressions.
A third option is to annotate methods with `__attribute__((objc_direct))` as `DW_AT_APPLE_objc_direct` which is what this patch implements. This way
LLDB doesn't have to call the runtime for any `__attribute__((objc_direct))` method and the AST in our module will already be correct when we create it.
Reviewers: aprantl, SouraVX
Reviewed By: aprantl
Subscribers: hiraditya, cfe-commits, llvm-commits
Tags: #clang, #llvm, #debug-info
Differential Revision: https://reviews.llvm.org/D71201
Fangrui Song [Sun, 15 Dec 2019 00:19:03 +0000 (16:19 -0800)]
[ELF] Rename .plt to .iplt and decrease EM_PPC{,64} alignment of .glink to 4
GNU ld creates the synthetic section .iplt, and has a built-in linker
script that assigns .iplt to the output section .plt . There is no
output section named .iplt .
Making .iplt an output section actually has a benefit that makes the
tricky toolchain feature stand out. Symbolizers don't have to deal with
mixed PLT entries (e.g. llvm-objdump -d incorrectly annotates such jump
targets).
On EM_PPC{,64}, .glink contains a PLT resolver and a series of jump
instructions. The 4-byte entry size makes it unnecessary to have an
alignment of 16.
Mark ppc32-gnu-ifunc.s and ppc32-gnu-ifunc-nonpreemptable.s as `XFAIL: *`.
They test IPLT on EM_PPC, which never works.
Reviewed By: peter.smith
Differential Revision: https://reviews.llvm.org/D71520
Raphael Isemann [Tue, 17 Dec 2019 08:13:23 +0000 (09:13 +0100)]
[lldb][NFC] Make clang-format happy by removing trailing space in ArchSpec.cpp
Martin Storsjö [Fri, 13 Dec 2019 21:28:19 +0000 (21:28 +0000)]
[lit] [windows] Make sure to convert all path separators to backslashes in NT style \\?\... paths
E.g. the mingw python distributed in msys2 (the mingw one, which is a
normal win32 application and doesn't use the msys2 runtime itself),
despite being a normal win32 python, still uses forward slashes. This
works fine for other cases (many, but not all), but when constructing a
raw NT path, all path separators must be backslashes.
Differential Revision: https://reviews.llvm.org/D71490
Martin Storsjö [Thu, 12 Dec 2019 09:08:18 +0000 (11:08 +0200)]
[MinGW] Implicitly add .exe suffix if not provided
GCC implicitly adds an .exe suffix if it is given an output file name,
but the file name doesn't contain a suffix, and there are certain
users of GCC that rely on this behaviour (and run into issues when
trying to use Clang instead of GCC). And MSVC's cl.exe also does the
same (but not link.exe).
However, GCC only does this when actually running on windows, not when
operating as a cross compiler.
As GCC doesn't have this behaviour when cross compiling, we definitely
shouldn't introduce the behaviour in such cases (as it would break
at least as many cases as this fixes).
Differential Revision: https://reviews.llvm.org/D71400
Fangrui Song [Sat, 14 Dec 2019 22:17:35 +0000 (14:17 -0800)]
[ELF] Add IpltSection
PltSection is used by both PLT and IPLT. The PLT section may have a
header while the IPLT section does not. Split off IpltSection from
PltSection to be clearer.
Unlike other targets, PPC64 cannot use the same code sequence for PLT
and IPLT. This helps make a future PPC64 patch (D71509) more isolated.
On EM_386 and EM_X86_64, when PLT is empty while IPLT is not, currently
we are inconsistent whether the PLT header is conceptually attached to
in.plt or in.iplt . Consistently attach the header to in.plt can make
the -z retpolineplt logic simpler. It also makes `jmp` point to an
aesthetically better place for non-retpolineplt cases.
Reviewed By: grimar, ruiu
Differential Revision: https://reviews.llvm.org/D71519
Igor Kudrin [Wed, 11 Dec 2019 10:37:24 +0000 (17:37 +0700)]
[sanitizer] Construct InternalMmapVector without memory allocation.
Construction of InternalMmapVector is often followed by a call to
reserve(), which may result in immediate reallocation of the memory
for the internal storage. This patch delays that allocation until
it is really needed.
Differential Revision: https://reviews.llvm.org/D71342
Igor Kudrin [Mon, 16 Dec 2019 14:16:14 +0000 (21:16 +0700)]
[MachO] Fix detecting malformed DWARF.
This fixes an invalid constant used to detect the reserved range when
reading the compilation unit header. See also: D64622 and D65039.
Differential Revision: https://reviews.llvm.org/D71546
Raphael Isemann [Tue, 17 Dec 2019 07:53:00 +0000 (08:53 +0100)]
[lldb] Fix unused variable warning in ThreadPlanStepRange.cpp
This was added in
434905b97d961531286d4b49c7ee1969f7cbea0e.
Remove it to fix the compiler warnings for this.
Craig Topper [Tue, 17 Dec 2019 07:35:29 +0000 (23:35 -0800)]
[LegalizeTypes] Pre-size the SmallVectors in ScalarizeVecRes_StrictFPOp and SplitVecRes_StrictFPOp so we don't have to call push_back. NFCI
This avoids grow checking/handling in each iteration of the loop.
Craig Topper [Tue, 17 Dec 2019 07:24:22 +0000 (23:24 -0800)]
[LegalizeTypes] Remove ScalarizeVecRes_STRICT_FP_ROUND in favor of just using ScalarizeVecRes_StrictFPOp. NFCI
It looks like ScalarizeVecRes_StrictFPOp can handle a variable
number of arguments with scalar and vector types so it should
be sufficient.
Craig Topper [Tue, 17 Dec 2019 04:52:02 +0000 (20:52 -0800)]
[LegalizeTypes] Remove the call to SplitVecRes_UnaryOp from SplitVecRes_StrictFPOp. NFCI
It doesn't seem to do anything that SplitVecRes_StrictFPOp can't
do. SplitVecRes_StrictFPOp already handles nodes with a variable
number of arguments and a mix of scalar and vector arguments.
Fangrui Song [Tue, 17 Dec 2019 07:05:23 +0000 (23:05 -0800)]
[MC] Delete redundant alignment update from MCELFStreamer::EmitCommonSymbol. NFC
EmitValueToAlignment() updates the maximum alignment.
QingShan Zhang [Tue, 17 Dec 2019 07:04:19 +0000 (07:04 +0000)]
[NFC][Test][PowerPC] Add the test to verify the mask with constant
LLVM GN Syncbot [Tue, 17 Dec 2019 03:51:59 +0000 (03:51 +0000)]
gn build: Merge
ec4749e3b8d
Whitney Tsang [Tue, 17 Dec 2019 03:50:03 +0000 (03:50 +0000)]
Revert "[LoopUtils] Updated deleteDeadLoop() to handle loop nest."
This reverts commit
cd09fee3d63296dd2df0bbb1fae363ca9f311d44.
This reverts commit
c066ff11d84a7797503ad5a44c4129136926dc85.
Johannes Doerfert [Tue, 17 Dec 2019 03:03:18 +0000 (21:03 -0600)]
[Attributor][NFC] Clang format the Attributor
The Attributor is always kept formatted so diffs are cleaner.
Sometime we get out of sync for various reasons so we need to format the
file once in a while.
Richard Smith [Tue, 17 Dec 2019 02:26:19 +0000 (18:26 -0800)]
Check whether the destination is a complete type in a static_cast (or
C-style cast) to an enumeration type.
We previously forgot to check this, and happened to get away with it
(with bad diagnostics) only because we misclassified incomplete
enumeration types as not being unscoped enumeration types. This also
fixes the misclassification.
Jon Chesterfield [Tue, 17 Dec 2019 02:22:28 +0000 (02:22 +0000)]
[libomptarget][nfc] Move timer functions behind target_impl
Summary: [libomptarget][nfc] Move timer functions behind target_impl
Reviewers: jdoerfert, ABataev, grokos
Reviewed By: jdoerfert
Subscribers: jvesely, openmp-commits
Tags: #openmp
Differential Revision: https://reviews.llvm.org/D71584
Jim Ingham [Tue, 17 Dec 2019 02:08:21 +0000 (18:08 -0800)]
Explicitly specify -std=c++11 and include <mutex> and <condition_variable>.
These files built on macos but not on Debian Linux. Let's see if this fixes it.
Craig Topper [Tue, 17 Dec 2019 02:04:25 +0000 (18:04 -0800)]
[SelectionDAG] Add the fpexcept flag to the SelectionDAG dumping output so we can better see when its not propagating.
We're currently losing this flag in type legalization and probably
other places when we expand strict fp nodes. This will make
reading logs easier.
Richard Smith [Tue, 17 Dec 2019 01:40:03 +0000 (17:40 -0800)]
[c++20] P1959R0: Remove support for std::*_equality.
Richard Smith [Tue, 17 Dec 2019 01:08:46 +0000 (17:08 -0800)]
If constant evaluation fails due to an unspecified pointer comparison,
produce a note saying that rather than the default "evaluation failed"
note.
Richard Smith [Mon, 16 Dec 2019 23:17:24 +0000 (15:17 -0800)]
[c++20] Add deprecation warnings for the expression forms deprecated by P1120R0.
This covers:
* usual arithmetic conversions (comparisons, arithmetic, conditionals)
between different enumeration types
* usual arithmetic conversions between enums and floating-point types
* comparisons between two operands of array type
The deprecation warnings are on-by-default (in C++20 compilations); it
seems likely that these forms will become ill-formed in C++23, so
warning on them now by default seems wise.
For the first two bullets, off-by-default warnings were also added for
all the cases where we didn't already have warnings (covering language
modes prior to C++20). These warnings are in subgroups of the existing
-Wenum-conversion (except that the first case is not warned on if either
enumeration type is anonymous, consistent with our existing
-Wenum-conversion warnings).
Jim Ingham [Tue, 17 Dec 2019 01:38:13 +0000 (17:38 -0800)]
Run all threads when extending a next range over a call.
If you don't do this you end up running arbitrary code with
only one thread allowed to run, which can cause deadlocks.
<rdar://problem/
56422478>
Differential Revision: https://reviews.llvm.org/D71440
Jon Chesterfield [Tue, 17 Dec 2019 01:30:04 +0000 (01:30 +0000)]
[libomptarget][nfc] Wrap cuda min() in target_impl
Summary:
[libomptarget][nfc] Wrap cuda min() in target_impl
nvptx forwards to cuda min, amdgcn implements directly.
Sufficient to build parallel.cu for amdgcn, added to CMakeLists.
All call sites are homogenous except one that passes a uint32_t and an
int32_t. This could be smoothed over by taking two type parameters
and some care over the return type, but overall I think the inline
<uint32_t> calling attention to what was an implicit sign conversion
is cleaner.
Reviewers: ABataev, jdoerfert
Reviewed By: jdoerfert
Subscribers: jvesely, mgorny, openmp-commits
Tags: #openmp
Differential Revision: https://reviews.llvm.org/D71580
LLVM GN Syncbot [Tue, 17 Dec 2019 01:17:52 +0000 (01:17 +0000)]
gn build: Merge
c066ff11d84
Whitney Tsang [Tue, 17 Dec 2019 01:14:14 +0000 (01:14 +0000)]
[LoopUtils] Updated deleteDeadLoop() to handle loop nest.
Reviewer: kariddi, sanjoy, reames, Meinersbur, bmahjour, etiotto,
kbarton
Reviewed By: Meinersbur
Subscribers: mgorny, hiraditya, llvm-commits
Tag: LLVM
Differential Revision: https://reviews.llvm.org/D70939
Whitney Tsang [Tue, 17 Dec 2019 00:03:04 +0000 (00:03 +0000)]
[LoopUtils] Updated deleteDeadLoop() to handle loop nest.
Reviewer: kariddi, sanjoy, reames, Meinersbur, bmahjour, etiotto,
kbarton
Reviewed By: Meinersbur
Subscribers: mgorny, hiraditya, llvm-commits
Tag: LLVM
Differential Revision: https://reviews.llvm.org/D70939
Xin-Xin Wang [Tue, 17 Dec 2019 00:08:07 +0000 (16:08 -0800)]
[llvm/runtimes] Add runtimes as a dependency of clang-bootstrap-deps
Summary: With the new LLVM_ENABLE_RUNTIMES option introduced in https://reviews.llvm.org/D40233, compiler-rt can now be included as a runtime. Since compiler-rt is needed for PGO, runtimes needs to be included as a dependency of clang-bootstrap-deps when building the stage1 compiler.
Reviewers: beanz, phosek, compnerd, smeenai, plotfi, xiaobai
Reviewed By: phosek
Subscribers: smeenai, beanz, phosek, mgorny, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D71430
Dan Liew [Mon, 16 Dec 2019 22:20:16 +0000 (14:20 -0800)]
Change `asan/TestCases/Darwin/malloc_zone-protected.cpp` to call abort so that it **always crashes**.
Summary:
This is needed because on some platforms we can't install signal
handlers and so the application just traps (i.e. crashes) rather than being intercepted
by ASan's signal handler which in the default Darwin config doesn't
exit with a crashing exit code.
rdar://problem/
57984547
Reviewers: yln, kubamracek, jfb
Subscribers: #sanitizers, llvm-commits
Tags: #sanitizers, #llvm
Differential Revision: https://reviews.llvm.org/D71573
Xin-Xin Wang [Mon, 16 Dec 2019 23:46:02 +0000 (15:46 -0800)]
[llvm] Add llvm-lipo dependency to runtimes
Summary: Currently, llvm-lipo is not specified as a dependency, but it is needed when building Darwin-x86_64 runtimes, so I'm adding it to the dependencies lists.
Reviewers: alexshap, beanz, phosek, compnerd, smeenai, mtrent, plotfi, xiaobai
Reviewed By: phosek, smeenai
Subscribers: smeenai, mgorny, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D71429
Eric Fiselier [Tue, 17 Dec 2019 00:03:23 +0000 (19:03 -0500)]
[libc++] Add __default_init_tag to basic_string constructors
This removes unneeded zero initialization of string data.
For example, given the below code:
void Init(void *mem) {
new (mem) std::string("Hello World");
}
Assembly before:
Init(void*):
xorps xmm0, xmm0
movups xmmword ptr [rdi], xmm0
mov qword ptr [rdi + 16], 0
mov byte ptr [rdi], 22
movabs rax,
8022916924116329800
mov qword ptr [rdi + 1], rax
mov dword ptr [rdi + 8],
1684828783
mov byte ptr [rdi + 12], 0
ret
Assembly after:
Init():
mov byte ptr [rdi], 22
movabs rax,
8022916924116329800
mov qword ptr [rdi + 1], rax
mov dword ptr [rdi + 8],
1684828783
mov byte ptr [rdi + 12], 0
ret
Patch by Martijn Vels (mvels@google.com)
Reviewed as https://reviews.llvm.org/D70621
Puyan Lotfi [Mon, 16 Dec 2019 23:49:03 +0000 (18:49 -0500)]
[NFC][llvm][MIRVRegNamerUtils] Moving some switch cases and altering comments.
Eric Fiselier [Mon, 16 Dec 2019 23:23:39 +0000 (18:23 -0500)]
[libc++] Rework compressed pair constructors.
This patch de-duplicates most compressed pair constructors
to use the same code in C++11 and C++03.
Part of doing that is deleting the "__second_tag()" and replacing
it with a "__value_init_tag()" which has the same effect, but
allows for the removal of the special "one-arg" first element
constructor.
This patch is intended to have no semantic change.
Puyan Lotfi [Mon, 16 Dec 2019 18:23:03 +0000 (13:23 -0500)]
[llvm][MIRVRegNamerUtils] Adding hashing on CImm / FPImm MachineOperands.
This patch makes it so that cases where multiple instructions that
differ only in their ConstantInt or ConstantFP MachineOperand values no
longer collide. For instance:
%0:_(s1) = G_CONSTANT i1 true
%1:_(s1) = G_CONSTANT i1 false
%2:_(s32) = G_FCONSTANT float 1.0
%3:_(s32) = G_FCONSTANT float 0.0
Prior to this patch the first two instructions would collide together.
Also, the last two G_FCONSTANT instructions would also collide. Now they
will no longer collide.
Differential Revision: https://reviews.llvm.org/D71558
Kamlesh Kumar [Mon, 16 Dec 2019 23:14:08 +0000 (15:14 -0800)]
Honor -fuse-init-array when os is not specified on x86
Currently -fuse-init-array option is not effective when target triple
does not specify os, on x86,x86_64.
i.e.
// -fuse-init-array is not honored.
$ clang -target i386 -fuse-init-array test.c -S
// -fuse-init-array is honored.
$ clang -target i386-linux -fuse-init-array test.c -S
This patch fixes first case.
And does cleanup.
Reviewers: rnk, craig.topper, fhahn, echristo
Reviewed By: rnk
Differential Revision: https://reviews.llvm.org/D71360
Ana Pazos [Mon, 16 Dec 2019 23:09:48 +0000 (15:09 -0800)]
[RISCV] Added isCompressibleInst() to estimate size in getInstSizeInBytes()
Summary:
Modified compression emitter tablegen backend to emit isCompressibleInst()
check which in turn is used by getInstSizeInBytes() to better estimate
instruction size. Note the generation of compressed instructions in RISC-V
happens late in the assembler therefore instruction size estimate might be off
if computed before.
Reviewers: lenary, asb, luismarques, lewis-revill
Reviewed By: asb
Subscribers: sameer.abuasal, lewis-revill, hiraditya, asb, rbar, johnrusso, simoncook, sabuasal, niosHD, kito-cheng, shiva0217, MaskRay, zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, rkruppe, PkmX, jocewei, psnobl, benna, Jim, lenary, s.egerton, pzheng, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D68290
Fangrui Song [Mon, 16 Dec 2019 23:04:16 +0000 (15:04 -0800)]
[AArch64][SVE] Change pattern generation code to fix -Wimplicit-fallthrough after D71483
Sam Clegg [Fri, 13 Dec 2019 22:44:06 +0000 (14:44 -0800)]
[WebAssembly] Setting export_name implies llvm.used
This change updates the clang front end to add symbols to llvm.used
when they have explicit export_name attribute.
Differential Revision: https://reviews.llvm.org/D71493
Brian Gesiak [Mon, 16 Dec 2019 22:19:16 +0000 (17:19 -0500)]
[coroutines][PR41909] Generalize fix from D62550
Summary:
In https://reviews.llvm.org/D62550 @rsmith pointed out that there are
many situations in which a coroutine body statement may be
transformed/rebuilt as part of a template instantiation, and my naive
check whether the coroutine was a generic lambda was insufficient.
This is indeed true, as I've learned by reading more of the
TreeTransform code. Most transformations are written in a way that
doesn't assume the resulting types are not dependent types. So the
assertion in 'TransformCoroutineBodyStmt', that the promise type must no
longer be dependent, is out of place.
This patch removes the assertion, spruces up some code comments, and
adds a test that would have failed with my naive check from
https://reviews.llvm.org/D62550.
Reviewers: GorNishanov, rsmith, lewissbaker
Reviewed By: rsmith
Subscribers: junparser, EricWF, rsmith, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D70579
Alex Langford [Mon, 16 Dec 2019 22:29:46 +0000 (14:29 -0800)]
[lldb] Respect previously set values of LLDB_TABLEGEN_EXE
If you set LLDB_TABLEGEN_EXE in a CMake cache file or in the CMake
invocation line, your setting isn't respected. Setting up the tablegen
for the host will overwrite the value that we set LLDB_TABLEGEN_EXE to,
which defeats the whole point of setting it in the first place.
Craig Topper [Mon, 16 Dec 2019 22:17:30 +0000 (14:17 -0800)]
[X86] Add x86 triple to command line in mxcsr-reg-usage.ll
I'm not sure how this hasn't been causing any issues.
Eric Fiselier [Mon, 16 Dec 2019 22:00:10 +0000 (17:00 -0500)]
Add default initialization to compressed_pair.
This change introduces the __default_init_tag to memory, and a corresponding
element constructor to allow for default initialization of either of the pair
values. This is useful for classes such as std::string where most (all)
constructors explicitly initialize the values in the constructor.
Patch by Martijn Vels (mvels@google.com)
Reviewed as https://reviews.llvm.org/D70617
Erich Keane [Mon, 16 Dec 2019 22:01:51 +0000 (14:01 -0800)]
Revert "[NFC-I] Remove hack for fp-classification builtins"
This reverts commit
b1e542f302c1ed796ad9f703d4d36e010afcb914.
The original 'hack' didn't chop out fp-16 to double conversions, so
systems that use FP16ConversionIntrinsics end up in IR-CodeGen with an
i16 type isntead of a float type (like PPC64-BE). The bots noticed
this.
Reverting until I figure out how to fix this
Valentin Churavy [Mon, 16 Dec 2019 09:35:14 +0000 (04:35 -0500)]
git-llvm: Add option to push to Github with SSH
Summary:
For users with 2FA Github password challenge can be rather cumbersome
and I personally use key based authentication through SSH. This fixes
the SSH feature that was present and exposes it as a command line
option.
Reviewers: tstellar
Subscribers: llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D71534
Danilo Carvalho Grael [Fri, 13 Dec 2019 19:01:03 +0000 (14:01 -0500)]
[AArch64][SVE] Add patterns for logical immediate operations.
Summary:
Add pattern matching for the following SVE logical vector and immediate instructions:
- and/bic, orr/orn, eor/eon.
Reviewers: sdesmalen, huntergr, rengolin, efriedma, c-rhodes, mgudim, kmclaughlin
Subscribers: tschuett, kristof.beyls, hiraditya, rkruppe, psnobl, llvm-commits, amehsan
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D71483
Julian Lettner [Thu, 12 Dec 2019 19:51:55 +0000 (11:51 -0800)]
[TSan][Darwin] Avoid calling pthread_self() before libpthread is initialized
This skips calling `pthread_self` when `main_thread_identity` hasn't
been initialized yet. `main_thread_identity` is only ever assigned in
`__tsan::InitializePlatform`. This change should be relatively safe; we
are not changing behavior other than skipping the call to `pthread_self`
when `main_thread_identity == 0`.
rdar://
57822138
Reviewed By: kubamracek
Differential Revision: https://reviews.llvm.org/D71559
John McCall [Mon, 16 Dec 2019 21:04:31 +0000 (16:04 -0500)]
Fix a bug in the property-based serialization of
dependent template names.
Apparently we didn't test this in the test suite because we have
a lot of redundant ways of representing this situation that kick
in in the more common situations. For example, DependentTST stores
a qualifier + identifier pair rather than a TemplateName.
Erich Keane [Mon, 16 Dec 2019 19:15:48 +0000 (11:15 -0800)]
[NFC-I] Remove hack for fp-classification builtins
The FP-classification builtins (__builtin_isfinite, etc) use variadic
packs in the definition file to mean an overload set. Because of that,
floats were converted to doubles, which is incorrect. There WAS a patch
to remove the cast after the fact.
THis patch switches these builtins to just be custom type checking,
calls the implicit conversions for the integer members, and makes sure
the correct L->R casts are put into place, then does type checking like
normal.
A future direction (that wouldn't be NFC) would consider making
conversions for the floating point parameter legal.
Kit Barton [Mon, 16 Dec 2019 16:57:52 +0000 (11:57 -0500)]
[LoopFusion] Restrict loop fusion to rotated loops.
Summary:
This patch restricts loop fusion to only consider rotated loops as valid candidates.
This simplifies the analysis and transformation and aligns with other loop optimizations.
Reviewers: jdoerfert, Meinersbur, dmgreen, etiotto, Whitney, fhahn, hfinkel
Reviewed By: Meinersbur
Subscribers: ormris, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D71025
Craig Topper [Mon, 16 Dec 2019 20:03:21 +0000 (12:03 -0800)]
[InstCombine] Teach removeBitcastsFromLoadStoreOnMinMax not to change the size of a store.
We can change the type as long as we don't change the size.
Fixes PR44306
Differential Revision: https://reviews.llvm.org/D71532
Thomas Lively [Sat, 14 Dec 2019 01:08:04 +0000 (17:08 -0800)]
[WebAssembly] Replace SIMD int min/max builtins with patterns
Summary:
The instructions were originally implemented via builtins and
intrinsics so users would have to explicitly opt-in to using
them. This was useful while were validating whether these instructions
should have been merged into the spec proposal. Now that they have
been, we can use normal codegen patterns, so the intrinsics and
builtins are no longer useful.
Reviewers: aheejin
Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish, cfe-commits, llvm-commits
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D71500
Nico Weber [Mon, 16 Dec 2019 19:26:31 +0000 (14:26 -0500)]
Only run mangled_names.test if python3 is available.
The %update_cc_test_checks substitution only gets added if python3
is on path, so the test fails if it isn't. Don't run the test
when it would fail.
Also include the '%' in the arg to add_update_script_substition(),
to help greppability.
Fangrui Song [Mon, 16 Dec 2019 19:19:22 +0000 (11:19 -0800)]
[ELF] Delete unused declaration addIRelativeRelocs after D65995. NFC
Fangrui Song [Sat, 14 Dec 2019 23:09:43 +0000 (15:09 -0800)]
[ELF] Delete relOff from TargetInfo::writePLT
This change only affects EM_386. relOff can be computed from `index`
easily, so it is unnecessarily passed as a parameter.
Both in.plt and in.iplt entries are written by writePLT. For in.iplt,
the instruction `push reloc_offset` will change because `index` is now
different. Fortunately, this does not matter because `push; jmp` is only
used by PLT. IPLT does not need the code sequence.
Reviewed By: grimar, ruiu
Differential Revision: https://reviews.llvm.org/D71518
Fangrui Song [Mon, 16 Dec 2019 18:58:48 +0000 (10:58 -0800)]
[ELF] De-template PltSection::addEntry. NFC
Nico Weber [Mon, 16 Dec 2019 18:59:41 +0000 (13:59 -0500)]
gn build: (manually) merge
c82e4ef69
Alexey Bataev [Mon, 16 Dec 2019 18:38:12 +0000 (13:38 -0500)]
[OPENMP][DOCS]Claim simd nontemporal clause, NFC.
John McCall [Mon, 16 Dec 2019 18:31:44 +0000 (13:31 -0500)]
Forward {read,write}SomeEnumType to {read,write}Enum instead of
directly to {read,write}UInt32.
This will be useful for textual formats. NFC.
John McCall [Mon, 16 Dec 2019 16:57:23 +0000 (11:57 -0500)]
Use property-based serialization for TemplateArgument.
John McCall [Mon, 16 Dec 2019 16:57:03 +0000 (11:57 -0500)]
Add Optional::map.
John McCall [Mon, 16 Dec 2019 08:59:21 +0000 (03:59 -0500)]
Use property-based serialization for TemplateName.
John McCall [Mon, 16 Dec 2019 08:51:16 +0000 (03:51 -0500)]
Add the ability for properties to be conditional on other properties.
This will be required by TemplateName.
John McCall [Mon, 16 Dec 2019 07:56:32 +0000 (02:56 -0500)]
Add the ability to declare helper variables when reading
properties from a value.
This is useful when the properties of a case are actually
read out of a specific structure, as with TemplateName.
John McCall [Mon, 16 Dec 2019 07:11:49 +0000 (02:11 -0500)]
Use property-based serialization for DeclarationName.
John McCall [Mon, 16 Dec 2019 07:10:15 +0000 (02:10 -0500)]
Add the ability to use property-based serialization for "cased" types.
This patch doesn't actually use this serialization for anything,
but follow-ups will move the current handling of various standard
types over to this.
John McCall [Mon, 16 Dec 2019 04:51:44 +0000 (23:51 -0500)]
Replace tabs with spaces.
John McCall [Sun, 15 Dec 2019 07:39:13 +0000 (02:39 -0500)]
Move Basic{Reader,Writer} emission into ASTPropsEmitter; NFC.
I'm going to introduce some uses of the property read/write methods.
John McCall [Sun, 15 Dec 2019 07:27:27 +0000 (02:27 -0500)]
Always -I clang/include when tblgen'ing in Clang.