platform/upstream/llvm.git
8 years agoDo not remove empty lifetime.start/lifetime.end ranges
Vitaly Buka [Thu, 28 Jul 2016 22:50:48 +0000 (22:50 +0000)]
Do not remove empty lifetime.start/lifetime.end ranges

Summary:
Asan stack-use-after-scope check should poison alloca even if there is
no access between start and end.

This is possible for code like this:
for (int i = 0; i < 3; i++) {
  int x;
  p = &x;
}

"Loop Invariant Code Motion" will move "p = &x;" out of the loop, making
start/end range empty.

PR27453

Reviewers: eugenis

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

llvm-svn: 277068

8 years agomaned
Vitaly Buka [Thu, 28 Jul 2016 22:50:45 +0000 (22:50 +0000)]
maned

llvm-svn: 277067

8 years agorange
Vitaly Buka [Thu, 28 Jul 2016 22:50:43 +0000 (22:50 +0000)]
range

llvm-svn: 277066

8 years agoSmall refinement on the memory segment support in core files that
Jason Molenda [Thu, 28 Jul 2016 22:43:10 +0000 (22:43 +0000)]
Small refinement on the memory segment support in core files that
Greg added in r272276 -- when working with a non-user-process mach-o
core file, force the permissions to readable + executable, else the
unwinder can stop backtracing early if it gets a pc value in a segment
that it thinks is non-executable.
<rdar://problem/27138456>
<rdar://problem/27462904>

llvm-svn: 277065

8 years ago[CUDA] Unswitch enumerators in the selection of the offloading tool chain.
Samuel Antao [Thu, 28 Jul 2016 22:42:42 +0000 (22:42 +0000)]
[CUDA] Unswitch enumerators in the selection of the offloading tool chain.

llvm-svn: 277064

8 years agoRework CFG simplification in bugpoint
Daniel Berlin [Thu, 28 Jul 2016 22:29:25 +0000 (22:29 +0000)]
Rework CFG simplification in bugpoint

Summary:
Depends on D22841

We now use a much simpler CFG simplification routine for bugpoint,
because SimplifyCFG is no longer a good match for what bugpoint wants
to do.

At the same time, to make sure we don't lose anything valuable it was doing,
SimplifyCFG is now run as a per-BB reduction pass.

With this and D22841 combined, bugpoint operates both much faster on
the large testcases i have, and reduces them to pretty much minimal
testcases (in one case, bugpoint used to leave about 6000 useless blocks, and
now it leaves 3 ...)

Reviewers: chandlerc, majnemer

Subscribers: llvm-commits

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

llvm-svn: 277063

8 years ago[ELF] - Removed excessive check. NFC.
George Rimar [Thu, 28 Jul 2016 22:15:44 +0000 (22:15 +0000)]
[ELF] - Removed excessive check. NFC.

Thanks to Rui Ueyama who noticed that.

llvm-svn: 277062

8 years agoRemove a duplicated block in cmake.
Stephane Sezer [Thu, 28 Jul 2016 22:11:54 +0000 (22:11 +0000)]
Remove a duplicated block in cmake.

Summary:
This is supposed to find the python lib dir and seems like it's just
been copied twice by mistake.

Reviewers: tfiala

Subscribers: lldb-commits

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

llvm-svn: 277060

8 years ago[ELF] - Attempt to fix BB after 277042.
George Rimar [Thu, 28 Jul 2016 22:10:50 +0000 (22:10 +0000)]
[ELF] - Attempt to fix BB after 277042.
http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/17294
Change:
std::make_unique -> llvm::make_unique

llvm-svn: 277059

8 years ago[ObjC] Consider availability of context when emitting availability warnings
Erik Pilkington [Thu, 28 Jul 2016 22:09:53 +0000 (22:09 +0000)]
[ObjC] Consider availability of context when emitting availability warnings

This means that a function marked with an availability attribute can safely
refer to a declaration that is greater than the deployment target, but less then
or equal to the context availability without -Wpartial-availability firing.

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

llvm-svn: 277058

8 years ago[PM] Port LowerGuardIntrinsic to the new PM.
Michael Kuperstein [Thu, 28 Jul 2016 22:08:41 +0000 (22:08 +0000)]
[PM] Port LowerGuardIntrinsic to the new PM.

llvm-svn: 277057

8 years ago[ELF] - Cosmetic change. NFC.
George Rimar [Thu, 28 Jul 2016 22:01:56 +0000 (22:01 +0000)]
[ELF] - Cosmetic change. NFC.

peek()[0] == '*' changed to peek().startswith("*")

llvm-svn: 277043

8 years ago[ELF] - Linkerscript: implemented filename specification.
George Rimar [Thu, 28 Jul 2016 21:51:30 +0000 (21:51 +0000)]
[ELF] - Linkerscript: implemented filename specification.

Scripts can contain something like:
KEEP (*crtbegin.o(.ctors))

What means that "*crtbegin.o" is a wildcard of file to take the sections from.
This is some kind of opposite to EXCLUDE_FILE and used in FreeBSD script:
https://svnweb.freebsd.org/base/head/sys/conf/ldscript.amd64?revision=284870&view=markup#l122

Patch implements this.

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

llvm-svn: 277042

8 years agoFix some sign compare warnings breaking the -Werror build
David Blaikie [Thu, 28 Jul 2016 21:42:12 +0000 (21:42 +0000)]
Fix some sign compare warnings breaking the -Werror build

llvm-svn: 277040

8 years agoRevert r277038 until clearing why tests fail.
Alina Sbirlea [Thu, 28 Jul 2016 21:35:20 +0000 (21:35 +0000)]
Revert r277038 until clearing why tests fail.

llvm-svn: 277039

8 years agoRemove TargetBaseAlign. Keep alignment for stack adjustments.
Alina Sbirlea [Thu, 28 Jul 2016 21:26:40 +0000 (21:26 +0000)]
Remove TargetBaseAlign. Keep alignment for stack adjustments.

Summary:
TargetBaseAlign is no longer required since LSV checks if target allows misaligned accesses.
A constant defining a base alignment is still needed for stack accesses where alignment can be adjusted.

Reviewers: llvm-commits, jlebar

Subscribers: mzolotukhin, arsenm

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

llvm-svn: 277038

8 years agoReally try to pacify the build bots :/
David Majnemer [Thu, 28 Jul 2016 21:22:31 +0000 (21:22 +0000)]
Really try to pacify the build bots :/

llvm-svn: 277037

8 years agoTry to passify the builders
David Majnemer [Thu, 28 Jul 2016 21:16:51 +0000 (21:16 +0000)]
Try to passify the builders

llvm-svn: 277036

8 years ago[ELF] - Linkerscript: implemented += operator.
George Rimar [Thu, 28 Jul 2016 21:08:56 +0000 (21:08 +0000)]
[ELF] - Linkerscript: implemented += operator.

Sometimes += is used to move the location counter.
Example from the wild is:

.dbg_excpt _DBG_EXCPT_ADDR (NOLOAD) :
{
  . += (DEFINED (_DEBUGGER) ? 0x8 : 0x0);
https://github.com/chipKIT32/pic32-Arduino-USB-Bootloader-original/blob/master/boot-linkerscript.ld

Patch implements it and opens way for others type of assignments (-= *= etc), though I think only += is
actual to support.

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

llvm-svn: 277035

8 years agoMake CommonInputSection singleton class.
Rui Ueyama [Thu, 28 Jul 2016 21:05:04 +0000 (21:05 +0000)]
Make CommonInputSection singleton class.

All other singleton instances are accessible globally.
CommonInputSection shouldn't be an exception.

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

llvm-svn: 277034

8 years ago[coroutines] Part 3 of N: Adding Boilerplate for Coroutine Passes
David Majnemer [Thu, 28 Jul 2016 21:04:31 +0000 (21:04 +0000)]
[coroutines] Part 3 of N: Adding Boilerplate for Coroutine Passes

This adds boilerplate code for all coroutine passes,
the passes are no-ops for now.
Also, a small test has been added to verify that passes execute in
the expected order or not at all if coroutine support is disabled.

Patch by Gor Nishanov!

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

llvm-svn: 277033

8 years ago[docs] Add sub-mod example by Chris to GitHub proposal
Renato Golin [Thu, 28 Jul 2016 20:57:25 +0000 (20:57 +0000)]
[docs] Add sub-mod example by Chris to GitHub proposal

llvm-svn: 277032

8 years agoFix build breaks after r277028
Krzysztof Parzyszek [Thu, 28 Jul 2016 20:25:21 +0000 (20:25 +0000)]
Fix build breaks after r277028

llvm-svn: 277031

8 years agoMissed updating a GlobalISel bit in my last commit
Matthias Braun [Thu, 28 Jul 2016 20:13:42 +0000 (20:13 +0000)]
Missed updating a GlobalISel bit in my last commit

GlobalISel isn't built by default so I missed it.

llvm-svn: 277030

8 years ago[analyzer] Update the web manual for checker developers.
Artem Dergachev [Thu, 28 Jul 2016 20:13:14 +0000 (20:13 +0000)]
[analyzer] Update the web manual for checker developers.

Fix the explanation of how to run tests after migration
from autotools to cmake.

Significantly expand the "debugging" section
with more interesting stuff.

Update the table of contents accordingly.

Fix paragraphs in the overview section.

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

llvm-svn: 277029

8 years ago[Hexagon] Implement MI-level constant propagation
Krzysztof Parzyszek [Thu, 28 Jul 2016 20:01:59 +0000 (20:01 +0000)]
[Hexagon] Implement MI-level constant propagation

llvm-svn: 277028

8 years agoFix DbgValue handling in SelectionDAG.
Nirav Dave [Thu, 28 Jul 2016 19:48:39 +0000 (19:48 +0000)]
Fix DbgValue handling in SelectionDAG.

[DAG] Relocate TransferDbgValues in ReplaceAllUsesWith(SDValue, SDValue)
to before we modify the CSE maps.

llvm-svn: 277027

8 years ago[pdb] Fix another narrowing conversion on x64 builds.
Zachary Turner [Thu, 28 Jul 2016 19:47:04 +0000 (19:47 +0000)]
[pdb] Fix another narrowing conversion on x64 builds.

llvm-svn: 277026

8 years ago[pdb] Fix an ambiguity when writing size_t on x64 platforms.
Zachary Turner [Thu, 28 Jul 2016 19:29:52 +0000 (19:29 +0000)]
[pdb] Fix an ambiguity when writing size_t on x64 platforms.

llvm-svn: 277025

8 years ago[OpenCL] Generate opaque type for sampler_t and function call for the initializer
Yaxun Liu [Thu, 28 Jul 2016 19:26:30 +0000 (19:26 +0000)]
[OpenCL] Generate opaque type for sampler_t and function call for the initializer

Currently Clang use int32 to represent sampler_t, which have been a source of issue for some backends, because in some backends sampler_t cannot be represented by int32. They have to depend on kernel argument metadata and use IPA to find the sampler arguments and global variables and transform them to target specific sampler type.

This patch uses opaque pointer type opencl.sampler_t* for sampler_t. For each use of file-scope sampler variable, it generates a function call of __translate_sampler_initializer. For each initialization of function-scope sampler variable, it generates a function call of __translate_sampler_initializer.

Each builtin library can implement its own __translate_sampler_initializer(). Since the real sampler type tends to be architecture dependent, allowing it to be initialized by a library function simplifies backend design. A typical implementation of __translate_sampler_initializer could be a table lookup of real sampler literal values. Since its argument is always a literal, the returned pointer is known at compile time and easily optimized to finally become some literal values directly put into image read instructions.

This patch is partially based on Alexey Sotkin's work in Khronos Clang (https://github.com/KhronosGroup/SPIR/commit/3d4eec61623502fc306e8c67c9868be2b136e42b).

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

llvm-svn: 277024

8 years ago[ELF] Allows setting section for common symbols in linker script
Eugene Leviant [Thu, 28 Jul 2016 19:24:13 +0000 (19:24 +0000)]
[ELF] Allows setting section for common symbols in linker script

llvm-svn: 277023

8 years agoTrying to fix this test on windows.
Rafael Espindola [Thu, 28 Jul 2016 19:18:22 +0000 (19:18 +0000)]
Trying to fix this test on windows.

llvm-svn: 277022

8 years ago[pdb] Fix some warnings that break -Werror builds.
Zachary Turner [Thu, 28 Jul 2016 19:18:02 +0000 (19:18 +0000)]
[pdb] Fix some warnings that break -Werror builds.

llvm-svn: 277021

8 years ago[Hexagon] Insert CFI instructions before throwing calls
Krzysztof Parzyszek [Thu, 28 Jul 2016 19:13:46 +0000 (19:13 +0000)]
[Hexagon] Insert CFI instructions before throwing calls

Normally, CFI instructions should be inserted after allocframe, but
if allocframe is in the same packet with a call, the CFI instructions
should be inserted before that packet.

llvm-svn: 277020

8 years ago[pdb] Refactor library to more clearly separate reading/writing
Zachary Turner [Thu, 28 Jul 2016 19:12:28 +0000 (19:12 +0000)]
[pdb] Refactor library to more clearly separate reading/writing

Reviewed By: amccarth, ruiu
Differential Revision: https://reviews.llvm.org/D22693

llvm-svn: 277019

8 years agoGet rid of IMsfStreamData class.
Zachary Turner [Thu, 28 Jul 2016 19:11:09 +0000 (19:11 +0000)]
Get rid of IMsfStreamData class.

This was a pure virtual base class whose purpose was to abstract
away the notion of how you retrieve the layout of a discontiguous
stream of blocks in an Msf file.  This led to too many layers of
abstraction making it difficult to figure out what was going on
and extend things.  Ultimately, a stream's layout is decided by
its length and the array of block numbers that it lives on.  So
rather than have an abstract base class which can return this in
any number of ways, it's more straightforward to simply store them
as fields of a trivial struct, and also to give a more appropriate
name.

This patch does that.  It renames IMsfStreamData to MsfStreamLayout,
and deletes the 2 concrete implementations, DirectoryStreamData
and IndexedStreamData.  MsfStreamLayout is a trivial struct
with the necessary data.

llvm-svn: 277018

8 years agoMachineFunction: Return reference for getFrameInfo(); NFC
Matthias Braun [Thu, 28 Jul 2016 18:40:00 +0000 (18:40 +0000)]
MachineFunction: Return reference for getFrameInfo(); NFC

getFrameInfo() never returns nullptr so we should use a reference
instead of a pointer.

llvm-svn: 277017

8 years agoCleanup some format string warnings
Luke Drummond [Thu, 28 Jul 2016 18:19:33 +0000 (18:19 +0000)]
Cleanup some format string warnings

Clean up format string warnings in ValueObjectSyntheticFilter.cpp to explictly cast "%p" params to void *`

Subscribers: lldb-commits

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

llvm-svn: 277016

8 years agoFix dangling reference to temporary in use of ArrayRef
Reid Kleckner [Thu, 28 Jul 2016 18:17:01 +0000 (18:17 +0000)]
Fix dangling reference to temporary in use of ArrayRef

Fixes tests locally for me with MSVC 2015.

llvm-svn: 277015

8 years agoAdd support for SEGMENT_START.
Rafael Espindola [Thu, 28 Jul 2016 18:16:24 +0000 (18:16 +0000)]
Add support for SEGMENT_START.

This is a bit of an odd feature. It is normally used in

. = SEGMENT_START(seg, val);

In bfd it evaluates to val or to the value of the corresponding
-T<seg>-segment. Note that the -T<seg>-segment in bfd doesn't actually
change the segment address, just the value this evaluates too,
including in the default linker script.

In gold the -T<seg>-segment options do change the segment address and
seeing this expressions in linker scripts disables the options.

For new this just always evaluates the expression to val.

llvm-svn: 277014

8 years agoHost: correct use of std::condition_variable::wait_for
Saleem Abdulrasool [Thu, 28 Jul 2016 18:16:07 +0000 (18:16 +0000)]
Host: correct use of std::condition_variable::wait_for

std::condition::wait_for takes a std::unique_lock<T>.  The previous commit
accidentally left a reference to `m_mutex` instead of `lock`.  Update that.
Should restore the android lldb builder to green.

llvm-svn: 277013

8 years agoFixed up Xcode build for r276976 and r277011.
Todd Fiala [Thu, 28 Jul 2016 17:56:26 +0000 (17:56 +0000)]
Fixed up Xcode build for r276976 and r277011.

Also, fixed up typos in RenderScript code that could
not possibly compile.

llvm-svn: 277012

8 years agoClean up vestigial remnants of locking primitives
Saleem Abdulrasool [Thu, 28 Jul 2016 17:32:20 +0000 (17:32 +0000)]
Clean up vestigial remnants of locking primitives

This finally removes the use of the Mutex and Condition classes. This is an
intricate patch as the Mutex and Condition classes were tied together.
Furthermore, many places had slightly differing uses of time values. Convert
timeout values to relative everywhere to permit the use of
std::chrono::duration, which is required for the use of
std::condition_variable's timeout. Adjust all Condition and related Mutex
classes over to std::{,recursive_}mutex and std::condition_variable.

This change primarily comes at the cost of breaking the TracingMutex which was
based around the Mutex class. It would be possible to write a wrapper to
provide similar functionality, but that is beyond the scope of this change.

llvm-svn: 277011

8 years ago[analyzer] Fix misleading indentation in ObjCDeallocChecker. NFC.
Devin Coughlin [Thu, 28 Jul 2016 17:18:33 +0000 (17:18 +0000)]
[analyzer] Fix misleading indentation in ObjCDeallocChecker. NFC.

llvm-svn: 277009

8 years agoRevert r276973 "Adjust Registry interface to not require plugins to export a registry"
John Brawn [Thu, 28 Jul 2016 17:17:22 +0000 (17:17 +0000)]
Revert r276973 "Adjust Registry interface to not require plugins to export a registry"

Buildbot failures when building with clang -Werror. Reverting while I try to
figure this out.

llvm-svn: 277008

8 years ago[AArch64][GlobalISel] Select G_BR.
Ahmed Bougacha [Thu, 28 Jul 2016 17:15:15 +0000 (17:15 +0000)]
[AArch64][GlobalISel] Select G_BR.

This is the first unsized instruction we support; move down the
'sized' check to binops.

llvm-svn: 277007

8 years ago[MIRParser] Accept unsized generic instructions.
Ahmed Bougacha [Thu, 28 Jul 2016 17:15:12 +0000 (17:15 +0000)]
[MIRParser] Accept unsized generic instructions.

Since r276158, we require generic instructions to have a sized type.
G_BR doesn't; relax the restriction.

llvm-svn: 277006

8 years ago[Driver] Fix Windows SDK Detection
Zachary Turner [Thu, 28 Jul 2016 17:13:32 +0000 (17:13 +0000)]
[Driver] Fix Windows SDK Detection

This fixes a couple of bugs in Windows SDK Detection.

1. `readFullStringValue` returns a bool, but was being compared
   with ERROR_SUCCESS.
2. `RegQueryValueExW` might return the null terminator in the
   queried value which will result in incorrect values being
   returned from `getSystemRegistryString`.

Patch By: comicfans44@gmail.com
Reviewed By: zturner
Differential Revision: http://reviews.llvm.org/D21946

llvm-svn: 277005

8 years ago[AArch64][GlobalISel] Select GPR G_SUB.
Ahmed Bougacha [Thu, 28 Jul 2016 16:58:35 +0000 (16:58 +0000)]
[AArch64][GlobalISel] Select GPR G_SUB.

llvm-svn: 277003

8 years ago[AArch64][GlobalISel] Select GPR G_AND.
Ahmed Bougacha [Thu, 28 Jul 2016 16:58:31 +0000 (16:58 +0000)]
[AArch64][GlobalISel] Select GPR G_AND.

llvm-svn: 277002

8 years ago[GlobalISel] Remove types on selected insts instead of using LLT().
Ahmed Bougacha [Thu, 28 Jul 2016 16:58:27 +0000 (16:58 +0000)]
[GlobalISel] Remove types on selected insts instead of using LLT().

LLT() has a particular meaning: it's one invalid type. But we really
want selected instructions to have no type whatsoever.

Also verify that types don't linger after ISel, and enable the verifier
on the AArch64 select test.

llvm-svn: 277001

8 years ago[AArch64][GlobalISel] Remove 'alignment' from MIR tests. NFC.
Ahmed Bougacha [Thu, 28 Jul 2016 16:58:21 +0000 (16:58 +0000)]
[AArch64][GlobalISel] Remove 'alignment' from MIR tests. NFC.

llvm-svn: 277000

8 years ago[lld][MachO] Fix bugs in the debug-syms test case.
Lang Hames [Thu, 28 Jul 2016 16:56:26 +0000 (16:56 +0000)]
[lld][MachO] Fix bugs in the debug-syms test case.

The previous run line depended on libSystem.dylib being present, which it's not
on non-darwin platforms. The new run line uses libSystem.yaml instead.

llvm-svn: 276999

8 years agoAMDGPU : Add intrinsics for compare with the full wavefront result
Wei Ding [Thu, 28 Jul 2016 16:42:13 +0000 (16:42 +0000)]
AMDGPU : Add intrinsics for compare with the full wavefront result

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

llvm-svn: 276998

8 years agoTargetInstrInfo: rename GetInstSizeInBytes to getInstSizeInBytes. NFC
Sjoerd Meijer [Thu, 28 Jul 2016 16:32:22 +0000 (16:32 +0000)]
TargetInstrInfo: rename GetInstSizeInBytes to getInstSizeInBytes. NFC

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

llvm-svn: 276997

8 years ago[CUDA] Remove duplicated test that should have been removed in r276995.
Samuel Antao [Thu, 28 Jul 2016 16:18:31 +0000 (16:18 +0000)]
[CUDA] Remove duplicated test that should have been removed in r276995.

llvm-svn: 276996

8 years ago[CUDA] Rename cuda_phases.cu test to cuda-phases.cu to be consistent with the other...
Samuel Antao [Thu, 28 Jul 2016 16:12:30 +0000 (16:12 +0000)]
[CUDA] Rename cuda_phases.cu test to cuda-phases.cu to be consistent with the other tests.

llvm-svn: 276995

8 years ago[mips] Fix a warning that occurs on some gcc 4.9.2's but not all of them.
Daniel Sanders [Thu, 28 Jul 2016 15:59:06 +0000 (15:59 +0000)]
[mips] Fix a warning that occurs on some gcc 4.9.2's but not all of them.

llvm-svn: 276993

8 years agoRevert r276982 and r276984: [mips][fastisel] Handle 0-4 arguments without SelectionDAG
Daniel Sanders [Thu, 28 Jul 2016 15:37:42 +0000 (15:37 +0000)]
Revert r276982 and r276984: [mips][fastisel] Handle 0-4 arguments without SelectionDAG

It seems that the stack offset in callabi.ll varies between machines. I'll look
into it.

llvm-svn: 276989

8 years ago[OpenMP] Change name of variable in mappble expression.
Samuel Antao [Thu, 28 Jul 2016 15:31:29 +0000 (15:31 +0000)]
[OpenMP] Change name of variable in mappble expression.

This attempts to fix a failure in Windows bots pottentially related with a reserved keyword.

llvm-svn: 276988

8 years ago[X86] Remove CustomInserter for FMA3 instructions. Looks like since we got full commu...
Craig Topper [Thu, 28 Jul 2016 15:28:56 +0000 (15:28 +0000)]
[X86] Remove CustomInserter for FMA3 instructions. Looks like since we got full commuting support for FMAs after this was added, the coalescer can now get this right on its own.

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

llvm-svn: 276987

8 years ago[mips] Reword debug message as should have been done before committing r276982
Daniel Sanders [Thu, 28 Jul 2016 15:13:23 +0000 (15:13 +0000)]
[mips] Reword debug message as should have been done before committing r276982

llvm-svn: 276984

8 years ago[OpenMP] Fix link command pattern in offloading interoperability test.
Samuel Antao [Thu, 28 Jul 2016 14:56:19 +0000 (14:56 +0000)]
[OpenMP] Fix link command pattern in offloading interoperability test.

It was causing a few bots to fail.

llvm-svn: 276983

8 years ago[mips][fastisel] Handle 0-4 arguments without SelectionDAG.
Daniel Sanders [Thu, 28 Jul 2016 14:55:28 +0000 (14:55 +0000)]
[mips][fastisel] Handle 0-4 arguments without SelectionDAG.

Summary:
Implements fastLowerArguments() to avoid the need to fall back on
SelectionDAG for 0-4 argument functions that don't do tricky things like
passing double in a pair of i32's.

This allows us to move all except one test to -fast-isel-abort=3. The
remaining one has function prototypes of the form 'i32 (i32, double, double)'
which requires floats to be passed in GPR's.

Reviewers: sdardis

Subscribers: dsanders, llvm-commits, sdardis

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

llvm-svn: 276982

8 years ago[OpenMP] Do not use default argument in lambda from mappable expressions handlers.
Samuel Antao [Thu, 28 Jul 2016 14:47:35 +0000 (14:47 +0000)]
[OpenMP] Do not use default argument in lambda from mappable expressions handlers.

Windows bots were complaining about that.

llvm-svn: 276981

8 years agoAMDGPU/SI: Don't use reserved VGPRs for SGPR spilling
Tom Stellard [Thu, 28 Jul 2016 14:30:43 +0000 (14:30 +0000)]
AMDGPU/SI: Don't use reserved VGPRs for SGPR spilling

Summary:
We were using reserved VGPRs for SGPR spilling and this was causing
some programs with a workgroup size of 1024 to use more than 64
registers, which is illegal.

Reviewers: arsenm, mareko, nhaehnle

Subscribers: nhaehnle, arsenm, llvm-commits, kzhuravl

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

llvm-svn: 276980

8 years ago[OpenMP][CUDA] Do not forward OpenMP flags for CUDA device actions.
Samuel Antao [Thu, 28 Jul 2016 14:29:18 +0000 (14:29 +0000)]
[OpenMP][CUDA] Do not forward OpenMP flags for CUDA device actions.

Summary:
This patch prevents OpenMP flags from being forwarded to CUDA device commands. That was causing the CUDA frontend to attempt to emit OpenMP code which is not supported.

This fixes the bug reported in https://llvm.org/bugs/show_bug.cgi?id=28723.

Reviewers: hfinkel, carlo.bertolli, arpith-jacob, kkwli0, tra, ABataev

Subscribers: caomhin, cfe-commits

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

llvm-svn: 276979

8 years ago[OpenMP] Code generation for the is_device_ptr clause
Samuel Antao [Thu, 28 Jul 2016 14:25:09 +0000 (14:25 +0000)]
[OpenMP] Code generation for the is_device_ptr clause

Summary: This patch adds support for the is_device_ptr clause. It expands SEMA to use the mappable expression logic that can only be tested with code generation in place and check conflicts with other data sharing related clauses using the mappable expressions infrastructure.

Reviewers: hfinkel, carlo.bertolli, arpith-jacob, kkwli0, ABataev

Subscribers: caomhin, cfe-commits

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

llvm-svn: 276978

8 years ago[OpenMP] Codegen for use_device_ptr clause.
Samuel Antao [Thu, 28 Jul 2016 14:23:26 +0000 (14:23 +0000)]
[OpenMP] Codegen for use_device_ptr clause.

Summary: This patch adds support for the use_device_ptr clause. It includes changes in SEMA that could not be tested without codegen, namely, the use of the first private logic and mappable expressions support.

Reviewers: hfinkel, carlo.bertolli, arpith-jacob, kkwli0, ABataev

Subscribers: caomhin, cfe-commits

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

llvm-svn: 276977

8 years agoAdd IR fixups for RenderScript ABI mismatch between ARMV7 frontend and x86 backend
Luke Drummond [Thu, 28 Jul 2016 14:21:07 +0000 (14:21 +0000)]
Add IR fixups for RenderScript ABI mismatch between ARMV7 frontend and x86 backend

Expression evaluation for function calls to certain public RenderScript
API functions in libRSCPURef can segfault.

`slang`,
the compiler frontend for RenderScript embeds an ARM specific triple in
IR that is shipped in the app, after generating IR that has some
assumptions that an ARM device is the target.
As the IR is then compiled on a device of unknown (at time the IR was
generated at least) architecture, when calling RenderScript API function
as part of debugger expressions, we have to perform a fixup pass that
removes those assumptions right before the module is sent to be
generated by the llvm backend.

This issue is caused by multiple problems with the ARMv7-specific
assumptions encoded in the LLVM IR. x86 large value returns use a hidden
first argument (mapping to llvm::Attribute::StructRet), which can't be
picked up by the JIT due to the mismatch between IR generated by the
slang frontend and llvm backend. This means that code generated by bcc
did not necessarily match the default SysV Linux/Android ABI used by the
LLDB JIT

- Original Authors: Luke Drummond (@ldrumm), Function declarations fixed by Aidan Dodds (@ADodds)

Subscribers: lldb-commits

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

llvm-svn: 276976

8 years agoRemoved unused variables
Simon Pilgrim [Thu, 28 Jul 2016 13:42:57 +0000 (13:42 +0000)]
Removed unused variables

llvm-svn: 276975

8 years agoFix signed/unsigned warning.
Simon Pilgrim [Thu, 28 Jul 2016 13:29:56 +0000 (13:29 +0000)]
Fix signed/unsigned warning.

llvm-svn: 276974

8 years agoReapply r276856 "Adjust Registry interface to not require plugins to export a registry"
John Brawn [Thu, 28 Jul 2016 12:48:17 +0000 (12:48 +0000)]
Reapply r276856 "Adjust Registry interface to not require plugins to export a registry"

This version has two fixes compared to the original:
 * In Registry.h the template static members are instantiated before they are
   used, as clang gives an error if you do it the other way around.
 * The use of the Registry template in clang-tidy is updated in the same way as
   has been done everywhere else.

Original commit message:

Currently the Registry class contains the vestiges of a previous attempt to
allow plugins to be used on Windows without using BUILD_SHARED_LIBS, where a
plugin would have its own copy of a registry and export it to be imported by
the tool that's loading the plugin. This only works if the plugin is entirely
self-contained with the only interface between the plugin and tool being the
registry, and in particular this conflicts with how IR pass plugins work.

This patch changes things so that instead the add_node function of the registry
is exported by the tool and then imported by the plugin, which solves this
problem and also means that instead of every plugin having to export every
registry they use instead LLVM only has to export the add_node functions. This
allows plugins that use a registry to work on Windows if
LLVM_EXPORT_SYMBOLS_FOR_PLUGINS is used.

llvm-svn: 276973

8 years agoAMDGPU: add execfix flag to SI_ELSE
Nicolai Haehnle [Thu, 28 Jul 2016 11:39:24 +0000 (11:39 +0000)]
AMDGPU: add execfix flag to SI_ELSE

Summary:
SI_ELSE is lowered into two parts:

s_or_saveexec_b64 dst, src (at the start of the basic block)

s_xor_b64 exec, exec, dst (at the end of the basic block)

The idea is that dst contains the exec mask of the preceding IF block. It can
happen that SIWholeQuadMode decides to switch from WQM to Exact mode inside
the basic block that contains SI_ELSE, in which case it introduces an instruction

s_and_b64 exec, exec, s[...]

which masks out bits that can correspond to both the IF and the ELSE paths.
So the resulting sequence must be:

s_or_savexec_b64 dst, src

s_and_b64 exec, exec, s[...] <-- added by SIWholeQuadMode
s_and_b64 dst, dst, exec <-- added by SILowerControlFlow

s_xor_b64 exec, exec, dst

Whether to add the additional s_and_b64 dst, dst, exec is currently determined
via the ExecModified tracking. With this change, it is instead determined by
an additional flag on SI_ELSE which is set by SIWholeQuadMode.

Finally: It also occured to me that an alternative approach for the long run
is for SILowerControlFlow to unconditionally emit

s_or_saveexec_b64 dst, src

...

s_and_b64 dst, dst, exec
s_xor_b64 exec, exec, dst

and have a pass that detects and cleans up the "redundant AND with exec"
pattern where possible. This could be useful anyway, because we also add
instructions

s_and_b64 vcc, exec, vcc

before s_cbranch_scc (in moveToALU), and those are often redundant. I have
some pending changes to how KILL is lowered that could also benefit from
such a cleanup pass.

In any case, this current patch could help in the short term with the whole
ExecModified business.

Reviewers: tstellarAMD, arsenm

Subscribers: arsenm, llvm-commits, kzhuravl

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

llvm-svn: 276972

8 years ago[clang-rename] remove redundant *_cast<> traversal
Kirill Bobyrev [Thu, 28 Jul 2016 10:31:16 +0000 (10:31 +0000)]
[clang-rename] remove redundant *_cast<> traversal

llvm-svn: 276971

8 years ago[modules] Add missing includes.
Vassil Vassilev [Thu, 28 Jul 2016 10:26:33 +0000 (10:26 +0000)]
[modules] Add missing includes.

llvm-svn: 276970

8 years agoRemove two tests added in r276957.
Daniel Jasper [Thu, 28 Jul 2016 09:54:35 +0000 (09:54 +0000)]
Remove two tests added in r276957.

These loop from 0 to AEK_XSCALE, which is currently defined as 0x80000000, and
thus the tests loop over the entire int range, which is unreasonable
and also too slow in debug builds.

llvm-svn: 276969

8 years agofix some typos in the doc
Sylvestre Ledru [Thu, 28 Jul 2016 09:28:58 +0000 (09:28 +0000)]
fix some typos in the doc

llvm-svn: 276968

8 years ago[clang-rename] USRFinder.cpp cleanup
Kirill Bobyrev [Thu, 28 Jul 2016 09:05:06 +0000 (09:05 +0000)]
[clang-rename] USRFinder.cpp cleanup

llvm-svn: 276967

8 years agoR276957 broke bot clang-ppc64be-linux-multistage,try to fix it.
Zijiao Ma [Thu, 28 Jul 2016 07:29:45 +0000 (07:29 +0000)]
R276957 broke bot clang-ppc64be-linux-multistage,try to fix it.

llvm-svn: 276966

8 years ago[ELF] - Linkerscript: ignore SORT(CONSTRUCTORS)
George Rimar [Thu, 28 Jul 2016 07:18:23 +0000 (07:18 +0000)]
[ELF] - Linkerscript: ignore SORT(CONSTRUCTORS)

Some scripts can contain SORT(CONSTRUCTORS) expression:
https://svnweb.freebsd.org/base/head/sys/conf/ldscript.amd64?revision=284870&view=markup#l152

for ELF it just a nop:
"When linking object file formats which do not support arbitrary sections, such as ECOFF and XCOFF, the linker will automatically recognize C++ global constructors and destructors by name. For these object file formats, the CONSTRUCTORS command tells the linker to place constructor information in the output section where the CONSTRUCTORS command appears. The CONSTRUCTORS command is ignored for other object file formats."
(http://www.sourceware.org/binutils/docs-2.10/ld_3.html)

So patch implements ignoring.

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

llvm-svn: 276965

8 years agoAdd missing REQUIRES line
Tobias Grosser [Thu, 28 Jul 2016 07:08:34 +0000 (07:08 +0000)]
Add missing REQUIRES line

llvm-svn: 276964

8 years agoGPGPU: Pass context parameters to GPU kernel
Tobias Grosser [Thu, 28 Jul 2016 06:47:59 +0000 (06:47 +0000)]
GPGPU: Pass context parameters to GPU kernel

llvm-svn: 276963

8 years agoGPGPU: Pass host iterators to kernel
Tobias Grosser [Thu, 28 Jul 2016 06:47:56 +0000 (06:47 +0000)]
GPGPU: Pass host iterators to kernel

llvm-svn: 276962

8 years agoGPGPU: use current 'Index' to find slot in parameter array
Tobias Grosser [Thu, 28 Jul 2016 06:47:53 +0000 (06:47 +0000)]
GPGPU: use current 'Index' to find slot in parameter array

Before this change we used the array index, which would result in us accessing
the parameter array out-of-bounds. This bug was visible for test cases where not
all arrays in a scop are passed to a given kernel.

llvm-svn: 276961

8 years agoGPGPU: Generate kernel parameter allocation with right size
Tobias Grosser [Thu, 28 Jul 2016 06:47:50 +0000 (06:47 +0000)]
GPGPU: Generate kernel parameter allocation with right size

Before this change we miscounted the number of function parameters.

llvm-svn: 276960

8 years ago[ConstantFolding] Don't bail on folding if ConstantFoldConstantExpression fails
David Majnemer [Thu, 28 Jul 2016 06:39:48 +0000 (06:39 +0000)]
[ConstantFolding] Don't bail on folding if ConstantFoldConstantExpression fails

When folding an expression, we run ConstantFoldConstantExpression on
each operand of that expression.
However, ConstantFoldConstantExpression can fail and retur nullptr.

Previously, we would bail on further refining the expression.
Instead, use the original operand and see if we can refine a later
operand.

llvm-svn: 276959

8 years ago[AArch64] Using AArch64TargetParser in Clang.
Zijiao Ma [Thu, 28 Jul 2016 06:24:48 +0000 (06:24 +0000)]
[AArch64] Using AArch64TargetParser in Clang.

This resubmit r270688 which broke some specific buildbots.That's because
there is incorrect indexing problem in the targetparser,and the problem is
fixed in r276957.

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

llvm-svn: 276958

8 years agoAdd unittests to {ARM | AArch64}TargetParser.
Zijiao Ma [Thu, 28 Jul 2016 06:11:18 +0000 (06:11 +0000)]
Add unittests to {ARM | AArch64}TargetParser.

Add unittest to {ARM | AArch64}TargetParser,and by the way correct problems as below:
1.Correct a incorrect indexing problem in AArch64TargetParser. The architecture enumeration
 is shared across ARM and AArch64 in original implementation.But In the code,I just used the
 index which was offset by the ARM, and this would index into the array incorrectly. To make
 AArch64 has its own arch enum,or we will do a lot of slowly iterating.
2.Correct a spelling error. The parameter of llvm::AArch64::getArchExtName.
3.Correct a writing mistake, in llvm::ARM::parseArchISA.

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

llvm-svn: 276957

8 years ago[CodeView] Don't crash on functions without subprograms
David Majnemer [Thu, 28 Jul 2016 05:03:22 +0000 (05:03 +0000)]
[CodeView] Don't crash on functions without subprograms

A function may have instructions annotated with debug info without
having a subprogram.

This fixes PR28747.

llvm-svn: 276956

8 years agoAdd a bunch of noexcepts to char_traits and string_view.
Marshall Clow [Thu, 28 Jul 2016 04:52:02 +0000 (04:52 +0000)]
Add a bunch of noexcepts to char_traits and string_view.

llvm-svn: 276955

8 years agoAdd some logging to the kernel dynamicloader plugin when we fail to read
Jason Molenda [Thu, 28 Jul 2016 04:18:44 +0000 (04:18 +0000)]
Add some logging to the kernel dynamicloader plugin when we fail to read
a kext binary from memory.
<rdar://problem/26158095>

llvm-svn: 276954

8 years agoAdd EP_CGSCCOptimizerLate extension point to PassManagerBuilder
David Majnemer [Thu, 28 Jul 2016 03:28:43 +0000 (03:28 +0000)]
Add EP_CGSCCOptimizerLate extension point to PassManagerBuilder

The EP_CGSCCOptimizerLate extension point allows adding CallGraphSCC
passes at the end of the main CallGraphSCC passes and before any
function simplification passes run by CGPassManager.

Patch by Gor Nishanov!

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

llvm-svn: 276953

8 years ago[InstCombine] Handle failures from ConstantFoldConstantExpression
David Majnemer [Thu, 28 Jul 2016 02:29:06 +0000 (02:29 +0000)]
[InstCombine] Handle failures from ConstantFoldConstantExpression

ConstantFoldConstantExpression returns null when folding fails.

This fixes PR28745.

llvm-svn: 276952

8 years agoFix broken build bot
Etienne Bergeron [Thu, 28 Jul 2016 01:35:32 +0000 (01:35 +0000)]
Fix broken build bot

The address resolution is ussing RTLD_NEXT and not RTLD_DEFAULT.
Which means &func may not be equivalent to dlsym("func").

llvm-svn: 276951

8 years ago[analyzer] Add check::BeginFunction to CheckerDocumentation checks. NFC.
Devin Coughlin [Thu, 28 Jul 2016 00:52:10 +0000 (00:52 +0000)]
[analyzer] Add check::BeginFunction to CheckerDocumentation checks. NFC.

This was an oversight from when I added BeginFunction support in r261293.

llvm-svn: 276950

8 years agotest: fix typo in file name (NFC)
Saleem Abdulrasool [Thu, 28 Jul 2016 00:43:14 +0000 (00:43 +0000)]
test: fix typo in file name (NFC)

llvm-svn: 276949

8 years agoclang-rename: adjust NamedDeclFindingASTVisitor for RecordDecls
Saleem Abdulrasool [Thu, 28 Jul 2016 00:42:01 +0000 (00:42 +0000)]
clang-rename: adjust NamedDeclFindingASTVisitor for RecordDecls

Ensure that Context is always properly initialised in the constructor.  It is
used for querying the LangOpts in VisitTypeLoc.  Prevent a null pointer
dereference in setResult by ensuring that a RecordDecl is being handled.

Patch by Alexander Shaposhnikov!

llvm-svn: 276948

8 years agoReplace preserve-as-comments CodeGen test with driver test
Nirav Dave [Thu, 28 Jul 2016 00:36:34 +0000 (00:36 +0000)]
Replace preserve-as-comments CodeGen test with driver test

llvm-svn: 276947

8 years agoAMDGPU: Turn dead checks into asserts
Matt Arsenault [Thu, 28 Jul 2016 00:32:05 +0000 (00:32 +0000)]
AMDGPU: Turn dead checks into asserts

llvm-svn: 276946