Commit Graph

242035 Commits

Author SHA1 Message Date
Jonas Hahnfeld dd9a05d5d8 [OMPT] save exit address to lwt if available
In case, the current team is a serialized team (lwt), the frame information should be written to this data structure.
Before, nested serialized teams would overwrite the same task information.

Patch by Joachim Protze!

Differential Revision: https://reviews.llvm.org/D23310

llvm-svn: 281467
2016-09-14 13:59:31 +00:00
Jonas Hahnfeld 28ea24bba7 [OMPT] fix __ompt_get_teaminfo to consult lwt entries of parent teams
The comment already states, that this function should work similarly as __ompt_get_taskinfo.

The function only looked for lwt entries of the current team, but not when unrolling the parents. This fix aligns the implementation to __ompt_get_taskinfo.

The new test case creates a single theaded team (->lwt) and then a nested active team.
Before the innermost print_id(1) would deliver a different team then the outer print_id(0).

Patch by Joachim Protze!

Differential Revision: https://reviews.llvm.org/D23309

llvm-svn: 281466
2016-09-14 13:59:24 +00:00
Jonas Hahnfeld 8a27064e05 [OMPT] Reset task exit frame when execution is finished
The exit address is set when execution of a task is started and should be reset as soon as the execution is finished.
Especially for the asm implementation of __kmp_invoke_microtask, resetting in this call would be painfull, so reset just after the invokation.

The testcase shows the effect of this patch:
Before, the implicit barriers at the end of an implicit task would see an exit address for the implicit task.

This barrier is a task scheduling point. Thus, any explicit task scheduled there would see an exit, but no reenter address for the implicit task.

Patch by Joachim Protze!

Differential Revision: https://reviews.llvm.org/D23307

llvm-svn: 281465
2016-09-14 13:59:19 +00:00
Jonas Hahnfeld fd0614d830 [OMPT] Align implementation of reenter frame address to latest (frozen) version of OMPT spec
The latest OMPT spec changed the semantic of a tasks reenter frame to be the application frame, that will be entered, when the runtime frame drops.
Before it was the last frame in the runtime. This doesn't work for some gcc execution pathes or even clang generated code for :
Since there is no runtime frame between the executed task and the encountering task.

The test case compares exit and reenter addresses against addresses captured in application code

Patch by Joachim Protze!

Differential Revision: https://reviews.llvm.org/D23305

llvm-svn: 281464
2016-09-14 13:59:13 +00:00
Jonas Hahnfeld 464cdca9d3 [OMPT] extend ompt tests by checks for frame pointers
OMPT tests can check for right frame information of tasks:
 * parent_task_frame was directly printed as a pointer, but actually points to a struct ompt_frame {void*, void*}
 * NULL is printed in the beginning of execution and loaded to FileChecker variable [[NULL]]
 * implicit tasks now also print their frame information
 * macro to print frame address from application
 * print task info for barrier begin

Patch by Joachim Protze!

Differential Revision: https://reviews.llvm.org/D23304

llvm-svn: 281463
2016-09-14 13:59:05 +00:00
Kuba Brecka 896bbb3dfe [tsan] Fix hanging gcd-apply and gcd-apply-race tests on macOS Sierra
llvm-svn: 281462
2016-09-14 13:53:06 +00:00
Michal Gorny 697026f312 [cmake] Support overriding llvm-config query results
Support overriding LLVM_* variables obtained from llvm-config when doing
stand-alone builds. The override of LLVM_MAIN_SRC_DIR is necessary to
provide LLVM sources when the initial directory used to build LLVM does
no longer exist when compiler-rt is built stand-alone. This is
especially the case when building the projects separately in temporary
directories with unpredictable names.

The code is based on existing CMakeLists.txt from clang. Alike clang, it
extends the override to all queried variables.

Differential Revision: https://reviews.llvm.org/D24005

llvm-svn: 281461
2016-09-14 13:42:31 +00:00
Martin Bohme cd56273ff1 [clang-tidy] Add dependency on clangAnalysis to clangTidyMiscModule
Summary:
This is needed for the recently submitted misc-use-after-move check (rL281453).
For some reason, this still built under Linux, but it caused the PPC build bot
to fail.

Subscribers: beanz, cfe-commits, mgorny

Differential Revision: https://reviews.llvm.org/D24561

llvm-svn: 281460
2016-09-14 13:33:11 +00:00
Kirill Bobyrev 8d78af4bb4 reverting r281456
llvm-svn: 281459
2016-09-14 13:23:14 +00:00
George Rimar d73ef1738b [ELF] - Implemented --section-start, -Ttext, -Tdata, -Tbss options.
--section-start=sectionname=org
Locate a section in the output file at the absolute address given by org. 
You may use this option as many times as necessary to locate multiple sections in the command line.
 org must be a single hexadecimal integer; for compatibility with other linkers, 
you may omit the leading `0x' usually associated with hexadecimal values. 
Note: there should be no white space between sectionname, the equals sign (“<=>”), and org.

-Tbss=org
-Tdata=org
-Ttext=org
Same as --section-start, with .bss, .data or .text as the sectionname.

Differential revision: https://reviews.llvm.org/D24294

llvm-svn: 281458
2016-09-14 13:07:13 +00:00
Eric Liu ac73ea34a4 Supports adding insertion around non-insertion replacements.
Summary:
Extend `tooling::Replacements::add()` to support adding order-independent replacements.

Two replacements are considered order-independent if one of the following conditions is true:
  - They do not overlap. (This is already supported.)
  - One replacement is insertion, and the other is a replacement with
    length > 0, and the insertion is adjecent to but not contained in the
    other replacement. In this case, the replacement should always change
    the original code instead of the inserted text.

Reviewers: klimek, djasper

Subscribers: cfe-commits, klimek

Differential Revision: https://reviews.llvm.org/D24515

llvm-svn: 281457
2016-09-14 13:04:51 +00:00
Kirill Bobyrev c2ed91fc4e [clang-rename] Merge rename-{at|all} & optimize.
Having both rename-at and rename-all both seems confusing and introduces
unneeded difficulties. Allowing to use both -qualified-name and -offset at once
while performing efficient renamings seems like a feature, too. Maintaining main
function wrappers and custom help becomes redundant while CLI becomes less
confusing.

Reviewers: alexfh

Differential Revision: https://reviews.llvm.org/D24224

llvm-svn: 281456
2016-09-14 13:00:36 +00:00
Martin Bohme 2ca3196998 [clang-tidy] Make test for misc-use-after-move pass under Windows
Summary: Adds -fno-delayed-template-parsing

Reviewers: alexfh

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D24550

llvm-svn: 281455
2016-09-14 12:22:35 +00:00
Rafael Espindola d88d7166a8 Use murmurhash2 instead of fnv.
It is substantially faster by processing 8 bytes at a time.

llvm-svn: 281454
2016-09-14 11:32:57 +00:00
Martin Bohme 42d3839bc5 [clang-tidy] Add check 'misc-use-after-move'
Summary:
The check warns if an object is used after it has been moved, without an
intervening reinitialization.

See user-facing documentation for details.

Reviewers: sbenza, Prazek, alexfh

Subscribers: beanz, mgorny, shadeware, omtcyfz, Eugene.Zelenko, Prazek, fowles, ioeric, cfe-commits

Differential Revision: https://reviews.llvm.org/D23353

llvm-svn: 281453
2016-09-14 10:29:32 +00:00
Eric Liu 762b4887c2 Revert "[modules] When merging one definition into another, propagate the list of re-exporting modules from the discarded definition to the retained definition."
This reverts commit r281429.

llvm-svn: 281452
2016-09-14 10:05:10 +00:00
James Molloy 9790d8f81d Revert "[Thumb] Teach ISel how to lower compares of AND bitmasks efficiently"
This reverts commit r281323. It caused chromium test failures and a selfhost failure.

llvm-svn: 281451
2016-09-14 09:45:28 +00:00
Vassil Vassilev 2ec8b1506a Missing includes.
llvm-svn: 281450
2016-09-14 08:55:18 +00:00
Eugene Leviant e05336ffa1 [ELF] Replace HasContents with HasSections. NFC
llvm-svn: 281449
2016-09-14 08:32:36 +00:00
Tim Northover 1c7825fd79 GlobalISel: mark pointer stores as legal on AArch64.
llvm-svn: 281448
2016-09-14 08:28:54 +00:00
Sjoerd Meijer 724023a1ec This reapplies r281304. The issue was that I had missed
to copy the new isAdd field in the tablegen data structure.

llvm-svn: 281447
2016-09-14 08:20:03 +00:00
Elena Demikhovsky 0569d9d588 AVX-512: Fixed a bug in kortest.z intrinsic
Lowering was wrong - X86ISD::SETCC node should return i8 type.

llvm-svn: 281446
2016-09-14 08:06:54 +00:00
Igor Breger 74813fc19c [AVX512BW] Change truncStore action (v16i16->v16i18). It can be legal only with AVX512VL.
Differential Revision: http://reviews.llvm.org/D24547

llvm-svn: 281445
2016-09-14 08:04:28 +00:00
Filipe Cabecinhas 36229e96bc [asan] Reify ErrorStringFunctionSizeOverflow
Summary: Continuing implementation mentioned in this thread: http://lists.llvm.org/pipermail/llvm-dev/2016-July/101933.html

Reviewers: kcc, eugenis, vitalybuka

Subscribers: llvm-commits, kubabrecka

Differential Revision: https://reviews.llvm.org/D24394

llvm-svn: 281444
2016-09-14 07:37:20 +00:00
Filipe Cabecinhas 7a196b9913 [asan] Reify ErrorStringFunctionMemoryRangesOverlap
Summary: Continuing implementation mentioned in this thread: http://lists.llvm.org/pipermail/llvm-dev/2016-July/101933.html

Reviewers: kcc, eugenis, vitalybuka

Subscribers: kubabrecka, llvm-commits

Differential Revision: https://reviews.llvm.org/D24393

llvm-svn: 281443
2016-09-14 07:37:14 +00:00
Craig Topper 4e2d5a43cf [X86] Remove the VCVTSI2SD32 with rounding intrinsic. It's not used by clang and not needed since 32-bit integer to double is always exact.
llvm-svn: 281442
2016-09-14 06:27:46 +00:00
Roman Gareev b3224adfb6 Perform copying to created arrays according to the packing transformation
This is the fourth patch to apply the BLIS matmul optimization pattern on matmul
kernels (http://www.cs.utexas.edu/users/flame/pubs/TOMS-BLIS-Analytical.pdf).
BLIS implements gemm as three nested loops around a macro-kernel, plus two
packing routines. The macro-kernel is implemented in terms of two additional
loops around a micro-kernel. The micro-kernel is a loop around a rank-1
(i.e., outer product) update. In this change we perform copying to created
arrays, which is the last step to implement the packing transformation.

Reviewed-by: Tobias Grosser <tobias@grosser.es>

Differential Revision: https://reviews.llvm.org/D23260

llvm-svn: 281441
2016-09-14 06:26:09 +00:00
Jonas Hahnfeld 79e00930e2 Document option '-rtlib' in clang's man page and help info
This patch adds an entry for "-rtlib" in the output of `man clang` and `clang -help`.

Patch by Lei Zhang!

Differential Revision: https://reviews.llvm.org/D24069

llvm-svn: 281440
2016-09-14 05:52:21 +00:00
Wei Mi 24662395df Create a getelementptr instead of sub expr for ValueOffsetPair if the
value is a pointer.

This patch is to fix PR30213. When expanding an expr based on ValueOffsetPair,
if the value is of pointer type, we can only create a getelementptr instead
of sub expr.

Differential Revision: https://reviews.llvm.org/D24088

llvm-svn: 281439
2016-09-14 04:39:50 +00:00
Tobias Grosser 12cc2b80b6 Ensure Polly linking works without BUILD_SHARED_LIBS
This change ensures all necessary symbols are resolved correctly. Before this
change on some systems, the linker may have eliminated some symbols not directly
used in bugpoint, but used in Polly.

Suggested-by: Michael Kruse <lvm@meinersbur.de>
llvm-svn: 281438
2016-09-14 03:09:48 +00:00
Peter Collingbourne 0758644461 gold: Simplify. Do not unnecessarily enumerate Obj's symbols.
llvm-svn: 281437
2016-09-14 02:55:16 +00:00
Richard Smith 14568ff2ad [docs] Fix formatting of &nbsp; characters so that tables line up properly. Add
padding around table cells so the borders of adjacent tables don't run into
each other (now that they're perfectly aligned).

llvm-svn: 281436
2016-09-14 02:24:50 +00:00
Kostya Serebryany a00b243c75 [libFuzzer] start using trace-pc-guard as an alternative source of coverage
llvm-svn: 281435
2016-09-14 02:13:06 +00:00
Richard Smith 8cba29181b [docs] Order diagnostic cross-references alphabetically rather than based on
order in the .td file.

llvm-svn: 281434
2016-09-14 01:55:42 +00:00
Richard Smith ce9d586fdb Update DiagnosticsReference and fix emitter to emit -Wpedantic diagnostics and groups in a deterministic order.
llvm-svn: 281433
2016-09-14 01:51:10 +00:00
Kostya Serebryany 60cdd6113f [sanitizer-coverage] add yet another flavour of coverage instrumentation: trace-pc-guard. The intent is to eventually replace all of {bool coverage, 8bit-counters, trace-pc} with just this one. Clang part
llvm-svn: 281432
2016-09-14 01:39:49 +00:00
Kostya Serebryany da718e55cf [sanitizer-coverage] add yet another flavour of coverage instrumentation: trace-pc-guard. The intent is to eventually replace all of {bool coverage, 8bit-counters, trace-pc} with just this one. LLVM part
llvm-svn: 281431
2016-09-14 01:39:35 +00:00
Nico Weber d58c26090d Follow-up to r281367: Compare uuids case-insensitively.
llvm-svn: 281430
2016-09-14 01:16:54 +00:00
Richard Smith 1c16d1b576 [modules] When merging one definition into another, propagate the list of
re-exporting modules from the discarded definition to the retained definition.

llvm-svn: 281429
2016-09-14 01:05:35 +00:00
Sean Callanan 5085710892 Cleaned up the code that handles function return addresses in "frame diagnose."
llvm-svn: 281428
2016-09-14 00:48:19 +00:00
Richard Smith 9d5f86b694 Color warnings purple rather than orange, to match actual Clang output.
llvm-svn: 281427
2016-09-14 00:35:56 +00:00
Rui Ueyama 2d7fe598f2 Turn a no-op assignment into an assertion.
r279456 guarantees that this condition is always satisfied.

llvm-svn: 281426
2016-09-14 00:09:50 +00:00
Rui Ueyama 38dbd3eea9 Simplify InputFile ownership management.
Previously, all input files were owned by the symbol table.
Files were created at various places, such as the Driver, the lazy
symbols, or the bitcode compiler, and the ownership of new files
was transferred to the symbol table using std::unique_ptr.
All input files were then free'd when the symbol table is freed
which is on program exit.

I think we don't have to transfer ownership just to free all
instance at once on exit.

In this patch, all instances are automatically collected to a
vector and freed on exit. In this way, we no longer have to
use std::unique_ptr.

Differential Revision: https://reviews.llvm.org/D24493

llvm-svn: 281425
2016-09-14 00:05:51 +00:00
Jason Henline b38d8a3a3b [SE] Pack global dev handle addresses
Summary:
We were packing global device memory handles in
`PackedKernelArgumentArray`, but as I was implementing the CUDA
platform, I realized that CUDA wants the address of the handle, not the
handle itself. So this patch switches to packing the address of the
handle.

Reviewers: jlebar

Subscribers: jprice, jlebar, parallel_libs-commits

Differential Revision: https://reviews.llvm.org/D24528

llvm-svn: 281424
2016-09-13 23:59:10 +00:00
Jason Henline 3a90112591 Device doc says device is small
llvm-svn: 281423
2016-09-13 23:56:47 +00:00
Jason Henline 16a5352121 [SE] Platforms return Device values
Summary:
Platforms were returning Device pointers, but a Device is now basically
just a pointer to an underlying PlatformDevice, so we will now just pass
it around as a value.

Reviewers: jlebar

Subscribers: jprice, jlebar, parallel_libs-commits

Differential Revision: https://reviews.llvm.org/D24537

llvm-svn: 281422
2016-09-13 23:56:46 +00:00
Akira Hatanaka 6d5a29489a Address Pete's review comment and define OrigArg on its own line.
This is a follow-up to r281419.

llvm-svn: 281421
2016-09-13 23:53:43 +00:00
Zachary Turner 471932de24 Force c++14 when running tests on Windows.
VS 2015 and higher begin making use of c++14 in their standard
library headers.  As such, -std=c++11 makes it so you can't compile
trivial programs.  Bump this to -std=c++14 when this situation is
detected.

llvm-svn: 281420
2016-09-13 23:45:11 +00:00
Akira Hatanaka dea090e6b2 [ObjCARC] Traverse chain downwards to replace uses of argument passed to
ObjC library call with call return.

ARC contraction tries to replace uses of an argument passed to an
objective-c library call with the call return value. For example, in the
following IR, it replaces uses of argument %9 and uses of the values
discovered traversing the chain upwards (%7 and %8) with the call return
%10, if they are dominated by the call to @objc_autoreleaseReturnValue.
This transformation enables code-gen to tail-call the call to
@objc_autoreleaseReturnValue, which is necessary to enable auto release
return value optimization.

%7 = tail call i8* @objc_loadWeakRetained(i8** %6)
%8 = bitcast i8* %7 to %0*
%9 = bitcast %0* %8 to i8*
%10 = tail call i8* @objc_autoreleaseReturnValue(i8* %9)
ret %0* %8

Since r276727, llvm started removing redundant bitcasts and as a result
started feeding the following IR to ARC contraction:

%7 = tail call i8* @objc_loadWeakRetained(i8** %6)
%8 = bitcast i8* %7 to %0*
%9 = tail call i8* @objc_autoreleaseReturnValue(i8* %7)
ret %0* %8

ARC contraction no longer does the optimization described above since it
only traverses the chain upwards and fails to recognize that the
function return can be replaced by the call return. This commit changes
ARC contraction to traverse the chain downwards too and replace uses of
bitcasts with the call return.

rdar://problem/28011339

Differential Revision: https://reviews.llvm.org/D24523

llvm-svn: 281419
2016-09-13 23:43:11 +00:00
Jason Molenda d82e1063f9 TestQueues could error out because the one second sleep main.c was
using to enqueue all the jobs wasn't enough time on a slow/overloaded
system.  Instead use a global to indicate when all the work has
been enqueued, let's see if this makes the CIs work more reliably.

llvm-svn: 281418
2016-09-13 23:29:46 +00:00