Ayke van Laethem [Mon, 24 Feb 2020 19:13:41 +0000 (20:13 +0100)]
[LLVM-C] Add bindings for addCoroutinePassesToExtensionPoints
This patch adds bindings to C and Go for
addCoroutinePassesToExtensionPoints, which is used to add coroutine
passes to the correct locations in PassManagerBuilder.
Differential Revision: https://reviews.llvm.org/D51642
Simon Pilgrim [Mon, 24 Feb 2020 18:52:18 +0000 (18:52 +0000)]
[SelectionDAG] Merge constant SDNode arithmetic into foldConstantArithmetic
This is the second patch as part of https://bugs.llvm.org/show_bug.cgi?id=36544
Merging in the ConstantSDNode variant of FoldConstantArithmetic. After this, I will begin merging in FoldConstantVectorArithmetic
I've ensured this patch can build & pass all lit tests in Windows and Linux environments.
Patch by @justice_adams (Justice Adams)
Differential Revision: https://reviews.llvm.org/D74881
Francis Visoiu Mistrih [Mon, 24 Feb 2020 18:42:21 +0000 (10:42 -0800)]
[MachO] Add cpu(sub)type tests and improve error handling
Add checks for triples that don't use mach-o, and unit tests for
everything.
Ayke van Laethem [Mon, 24 Feb 2020 18:38:47 +0000 (19:38 +0100)]
[bindings/go] Add RemoveFromParentAsInstruction
This allows removing instructions without erasing them. They can then be
added somewhere else in the IR using Builder.Insert().
Ayke van Laethem [Wed, 5 Feb 2020 11:53:06 +0000 (12:53 +0100)]
[AVR] Disassemble register operands
Simply by implementing a few functions I was able to correctly
disassemble a much larger amount of instructions.
Differential Revision: https://reviews.llvm.org/D74045
Simon Pilgrim [Mon, 24 Feb 2020 18:24:31 +0000 (18:24 +0000)]
[X86] combineX86ShuffleChain - select X86ISD::FAND/ISD::AND based on MaskVT
Noticed by inspection, we shouldn't use FloatDomain directly, we've already bitcast both inputs to MaskVT so select the opcode using that.
Ayke van Laethem [Tue, 4 Feb 2020 13:12:43 +0000 (14:12 +0100)]
[AVR] Don't assert on an undefined operand
Not all operands are correctly disassembled at the moment. This means
that some machine instructions won't have all the necessary operands
set.
To avoid asserting, print an error instead until the necessary support
has been implemented.
Differential Revision: https://reviews.llvm.org/D73958
Ayke van Laethem [Mon, 24 Feb 2020 14:45:43 +0000 (15:45 +0100)]
[AVR] Use correct register class for mul instructions
A number of multiplication instructions (muls, mulsu, fmul, fmuls,
fmulsu) had the wrong register class for an operand. This resulted in
the wrong register being used for the instruction.
Example:
target datalayout = "e-P1-p:16:8-i8:8-i16:8-i32:8-i64:8-f32:8-f64:8-n8-a:8"
target triple = "avr-atmel-none"
define i16 @sliceAppend(i16, i16, i16, i16, i16, i16) addrspace(1) {
%d = mul i16 %0, %5
ret i16 %d
}
The first instruction would be muls r24, r31 before this patch. The r31
should have been r15 if you look at the intermediate forms during
instruction selection / register allocation, but the generated
instruction uses r31. After this patch, an extra movw is inserted to get
%5 in range for muls.
To make sure this bug is fixed everywhere, I checked all instructions
and found that most multiplication instructions suffered from this bug,
which I have fixed with this patch. No other instructions appear to be
affected.
Differential Revision: https://reviews.llvm.org/D74281
jasonliu [Mon, 24 Feb 2020 15:46:11 +0000 (15:46 +0000)]
[XCOFF][AIX] Fix incorrect alignment for function descriptor csect
Summary:
Function descriptor csect on AIX should be 4 byte align instead of 1 byte align.
Reviewer: daltenty
Differential Revision: https://reviews.llvm.org/D74974
Michael Kruse [Mon, 24 Feb 2020 17:51:00 +0000 (11:51 -0600)]
[CMake] Default to static linking for subprojects.
Pass plugins introduced in D61446 do not support dynamic linking on
Windows, hence the option LLVM_${name_upper}_LINK_INTO_TOOLS can only
work being set to "ON". Currently, it defaults to "OFF" such that such
plugins are inoperable by default on Windows. Change the default for
subprojects to follow LLVM_ENABLE_PROJECTS.
Reviewed By: serge-sans-paille, MaskRay
Differential Revision: https://reviews.llvm.org/D72372
Francesco Petrogalli [Fri, 21 Feb 2020 16:15:09 +0000 (16:15 +0000)]
[ReleaseNotes] Mention the `vector-function-abi-variant` attribute.
Subscribers: llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D74969
Louis Dionne [Mon, 24 Feb 2020 17:21:07 +0000 (12:21 -0500)]
[libc++] Drop redundant check for -std=c++14
We always build all components of libc++ with -std=c++14 anyway
serge-sans-paille [Mon, 24 Feb 2020 16:20:49 +0000 (17:20 +0100)]
[NFC] Fix typo in error message
Peter Collingbourne [Mon, 24 Feb 2020 17:11:15 +0000 (09:11 -0800)]
Revert "Rework go bindings so that validation works fine"
And add llvm-go back to the test dependencies.
No longer necessary now that llvm-go has been brought back.
This reverts commit
e8f8873da5eaad187f82dad78ebdb3ab3df22b36.
Nico Weber [Mon, 24 Feb 2020 17:10:40 +0000 (12:10 -0500)]
[gn build] remove -std=c++11 in libcxx build pending discussion in
80e73f2 review thread
Louis Dionne [Mon, 24 Feb 2020 16:39:48 +0000 (11:39 -0500)]
[libc++] Fix CI and Linux failures after landing D68480
- Avoid using C++11-and-later features in <atomic>:
Historically, we've supported <atomic> in C++03, so we can't use C++11
features in that header. This is something we really need to change,
since our implementation of <atomic> is starting to accumulate technical
debt because of that.
- Mark a test as unsupported on single threaded systems
- Add missing symbols to the Linux ABI list
Nico Weber [Mon, 24 Feb 2020 16:42:32 +0000 (11:42 -0500)]
[gn build] (manually) merge
54fa9ecd308
Simon Pilgrim [Mon, 24 Feb 2020 16:25:55 +0000 (16:25 +0000)]
[X86] getTargetShuffleInputs - check that the source inputs are all the right size.
I'm hoping to begin improving shuffle combining across different vector sizes, but before that we must ensure that all existing getTargetShuffleInputs calls must bail if the inputs aren't the same size.
Sean Fertile [Mon, 24 Feb 2020 15:48:45 +0000 (10:48 -0500)]
[PowerPC][AIX] Spill/restore the callee-saved condition register bits.
Extends the existing support for spilling and restoring the condition
register to the linkage area for 32-bit targets, and enables for AIX.
Differential Revision: https://reviews.llvm.org/D74349
Pavel Labath [Mon, 24 Feb 2020 15:45:37 +0000 (16:45 +0100)]
[lldb/DWARF] Fix dwp search path in the separate-debug-file case
The convention is that the dwp file name is derived from the name of the
file holding the executable code, even if the linked portion of the
debug info is elsewhere (objcopy --only-keep-debug).
Louis Dionne [Mon, 17 Feb 2020 15:23:48 +0000 (10:23 -0500)]
[libc++] Mark the C++03 version of std::function as deprecated
Summary: We want to eventually remove it.
Reviewers: EricWF
Subscribers: christof, jkorous, dexonsmith, libcxx-commits
Tags: #libc
Differential Revision: https://reviews.llvm.org/D74719
Louis Dionne [Mon, 24 Feb 2020 15:08:41 +0000 (10:08 -0500)]
[libc++] Adapt a few things around the implementation of P1135R6
- Add the new symbols to the ABI list on Darwin
- Add XFAIL markup to the tests that require dylib support on older platforms
- Add availability markup for back-deployment
Olivier Giroux [Tue, 18 Feb 2020 14:58:34 +0000 (09:58 -0500)]
[libc++] Implementation of C++20's P1135R6 for libcxx
Differential Revision: https://reviews.llvm.org/D68480
cchen [Mon, 24 Feb 2020 15:06:17 +0000 (10:06 -0500)]
[OpenMP] Refactor the analysis in checkMapClauseBaseExpression using StmtVisitor class.
Summary: This step is the preparation of allowing lvalue in map/motion clause.
Reviewers: ABataev, jdoerfert
Reviewed By: ABataev
Subscribers: guansong, cfe-commits
Tags: #clang, #openmp
Differential Revision: https://reviews.llvm.org/D74970
Xiangling Liao [Mon, 24 Feb 2020 14:46:00 +0000 (09:46 -0500)]
[AIX][Frontend] C++ ABI customizations for AIX boilerplate
This PR enables "XL" C++ ABI in frontend AST to IR codegen. And it is driven by
static init work. The current kind in Clang by default is Generic Itanium, which
has different behavior on static init with IBM xlclang compiler on AIX.
Differential Revision: https://reviews.llvm.org/D74015
Melanie Blower [Mon, 24 Feb 2020 14:42:05 +0000 (06:42 -0800)]
add release notes for ffp-model and ffp-exception-behavior
Simon Pilgrim [Mon, 24 Feb 2020 14:22:48 +0000 (14:22 +0000)]
[CostModel][X86] We don't need a scale factor for SLM extract costs
D74976 will handle larger vector types, but since SLM doesn't support AVX+ then we will always be extracting from 128-bit vectors so don't need to scale the cost.
Sjoerd Meijer [Mon, 24 Feb 2020 14:19:21 +0000 (14:19 +0000)]
[MIR][ARM] MachineOperand comments
This adds infrastructure to print and parse MIR MachineOperand comments.
The motivation for the ARM backend is to print condition code names instead of
magic constants that are difficult to read (for human beings). For example,
instead of this:
dead renamable $r2, $cpsr = tEOR killed renamable $r2, renamable $r1, 14, $noreg
t2Bcc %bb.4, 0, killed $cpsr
we now print this:
dead renamable $r2, $cpsr = tEOR killed renamable $r2, renamable $r1, 14 /* CC::always */, $noreg
t2Bcc %bb.4, 0 /* CC:eq */, killed $cpsr
This shows that MachineOperand comments are enclosed between /* and */. In this
example, the EOR instruction is not conditionally executed (i.e. it is "always
executed"), which is encoded by the 14 immediate machine operand. Thus, now
this machine operand has /* CC::always */ as a comment. The 0 on the next
conditional branch instruction represents the equal condition code, thus now
this operand has /* CC:eq */ as a comment.
As it is a comment, the MI lexer/parser completely ignores it. The benefit is
that this keeps the change in the lexer extremely minimal and no target
specific parsing needs to be done. The changes on the MIPrinter side are also
minimal, as there is only one target hooks that is used to create the machine
operand comments.
Differential Revision: https://reviews.llvm.org/D74306
Kerry McLaughlin [Mon, 24 Feb 2020 11:08:52 +0000 (11:08 +0000)]
[AArch64][SVE] Add the SVE dupq_lane intrinsic
Summary:
Implements the @llvm.aarch64.sve.dupq.lane intrinsic.
As specified in the ACLE, the behaviour of:
svdupq_lane_u64(data, index)
...is identical to:
svtbl(data, svadd_x(svptrue_b64(),
svand_x(svptrue_b64(), svindex_u64(0, 1), 1),
index * 2))
If the index is in the range [0,3], the operation is equivalent
to a single DUP (.q) instruction.
Reviewers: sdesmalen, c-rhodes, cameron.mcinally, efriedma, dancgr, rengolin
Reviewed By: sdesmalen
Subscribers: tschuett, kristof.beyls, hiraditya, rkruppe, psnobl, cfe-commits, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D74734
Sam Parker [Mon, 24 Feb 2020 13:50:46 +0000 (13:50 +0000)]
[RDA][ARM][LowOverheadLoops] Iteration count IT blocks
Change the way that we remove the redundant iteration count code in
the presence of IT blocks. collectLocalKilledOperands has been
introduced to scan an instructions operands, collecting the killed
instructions and then visiting them too. This is used to delete the
code in the preheader which calculates the iteration count. We also
track any IT blocks within the preheader and, if we remove all the
instructions from the IT block, we also remove the IT instruction.
isSafeToRemove is used to remove any redundant uses of the iteration
count within the loop body.
Differential Revision: https://reviews.llvm.org/D74975
Michele Scandale [Mon, 24 Feb 2020 12:59:26 +0000 (07:59 -0500)]
Fix TryParsePtrOperatorSeq.
The syntax rules for ptr-operator allow attributes after *, &,
&&, therefore we should be able to parse the following:
void fn() {
void (*[[attr]] x)() = &fn;
void (&[[attr]] y)() = fn;
void (&&[[attr]] z)() = fn;
}
However the current logic in TryParsePtrOperatorSeq does not consider
the presence of attributes leading to unexpected parsing errors.
Moreover we should also consider _Atomic a possible qualifier that can
appear after the sequence of attribute specifiers.
Mikhail Maltsev [Mon, 24 Feb 2020 12:49:20 +0000 (12:49 +0000)]
[ARM,MVE] Remove 64-bit variants of vbrsrq* intrinsics
Summary:
According to the ACLE the vbrsrq* intrinsics don't accept vectors
with 64-bit elements (and neither does the corresponding VBRSR
instruction).
Reviewers: simon_tatham, dmgreen, MarkMurrayARM, ostannard
Reviewed By: simon_tatham
Subscribers: kristof.beyls, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D75038
David Green [Mon, 24 Feb 2020 11:15:09 +0000 (11:15 +0000)]
[ARM] FP16 bitcast test. NFC
Simon Pilgrim [Mon, 24 Feb 2020 11:58:50 +0000 (11:58 +0000)]
[CostModel][X86] Try to check against common prefixes before using target-specific cpu checks
SLM/GLM is still a mess so not all of them have been updated yet.
Kirill Bobyrev [Mon, 24 Feb 2020 11:17:55 +0000 (12:17 +0100)]
Use temporary directory for tests in D74346
Benjamin Kramer [Mon, 24 Feb 2020 11:10:13 +0000 (12:10 +0100)]
[ORC] Remove spammy debug print
Kerry McLaughlin [Mon, 24 Feb 2020 10:38:37 +0000 (10:38 +0000)]
[AArch64][SVE] Add intrinsics for SVE2 cryptographic instructions
Summary:
Implements the following SVE2 intrinsics:
- @llvm.aarch64.sve.aesd
- @llvm.aarch64.sve.aesimc
- @llvm.aarch64.sve.aese
- @llvm.aarch64.sve.aesmc
- @llvm.aarch64.sve.rax1
- @llvm.aarch64.sve.sm4e
- @llvm.aarch64.sve.sm4ekey
Reviewers: sdesmalen, c-rhodes, dancgr, cameron.mcinally, efriedma, rengolin
Reviewed By: sdesmalen
Subscribers: tschuett, kristof.beyls, hiraditya, rkruppe, psnobl, cfe-commits, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D74833
Benjamin Kramer [Mon, 24 Feb 2020 10:45:59 +0000 (11:45 +0100)]
Silence compiler warnings
mlir/lib/Parser/Parser.cpp:4484:15: warning: 'parseAssignmentList' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
ParseResult parseAssignmentList(SmallVectorImpl<OperandType> &lhs,
^
mlir/include/mlir/IR/OpImplementation.h:662:3: note: overridden virtual function is here
parseAssignmentList(SmallVectorImpl<OperandType> &lhs,
^
mlir/lib/Parser/Parser.cpp:4488:12: warning: unused variable 'type' [-Wunused-variable]
Type type;
^
Benjamin Kramer [Fri, 21 Feb 2020 12:24:54 +0000 (13:24 +0100)]
Add a basic tiling pass for parallel loops
This exploits the fact that the iterations of parallel loops are
independent so tiling becomes just an index transformation. This pass
only tiles the innermost loop of a loop nest.
The ultimate goal is to allow vectorization of the tiled loops, but I
don't think we're there yet with the current rewriting, as the tiled
loops don't have a constant trip count.
Differential Revision: https://reviews.llvm.org/D74954
Bevin Hansson [Mon, 16 Dec 2019 14:25:52 +0000 (15:25 +0100)]
[Intrinsic] Add fixed point saturating division intrinsics.
Summary:
This patch adds intrinsics and ISelDAG nodes for signed
and unsigned fixed-point division:
```
llvm.sdiv.fix.sat.*
llvm.udiv.fix.sat.*
```
These intrinsics perform scaled, saturating division
on two integers or vectors of integers. They are
required for the implementation of the Embedded-C
fixed-point arithmetic in Clang.
Reviewers: bjope, leonardchan, craig.topper
Subscribers: hiraditya, jdoerfert, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D71550
Calixte Denizet [Mon, 10 Feb 2020 17:46:37 +0000 (18:46 +0100)]
[profile] Don't dump counters when forking and don't reset when calling exec** functions
Summary:
There is no need to write out gcdas when forking because we can just reset the counters in the parent process.
Let say a counter is N before the fork, then fork and this counter is set to 0 in the child process.
In the parent process, the counter is incremented by P and in the child process it's incremented by C.
When dump is ran at exit, parent process will dump N+P for the given counter and the child process will dump 0+C, so when the gcdas are merged the resulting counter will be N+P+C.
About exec** functions, since the current process is replaced by an another one there is no need to reset the counters but just write out the gcdas since the counters are definitely lost.
To avoid to have lists in a bad state, we just lock them during the fork and the flush (if called explicitely) and lock them when an element is added.
Reviewers: marco-c
Reviewed By: marco-c
Subscribers: hiraditya, cfe-commits, #sanitizers, llvm-commits, sylvestre.ledru
Tags: #clang, #sanitizers, #llvm
Differential Revision: https://reviews.llvm.org/D74953
Pavel Labath [Thu, 20 Feb 2020 14:24:09 +0000 (15:24 +0100)]
Use new FailedWithMessage matcher in DWARFDebugLineTest.cpp
Summary:
This should produce slightly better error messages in case of failures.
Only slightly, because this code was pretty careful about that to begin
with -- I've seen code which does much worse.
Reviewers: jhenderson, dblaikie
Subscribers: llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D74899
Bevin Hansson [Mon, 9 Dec 2019 15:22:57 +0000 (16:22 +0100)]
[MC] Widen the functional unit type from 32 to 64 bits.
Summary:
The type used to represent functional units in MC is
'unsigned', which is 32 bits wide. This is currently
not a problem in any upstream target as no one seems
to have hit the limit on this yet, but in our
downstream one, we need to define more than 32
functional units.
Increasing the size does not seem to cause a huge
size increase in the binary (an llc debug build went
from
1366497672 to
1366523984, a difference of 26k),
so perhaps it would be acceptable to have this patch
applied upstream as well.
Subscribers: hiraditya, jsji, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D71210
Raphael Isemann [Mon, 24 Feb 2020 08:04:18 +0000 (09:04 +0100)]
[lldb] Disable auto fix-its when evaluating expressions in the test suite
Summary:
Currently the test suite runs with enabled automatically applied Clang fix-its for expressions.
This is causing that sometimes incorrect expressions in tests are still evaluated even though they
are actually incorrect. Let's disable this feature in the test suite so that we know when expressions
are wrong and leave the fix-it testing to the dedicated tests for that feature.
Also updates the `lang/cpp/operators/` test as it seems Clang needs the `struct` keywords
before C and would otherwise fail without fixits.
Reviewers: jingham, JDevlieghere, shafik
Reviewed By: JDevlieghere, shafik
Subscribers: shafik, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D74957
Pavel Labath [Mon, 24 Feb 2020 08:02:18 +0000 (09:02 +0100)]
[lldb/test] simplify basic-elf.yaml
Explicit dynsym/dynstr sections were added in
a6370d5 to compensate for
a yaml2obj change D74764. This test doesn't need those sections, so
instead I just delete the explicit section blocks, and also the
"DynamicSymbols" block, which triggers their implicit generation.
Pavel Labath [Fri, 21 Feb 2020 14:49:12 +0000 (15:49 +0100)]
[lldb/DWARF] Don't index dwp file multiple times
Summary:
When we added support for type units in dwo files, we changed the
"manual" dwarf index to index _all_ dwarf units in the dwo file instead
of just the split unit belonging to our skeleton unit. This was fine for
dwo files, as they contain only a single compile units and type units do
not have a split type unit which would point to them.
However, this does not work for dwp files because, these files do
contain multiple split compile units, and the current approach means
that each unit gets indexed multiple times (once for each split unit =>
n^2 complexity).
This patch teaches the manual dwarf index to treat dwp files specially.
Any type units in the dwp file added to the main list of compile units
and indexed with them in a single batch. Split compile units in dwp
files are still indexed as a part of their skeleton unit -- this is done
because we need the DW_AT_language attribute from the skeleton unit to
index them properly.
Handling of dwo files remains unchanged -- all units (type and skeleton)
are indexed when we reach the dwo file through the split unit.
Reviewers: clayborg, JDevlieghere, aprantl
Subscribers: arphaman, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D74964
Sam Parker [Fri, 21 Feb 2020 14:57:51 +0000 (14:57 +0000)]
[ARM][MVE] Combine more extending masked loads
For MVE, don't look at the users of the extending loads so that more
as desirable for folding.
Differential Revision: https://reviews.llvm.org/D74958
Raphael Isemann [Mon, 24 Feb 2020 07:38:44 +0000 (08:38 +0100)]
[lldb] Remove all the 'current_id' logging counters from the lookup code.
Summary:
We have a lot of code in our lookup code to pass around `current_id` counters which end up in our logs like this:
```
AOCTV::FT [234] Found XYZ
```
This patch removes all of this code because:
* I'm splitting up all humongous functions, so I need to write more and more boilerplate to pass around these ids.
* I never saw any similar counters in the LLDB/LLVM code base.
* They're essentially globals and the last thing we need in LLDB is even more global state.
* They're not really useful when readings logs. It doesn't help that there isn't just 1 or 2 counters, but 12 (!) unique counters. I always thought that if I see two identical counter values in those brackets it's the same lookup request, but it seems that's only true by accident (and you can't know which of the 12 counters is actually printed without reading the code). The only time I know I can trust the counters is when it's obvious from the log that it's the same counter like in the log below, but then why have the counters in the first place?
```
LayoutRecordType[28] on (ASTContext*)0x00007FFA1C840200 'scratch ASTContext' for (RecordDecl*)0x00007FFA0AAE8CF0 [name = '__tree']
LRT[28] returned:
LRT[28] Original = (RecordDecl*)%p
LRT[28] Size = %lld
LRT[28] Alignment = %lld
LRT[28] Fields:
LRT[28] (FieldDecl*)0x00007FFA1A13B1D0, Name = '__begin_node_', Offset = 0 bits
LRT[28] (FieldDecl*)0x00007FFA1C08FD30, Name = '__pair1_', Offset = 64 bits
LRT[28] (FieldDecl*)0x00007FFA1C061210, Name = '__pair3_', Offset = 128 bits
LRT[28] Bases:
```
Reviewers: labath, shafik, JDevlieghere
Reviewed By: labath, shafik, JDevlieghere
Subscribers: abidh, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D74951
Lang Hames [Mon, 24 Feb 2020 06:53:48 +0000 (22:53 -0800)]
[JITLink] Add a MachO x86-64 GOT and Stub bypass optimization.
This optimization bypasses GOT loads and calls/branches through stubs when the
ultimate target of the access/branch is found to be within range of the
reference.
Extra debugging output is also added to the generic JITLink algorithm and
basic GOT and Stubs builder utility to aid debugging.
Craig Topper [Mon, 24 Feb 2020 07:00:40 +0000 (23:00 -0800)]
[X86] When creating X86ISD::MGATHER nodes from AVX2 gather intrinsics, cast the mask to integer type.
The gather intrinsics use a floating point mask when the result
type is FP. But we call DemandedBits on the mask assuming its an
integer type. We also use integer types when we create it from
generic IR. So add a bitcast to the intrinsic path to guarantee
the integer type.
Craig Topper [Mon, 24 Feb 2020 03:40:29 +0000 (19:40 -0800)]
[X86] Use custom isel for gather/scatter instructions.
The type profile we use for the isel patterns lied about how
many operands the gather/scatter node has to skip the index
and scale operands. This allowed us to expand the baseptr
operand into base, displacement, and segment and then merge
the index and scale with them in the final instruction during
isel. This is kind of a hack that relies on isel not checking the
number of operands at all.
This commit switches to custom isel where we can manage this
directly without relying on holes in the isel checking.
Craig Topper [Sun, 23 Feb 2020 23:19:04 +0000 (15:19 -0800)]
[SelectionDAG] Remove ISD::LIFETIME_START/LIFETIME_END from assert in getMemIntrinsicNode.
These appear to have their own SDNode type and shouldn't use
MemIntrinsicSDNode.
Siva Chandra Reddy [Wed, 12 Feb 2020 21:03:09 +0000 (13:03 -0800)]
[libc] Add a README to the sub-directories under the utils directory.
Also, the source layout document has been updated to reflect the current
layout of the `utils` directory.
Reviewers: PaulkaToast
Differential Revision: https://reviews.llvm.org/D74502
Shengchen Kan [Sun, 23 Feb 2020 12:35:32 +0000 (20:35 +0800)]
[Driver][X86] Add helptext for malign-branch*, mbranches-within-32B-boundaries
Differential Revision: https://reviews.llvm.org/D75017
QingShan Zhang [Mon, 24 Feb 2020 04:02:24 +0000 (04:02 +0000)]
[NFC][PowerPC] Refactor the tryAndWithMask()
Split the tryAndWithMask into several small calls.
Differential Revision: https://reviews.llvm.org/D72250
Hongtao Yu [Sun, 23 Feb 2020 23:13:27 +0000 (15:13 -0800)]
IR printing for single function with the new pass manager.
Summary:
The IR printing always prints out all functions in a module with the new pass manager, even with -filter-print-funcs specified. This is being fixed in this change. However, there are two exceptions, i.e, with user-specified wildcast switch -filter-print-funcs=* or -print-module-scope, under which IR of all functions should be printed.
Test Plan:
make check-clang
make check-llvm
Reviewers: wenlei
Reviewed By: wenlei
Subscribers: wenlei, hiraditya, cfe-commits, llvm-commits
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D74814
Craig Topper [Sun, 23 Feb 2020 20:50:48 +0000 (12:50 -0800)]
[SelectionDAG] Remove SelectionDAG::getTargetMemSDNode now that its not used.
Targets are expected to use getMemIntrinsicNode and not provide
their own subclasses. X86 was previously the only user.
Craig Topper [Sun, 23 Feb 2020 20:47:42 +0000 (12:47 -0800)]
[X86] Remove most X86 specific subclasses of MemSDNode. Just use a MemIntrinsicSDNode as we usually do.
Leave the gather/scatter subclasses, but make them inherit from
MemIntrinsicSDNode and delete their constructor and destructor.
This way we can still have the getIndex, getMask, etc. convenience
functions.
Craig Topper [Sun, 23 Feb 2020 18:46:34 +0000 (10:46 -0800)]
[X86] Enable the use of movlps for i64 atomic load on 32-bit targets with sse1.
Still a little room for improvement by using movlps to store to
the stack temporary needed to move data out of the xmm register
after the load.
Craig Topper [Sun, 23 Feb 2020 18:21:59 +0000 (10:21 -0800)]
[X86] Use FIST for i64 atomic stores on 32-bit targets without SSE.
Jonas Paulsson [Wed, 19 Feb 2020 22:54:12 +0000 (14:54 -0800)]
[SystemZ] Support the kernel back chain.
In order to build the Linux kernel, the back chain must be supported with
packed-stack. The back chain is then stored topmost in the register save
area.
Review: Ulrich Weigand
Differential Revision: https://reviews.llvm.org/D74506
Sam McCall [Sun, 23 Feb 2020 20:11:58 +0000 (21:11 +0100)]
[clangd] Try to fix buildbots - copy elision not happening here?
Aaron Ballman [Sun, 23 Feb 2020 19:33:37 +0000 (14:33 -0500)]
Updating a comment to clarify that SkipUntil handles balanced delimiters.
Sam McCall [Sun, 23 Feb 2020 19:03:00 +0000 (20:03 +0100)]
[clangd] Reapply
b60896fad926 Fall back to selecting token-before-cursor if token-after-cursor fails.
This reverts commit
b4b9706d5da368c81b86867b1c11a2e17b4472ac.
Now avoiding expected<vector<selection>> in favor of expected<vector<unique_ptr<selection>>>
Florian Hahn [Sun, 23 Feb 2020 19:13:13 +0000 (19:13 +0000)]
[AArch64] Update new test.
Changed after
7769030b9310c1865fd331edb78dc242a39b109a.
Florian Hahn [Sun, 23 Feb 2020 16:32:55 +0000 (16:32 +0000)]
Recommit "[PatternMatch] Match XOR variant of unsigned-add overflow check."
This version fixes a buildbot failure cause by picking the wrong insert
point for XORs. We cannot pick the XOR binary operator as insert point,
as it is not guaranteed that both input operands for the overflow
intrinsic are defined before it.
This reverts the revert commit
c7fc0e5da6c3c36eb5f3a874a6cdeaedb26856e0.
Craig Topper [Sun, 23 Feb 2020 07:01:19 +0000 (23:01 -0800)]
[X86] Regenerate some tests to show FMA4 comments. NFC
Sanjay Patel [Sun, 23 Feb 2020 16:26:28 +0000 (11:26 -0500)]
[SDAG] fold fsub -0.0, undef to undef rather than NaN
A question about this behavior came up on llvm-dev:
http://lists.llvm.org/pipermail/llvm-dev/2020-February/139003.html
...and as part of backend improvements in D73978.
We decided not to implement a more general change that would have
folded any FP binop with nearly arbitrary constant + undef operand
to undef because that is not theoretically correct (even if it is
practically correct).
This is the SDAG-equivalent to the IR change in D74713.
Florian Hahn [Sun, 23 Feb 2020 15:39:15 +0000 (15:39 +0000)]
[DSE] Track overlapping stores.
Add a map from BasicBlocks to overlap intervals. For partial writes, we
can keep track of those in IOLs. We only add candidates that are valid
for eliminations.
Reviewers: dmgreen, bryant, asbirlea, Tyker
Reviewed By: asbirlea
Differential Revision: https://reviews.llvm.org/D73757
Sam McCall [Sun, 23 Feb 2020 15:34:49 +0000 (16:34 +0100)]
Revert "[clangd] Reapply
b60896fad926 Fall back to selecting token-before-cursor if token-after-cursor fails."
This reverts commit
a2ce807eb72a8e154abca09b1e968b2d99ba6933.
Buildbot failures on GCC due to SelectionTree not being copyable, and
instantiating vector<Selection> in the tweak-handling in ClangdServer.
Sam McCall [Sun, 23 Feb 2020 15:09:36 +0000 (16:09 +0100)]
[clangd] Reapply
b60896fad926 Fall back to selecting token-before-cursor if token-after-cursor fails.
This reverts commit
6af1ad20d60ef8ea23f2cfdb02d299b3b3114b06.
Sam McCall [Tue, 4 Feb 2020 11:47:05 +0000 (12:47 +0100)]
[clangd] Debounce rebuilds responsively to rebuild times.
Summary:
Old: 500ms always. New: rebuild time, up to 500ms.
Fixes https://github.com/clangd/clangd/issues/275
Reviewers: hokein
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D73949
Nuno Lopes [Sun, 23 Feb 2020 12:42:47 +0000 (12:42 +0000)]
[NFC] fix test nan value
Denis Khalikov [Sun, 23 Feb 2020 12:05:27 +0000 (15:05 +0300)]
[NFC] Test commit access. Drop trivial braces.
Craig Topper [Sun, 23 Feb 2020 06:40:13 +0000 (22:40 -0800)]
[X86] Add sse2 command lines to sse-intrinsics-fast-isel.ll.
The extra available vector types on sse2 causes us to produce
different code.
Craig Topper [Sun, 23 Feb 2020 05:42:57 +0000 (21:42 -0800)]
[X86] Add AddToWorklist(N) after calls to SimplifyDemandedBits/SimplifyDemandedVectorElts that are called on an operand of N.
If a simplication occurs the operand will be added to the worklist.
But since the demanded mask was based on N, we need to make sure
we revisit N in case there are more simplifications to be done.
Returning SDValue(N, 0) as we do, only tells DAG combine that
something changed, but that won't make it add anything to the
worklist.
Found while playing around with using VEXTRACT_STORE in more cases.
But I guess this doesn't affect any of our existing tests.
Craig Topper [Sun, 23 Feb 2020 02:50:41 +0000 (18:50 -0800)]
[X86] Teach EltsFromConsecutiveLoads that it's ok to form a v4f32 VZEXT_LOAD with a 64 bit memory size on SSE1 targets.
We can use MOVLPS which will load 64 bits, but we need a v4f32
result type. We already have isel patterns for this.
The code here is a little hacky. We can probably improve it with
more isel patterns.
Craig Topper [Sun, 23 Feb 2020 02:15:27 +0000 (18:15 -0800)]
[X86] Use movlps for i64 atomic stores on 32-targets with sse1.
This is similar to using movd which we do for sse2 targets.
I've added a DAG combine for VEXTRACT_STORE to use SimplifyDemandedVectorElts
to clean up some artifacts from type legalization.
Lang Hames [Sat, 22 Feb 2020 17:49:55 +0000 (09:49 -0800)]
[ORC] Update LLJIT to automatically run specially named initializer functions.
The GenericLLVMIRPlatformSupport class runs a transform on all LLVM IR added to
the LLJIT instance to replace instances of llvm.global_ctors with a specially
named function that runs the corresponing static initializers (See
(GlobalCtorDtorScraper from lib/ExecutionEngine/Orc/LLJIT.cpp). This patch
updates the GenericIRPlatform class to check for this specially named function
in other materialization units that are added to the JIT and, if found, add
the function to the initializer work queue. Doing this allows object files
that were compiled from IR and cached to be reloaded in subsequent JIT sessions
without their initializers being skipped.
To enable testing this patch also updates the lli tool's -jit-kind=orc-lazy mode
to respect the -enable-cache-manager and -object-cache-dir options, and modifies
the CompileOnDemandLayer to rename extracted submodules to include a hash of the
names of their symbol definitions. This allows a simple object caching scheme
based on module names (which was already implemented in lli) to work with the
lazy JIT.
Lang Hames [Sat, 22 Feb 2020 01:38:42 +0000 (17:38 -0800)]
[ORC] Add errors for missing and extraneous symbol definitions.
This patch adds new errors and error checking to the ObjectLinkingLayer to
catch cases where a compiled or loaded object either:
(1) Contains definitions not covered by its responsibility set, or
(2) Is missing definitions that are covered by its responsibility set.
Proir to this patch providing the correct set of definitions was treated as
an API contract requirement, however this requires that the client be confident
in the correctness of the whole compiler / object-cache pipeline and results
in difficult-to-debug assertions upon failure. Treating this as a recoverable
error results in clearer diagnostics.
The performance overhead of this check is one comparison of densemap keys
(symbol string pointers) per linking object, which is minimal. If this overhead
ever becomes a problem we can add the check under a flag that can be turned off
if the client fully trusts the rest of the pipeline.
Mark de Wever [Sat, 22 Feb 2020 09:37:41 +0000 (10:37 +0100)]
[Sema] Fix pointer-to-int-cast diagnostic for _Bool
The diagnostic added in D72231 also shows a diagnostic when casting to a
_Bool. This is unwanted. This patch removes the diagnostic for _Bool types.
Differential Revision: https://reviews.llvm.org/D74860
Rafael Ávila de Espíndola [Sat, 22 Feb 2020 17:51:02 +0000 (09:51 -0800)]
Add a llvm::shuffle and use it in lld
With this --shuffle-sections=seed produces the same result in every
host.
Reviewed By: grimar, MaskRay
Differential Revision: https://reviews.llvm.org/D74971
Billy Robert O'Neal III [Sat, 22 Feb 2020 14:57:37 +0000 (06:57 -0800)]
[libcxx] [test] Suppress MSVC++ warning 4640 under /Zc:threadSafeInit-
Tyker [Sat, 22 Feb 2020 13:11:31 +0000 (14:11 +0100)]
Georgii Rymar [Sat, 22 Feb 2020 13:06:55 +0000 (16:06 +0300)]
[lldb][test] - Update basic-elf.yaml to fix build bot.
D74764 (https://reviews.llvm.org/rG31f2ad9c368d47721508cbd0d120d626f9041715)
changed the behavior of the yaml2obj. Now it assigns virtual addresses
for allocatable sections.
SymbolFile/Breakpad/symtab.test started to fail after this change:
(http://lab.llvm.org:8011/builders/lldb-x86_64-debian/builds/5520/steps/test/logs/stdio)
Command Output (stderr):
--
/home/worker/lldb-x86_64-debian/lldb-x86_64-debian/llvm-project/lldb/test/Shell/SymbolFile/Breakpad/symtab.test:6:10: error: CHECK: expected string not found in input
# CHECK: Symtab, file = {{.*}}symtab.out, num_symbols = 5:
^
<stdin>:15:1: note: scanning from here
Symtab, file = /home/worker/lldb-x86_64-debian/lldb-x86_64-debian/build/tools/lldb/test/SymbolFile/Breakpad/Output/symtab.out, num_symbols = 6:
^
<stdin>:15:99: note: possible intended match here
Symtab, file = /home/worker/lldb-x86_64-debian/lldb-x86_64-debian/build/tools/lldb/test/SymbolFile/Breakpad/Output/symtab.out, num_symbols = 6:
For now I've updated the basic-elf.yaml so that now it produce the same layout as before D74764.
Breakpad/symtab.test should be updated it seems.
Georgii Rymar [Tue, 18 Feb 2020 13:49:12 +0000 (16:49 +0300)]
[yaml2obj] - Automatically assign sh_addr for allocatable sections.
I've noticed that it is not convenient to create YAMLs from
binaries (using obj2yaml) that have to be test cases for obj2yaml
later (after applying yaml2obj).
The problem, for example is that obj2yaml emits "DynamicSymbols:"
key instead of .dynsym. It also does not create .dynstr.
And when a YAML document without explicitly defined .dynsym/.dynstr
is given to yaml2obj, we have issues:
1) These sections are placed after non-allocatable sections (I've fixed it in D74756).
2) They have VA == 0. User needs create descriptions for such sections explicitly manually
to set a VA.
This patch addresses (2). I suggest to let yaml2obj assign virtual addresses by itself.
It makes an output binary to be much closer to "normal" ELF.
(It is still possible to use "Address: 0x0" for a section to get the original behavior
if it is needed)
Differential revision: https://reviews.llvm.org/D74764
Simon Moll [Sat, 22 Feb 2020 09:45:16 +0000 (10:45 +0100)]
[VE][fix] missing include
Baden Hughes [Sat, 22 Feb 2020 02:08:33 +0000 (12:08 +1000)]
Update ShapeInference.md
Variety of editorial and typographic and formatting tweaks.
Baden Hughes [Sat, 22 Feb 2020 01:58:37 +0000 (11:58 +1000)]
Update Quantization.md
Various typographic, grammatical and formatting edits and tidy ups.
Roland McGrath [Sat, 22 Feb 2020 07:28:56 +0000 (23:28 -0800)]
[Preprocessor][X86] Fix __code_model_*__ predefine macros
GCC defines __code_model_*__ (two trailing underscores), not
__code_model_*_ (one trailing underscore).
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D75003
Roland McGrath [Sat, 22 Feb 2020 05:25:57 +0000 (21:25 -0800)]
[AArch64] Predefine __AARCH64_CMODEL_*__ as GCC does
Make Clang on aarch64 targets predefine `__AARCH64_CMODEL_SMALL__`
or `__AARCH64_CMODEL_TINY__`, etc. These are the names that GCC
uses for its predefines.
Reviewed By: tamur, MaskRay
Differential Revision: https://reviews.llvm.org/D75002
Fangrui Song [Sat, 22 Feb 2020 06:41:34 +0000 (22:41 -0800)]
[Frontend] Replace CC1 option -mcode-model with -mcmodel=
Before:
% clang -mcmodel=x -xc /dev/null
error: invalid argument 'x' in '-mcode-model x'
Now:
% clang -mcmodel=x -xc /dev/null
clang-11: error: invalid argument 'x' to -mcmodel=
Fangrui Song [Sat, 22 Feb 2020 06:37:40 +0000 (22:37 -0800)]
[Preprocessor][test] Fix __VERSION__ in init-aarch64.c
Fangrui Song [Sat, 22 Feb 2020 05:43:02 +0000 (21:43 -0800)]
[Preprocessor][test] Move AArch64 tests from init.c to init-aarch.c
Quentin Colombet [Sat, 22 Feb 2020 05:07:04 +0000 (21:07 -0800)]
[GISel][KnownBits] Suppress unused warning on the dump method
NFC
Paula Toth [Sat, 22 Feb 2020 03:14:51 +0000 (19:14 -0800)]
[libc] Lay out framework for fuzzing libc functions.
Summary:
Added fuzzing test for strcpy and some documentation related to fuzzing.
This will be the first step in integrating this with oss-fuzz.
Reviewers: sivachandra, abrachet
Reviewed By: sivachandra, abrachet
Subscribers: gchatelet, abrachet, mgorny, MaskRay, tschuett, libc-commits
Tags: #libc-project
Differential Revision: https://reviews.llvm.org/D74091
Fangrui Song [Sat, 22 Feb 2020 02:48:53 +0000 (18:48 -0800)]
[lldb][test] Fix sh_flags and sh_entsize of .debug_str.dwo
sh_flags: SHF_MERGE | SHF_STRINGS | SHF_EXCLUDE
sh_entsize: 1
Incorrect sh_flags or sh_entsize is an error after the assembler change made by D73999.
Craig Topper [Sat, 22 Feb 2020 01:56:35 +0000 (17:56 -0800)]
[X86] Teach combineCVTPH2PS to shrink v8i16 loads when the output type is v4f32. Remove extra isel patterns.
Similar to what do for other operations that use a subset of bits.
Allows us to remove a pattern that shrinks a load. Which was
incorrect if the load was volatile.
Alex Brachet [Sat, 22 Feb 2020 01:48:07 +0000 (20:48 -0500)]
Remove unused variable
Fangrui Song [Sat, 22 Feb 2020 01:37:01 +0000 (17:37 -0800)]
[lldb][test] Fix sh_type of .debug_cu_index and .debug_tu_index
They do not have the SHF_EXCLUDE flag.
After D73999, MC errors `changed section type for .debug_cu_index, expected: 0x0`