Sanjay Patel [Tue, 30 Oct 2018 16:21:56 +0000 (16:21 +0000)]
[InstCombine] use getFltSemantics() instead of duplicating it; NFC
llvm-svn: 345613
Fangrui Song [Tue, 30 Oct 2018 15:56:08 +0000 (15:56 +0000)]
[llvm-mca] Move namespace mca inside llvm::
Summary: This allows to remove `using namespace llvm;` in those *.cpp files
When we want to revisit the decision (everything resides in llvm::mca::*) in the future, we can move things to a nested namespace of llvm::mca::, to conceptually make them separate from the rest of llvm::mca::*
Reviewers: andreadb, mattd
Reviewed By: andreadb
Subscribers: javed.absar, tschuett, gbedwell, llvm-commits
Differential Revision: https://reviews.llvm.org/D53407
llvm-svn: 345612
Samuel Benzaquen [Tue, 30 Oct 2018 15:54:22 +0000 (15:54 +0000)]
Add more benchmarks for std::string.
Summary:
Added benchmarks for Construct, Copy, Move, Destroy, Relationals and
Read. On the ones that matter, the benchmarks tests hot and cold data,
and opaque and transparent inputs.
Reviewers: EricWF
Subscribers: christof, ldionne, libcxx-commits
Differential Revision: https://reviews.llvm.org/D53825
llvm-svn: 345611
Roman Lebedev [Tue, 30 Oct 2018 15:52:36 +0000 (15:52 +0000)]
[clang-tidy] cppcoreguidelines-macro-usage: print macro names
Summary:
The macro may not have location (or more generally, the location may not exist),
e.g. if it originates from compiler's command-line.
The check complains on all the macros, even those without the location info.
Which means, it only says it does not like it. What is 'it'? I have no idea.
If we don't print the name, then there is no way to deal with that situation.
And in general, not printing name here forces the user to try to understand,
given, the macro definition location, what is the macro name?
This isn't fun.
Also, ignores-by-default the macros originating from command-line,
with an option to not ignore those.
I suspect some more issues may crop up later.
Reviewers: JonasToth, aaron.ballman, hokein, xazax.hun, alexfh
Reviewed By: JonasToth, aaron.ballman
Subscribers: nemanjai, kbarton, rnkovacs, cfe-commits
Tags: #clang-tools-extra
Differential Revision: https://reviews.llvm.org/D53817
llvm-svn: 345610
Alexey Bataev [Tue, 30 Oct 2018 15:50:12 +0000 (15:50 +0000)]
[OPENMP] Support for mapping of the lambdas in target regions.
Added support for mapping of lambdas in the target regions. It scans all
the captures by reference in the lambda, implicitly maps those variables
in the target region and then later reinstate the addresses of
references in lambda to the correct addresses of the captured|privatized
variables.
llvm-svn: 345609
Alexey Bataev [Tue, 30 Oct 2018 15:42:12 +0000 (15:42 +0000)]
[LIBOMPTARGET] Add support for mapping of lambda captures.
Summary:
Added support for correct mapping of variables captured by reference in
lambdas. That kind of mapping may appear only in target-executable
regions and must follow the original lambda or another lambda capture
for the same lambda.
The expected data: base address - the address of the lambda, begin
pointer - pointer to the address of the lambda capture, size - size of
the captured variable.
When OMP_TGT_MAPTYPE_PTR_AND_OBJ mapping type is seen in
target-executable region, the target address of the last processed item
is taken as the address of the original lambda `tgt_lambda_ptr`. Then,
the pointer to capture on the device is calculated like `tgt_lambda_ptr
+ (host_begin_pointer - host_begin_base)` and the target-based address
of the original variable (which host address is
`*(void**)begin_pointer`) is written to that pointer.
Reviewers: kkwli0, gtbercea, grokos
Subscribers: openmp-commits
Differential Revision: https://reviews.llvm.org/D51107
llvm-svn: 345608
Sanjay Patel [Tue, 30 Oct 2018 15:26:39 +0000 (15:26 +0000)]
[InstCombine] try to turn shuffle into insertelement
shuffle (insert ?, Scalar, IndexC), V1, Mask --> insert V1, Scalar, IndexC'
The motivating case is at least a couple of steps away: I noticed that
SLPVectorizer does not analyze shuffles as well as sequences of
insert/extract in PR34724:
https://bugs.llvm.org/show_bug.cgi?id=34724
...so SLP may fail to vectorize when source code has shuffles to start
with or instcombine has converted insert/extract to shuffles.
Independent of that, an insertelement is always a simpler op for IR
analysis vs. a shuffle, so we should transform to insert when possible.
I don't think there's any codegen concern here - if a target can't insert
a scalar directly to some fixed element in a vector (x86?), then this
should get expanded to the insert+shuffle that we started with.
Differential Revision: https://reviews.llvm.org/D53507
llvm-svn: 345607
Jonas Paulsson [Tue, 30 Oct 2018 15:04:40 +0000 (15:04 +0000)]
[SchedModel] Fix for read advance cycles with implicit pseudo operands.
The SchedModel allows the addition of ReadAdvances to express that certain
operands of the instructions are needed at a later point than the others.
RegAlloc may add pseudo operands that are not part of the instruction
descriptor, and therefore cannot have any read advance entries. This meant
that in some cases the desired read advance was nullified by such a pseudo
operand, which still had the original latency.
This patch fixes this by making sure that such pseudo operands get a zero
latency during DAG construction.
Review: Matthias Braun, Ulrich Weigand.
https://reviews.llvm.org/D49671
llvm-svn: 345606
Bruno Ricci [Tue, 30 Oct 2018 14:40:49 +0000 (14:40 +0000)]
[AST] Only store data for the NRVO candidate in ReturnStmt if needed
Only store the NRVO candidate if needed in ReturnStmt.
A good chuck of all of the ReturnStmt have no NRVO candidate
(more than half when parsing all of Boost). For all of them
this saves one pointer. This has no impact on children().
Differential Revision: https://reviews.llvm.org/D53716
Reviewed By: rsmith
llvm-svn: 345605
Sean Fertile [Tue, 30 Oct 2018 14:37:17 +0000 (14:37 +0000)]
[PPC64] Handle powerpc64 in OUTPUT_FORMAT.
Differential Revision: https://reviews.llvm.org/D53652
llvm-svn: 345604
Jonas Paulsson [Tue, 30 Oct 2018 14:34:15 +0000 (14:34 +0000)]
[LoopVectorizer] Fix for cost values of memory accesses.
This commit is a combination of two patches:
* "Fix in getScalarizationOverhead()"
If target returns false in TTI.prefersVectorizedAddressing(), it means the
address registers will not need to be extracted. Therefore, there should
be no operands scalarization overhead for a load instruction.
* "Don't pass the instruction pointer from getMemInstScalarizationCost."
Since VF is always > 1, this is a cost query for an instruction in the
vectorized loop and it should not be evaluated within the scalar
context of the instruction.
Review: Ulrich Weigand, Hal Finkel
https://reviews.llvm.org/D52351
https://reviews.llvm.org/D52417
llvm-svn: 345603
Sanjay Patel [Tue, 30 Oct 2018 14:14:34 +0000 (14:14 +0000)]
[DAGCombiner] narrow vector binops when extraction is cheap
Narrowing vector binops came up in the demanded bits discussion in D52912.
I don't think we're going to be able to do this transform in IR as a canonicalization
because of the risk of creating unsupported widths for vector ops, but we already have
a DAG TLI hook to allow what I was hoping for: isExtractSubvectorCheap(). This is
currently enabled for x86, ARM, and AArch64 (although only x86 has existing regression
test diffs).
This is artificially limited to not look through bitcasts because there are so many
test diffs already, but that's marked with a TODO and is a small follow-up.
Differential Revision: https://reviews.llvm.org/D53784
llvm-svn: 345602
Diogo N. Sampaio [Tue, 30 Oct 2018 13:59:21 +0000 (13:59 +0000)]
[FIX][AArch64] Add support for UDF instruction
Fix: Simplify test files from rL345581 failing
in windows bots.
llvm-svn: 345601
Kamil Rytarowski [Tue, 30 Oct 2018 13:58:45 +0000 (13:58 +0000)]
Disable ASan test asan_and_llvm_coverage_test for NetBSD
Right now the LLVM profile feature is turned off for this OS.
llvm-svn: 345600
Kamil Rytarowski [Tue, 30 Oct 2018 13:49:15 +0000 (13:49 +0000)]
Adapt ASan test heavy_uar_test for NetBSD
The stack size is tight for the main thread in multithread
environment and follow the FreeBSD approach of reducing stack
usage.
llvm-svn: 345599
Sanjay Patel [Tue, 30 Oct 2018 13:47:19 +0000 (13:47 +0000)]
[SelectionDAG] fix build warning for mismatched signs in compare; NFC
llvm-svn: 345598
Bruno Ricci [Tue, 30 Oct 2018 13:42:41 +0000 (13:42 +0000)]
[AST] Only store the needed data in WhileStmt
Don't store the data for the condition variable if not needed.
This cuts the size of WhileStmt by up to a pointer.
The order of the children is kept the same.
Differential Revision: https://reviews.llvm.org/D53715
Reviewed By: rjmccall
llvm-svn: 345597
Jonas Paulsson [Tue, 30 Oct 2018 13:41:03 +0000 (13:41 +0000)]
[SystemZ] Improve isFoldableLoad() for Sub, SDiv and UDiv.
Sub, SDiv and UDiv are not commutative, so only the RHS operand can fold a
load. This patch adds a check for this.
Review: Ulrich Weigand
https://reviews.llvm.org/D53791
llvm-svn: 345596
Kamil Rytarowski [Tue, 30 Oct 2018 13:28:32 +0000 (13:28 +0000)]
Mark breaking TSan tests on NetBSD with XFAIL
Failing tests:
- dtls
- ignored-interceptors-mmap
- mutex_lock_destroyed
llvm-svn: 345595
Roman Lebedev [Tue, 30 Oct 2018 12:37:16 +0000 (12:37 +0000)]
[clang] Move two utility functions into SourceManager
Summary: So we can keep that not-so-great logic in one place.
Reviewers: rsmith, aaron.ballman
Reviewed By: rsmith
Subscribers: nemanjai, kbarton, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D53837
llvm-svn: 345594
Francis Visoiu Mistrih [Tue, 30 Oct 2018 12:20:17 +0000 (12:20 +0000)]
[X86] Re-enable the machine verifier after fixing more tests
Was disabled again in r345528. Hopefully this the bots.
llvm-svn: 345593
Diogo N. Sampaio [Tue, 30 Oct 2018 12:19:55 +0000 (12:19 +0000)]
[FIX][AArch64] lld test change
Adding AArch64 UDF, in rL345581,
breaks some lld test files, due
different decoding
llvm-svn: 345592
Francis Visoiu Mistrih [Tue, 30 Oct 2018 12:18:33 +0000 (12:18 +0000)]
[CodeGen] Disable the machine verifier on a ThinLTO test
This allows us to turn the machine verifier on by default on X86.
llvm-svn: 345591
Kadir Cetinkaya [Tue, 30 Oct 2018 12:13:27 +0000 (12:13 +0000)]
[clangd] Use thread pool for background indexing.
Reviewers: sammccall, ioeric
Reviewed By: sammccall
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, jfb, cfe-commits
Differential Revision: https://reviews.llvm.org/D53651
llvm-svn: 345590
Francis Visoiu Mistrih [Tue, 30 Oct 2018 12:07:18 +0000 (12:07 +0000)]
[llc] Error out when -print-machineinstrs is used with an unknown pass
We used to assert instead of reporting an error.
PR39494
llvm-svn: 345589
James Henderson [Tue, 30 Oct 2018 11:52:47 +0000 (11:52 +0000)]
[llvm-size] Reject unknown radix values
This addresses https://bugs.llvm.org/show_bug.cgi?id=39403 by making
-radix an enumeration option with 8, 10, and 16 as the only accepted
values.
Reviewed by: jhenderson, MaskRay
Differential Revision: https://reviews.llvm.org/D53799
Patch by Eugene Sharygin
llvm-svn: 345588
Diogo N. Sampaio [Tue, 30 Oct 2018 11:39:33 +0000 (11:39 +0000)]
[FIX][AArch64] Add support for UDF instruction
Fix wrong test files submited
in rL345581
llvm-svn: 345587
Kamil Rytarowski [Tue, 30 Oct 2018 11:34:36 +0000 (11:34 +0000)]
Cleanup includes in sanitizer_platform_limits_netbsd.cc
Sort the headers more correctly according to NetBSD style.
Prevent in this code part clang-format, as shuffling the order
will cause build failures.
llvm-svn: 345586
Nicola Zaghen [Tue, 30 Oct 2018 11:15:04 +0000 (11:15 +0000)]
[SROA] Use offset sizes from the DataLayout instead of the pointer siezes.
This fixes an assertion when constant folding a GEP when the part of the offset
was in i32 (IndexSize, as per DataLayout) and part in the i64 (PointerSize) in
the newly created test case.
Differential Revision: https://reviews.llvm.org/D52609
llvm-svn: 345585
Roman Lebedev [Tue, 30 Oct 2018 11:12:34 +0000 (11:12 +0000)]
[X86][BMI1] X86DAGToDAGISel: select BEXTR from x & (-1 >> (32 - y)) pattern
Summary:
The final pattern.
There is no test changes:
* We are looking for the pattern with one-use of it's mask,
* If the mask is one-use, D48768 will unfold it into pattern d.
* Thus, the tests have extra-use on the mask.
* Thus, only the BMI2 BZHI can be tested, and it already worked.
* So there is no BMI1 test coverage, we just assume it works since it uses the same codepath.
Reviewers: craig.topper, RKSimon
Reviewed By: RKSimon
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D53575
llvm-svn: 345584
Roman Lebedev [Tue, 30 Oct 2018 11:12:29 +0000 (11:12 +0000)]
[X86] Add extra-uses on the mask of pattern c of extract-{low,}bits.ll tests
Summary:
Because of the D48768, that pattern is always unfolded into pattern d,
thus we had no test coverage.
Reviewers: RKSimon, craig.topper
Reviewed By: craig.topper
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D53574
llvm-svn: 345583
Kamil Rytarowski [Tue, 30 Oct 2018 11:10:36 +0000 (11:10 +0000)]
Regenerate syscall hooks for NetBSD 8.99.25
Register new syscall getsockopt2.
Drop removed syscalls pmc_get_info and pmc_control.
While there address compiler warnings about potentially
unused variables.
llvm-svn: 345582
Diogo N. Sampaio [Tue, 30 Oct 2018 11:06:50 +0000 (11:06 +0000)]
[AArch64] Add support for UDF instruction
Summary: Add support for AArch64 UDF instruction.
UDF - Permanently Undefined generates an Undefined
Instruction exception (ESR_ELx.EC =
0b000000).
Reviewers: DavidSpickett, javed.absar, t.p.northover
Reviewed By: javed.absar
Subscribers: nhaehnle, kristof.beyls
Differential Revision: https://reviews.llvm.org/D53319
llvm-svn: 345581
Kamil Rytarowski [Tue, 30 Oct 2018 11:03:37 +0000 (11:03 +0000)]
Update generate_netbsd_syscalls.awk for NetBSD 8.99.25
Register new syscall getsockopt2.
Drop removed syscalls pmc_get_info and pmc_control.
While there address compiler warnings about potentially
unused variables.
llvm-svn: 345580
James Henderson [Tue, 30 Oct 2018 10:55:14 +0000 (10:55 +0000)]
[ELF][PPC64]Workaround bogus Visual Studio build warning
Visual Studio has a bug where it converts the integer literal
2147483648
into an unsigned int instead of a long long (i.e. it follows C89 rules).
The bug has been reported as:
https://developercommunity.visualstudio.com/content/problem/141813/-
2147483648-c4146-error.html.
Because of this bug, we were getting a signed/unsigned comparison
warning in VS2015 from the old code (the subsequent unary negation had
no effect on the type).
Reviewed by: sfertile
Differential Revision: https://reviews.llvm.org/D53821
llvm-svn: 345579
Simon Pilgrim [Tue, 30 Oct 2018 10:32:11 +0000 (10:32 +0000)]
[SelectionDAG] Add FoldBUILD_VECTOR to simplify new BUILD_VECTOR nodes
Similar to FoldCONCAT_VECTORS, this patch adds FoldBUILD_VECTOR to simplify cases that can avoid the creation of the BUILD_VECTOR - if all the operands are UNDEF or if the BUILD_VECTOR simplifies to a copy.
This exposed an assumption in some AMDGPU code that getBuildVector was guaranteed to be a BUILD_VECTOR node that I've tried to handle.
Differential Revision: https://reviews.llvm.org/D53760
llvm-svn: 345578
Aleksandr Urakov [Tue, 30 Oct 2018 10:07:08 +0000 (10:07 +0000)]
[x86] Fix issues with a realigned stack in MSVC compiled applications
Summary:
This patch fixes issues with a stack realignment.
MSVC maintains two frame pointers (`ebx` and `ebp`) for a realigned stack - one
is used for access to function parameters, while another is used for access to
locals. To support this the patch:
- adds an alternative frame pointer (`ebx`);
- considers stack realignment instructions (e.g. `and esp, -32`);
- along with CFA (Canonical Frame Address) which point to the position next to
the saved return address (or to the first parameter on the stack) introduces
AFA (Aligned Frame Address) which points to the position of the stack pointer
right after realignment. AFA is used for access to registers saved after the
realignment (see the test);
Here is an example of the code with the realignment:
```
struct __declspec(align(256)) OverAligned {
char c;
};
void foo(int foo_arg) {
OverAligned oa_foo = { 1 };
auto aaa_foo = 1234;
}
void bar(int bar_arg) {
OverAligned oa_bar = { 2 };
auto aaa_bar = 5678;
foo(1111);
}
int main() {
bar(2222);
return 0;
}
```
and here is the `bar` disassembly:
```
push ebx
mov ebx, esp
sub esp, 8
and esp, -100h
add esp, 4
push ebp
mov ebp, [ebx+4]
mov [esp+4], ebp
mov ebp, esp
sub esp, 200h
mov byte ptr [ebp-200h], 2
mov dword ptr [ebp-4], 5678
push 1111 ; foo_arg
call j_?foo@@YAXH@Z ; foo(int)
add esp, 4
mov esp, ebp
pop ebp
mov esp, ebx
pop ebx
retn
```
Reviewers: labath, zturner, jasonmolenda, stella.stamenova
Reviewed By: jasonmolenda
Subscribers: abidh, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D53435
llvm-svn: 345577
Takuto Ikuta [Tue, 30 Oct 2018 09:42:49 +0000 (09:42 +0000)]
Remove trailing space from clang/Basic/LangOptions.h
llvm-svn: 345576
David Bolvansky [Tue, 30 Oct 2018 09:07:22 +0000 (09:07 +0000)]
[DAGCombiner] Improve X div/rem Y fold if single bit element type
Summary: Tests by @spatel, thanks
Reviewers: spatel, RKSimon
Reviewed By: spatel
Subscribers: sdardis, atanasyan, llvm-commits, spatel
Differential Revision: https://reviews.llvm.org/D52668
llvm-svn: 345575
Kamil Rytarowski [Tue, 30 Oct 2018 08:51:34 +0000 (08:51 +0000)]
Handle pthread_sigmask in DemangleFunctionName()
Translate __libc_thr_sigsetmask to pthread_sigmask on NetBSD.
llvm-svn: 345574
Bjorn Pettersson [Tue, 30 Oct 2018 08:49:26 +0000 (08:49 +0000)]
[OPENMP] Fix for "error: unused variable 'CED'"
Quick fix to make code compile with -Werror,-Wunused-variable.
llvm-svn: 345573
Kamil Rytarowski [Tue, 30 Oct 2018 08:32:47 +0000 (08:32 +0000)]
Drop now hidden ioctl(2) operations for NetBSD
POWER_IOC_GET_TYPE_WITH_LOSSAGE is no longer accessible from userland.
llvm-svn: 345572
Kamil Rytarowski [Tue, 30 Oct 2018 08:16:14 +0000 (08:16 +0000)]
Handle NetBSD symbol mangling for tzset
Native code generated on NetBSD mangles tzet to __tzset50.
Handle this accordingly in MSan.
llvm-svn: 345571
Kamil Rytarowski [Tue, 30 Oct 2018 08:06:42 +0000 (08:06 +0000)]
Handle NetBSD symbol mangling for nanosleep and vfork
Summary:
Native code generated on NetBSD mangles:
- vfork into __vfork14
- nanosleep into __nanosleep50
Handle this accordingly in TSan.
Reviewers: vitalybuka, dvyukov, joerg
Reviewed By: vitalybuka
Subscribers: kubamracek, llvm-commits, #sanitizers, mgorny
Tags: #sanitizers
Differential Revision: https://reviews.llvm.org/D53806
llvm-svn: 345570
Saleem Abdulrasool [Tue, 30 Oct 2018 06:29:28 +0000 (06:29 +0000)]
Utility: fix cross-compilation from Linux to Windows
Only attempt to link against Backtrace if it is found. Without this,
trying to cross-compile to Windows would try to link against
"Backtrace_LIBRARY-NOTFOUND.lib".
llvm-svn: 345569
Dean Michael Berris [Tue, 30 Oct 2018 04:35:48 +0000 (04:35 +0000)]
[XRay] Migrate FDR runtime to use refactored controller
Summary:
This change completes the refactoring of the FDR runtime to support the
following:
- Generational buffer management.
- Centralised and well-tested controller implementation.
In this change we've had to:
- Greatly simplify the code in xray_fdr_logging.cc to only implement the
glue code for calling into the controller.
- Implement the custom and typed event logging functions in the
FDRLogWriter.
- Imbue the `XRAY_NEVER_INSTRUMENT` attribute onto all functions in the
controller implementation.
Reviewers: mboerger, eizan, jfb
Subscribers: jfb, llvm-commits
Differential Revision: https://reviews.llvm.org/D53858
llvm-svn: 345568
Craig Topper [Tue, 30 Oct 2018 03:27:15 +0000 (03:27 +0000)]
[LegalizeTypes] Teach PromoteIntRes_BITCAST to better handle a bitcast with vector output type and a vector input type that needs to be widened
Summary: Previously if we had a bitcast vector output type that needs promotion and a vector input type that needs widening we would just do a stack store and load to handle the conversion. We can do a little better if we can widen the bitcast to a legal vector type the same size as the widened input type. Then we can do the bitcast between this widened type and the widened input type. Afterwards we can extract_subvector back to the original output and any_extend that. Type legalization will then circle back and handle promotion of the extract_subvector and the any_extend will just be removed. This will avoid going through the stack and allows us to remove a custom version of this legalization from X86.
Reviewers: efriedma, RKSimon
Reviewed By: efriedma
Subscribers: javed.absar, llvm-commits
Differential Revision: https://reviews.llvm.org/D53229
llvm-svn: 345567
Craig Topper [Tue, 30 Oct 2018 03:27:13 +0000 (03:27 +0000)]
[AArch64] Add test case for D53229. NFC
llvm-svn: 345566
Craig Topper [Tue, 30 Oct 2018 03:27:12 +0000 (03:27 +0000)]
[X86] Cleanup the code in LowerFABSorFNEG and LowerFCOPYSIGN a little. NFC
Use SelectionDAG::EVTToAPFloatSemantics. Make the LogicVT calculation in LowerFABSorFNEG similar to LowerFCOPYSIGN. Use APInt::getSignedMaxValue instead of ~APInt::getSignMask.
llvm-svn: 345565
Craig Topper [Tue, 30 Oct 2018 03:27:11 +0000 (03:27 +0000)]
[X86] Stop changing f128 fand/for/fxor to v2i64.
The additional patterns don't cost us much and it seems better than changing element widths.
llvm-svn: 345564
Marc-Andre Laperle [Tue, 30 Oct 2018 03:10:41 +0000 (03:10 +0000)]
[lldb-mi] Implement -gdb-set breakpoint pending on/off
Summary:
This allows creating pending breakpoint automatically when a location is not found.
This is used by some front-ends instead of doing "-break-insert -f" every time.
See also https://sourceware.org/gdb/onlinedocs/gdb/Set-Breaks.html
Signed-off-by: Marc-Andre Laperle <malaperle@gmail.com>
Subscribers: MaskRay, llvm-commits, lldb-commits, ki.stfu
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D52953
llvm-svn: 345563
Richard Smith [Tue, 30 Oct 2018 02:02:49 +0000 (02:02 +0000)]
PR23833, DR2140: an lvalue-to-rvalue conversion on a glvalue of type
nullptr_t does not access memory.
We now reuse CK_NullToPointer to represent a conversion from a glvalue
of type nullptr_t to a prvalue of nullptr_t where necessary.
llvm-svn: 345562
Eric Fiselier [Tue, 30 Oct 2018 02:02:00 +0000 (02:02 +0000)]
Unify definition of _LIBCPP_BEGIN/END_NAMESPACE_STD
llvm-svn: 345561
Matt Arsenault [Tue, 30 Oct 2018 01:37:59 +0000 (01:37 +0000)]
AMDGPU: Remove custom BUILD_VECTOR combine
This was looping in a testcase and removing it
now slightly improves a test.
llvm-svn: 345560
Matt Arsenault [Tue, 30 Oct 2018 01:33:14 +0000 (01:33 +0000)]
AMDGPU: Use scavengeRegisterBackwards
llvm-svn: 345559
Alexander Shaposhnikov [Tue, 30 Oct 2018 01:20:37 +0000 (01:20 +0000)]
[analyzer] Allow padding checker to traverse simple class hierarchies
The existing padding checker skips classes that have any base classes.
This patch allows the checker to traverse very simple cases:
classes that have no fields and have exactly one base class.
This is important mostly in the case of array declarations.
Patch by Max Bernstein!
Test plan: make check-all
Differential revision: https://reviews.llvm.org/D53206
llvm-svn: 345558
Vitaly Buka [Tue, 30 Oct 2018 01:20:12 +0000 (01:20 +0000)]
[ubsan-minimal] update comments in CMakeLists.txt
Summary:
Prepend minimal when UBsan is mentioned and delete a dead comment
Patch by Igor Sugak
Reviewers: eugenis, pcc
Reviewed By: eugenis
Subscribers: mgorny, llvm-commits, #sanitizers
Differential Revision: https://reviews.llvm.org/D53826
llvm-svn: 345557
Vitaly Buka [Tue, 30 Oct 2018 01:20:01 +0000 (01:20 +0000)]
[sanitizer] Move interceptor initialization check into real_clock_gettime
Reviewers: cryptoad, kubamracek
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D53777
llvm-svn: 345556
Matt Arsenault [Tue, 30 Oct 2018 01:12:12 +0000 (01:12 +0000)]
Remove dead declaration
llvm-svn: 345555
Matt Arsenault [Tue, 30 Oct 2018 01:11:52 +0000 (01:11 +0000)]
Fix typos in comment
llvm-svn: 345554
Matt Arsenault [Tue, 30 Oct 2018 01:11:31 +0000 (01:11 +0000)]
Pass TRI to printReg
llvm-svn: 345553
Petr Hosek [Mon, 29 Oct 2018 23:10:49 +0000 (23:10 +0000)]
[CMake][Fuchsia] Drop the LIBCXX_HIDE_FROM_ABI_PER_TU_BY_DEFAULT
Now that libc++ uses __exclude_from_explicit_instantiation__ attribute,
this is no longer needed.
Differential Revision: https://reviews.llvm.org/D53839
llvm-svn: 345552
Erik Pilkington [Mon, 29 Oct 2018 23:01:26 +0000 (23:01 +0000)]
[compiler-rt][builtins] Don't #include CoreFoundation in os_version_check.c
This breaks some configurations, so just forward declare everything that we need.
rdar://
35943793
Differential revision: https://reviews.llvm.org/D50269
llvm-svn: 345551
Reid Kleckner [Mon, 29 Oct 2018 22:48:14 +0000 (22:48 +0000)]
[builtins] Fix -Wunused-local-typedef warning in compile time asserts
Use the __attribute__ spellings when compiling with clang-cl so that
__attribute__((unused)) expands to something.
llvm-svn: 345550
Reid Kleckner [Mon, 29 Oct 2018 22:38:13 +0000 (22:38 +0000)]
Remove unneeded friend declarations that clang-cl warns on
llvm-svn: 345549
Alina Sbirlea [Mon, 29 Oct 2018 22:25:59 +0000 (22:25 +0000)]
[AliasSetTracker] Cleanup addPointer interface. [NFCI]
Summary:
Attempting to simplify the addPointer interface.
Currently there's code decomposing a MemoryLocation into (Ptr, Size, AAMDNodes) only to recreate the MemoryLocation inside the call.
Reviewers: reames, mkazantsev
Subscribers: sanjoy, jlebar, llvm-commits
Differential Revision: https://reviews.llvm.org/D53836
llvm-svn: 345548
Petr Hosek [Mon, 29 Oct 2018 22:16:56 +0000 (22:16 +0000)]
[CMake] When built with LLVM, not use `-Wl,-z,defs`
This matches standalone build behavior. PR28681
Differential Revision: https://reviews.llvm.org/D53686
Patch By: tabloid.adroit
llvm-svn: 345547
Wolfgang Pieb [Mon, 29 Oct 2018 22:16:47 +0000 (22:16 +0000)]
[DWARF][NFC] Refactor range list extraction and dumping
The purpose of this patch is twofold:
- Fold pre-DWARF v5 functionality into v5 to eliminate the need for 2 different
versions of range list handling. We get rid of DWARFDebugRangelist{.cpp,.h}.
- Templatize the handling of range list tables so that location list handling
can take advantage of it as well. Location list and range list tables have the
same basic layout.
A non-NFC version of this patch was previously submitted with r342218, but it caused
errors with some TSan tests. This patch has no functional changes. The difference to
the non-NFC patch is that there are no changes to rangelist dumping in this patch.
Differential Revision: https://reviews.llvm.org/D53545
llvm-svn: 345546
Aleksei Sidorin [Mon, 29 Oct 2018 21:46:18 +0000 (21:46 +0000)]
[ASTImporter] Reorder fields after structure import is finished
There are multiple reasons why field structures can be imported
in wrong order. The simplest is the ability of field initializers
and method bodies to refer fields not in order they are listed in.
Unfortunately, there is no clean solution for that currently
so I'm leaving a FIXME.
Differential Revision: https://reviews.llvm.org/D44100
llvm-svn: 345545
Alexander Shaposhnikov [Mon, 29 Oct 2018 21:22:58 +0000 (21:22 +0000)]
[llvm-objcopy] Move elf-specific code into subfolder
In this diff the elf-specific code is moved into the subfolder ELF
(and factored out from llvm-objcopy.cpp).
Test plan: make check-all
Differential revision: https://reviews.llvm.org/D53790
llvm-svn: 345544
Erich Keane [Mon, 29 Oct 2018 21:21:55 +0000 (21:21 +0000)]
Add parens to fix incorrect assert check.
&& has higher priority than ||, so this assert works really oddly. Add
parens to match the programmer's intent.
Change-Id: I3abe1361ee0694462190c5015779db664012f3d4
llvm-svn: 345543
Konstantin Zhuravlyov [Mon, 29 Oct 2018 21:07:27 +0000 (21:07 +0000)]
AMDGPU: Enable code object v3 by default
Differential Revision: https://reviews.llvm.org/D53525
llvm-svn: 345542
Sanjay Patel [Mon, 29 Oct 2018 21:05:41 +0000 (21:05 +0000)]
[InstSimplify] add tests for abs/nabs+icmp folding; NFC
llvm-svn: 345541
Petr Hosek [Mon, 29 Oct 2018 21:04:12 +0000 (21:04 +0000)]
[Driver] Include missing touch files for sanitized library paths
These were forgotten in r345537 causing test failures on Clang builders.
Differential Revision: https://reviews.llvm.org/D53833
llvm-svn: 345540
Fedor Sergeev [Mon, 29 Oct 2018 20:38:23 +0000 (20:38 +0000)]
[LoopUnroll] NFC. Factor out runtime-loop.ll common test behavior.
Adding COMMON prefix to get common part handled there.
Needed to simplify test changes for D53440.
llvm-svn: 345538
Petr Hosek [Mon, 29 Oct 2018 20:37:52 +0000 (20:37 +0000)]
[Driver] Support sanitized libraries on Fuchsia
When using sanitizers, add <resource_dir>/<target>/lib/<sanitizer>
to the list of library paths to support using sanitized version of
runtime libraries if available.
Differential Revision: https://reviews.llvm.org/D53487
llvm-svn: 345537
John McCall [Mon, 29 Oct 2018 20:32:36 +0000 (20:32 +0000)]
In swiftcall, don't merge FP/vector types within a chunk.
llvm-svn: 345536
Jessica Paquette [Mon, 29 Oct 2018 20:27:07 +0000 (20:27 +0000)]
[MachineOutliner] Inherit target features from parent function
If a function has target features, it may contain instructions that aren't
represented in the default set of instructions. If the outliner pulls out one
of these instructions, and the function doesn't have the right attributes
attached, we'll run into an LLVM error explaining that the target doesn't
support the necessary feature for the instruction.
This makes outlined functions inherit target features from their parents.
It also updates the machine-outliner.ll test to check that we're properly
inheriting target features.
llvm-svn: 345535
Petr Hosek [Mon, 29 Oct 2018 20:20:26 +0000 (20:20 +0000)]
[libc++abi] Provide __cxa_thread_atexit on Fuchsia
Fuchsia already supports this interface.
Differential Revision: https://reviews.llvm.org/D53801
llvm-svn: 345534
Alexey Bataev [Mon, 29 Oct 2018 20:17:42 +0000 (20:17 +0000)]
[OPENMP]Fix PR39372: Does not complain about loop bound variable not
being shared.
According to the standard, the variables with unspecified data-sharing
attributes in presence of `default(none)` clause must be reported to
users. Compiler did not generate error reports for the variables used in
other OpenMP regions. Patch fixes this.
llvm-svn: 345533
Matthias Braun [Mon, 29 Oct 2018 20:10:42 +0000 (20:10 +0000)]
Relax fast register allocator related test cases; NFC
- Relex hard coded registers and stack frame sizes
- Some test cleanups
- Change phi-dbg.ll to match on mir output after phi elimination instead
of going through the whole codegen pipeline.
This is in preparation for https://reviews.llvm.org/D52010
I'm committing all the test changes upfront that work before and after
independently.
llvm-svn: 345532
Kristof Umann [Mon, 29 Oct 2018 20:06:30 +0000 (20:06 +0000)]
[analyzer][NFC] Refactor PlistDiagnostics to use a class instead of passing 9 parameters around
This has been a long time coming. Note the usage of AnalyzerOptions: I'll need
it for D52742, and added it in rC343620. The main motivation for this was that
I'll need to add yet another parameter to every single function, and some
functions would reach their 10th parameter with that change.
llvm-svn: 345531
Konstantin Zhuravlyov [Mon, 29 Oct 2018 19:59:12 +0000 (19:59 +0000)]
AMDGPU: Switch some lld tests to v2
Differential Revision: https://reviews.llvm.org/D53526
llvm-svn: 345530
Eric Fiselier [Mon, 29 Oct 2018 19:52:22 +0000 (19:52 +0000)]
XFAIL test on OS X availability
llvm-svn: 345529
Simon Pilgrim [Mon, 29 Oct 2018 19:51:52 +0000 (19:51 +0000)]
[X86] Set isMachineVerifierClean() back to false (PR27481)
Put back the isMachineVerifierClean() override removed at rL345513 to fix Windows ThinLTO tests
llvm-svn: 345528
Gheorghe-Teodor Bercea [Mon, 29 Oct 2018 19:44:25 +0000 (19:44 +0000)]
[OpenMP] Fix condition.
Summary: Iteration variable must be strictly less than the number of iterations. This fixes a bug introduced by previous patch D53448.
Reviewers: ABataev, caomhin
Reviewed By: ABataev
Subscribers: guansong, cfe-commits
Differential Revision: https://reviews.llvm.org/D53827
llvm-svn: 345527
Marshall Clow [Mon, 29 Oct 2018 19:31:35 +0000 (19:31 +0000)]
Added Phab link for P0927
llvm-svn: 345526
Eric Fiselier [Mon, 29 Oct 2018 19:25:02 +0000 (19:25 +0000)]
Bug 39129: Speeding up partition_point/lower_bound/upper_bound/ by using unsigned division by 2 when possible.
Patch by Denis Yaroshevskiy (denis.yaroshevskij@gmail.com)
The rational and measurements can be found in the bug description: https://bugs.llvm.org/show_bug.cgi?id=39129
Reviewed as https://reviews.llvm.org/D52697
llvm-svn: 345525
Vedant Kumar [Mon, 29 Oct 2018 19:15:39 +0000 (19:15 +0000)]
[HotColdSplitting] Allow outlining single-block cold regions
It can be profitable to outline single-block cold regions because they
may be large.
Allow outlining single-block regions if they have over some threshold of
non-debug, non-terminator instructions. I chose 3 as the threshold after
experimenting with several internal frameworks.
In practice, reducing the threshold further did not give much
improvement, whereas increasing it resulted in substantial regressions.
Differential Revision: https://reviews.llvm.org/D53824
llvm-svn: 345524
Samuel Benzaquen [Mon, 29 Oct 2018 19:08:31 +0000 (19:08 +0000)]
Fix mismatch between size_t and uint64_t in std::set benchmark.
llvm-svn: 345523
Stephen Kelly [Mon, 29 Oct 2018 18:59:56 +0000 (18:59 +0000)]
[clang-query] Add non-exclusive output API
Summary:
Add granular options for AST dumping, text printing and diagnostics.
This makes it possible to
* Have both diag and dump active at once
* Extend the output with other queryable content in the future.
Reviewers: aaron.ballman, pcc, ioeric, ilya-biryukov, klimek, sammccall
Reviewed By: aaron.ballman
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D52857
llvm-svn: 345522
Thomas Lively [Mon, 29 Oct 2018 18:38:12 +0000 (18:38 +0000)]
[WebAssembly] Lower away condition truncations for scalar selects
Reviewers: aheejin, dschuff
Subscribers: sbc100, jgravelle-google, sunfish, llvm-commits
Differential Revision: https://reviews.llvm.org/D53676
llvm-svn: 345521
Simon Pilgrim [Mon, 29 Oct 2018 18:25:48 +0000 (18:25 +0000)]
[X86][SSE] getFauxShuffleMask - Fix shuffle mask adjustment for multiple inserted subvectors
Part of the issue discovered in PR39483, although its not fully exposed until I reapply rL345395 (by reverting rL345451)
llvm-svn: 345520
Craig Topper [Mon, 29 Oct 2018 18:17:01 +0000 (18:17 +0000)]
[X86] Add AES to KNL CPUs to match clang.
I believe this was lost from KNL when AES was pushed from Westmere to Skylake recently. KNL used to inherit from IVB.
llvm-svn: 345519
Stanislav Mekhanoshin [Mon, 29 Oct 2018 17:53:23 +0000 (17:53 +0000)]
[AMDGPU] Fixed return value causing warning and regression
llvm-svn: 345518
Erik Pilkington [Mon, 29 Oct 2018 17:38:42 +0000 (17:38 +0000)]
Revert "Revert "Support for groups of attributes in #pragma clang attribute""
This reverts commit r345487, which reverted r345486. I think the crashes were
caused by an OOM on the builder, trying again to confirm...
llvm-svn: 345517
Louis Dionne [Mon, 29 Oct 2018 17:30:04 +0000 (17:30 +0000)]
[libc++] Use exclude_from_explicit_instantiation instead of always_inline
Summary:
This commit adopts the exclude_from_explicit_instantiation attribute discussed
at [1] and reviewed in [2] in libc++ to supplant the use of __always_inline__
for visibility purposes.
This change means that users wanting to link together translation units built
with different versions of libc++'s headers into the same final linked image
MUST define the _LIBCPP_HIDE_FROM_ABI_PER_TU macro to 1 when building those
TUs. Doing otherwise will lead to ODR violations and ABI issues.
[1]: http://lists.llvm.org/pipermail/cfe-dev/2018-August/059024.html
[2]: https://reviews.llvm.org/D51789
Reviewers: rsmith, EricWF
Subscribers: dexonsmith, libcxx-commits
Differential Revision: https://reviews.llvm.org/D52405
llvm-svn: 345516
Bryan Chan [Mon, 29 Oct 2018 17:27:34 +0000 (17:27 +0000)]
[AArch64] Rename FP16FML instruction format (NFC)
Rename SIMDThreeSameMult (etc.) to SIMDThreeSameVectorFML (etc.) to follow
usual naming convention, and add some comments in the .td files.
llvm-svn: 345515
Stanislav Mekhanoshin [Mon, 29 Oct 2018 17:26:01 +0000 (17:26 +0000)]
[AMDGPU] Match v_swap_b32
Differential Revision: https://reviews.llvm.org/D52677
llvm-svn: 345514
Francis Visoiu Mistrih [Mon, 29 Oct 2018 16:57:43 +0000 (16:57 +0000)]
[X86] Enable the MachineVerifier by default
The machine verifier was disabled for x86 by default. There are now only
9 tests failing, compared to what previously was between 20 and 30.
This is a good opportunity to file bugs for all the remaining issues,
then explicitly disable the failing tests and enabling the machine
verifier by default.
This allows us to avoid adding new tests that break the verifier.
PR27481
llvm-svn: 345513