Commit Graph

302110 Commits

Author SHA1 Message Date
Bruno Ricci 023b1d19f3 [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
2018-10-30 14:40:49 +00:00
Sean Fertile 92964e74a5 [PPC64] Handle powerpc64 in OUTPUT_FORMAT.
Differential Revision: https://reviews.llvm.org/D53652

llvm-svn: 345604
2018-10-30 14:37:17 +00:00
Jonas Paulsson 1f067c94dc [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
2018-10-30 14:34:15 +00:00
Sanjay Patel 8b207defea [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
2018-10-30 14:14:34 +00:00
Diogo N. Sampaio bd74554f54 [FIX][AArch64] Add support for UDF instruction
Fix: Simplify test files from rL345581 failing
in windows bots.

llvm-svn: 345601
2018-10-30 13:59:21 +00:00
Kamil Rytarowski d045b15bce 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
2018-10-30 13:58:45 +00:00
Kamil Rytarowski 02f838d778 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
2018-10-30 13:49:15 +00:00
Sanjay Patel 680c9227ca [SelectionDAG] fix build warning for mismatched signs in compare; NFC
llvm-svn: 345598
2018-10-30 13:47:19 +00:00
Bruno Ricci bacf751add [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
2018-10-30 13:42:41 +00:00
Jonas Paulsson af8e036c29 [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
2018-10-30 13:41:03 +00:00
Kamil Rytarowski 647ece0144 Mark breaking TSan tests on NetBSD with XFAIL
Failing tests:
 - dtls
 - ignored-interceptors-mmap
 - mutex_lock_destroyed

llvm-svn: 345595
2018-10-30 13:28:32 +00:00
Roman Lebedev a32a2e3443 [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
2018-10-30 12:37:16 +00:00
Francis Visoiu Mistrih 0e237d357e [X86] Re-enable the machine verifier after fixing more tests
Was disabled again in r345528. Hopefully this the bots.

llvm-svn: 345593
2018-10-30 12:20:17 +00:00
Diogo N. Sampaio 0c4a184577 [FIX][AArch64] lld test change
Adding AArch64 UDF, in rL345581,
breaks some lld test files, due
different decoding

llvm-svn: 345592
2018-10-30 12:19:55 +00:00
Francis Visoiu Mistrih 0df3a8f51a [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
2018-10-30 12:18:33 +00:00
Kadir Cetinkaya 6675be8747 [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
2018-10-30 12:13:27 +00:00
Francis Visoiu Mistrih 85d3f1ee8f [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
2018-10-30 12:07:18 +00:00
James Henderson b3735ee14e [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
2018-10-30 11:52:47 +00:00
Diogo N. Sampaio 1cc49d3ca8 [FIX][AArch64] Add support for UDF instruction
Fix wrong test files submited
in rL345581

llvm-svn: 345587
2018-10-30 11:39:33 +00:00
Kamil Rytarowski 8f545983a3 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
2018-10-30 11:34:36 +00:00
Nicola Zaghen f96383c99e [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
2018-10-30 11:15:04 +00:00
Roman Lebedev b3a14208ac [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
2018-10-30 11:12:34 +00:00
Roman Lebedev 9ffca9b83c [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
2018-10-30 11:12:29 +00:00
Kamil Rytarowski 4f343547ba 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
2018-10-30 11:10:36 +00:00
Diogo N. Sampaio a3783b2ac2 [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
2018-10-30 11:06:50 +00:00
Kamil Rytarowski 1308779f79 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
2018-10-30 11:03:37 +00:00
James Henderson 1e74ecab17 [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
2018-10-30 10:55:14 +00:00
Simon Pilgrim 858303b827 [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
2018-10-30 10:32:11 +00:00
Aleksandr Urakov 4538ed3b85 [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
2018-10-30 10:07:08 +00:00
Takuto Ikuta d62afe0063 Remove trailing space from clang/Basic/LangOptions.h
llvm-svn: 345576
2018-10-30 09:42:49 +00:00
David Bolvansky dfdbb038e8 [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
2018-10-30 09:07:22 +00:00
Kamil Rytarowski da78171643 Handle pthread_sigmask in DemangleFunctionName()
Translate __libc_thr_sigsetmask to pthread_sigmask on NetBSD.

llvm-svn: 345574
2018-10-30 08:51:34 +00:00
Bjorn Pettersson 6c2d83b46d [OPENMP] Fix for "error: unused variable 'CED'"
Quick fix to make code compile with -Werror,-Wunused-variable.

llvm-svn: 345573
2018-10-30 08:49:26 +00:00
Kamil Rytarowski 7fc4f0d9af Drop now hidden ioctl(2) operations for NetBSD
POWER_IOC_GET_TYPE_WITH_LOSSAGE is no longer accessible from userland.

llvm-svn: 345572
2018-10-30 08:32:47 +00:00
Kamil Rytarowski 4c5620f233 Handle NetBSD symbol mangling for tzset
Native code generated on NetBSD mangles tzet to __tzset50.

Handle this accordingly in MSan.

llvm-svn: 345571
2018-10-30 08:16:14 +00:00
Kamil Rytarowski 7b88204b39 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
2018-10-30 08:06:42 +00:00
Saleem Abdulrasool f66cb01b44 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
2018-10-30 06:29:28 +00:00
Dean Michael Berris 01aeb3221d [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
2018-10-30 04:35:48 +00:00
Craig Topper b293322cee [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
2018-10-30 03:27:15 +00:00
Craig Topper 2640795c94 [AArch64] Add test case for D53229. NFC
llvm-svn: 345566
2018-10-30 03:27:13 +00:00
Craig Topper 67c2878501 [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
2018-10-30 03:27:12 +00:00
Craig Topper 676d7a7a43 [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
2018-10-30 03:27:11 +00:00
Marc-Andre Laperle d8e14a5901 [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
2018-10-30 03:10:41 +00:00
Richard Smith d2e69dfddb 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
2018-10-30 02:02:49 +00:00
Eric Fiselier 2f3e8b3d2e Unify definition of _LIBCPP_BEGIN/END_NAMESPACE_STD
llvm-svn: 345561
2018-10-30 02:02:00 +00:00
Matt Arsenault abc4f29f9c AMDGPU: Remove custom BUILD_VECTOR combine
This was looping in a testcase and removing it
now slightly improves a test.

llvm-svn: 345560
2018-10-30 01:37:59 +00:00
Matt Arsenault b0b741efb8 AMDGPU: Use scavengeRegisterBackwards
llvm-svn: 345559
2018-10-30 01:33:14 +00:00
Alexander Shaposhnikov e2f073463e [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
2018-10-30 01:20:37 +00:00
Vitaly Buka 7c180fa915 [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
2018-10-30 01:20:12 +00:00
Vitaly Buka 9817192691 [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
2018-10-30 01:20:01 +00:00