Commit Graph

234401 Commits

Author SHA1 Message Date
Miklos Vajna 47bd46395a clang-rename: add a -old-name option
This is similar to -offset with the following differences:

1) -offset can refer to local variables as well.

2) -old-name makes it easier to refer to e.g. ClassName::MemberName by
spelling out the fully qualified name, instead of having to use e.g.
grep to look up the exact offset.

In other words, -offset is great when clang-rename is invoked by e.g. an
IDE, but not really user-friendly when the tool is invoked by the user
from commandline.  That's the use case where -old-name is supposed to
improve the situation.

Reviewers: klimek

Differential Revision: http://reviews.llvm.org/D21517

llvm-svn: 273304
2016-06-21 19:48:57 +00:00
Rafael Espindola 48975881ab Delete some dead code.
Found by gcc 6.

llvm-svn: 273303
2016-06-21 19:48:12 +00:00
Artem Belevich df7103ddc5 [build] Make sure to link main executable with pthreads
Otherwise it gets linked in by one of the dependencies of shared
libraries which may be too late and we end up with weird crashes in
std::call_once().

Differential Revision: http://reviews.llvm.org/D21478

llvm-svn: 273302
2016-06-21 19:34:40 +00:00
Easwaran Raman 8bceb9d210 Fix PR28219: Use profile summary from reader and not compute it
Differentiaal revision: http://reviews.llvm.org/D21546

llvm-svn: 273301
2016-06-21 19:29:49 +00:00
Rafael Espindola ea2a5e6897 Delete dead code.
Found by gcc 6.

llvm-svn: 273300
2016-06-21 19:19:31 +00:00
Jonathan Peyton d4f397741b Add debug trace messages for taskloop
llvm-svn: 273299
2016-06-21 19:18:13 +00:00
Dehao Chen 1997d8684f Invoke PruneEH pass before Sample Profile pass.
Summary: We need to call PruneEH pass before AutoFDO pass so that some EH-related calls can get inlined in Sample Profile pass.

Reviewers: davidxl, dnovillo

Subscribers: junbuml, llvm-commits

Differential Revision: http://reviews.llvm.org/D21197

llvm-svn: 273298
2016-06-21 19:16:41 +00:00
Jonathan Peyton c76f9f0df8 Bug fix for hang when tasks used in nested parallel
Bug fix for hang when omp task and nested parallelism used together.
Still some problem remains with task state saving/restoring, but
user's case works fine now. All tasking unit tests passed as well.

Patch by Andrey Churbanov

Differential Revision: http://reviews.llvm.org/D21558

llvm-svn: 273297
2016-06-21 19:12:07 +00:00
Reid Kleckner 93b4b2e386 [MS] Don't expect vftables to be provided for extern template instantiations
MSVC doesn't provide them. PR28223

I left behind the machinery in case we want to resurrect available_externally
vftable emission to support devirtualization.

Reviewers: majnemer

Differential Revision: http://reviews.llvm.org/D21544

llvm-svn: 273296
2016-06-21 18:39:55 +00:00
Daniel Berlin 1430026142 Add MemoryAccess creation and PHI creation APIs to MemorySSA
Reviewers: george.burgess.iv, gberry, hfinkel

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D21463

llvm-svn: 273295
2016-06-21 18:39:20 +00:00
Reid Kleckner 5b335b864b [codeview] Add support for splitting field list records over 64KB
The basic structure is that once a list record goes over 64K, the last
subrecord of the list is an LF_INDEX record that refers to the next
record. Because the type record graph must be toplogically sorted, this
means we have to emit them in reverse order. We build the type record in
order of declaration, so this means that if we don't want extra copies,
we need to detect when we were about to split a record, and leave space
for a continuation subrecord that will point to the eventual split
top-level record.

Also adds dumping support for these records.

Next we should make sure that large method overload lists work properly.

llvm-svn: 273294
2016-06-21 18:33:01 +00:00
Jonathan Peyton ff5ca8b4cf Performance improvement: accessing thread struct as opposed to team struct
Replaced readings of nproc from team structure with ones from
thread structure to improve performance.

Patch by Andrey Churbanov.

Differential Revision: http://reviews.llvm.org/D21559

llvm-svn: 273293
2016-06-21 18:30:15 +00:00
Eugene Zelenko 2487cb28ce Respect LLVM_INSTALL_TOOLCHAIN_ONLY.
Only shared library should be installed when LLVM_INSTALL_TOOLCHAIN_ONLY=ON.

Differential revision: http://reviews.llvm.org/D21543

llvm-svn: 273292
2016-06-21 18:14:01 +00:00
Eric Liu de027f2791 [clang-apply-replacements] use Range::operator==() instead of self-defined operator.
llvm-svn: 273291
2016-06-21 17:59:57 +00:00
Eric Liu 8b636db8d4 Added calculateRangesAfterReplaments() to calculate affacted ranges in the new code.
Summary:
Added calculateRangesAfterReplaments() to calculate original ranges as well as
newly affacted ranges in the new code.

Reviewers: klimek, djasper

Subscribers: cfe-commits, klimek

Differential Revision: http://reviews.llvm.org/D21547

llvm-svn: 273290
2016-06-21 17:56:31 +00:00
Artem Belevich 4987dc85b4 [aarch64] Update datalayout for aarch64 tests
This brings the tests in sync with the changes in r273280.

llvm-svn: 273289
2016-06-21 17:35:31 +00:00
Dmitry Vyukov 42c06a933a Fix asan_win_dll_thunk.cc test
Add the two public functions I added in my last commit in asan_win_dll_thunk.cc

Author: blastrock (Philippe Daouadi)
Reviewed in http://reviews.llvm.org/D21557

llvm-svn: 273288
2016-06-21 17:28:06 +00:00
Saleem Abdulrasool 983e6f9d66 llvm-ar: correct typo
Default was misspelt.  NFC.

llvm-svn: 273287
2016-06-21 17:19:28 +00:00
Silviu Baranga 03b6a4fc88 [AArch64] Fix merge-store.ll regression test after r273271
r273271 changed the RUN line of the regression test to use
-march=cyclone instead of -mtriple=aarch64-none-none.

This caused a change in the output syntax for the ext
instruction, causing the test to fail. Change this test
back to using -mtriple=aarch64-none-none.

llvm-svn: 273286
2016-06-21 17:15:49 +00:00
Daniel Jasper f8bcc2445d clang-format: [JS] Add a Closure Compiler JSDoc tags to the default
Google configuration so that it isn't line-wrapped.

llvm-svn: 273285
2016-06-21 17:00:20 +00:00
Krzysztof Parzyszek 4f1c86b77c Fix typo, NFC
llvm-svn: 273284
2016-06-21 16:16:52 +00:00
Pirama Arumuga Nainar c85c85301d Add documentation for RenderScript changes
Summary:
- Document the new 'kernel' attribute
- Mention RenderScript support in the Release Notes.

Reviewers: rsmith

Subscribers: tberghammer, danalbert, cfe-commits, srhines

Differential Revision: http://reviews.llvm.org/D21212

llvm-svn: 273283
2016-06-21 16:09:30 +00:00
Jonathan Peyton 8c61c597be Addition of debugger comments and whitespace
The removal of legacy code to support long-deprecated debugger support library
resulted in some whitespace changes. Comments from that legacy code were made
public as they may be useful for other debuggers.

Patch by Olga Malysheva.

Differential Revision: http://reviews.llvm.org/D21391

llvm-svn: 273282
2016-06-21 15:59:34 +00:00
Etienne Bergeron f6be62f2c8 [StackProtector] Fix computation of GSCookieOffset and EHCookieOffset with SEH4
Summary:
Fix the computation of the offsets present in the scopetable when using the
SEH (__except_handler4).

This patch added an intrinsic to track the position of the allocation on the
stack of the EHGuard. This position is needed when producing the ScopeTable.

```
    struct _EH4_SCOPETABLE {
        DWORD GSCookieOffset;
        DWORD GSCookieXOROffset;
        DWORD EHCookieOffset;
        DWORD EHCookieXOROffset;
        _EH4_SCOPETABLE_RECORD ScopeRecord[1];
    };

    struct _EH4_SCOPETABLE_RECORD {
        DWORD EnclosingLevel;
        long (*FilterFunc)();
            union {
            void (*HandlerAddress)();
            void (*FinallyFunc)();
        };
    };
```

The code to generate the EHCookie is added in `X86WinEHState.cpp`.
Which is adding these instructions when using SEH4.

```
Lfunc_begin0:
# BB#0:                                 # %entry
	pushl	%ebp
	movl	%esp, %ebp
	pushl	%ebx
	pushl	%edi
	pushl	%esi
	subl	$28, %esp
	movl	%ebp, %eax                <<-- Loading FramePtr
	movl	%esp, -36(%ebp)
	movl	$-2, -16(%ebp)
	movl	$L__ehtable$use_except_handler4_ssp, %ecx
	xorl	___security_cookie, %ecx
	movl	%ecx, -20(%ebp)
	xorl	___security_cookie, %eax  <<-- XOR FramePtr and Cookie
	movl	%eax, -40(%ebp)           <<-- Storing EHGuard
	leal	-28(%ebp), %eax
	movl	$__except_handler4, -24(%ebp)
	movl	%fs:0, %ecx
	movl	%ecx, -28(%ebp)
	movl	%eax, %fs:0
	movl	$0, -16(%ebp)
	calll	_may_throw_or_crash
LBB1_1:                                 # %cont
	movl	-28(%ebp), %eax
	movl	%eax, %fs:0
	addl	$28, %esp
	popl	%esi
	popl	%edi
	popl	%ebx
	popl	%ebp
	retl

```

And the corresponding offset is computed:
```
Luse_except_handler4_ssp$parent_frame_offset = -36
	.p2align	2
L__ehtable$use_except_handler4_ssp:
	.long	-2                      # GSCookieOffset
	.long	0                       # GSCookieXOROffset
	.long	-40                     # EHCookieOffset    <<----
	.long	0                       # EHCookieXOROffset
	.long	-2                      # ToState
	.long	_catchall_filt          # FilterFunction
	.long	LBB1_2                  # ExceptionHandler

```

Clang is not yet producing function using SEH4, but it's a work in progress.
This patch is a step toward having a valid implementation of SEH4.
Unfortunately, it is not yet fully working. The EH registration block is not
allocated at the right offset on the stack.

Reviewers: rnk, majnemer

Subscribers: llvm-commits, chrisha

Differential Revision: http://reviews.llvm.org/D21231

llvm-svn: 273281
2016-06-21 15:58:55 +00:00
Evandro Menezes 04abc14fb5 [AArch64] Change the preferred alignment for char and short to word alignment
Differential Revision: http://reviews.llvm.org/D21414

llvm-svn: 273280
2016-06-21 15:55:29 +00:00
Evandro Menezes 230083ff9d [AArch64] Change the preferred alignment for char and short to word alignment
Differential Revision: http://reviews.llvm.org/D21414

llvm-svn: 273279
2016-06-21 15:55:18 +00:00
Jonathan Peyton fd7cc42fed Improvements to process affinity mask setting
A couple improvements:
1) Add ability to limit fullMask size when KMP_HW_SUBSET limits resources.
2) Make KMP_HW_SUBSET work for affinity_none, and only limit fullMask in this case.

Patch by Andrey Churbanov.

Differential Revision: http://reviews.llvm.org/D21528

llvm-svn: 273278
2016-06-21 15:54:38 +00:00
Silviu Baranga aee40fc61c [AArch64] Restore codegen for AArch64 Cortex-A72/A73 after NFCI
Summary:
Code generation for Cortex-A72/Cortex-A73 was accidentally changed
by r271555, which was a NFCI. The isCortexA57() predicate was not true
for Cortex-A72/Cortex-A73 before r271555 (since it was checking the CPU
string). Because Cortex-A72/Cortex-A73 inherit all features from Cortex-A57,
all decisions previously guarded by isCortexA57() are now taken.

This change restores the behaviour before r271555 by adding separate
ProcA72/ProcA73, which have the required features to preserve code
generation.

Reviewers: kristof.beyls, aadg, mcrosier, rengolin

Subscribers: mcrosier, llvm-commits, aemerson, t.p.northover, MatzeB, rengolin

Differential Revision: http://reviews.llvm.org/D21182

llvm-svn: 273277
2016-06-21 15:53:54 +00:00
Jonathan Peyton 5a276c45c2 Bug fix for segfault in stubs library
There was a segfault in the stubs library in posix_memalign because
of a bad parameter. The fix is to send address of the pointer as a
parameter. Also added check of result of posix_memalign.

Patch by Andrey Churbanov.

Differential Revision: http://reviews.llvm.org/D21529

llvm-svn: 273276
2016-06-21 15:39:08 +00:00
Piotr Padlewski 552d449482 [clang-tidy] Add modernize-use-emplace
Summary: Add check that replaces call of push_back to emplace_back

Reviewers: hokein

Differential Revision: http://reviews.llvm.org/D20964

llvm-svn: 273275
2016-06-21 15:23:27 +00:00
Etienne Bergeron 715ec09dcf fix indentation
llvm-svn: 273274
2016-06-21 15:21:04 +00:00
Jonathan Peyton 98b76f6f87 [STATS] Adding process id to output filename
This change appends the process id to the KMP_STATS_FILE (if specified) which
enables MPI processes to output their stats to separate files.

Differential Revision: http://reviews.llvm.org/D21386

llvm-svn: 273273
2016-06-21 15:20:33 +00:00
Jonathan Peyton ea26f3f82a Fix typos in Fortran headers
Fix typos in Fortran headers to match spec.
Patch by Andrey Churbanov.
Differential Revision: http://reviews.llvm.org/D21531

llvm-svn: 273272
2016-06-21 15:16:51 +00:00
Silviu Baranga dc43d61a25 [AArch64] Switch regression tests to test features not CPUs
Summary:
We have switched to using features for all heuristics, but
the tests for these are still using -mcpu, which means we
are not directly testing the features.

This converts at least some of the existing regression tests
to use the new features.

This still leaves the following features untested:

merge-narrow-ld
predictable-select-expensive
alternate-sextload-cvt-f32-pattern
disable-latency-sched-heuristic

Reviewers: mcrosier, t.p.northover, rengolin

Subscribers: MatzeB, aemerson, llvm-commits, rengolin

Differential Revision: http://reviews.llvm.org/D21288

llvm-svn: 273271
2016-06-21 15:16:34 +00:00
Etienne Bergeron 3d6a88c389 Change the shadow memory address for win64.
This is part of the effort for asan to support Windows 64 bit.

Patch by Wei Wang
Differential Revision: http://reviews.llvm.org/D21525

llvm-svn: 273270
2016-06-21 15:11:24 +00:00
Etienne Bergeron 70684f9422 This is part of the effort for asan to support Windows 64 bit.
The large offset is being tested on Windows 10 (which has larger usable
virtual address space than Windows 8 or earlier)

Patch by:  Wei Wang
Differential Revision: http://reviews.llvm.org/D21523

llvm-svn: 273269
2016-06-21 15:07:29 +00:00
Reid Kleckner 9ff936cfc1 [codeview] Fix DenseMap pointer invalidation bug
When you have a map holding a unique_ptr, hold a reference to the raw
pointer instead of the unique pointer. The unique_ptr will be moved on
rehash.

llvm-svn: 273268
2016-06-21 14:56:24 +00:00
Etienne Bergeron 48933772f7 [asan] Fix shifting compiler warnings when compiler in 64-bits
Summary:
The MSVC compiler complains about implicit conversion of 32-bits constant to
64-bit when using this shiting pattern  1 << (<64-bit expr>).

Reviewers: rnk

Subscribers: kcc, llvm-commits, wang0109, kubabrecka, chrisha

Differential Revision: http://reviews.llvm.org/D21524

llvm-svn: 273267
2016-06-21 14:53:16 +00:00
Rafael Espindola 254b58dfe3 Revert "Revert "Add a test showing that lto produces relaxable relocations.""
This reverts commit r273247.

lld should always use the new relocations.

llvm-svn: 273266
2016-06-21 14:47:43 +00:00
Etienne Bergeron 7e2fc3b702 [compiler-rt] Split cflags and link flags to avoid warnings
Summary:
The MSVC compiler is complaining about invalid flags. The CFLAGS are passed
to the linker (i.e. /Gy-, ...).

Reviewers: rnk

Subscribers: llvm-commits, kubabrecka, chrisha

Differential Revision: http://reviews.llvm.org/D21554

llvm-svn: 273265
2016-06-21 14:46:32 +00:00
Simon Pilgrim bb8a40fdd2 Strip trailing whitespace
llvm-svn: 273264
2016-06-21 14:37:39 +00:00
Etienne Bergeron b2f17d1719 trimming whitespaces
llvm-svn: 273263
2016-06-21 14:32:52 +00:00
Aaron Ballman 0ad004620c Switch to using an API that handles non-ASCII paths appropriately on Windows.
llvm-svn: 273262
2016-06-21 14:24:48 +00:00
Rafael Espindola 3d6a130fee Define a isPositionIndependent helper for ARMAsmPrinter. NFC.
llvm-svn: 273261
2016-06-21 14:21:53 +00:00
Dmitry Vyukov 47b7c5c912 [asan] add primitives that allow coroutine implementations
This patch adds the __sanitizer_start_switch_fiber and
__sanitizer_finish_switch_fiber methods inspired from what can be found here
2ea64dd249 .

These methods are needed when the compiled software needs to implement
coroutines, fibers or the like. Without a way to annotate them, when the program
jumps to a stack that is not the thread stack, __asan_handle_no_return shows a
warning about that, and the fake stack mechanism may free fake frames that are
still in use.

Author: blastrock (Philippe Daouadi)
Reviewed in http://reviews.llvm.org/D20913

llvm-svn: 273260
2016-06-21 12:29:18 +00:00
Daniel Sanders bf2c03ee69 [arm+x86] Make GNU variants behave like GNU w.r.t combining sin+cos into sincos.
Summary:
canCombineSinCosLibcall() would previously combine sin+cos into sincos for
GNUX32/GNUEABI/GNUEABIHF regardless of whether UnsafeFPMath were set or not.
However, GNU would only combine them for UnsafeFPMath because sincos does not
set errno like sin and cos do. It seems likely that this is an oversight.

Reviewers: t.p.northover

Subscribers: t.p.northover, aemerson, llvm-commits, rengolin

Differential Revision: http://reviews.llvm.org/D21431

llvm-svn: 273259
2016-06-21 12:29:03 +00:00
Elena Demikhovsky a266cf0518 reverted the prev commit due to assertion failure
llvm-svn: 273258
2016-06-21 12:10:11 +00:00
Elena Demikhovsky 9823c995bc Fixed consecutive memory access detection in Loop Vectorizer.
It did not handle correctly cases without GEP.

The following loop wasn't vectorized:

for (int i=0; i<len; i++)
  *to++ = *from++;

I use getPtrStride() to find Stride for memory access and return 0 is the Stride is not 1 or -1.

Differential revision: http://reviews.llvm.org/D20789

llvm-svn: 273257
2016-06-21 11:32:01 +00:00
Rui Ueyama d1188f757c Accept both single and double dashes for all options.
This is a follow-up patch to r273218. GNU ld accepts both "--" and "-"
for all multi-letter options except "-o". This patch makes lld compatible
with that behavior.

llvm-svn: 273256
2016-06-21 08:45:50 +00:00
Junmo Park 118119233d [TargetSchedule] Use 'isOutOfOrder' as possible to avoid magic number. NFC.
Summary:
Using isOutOfOrder makes the code more clear.

Reviewers: rengolin, atrick, hfinkel.

Differential Revision: http://reviews.llvm.org/D21548

llvm-svn: 273255
2016-06-21 08:09:58 +00:00