platform/upstream/llvm.git
8 years agoIslNodeBuilder: expose addReferencesFromStmt [NFC]
Tobias Grosser [Thu, 21 Jul 2016 13:15:55 +0000 (13:15 +0000)]
IslNodeBuilder: expose addReferencesFromStmt [NFC]

This will be used by Polly GPGPU to determine the values that need to be
passed to GPU kernels.

llvm-svn: 276269

8 years agoIslExprBuilder: allow to specify an external isl_id to ScopArrayInfo mapping
Tobias Grosser [Thu, 21 Jul 2016 13:15:51 +0000 (13:15 +0000)]
IslExprBuilder: allow to specify an external isl_id to ScopArrayInfo mapping

This is useful for external users using IslExprBuilder, in case they cannot
embed ScopArrayInfo data into their isl_ids, because the isl_ids either already
carry other information or the isl_ids have been created and their user pointers
cannot be updated any more.

llvm-svn: 276268

8 years agoSimplify symbol version handling.
Rui Ueyama [Thu, 21 Jul 2016 13:13:21 +0000 (13:13 +0000)]
Simplify symbol version handling.

r275711 for "speedng up symbol version handling" was committed
by misunderstanding; the benchmark number was measured with
a debug build. The number with a release build didn't actually change.
This patch removes false optimizations added in that patch.

llvm-svn: 276267

8 years agoExecutionDepsFix - Fix bug in clearance calculation
Marina Yatsina [Thu, 21 Jul 2016 12:37:07 +0000 (12:37 +0000)]
ExecutionDepsFix - Fix bug in clearance calculation

The clearance calculation did not take into account registers defined as outputs or clobbers in inline assembly machine instructions because these register defs are implicit.

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

llvm-svn: 276266

8 years ago[GCOV] Remove a layer of indirection.
Benjamin Kramer [Thu, 21 Jul 2016 12:06:31 +0000 (12:06 +0000)]
[GCOV] Remove a layer of indirection.

StringMap is designed to hold large values. No functionality change
intended.

llvm-svn: 276265

8 years ago[docs] Update release docs
Renato Golin [Thu, 21 Jul 2016 12:00:50 +0000 (12:00 +0000)]
[docs] Update release docs

llvm-svn: 276264

8 years agoBlockGenerator: remove dead instructions in normal statements
Tobias Grosser [Thu, 21 Jul 2016 11:48:36 +0000 (11:48 +0000)]
BlockGenerator: remove dead instructions in normal statements

This ensures that no trivially dead code is generated. This is not only cleaner,
but also avoids troubles in case code is generated in a separate function and
some of this dead code contains references to values that are not available.
This issue may happen, in case the memory access functions have been updated
and old getelementptr instructions remain in the code. With normal Polly,
a test case is difficult to draft, but the upcoming GPU code generation can
possibly trigger such problems. We will later extend this dead-code elimination
to region and vector statements.

llvm-svn: 276263

8 years agotests: make test cases more robust using regexp
Tobias Grosser [Thu, 21 Jul 2016 11:48:31 +0000 (11:48 +0000)]
tests: make test cases more robust using regexp

llvm-svn: 276262

8 years agoInstantiate Interp output section only when needed.
Rui Ueyama [Thu, 21 Jul 2016 11:01:23 +0000 (11:01 +0000)]
Instantiate Interp output section only when needed.

This change simplifies interaction between Writer and the linker script
because we can make needsInterpSection() a file-scope function.

llvm-svn: 276261

8 years ago[ELF] Support FLAGS attribute in program header definition
Eugene Leviant [Thu, 21 Jul 2016 10:43:25 +0000 (10:43 +0000)]
[ELF] Support FLAGS attribute in program header definition

llvm-svn: 276260

8 years ago[clang-rename] check whether -new-name is valid identifier in C++17
Kirill Bobyrev [Thu, 21 Jul 2016 10:21:31 +0000 (10:21 +0000)]
[clang-rename] check whether -new-name is valid identifier in C++17

llvm-svn: 276259

8 years agoRevert r276256 - Attempt to fix clang-cmake-mips after r268977.
Daniel Sanders [Thu, 21 Jul 2016 09:52:33 +0000 (09:52 +0000)]
Revert r276256 - Attempt to fix clang-cmake-mips after r268977.

It didn't fix the problem on the buildbot. CAN_TARGET_mips64 is still true.

llvm-svn: 276258

8 years agoAMDGPU: Fix phis from blocks split due to register indexing
Matt Arsenault [Thu, 21 Jul 2016 09:40:57 +0000 (09:40 +0000)]
AMDGPU: Fix phis from blocks split due to register indexing

llvm-svn: 276257

8 years agoAttempt to fix clang-cmake-mips after r268977.
Daniel Sanders [Thu, 21 Jul 2016 09:28:09 +0000 (09:28 +0000)]
Attempt to fix clang-cmake-mips after r268977.

I think it's wiped out the build area and fully-reconfigured for the first time
since r268977. This seems to have caused Mips64 to become enabled when it wasn't
before because compiling with -mabi=64 succeeds but linking with -mabi=64 fails.

llvm-svn: 276256

8 years agoDefault XRay building to OFF to let build bots that do not support building sanitizer...
Dean Michael Berris [Thu, 21 Jul 2016 08:53:31 +0000 (08:53 +0000)]
Default XRay building to OFF to let build bots that do not support building sanitizers to disable explicitly too

llvm-svn: 276255

8 years agoAdd a new DynamicLoader plugin that uses SPI that are in development
Jason Molenda [Thu, 21 Jul 2016 08:30:55 +0000 (08:30 +0000)]
Add a new DynamicLoader plugin that uses SPI that are in development
for the fall (northern hemisphere) 2016 Darwin platforms to learn
about loaded images, instead of reading dyld internal data structures.
These new SPI don't exist on older releases, and new packets are
needed from debugserver to use them (those changes are already committed).

I had to change the minimum deployment target for debugserver in the xcode
project file to macOS 10.10 so that debugserver will use the
[[NSProcessInfo processInfo] operatingSystemVersion]
call in MachProcess::GetOSVersionNumbers to get the operarting system
version # -- this API is only available in macOS 10.10 and newer
("OS X Yosemite", released Oct 2014).  If we have many people building
llvm.org lldb on older systems still, we can back off on this for the
llvm.org sources.

There should be no change in behavior with this commit, either to
older darwin systems or newer darwin systems.

For now the new DynamicLoader plugin is never activated - I'm forcing
the old plugin to be used in DynamicLoaderDarwin::UseDYLDSPI.
I'll remove that unconditional use of the old plugin soon, so the
newer plugin is used on the newest Darwin platforms.

<rdar://problem/25251243>

llvm-svn: 276254

8 years ago[ELF] - Linkerscript: remove excessive ScriptConfiguration::Filler field
George Rimar [Thu, 21 Jul 2016 07:48:54 +0000 (07:48 +0000)]
[ELF] - Linkerscript: remove excessive ScriptConfiguration::Filler field

Previously OutputSectionCommand::Filler was introduced, but unused.
Patch fixes that.

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

llvm-svn: 276253

8 years agoProvide __GLIBCXX_TYPE_INT_N_0 and __GLIBCXX_BITSIZE_INT_N_0 when in C++ gnu language...
Yaron Keren [Thu, 21 Jul 2016 07:44:41 +0000 (07:44 +0000)]
Provide __GLIBCXX_TYPE_INT_N_0 and __GLIBCXX_BITSIZE_INT_N_0 when in C++ gnu language extensions.
These are used by libstdc++ <type_traits> for is_integral<__int128>.
Addresses http://llvm.org/pr23156.

llvm-svn: 276252

8 years ago[compiler-rt][XRay] re-submitting r276117, with fixes for build breakage due to extra...
Dean Michael Berris [Thu, 21 Jul 2016 07:39:55 +0000 (07:39 +0000)]
[compiler-rt][XRay] re-submitting r276117, with fixes for build breakage due to extraneous and missing dependencies and attempts to build on unsupported OSes

Summary:
This is a fixed-up version of D21612, to address failure identified post-commit.

Original commit description:

This patch implements the initialisation and patching routines for the XRay runtime, along with the necessary trampolines for function entry/exit handling. For now we only define the basic hooks for allowing an implementation to define a handler that gets run on function entry/exit. We expose a minimal API for controlling the behaviour of the runtime (patching, cleanup, and setting the handler to invoke when instrumenting).

Fixes include:
- Gating XRay build to only Linux x86_64 and with the right dependencies in case it is the only library being built
- Including <cstddef> to fix std::size_t issue

Reviewers: kcc, rnk, echristo

Subscribers: mehdi_amini, llvm-commits

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

llvm-svn: 276251

8 years ago[Sema,X86] Add explicit check to ensure that builtins that require x86-64 target...
Craig Topper [Thu, 21 Jul 2016 07:38:43 +0000 (07:38 +0000)]
[Sema,X86] Add explicit check to ensure that builtins that require x86-64 target throw an error if used on 32-bit target.

If these builtins are allowed to go through on a 32-bit target they will fire assertions in the backend.

Fixes PR28635.

llvm-svn: 276250

8 years ago[X86] Add missing __x86_64__ qualifiers on a bunch of intrinsics that assume 64-bit...
Craig Topper [Thu, 21 Jul 2016 07:38:39 +0000 (07:38 +0000)]
[X86] Add missing __x86_64__ qualifiers on a bunch of intrinsics that assume 64-bit GPRs are available.

Usages of these intrinsics in a 32-bit build results in assertions in the backend.

llvm-svn: 276249

8 years ago[GVNHoist] Preserve optimization hints which agree
David Majnemer [Thu, 21 Jul 2016 07:16:26 +0000 (07:16 +0000)]
[GVNHoist] Preserve optimization hints which agree

If we have optimization hints with agree with each other along different
paths, preserve them.

llvm-svn: 276248

8 years agotests: fix order of memory accesses to ensure import succeeds
Tobias Grosser [Thu, 21 Jul 2016 07:12:17 +0000 (07:12 +0000)]
tests: fix order of memory accesses to ensure import succeeds

It seems the order in which we generated memory accesses changed such that
the import of these updated memory accesses failed for the 'loop3' statement
in this test case. Unfortunately, the existing CHECK lines were not strict
enough to catch this. Hence, besides fixing the order of the memory access
lines we also ensure that the memory access changes are both clearly visibly
and well checked.

llvm-svn: 276247

8 years agoJScop: Factor out importContext [NFC]
Tobias Grosser [Thu, 21 Jul 2016 06:56:33 +0000 (06:56 +0000)]
JScop: Factor out importContext [NFC]

This makes the structure of the code clearer and reduces the size of runOnScop.

We also adjust the coding style to the latest LLVM style guide.

llvm-svn: 276246

8 years agoJScop: Factor out importContext [NFC]
Tobias Grosser [Thu, 21 Jul 2016 06:56:31 +0000 (06:56 +0000)]
JScop: Factor out importContext [NFC]

This makes the structure of the code clearer and reduces the size of runOnScop.

We also adjust the coding style to the latest LLVM style guide.

llvm-svn: 276245

8 years agoJScop: Factor out importSchedule [NFC]
Tobias Grosser [Thu, 21 Jul 2016 06:56:28 +0000 (06:56 +0000)]
JScop: Factor out importSchedule [NFC]

This makes the structure of the code clearer and reduces the size of runOnScop.

We also adjust the coding style to the latest LLVM style guide.

llvm-svn: 276244

8 years ago[ELF] - Initial support of tree-style linker script implemented.
George Rimar [Thu, 21 Jul 2016 06:43:01 +0000 (06:43 +0000)]
[ELF] - Initial support of tree-style linker script implemented.

Approach uses LLVM-style RTTI for representing the linker script
commands in a form of tree for future simplification of parsing.

Core idea and code sample belongs to Rui Ueyama.

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

llvm-svn: 276243

8 years ago[CodeGen] Handle recursion in LLVMIRGeneration Timer.
Davide Italiano [Thu, 21 Jul 2016 06:28:48 +0000 (06:28 +0000)]
[CodeGen] Handle recursion in LLVMIRGeneration Timer.

This can happen when emitting a local decl, which triggers
loading a decl imported from an AST file, which we then
hand to the AST consumer. Timer is not allowed to recurse
so an assertion fire. Keep a reference counter to avoid this
problem. LGTM'd by Richard Smith on IRC.

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

llvm-svn: 276242

8 years agoFix some string_view tests that were failing when exceptions were disabled. Also...
Marshall Clow [Thu, 21 Jul 2016 06:24:04 +0000 (06:24 +0000)]
Fix some string_view tests that were failing when exceptions were disabled. Also comment out a _LIBCPP_ASSERT that gcc4.9 was complaining about. Will revisit that later.

llvm-svn: 276241

8 years ago[GVNHoist] Don't wrongly preserve TBAA
David Majnemer [Thu, 21 Jul 2016 05:59:53 +0000 (05:59 +0000)]
[GVNHoist] Don't wrongly preserve TBAA

We hoisted loads/stores without taking into account which can cause
miscompiles.

llvm-svn: 276240

8 years ago[MergedLoadStoreMotion] Remove out of date comment
David Majnemer [Thu, 21 Jul 2016 05:59:51 +0000 (05:59 +0000)]
[MergedLoadStoreMotion] Remove out of date comment

llvm-svn: 276239

8 years agoImplement std::string_view as described in http://wg21.link/P0254R1. Reviewed as...
Marshall Clow [Thu, 21 Jul 2016 05:31:24 +0000 (05:31 +0000)]
Implement std::string_view as described in wg21.link/P0254R1. Reviewed as https://reviews.llvm.org/D21459

llvm-svn: 276238

8 years agoAdd missing import to fix the build
Amaury Sechet [Thu, 21 Jul 2016 04:31:38 +0000 (04:31 +0000)]
Add missing import to fix the build

llvm-svn: 276237

8 years agoExpose AttributeSetNode, use it to provide aggregate getter for attribute in the...
Amaury Sechet [Thu, 21 Jul 2016 04:25:06 +0000 (04:25 +0000)]
Expose AttributeSetNode, use it to provide aggregate getter for attribute in the C API.

Summary: See D19181 for context.

Reviewers: whitequark, Wallbraker, jyknight, echristo, bkramer, void

Subscribers: mehdi_amini

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

llvm-svn: 276236

8 years agoIPRA: Fix RegMask calculation for alias registers
Matthias Braun [Thu, 21 Jul 2016 03:50:39 +0000 (03:50 +0000)]
IPRA: Fix RegMask calculation for alias registers

This patch fixes a very subtle bug in regmask calculation. Thanks to zan
jyu Wong <zyfwong@gmail.com> for bringing this to notice.
For example if CL is only clobbered than CH should not be marked
clobbered but CX, RCX and ECX should be mark clobbered. Previously for
each modified register all of its aliases are marked clobbered by
markRegClobbred() in RegUsageInfoCollector.cpp but that is wrong because
when CL is clobbered then MRI::isPhysRegModified() will return true for
CL, CX, ECX, RCX which is correct behavior but then for CX, EXC, RCX we
mark CH also clobbered as CH is aliased to CX,ECX,RCX so
markRegClobbred() is not required because isPhysRegModified already take
cares of proper aliasing register. A very simple test case has been
added to verify this change.
Please find relevant bug report here :
http://llvm.org/PR28567

Patch by Vivek Pandya <vivekvpandya@gmail.com>

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

llvm-svn: 276235

8 years ago[Profile] bug fix: profile dir not recursively created
Xinliang David Li [Thu, 21 Jul 2016 03:38:07 +0000 (03:38 +0000)]
[Profile] bug fix: profile dir not recursively created

llvm-svn: 276234

8 years agoMark P0358r1 as complete. It is already implemented
Eric Fiselier [Thu, 21 Jul 2016 03:28:52 +0000 (03:28 +0000)]
Mark P0358r1 as complete. It is already implemented

llvm-svn: 276233

8 years ago[Sema] Fix PR28623.
George Burgess IV [Thu, 21 Jul 2016 03:28:13 +0000 (03:28 +0000)]
[Sema] Fix PR28623.

In atomic builtins, we assumed that the LValue conversion on the first
argument would succeed. So, we would crash given code like:

```
void ovl(char);
void ovl(int);
__atomic_store_n(ovl, 0, 0);
```

This patch makes us not assume that said conversion is successful. :)

llvm-svn: 276232

8 years agoMark P0337r0 as complete. It was already implemented in std::experimental
Eric Fiselier [Thu, 21 Jul 2016 03:24:43 +0000 (03:24 +0000)]
Mark P0337r0 as complete. It was already implemented in std::experimental

llvm-svn: 276231

8 years agoImplement P0084r2. Changing emplace return types.
Eric Fiselier [Thu, 21 Jul 2016 03:20:17 +0000 (03:20 +0000)]
Implement P0084r2. Changing emplace return types.

llvm-svn: 276230

8 years ago[Profile] Add new test to cover %m specifier with shared library (instrumented)
Xinliang David Li [Thu, 21 Jul 2016 02:58:28 +0000 (02:58 +0000)]
[Profile] Add new test to cover %m specifier with shared library (instrumented)

llvm-svn: 276229

8 years ago[compiler-rt] Fix broken SymInitialize unittest
Etienne Bergeron [Thu, 21 Jul 2016 02:32:37 +0000 (02:32 +0000)]
[compiler-rt] Fix broken SymInitialize unittest

Summary:
By adding the initialisation of the symbolisation library (DbgHelp)
we are swapping the order in which both warnings are produced.

We can't use CHECK-NEXT as the dbghelp warning is multiline.

Reviewers: rnk

Subscribers: kubabrecka, llvm-commits, wang0109, chrisha

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

llvm-svn: 276228

8 years agofix warning when generating sphinx doc.
Etienne Bergeron [Thu, 21 Jul 2016 02:27:05 +0000 (02:27 +0000)]
fix warning when generating sphinx doc.

llvm-svn: 276227

8 years ago[Profile] More test clean up to read profile from directory specified by -fprofile...
Xinliang David Li [Thu, 21 Jul 2016 02:14:55 +0000 (02:14 +0000)]
[Profile] More test clean up to read profile from directory specified by -fprofile-generate=

llvm-svn: 276226

8 years ago[Profile] Cleanup test to use new dir input feature
Xinliang David Li [Thu, 21 Jul 2016 01:53:41 +0000 (01:53 +0000)]
[Profile] Cleanup test to use new dir input feature

llvm-svn: 276225

8 years ago[OptDiag] Missed these when making the IR Value a const pointer
Adam Nemet [Thu, 21 Jul 2016 01:11:12 +0000 (01:11 +0000)]
[OptDiag] Missed these when making the IR Value a const pointer

llvm-svn: 276224

8 years ago[OptDiag,LV] Add hotness attribute to applied-optimization remarks
Adam Nemet [Thu, 21 Jul 2016 01:07:13 +0000 (01:07 +0000)]
[OptDiag,LV] Add hotness attribute to applied-optimization remarks

Test coverage is provided by modifying the function in the FP-math
testcase that we are allowed to vectorize.

llvm-svn: 276223

8 years agoX86InstrInfo: No need for liveness analysis in classifyLEAReg()
Matthias Braun [Thu, 21 Jul 2016 00:33:38 +0000 (00:33 +0000)]
X86InstrInfo: No need for liveness analysis in classifyLEAReg()

classifyLEAReg() deals with switching operands from 32bit to 64bit in
order to use a LEA64_32 instruction (for three address code goodness).
It currently performs a liveness analysis to determine the kill/undef
flag for the newly added operand. This should not be necessary:

- If the previous operand had a kill flag, then the 32bit part of the
  register gets killed, this will kill the super register as well.
- If the previous operand had an undef flag then we didn't care what
  value we read, just use the same flag on the new operand.
  (No matter what an operand with an undef flag won't affect liveness)

This makes the code independent of the presence of kill flags because it
avoids a call to MachineBasicBlock::computeRegisterLiveness().

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

llvm-svn: 276222

8 years ago[InstCombine] LogicOpc (zext X), C --> zext (LogicOpc X, C) (PR28476)
Sanjay Patel [Thu, 21 Jul 2016 00:24:18 +0000 (00:24 +0000)]
[InstCombine] LogicOpc (zext X), C --> zext (LogicOpc X, C) (PR28476)

The benefits of this change include:
1. Remove DeMorgan-matching code that was added specifically to work-around
   the missing transform in http://reviews.llvm.org/rL248634.
2. Makes the DeMorgan transform work for vectors too.
3. Fix PR28476: https://llvm.org/bugs/show_bug.cgi?id=28476

Extending this transform to other casts and other associative operators may
be useful too. See https://reviews.llvm.org/D22421 for a prerequisite for
doing that though.

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

llvm-svn: 276221

8 years agoFix an issue where LLDB would detect an empty shared cache - which is legitimate...
Enrico Granata [Thu, 21 Jul 2016 00:13:40 +0000 (00:13 +0000)]
Fix an issue where LLDB would detect an empty shared cache - which is legitimate albeit suboptimal - and warn about being unable to fetch ObjC class information, even though class data was actually properly loaded from the dynamic hashmap

Only ever warn about missing ObjC runtime class data if one either can't run the expressions to obtain such data, or the total count of classes is below a threshold that makes things sound really suspicious

Fixes rdar://27438500

llvm-svn: 276220

8 years ago[libunwind] Properly align _Unwind_Exception.
Eric Fiselier [Wed, 20 Jul 2016 23:56:42 +0000 (23:56 +0000)]
[libunwind] Properly align _Unwind_Exception.

Summary: _Unwind_Exception is required to be double word aligned. Currently the struct is under aligned.

Reviewers: mclow.lists, compnerd, kledzik, emaste

Subscribers: emaste, cfe-commits

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

llvm-svn: 276215

8 years agoUpdate .arcconfig
Eric Fiselier [Wed, 20 Jul 2016 23:56:17 +0000 (23:56 +0000)]
Update .arcconfig

llvm-svn: 276214

8 years ago[MachO] Add a couple of missing braces.
Davide Italiano [Wed, 20 Jul 2016 23:55:34 +0000 (23:55 +0000)]
[MachO] Add a couple of missing braces.

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

llvm-svn: 276213

8 years ago[OptDiag,LV] Add hotness attribute to the derived analysis remarks
Adam Nemet [Wed, 20 Jul 2016 23:50:32 +0000 (23:50 +0000)]
[OptDiag,LV] Add hotness attribute to the derived analysis remarks

This includes FPCompute and Aliasing.

Testcase is based on no_fpmath.ll.

llvm-svn: 276211

8 years ago[InstSimplify][InstCombine] don't crash when folding vector selects of icmp
Sanjay Patel [Wed, 20 Jul 2016 23:40:01 +0000 (23:40 +0000)]
[InstSimplify][InstCombine] don't crash when folding vector selects of icmp

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

llvm-svn: 276209

8 years agoDisable warning flags when running .fail.cpp tests.
Eric Fiselier [Wed, 20 Jul 2016 23:37:28 +0000 (23:37 +0000)]
Disable warning flags when running .fail.cpp tests.

Increasingly the .fail.cpp tests are written using -verify, making them
sensitive to the exact diagnostics generated by the compiler. To prevent
additional diagnostics from being generated, and causing the tests to fail,
this patch removes the warning flags when compiling those tests.

llvm-svn: 276208

8 years ago[Profile] Document new profile file name modifiers
Xinliang David Li [Wed, 20 Jul 2016 23:32:50 +0000 (23:32 +0000)]
[Profile] Document new profile file name modifiers

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

llvm-svn: 276207

8 years agoMake help text more consistent. NFC.
George Burgess IV [Wed, 20 Jul 2016 23:14:29 +0000 (23:14 +0000)]
Make help text more consistent. NFC.

llvm-svn: 276205

8 years agoGlobalISel: Remove explicit enumerator values from .def file.
Tim Northover [Wed, 20 Jul 2016 22:58:01 +0000 (22:58 +0000)]
GlobalISel: Remove explicit enumerator values from .def file.

They were all auto-incremented from 0 anyway, and I'm getting really annoying
conflicts and runtime failures when different people add more for GlobalISel
(and even when I'm refactoring my own patches).

NFC.

llvm-svn: 276204

8 years ago[OpenMP] Sema and parsing for 'target simd' pragma
Kelvin Li [Wed, 20 Jul 2016 22:57:10 +0000 (22:57 +0000)]
[OpenMP] Sema and parsing for 'target simd' pragma

This patch is to implement sema and parsing for 'target simd' pragma.

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

llvm-svn: 276203

8 years agoFix test failure on Win
Xinliang David Li [Wed, 20 Jul 2016 22:53:39 +0000 (22:53 +0000)]
Fix test failure on Win

llvm-svn: 276202

8 years ago[CFLAA] Add offset tracking in CFLGraph.
George Burgess IV [Wed, 20 Jul 2016 22:53:30 +0000 (22:53 +0000)]
[CFLAA] Add offset tracking in CFLGraph.

(Also, refactor our constexpr handling to be less insane).

This patch lets us track field offsets in the CFL Graph, which is the
first step to making CFLAA field/offset sensitive. Woohoo! Note that
this patch shouldn't visibly change our behavior (since we make no use
of the offsets we're now tracking), so we can't quite add tests for this
yet.

Patch by Jia Chen.

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

llvm-svn: 276201

8 years agoUnbreak traits tests by handling differences between version macros in clang/apple...
Eric Fiselier [Wed, 20 Jul 2016 22:53:21 +0000 (22:53 +0000)]
Unbreak traits tests by handling differences between version macros in clang/apple-clang.

llvm-svn: 276200

8 years ago[utils] Add script to check for code coverage regressions
Vedant Kumar [Wed, 20 Jul 2016 22:44:16 +0000 (22:44 +0000)]
[utils] Add script to check for code coverage regressions

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

llvm-svn: 276199

8 years agoSync up with llvm copy /NFC
Xinliang David Li [Wed, 20 Jul 2016 22:29:16 +0000 (22:29 +0000)]
Sync up with llvm copy /NFC

llvm-svn: 276198

8 years agoReapply r276185
Xinliang David Li [Wed, 20 Jul 2016 22:24:52 +0000 (22:24 +0000)]
Reapply r276185

Fix the test case that should not depend on dir iteration order.

llvm-svn: 276197

8 years ago[NVPTX] Enable the load-store vectorizer on nvptx.
Justin Lebar [Wed, 20 Jul 2016 22:11:36 +0000 (22:11 +0000)]
[NVPTX] Enable the load-store vectorizer on nvptx.

Reviewers: tra

Subscribers: jholewinski, arsenm, asbirlea

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

llvm-svn: 276196

8 years ago[sanitizers] split sanitizer_allocator.h into a number of smaller .h files; NFC
Kostya Serebryany [Wed, 20 Jul 2016 22:06:41 +0000 (22:06 +0000)]
[sanitizers] split sanitizer_allocator.h into a number of smaller .h files; NFC

llvm-svn: 276195

8 years agoRevert r276185 -- build bot failure
Xinliang David Li [Wed, 20 Jul 2016 21:50:38 +0000 (21:50 +0000)]
Revert r276185 -- build bot failure

llvm-svn: 276194

8 years ago[AArch64] Register AArch64LoadStoreOptimizer so it can be run by llc -run-pass. NFCI.
Geoff Berry [Wed, 20 Jul 2016 21:45:58 +0000 (21:45 +0000)]
[AArch64] Register AArch64LoadStoreOptimizer so it can be run by llc -run-pass. NFCI.

llvm-svn: 276193

8 years ago[OptDiag,LV] Add hotness attribute to analysis remarks
Adam Nemet [Wed, 20 Jul 2016 21:44:26 +0000 (21:44 +0000)]
[OptDiag,LV] Add hotness attribute to analysis remarks

The earlier change added hotness attribute to missed-optimization
remarks.  This follows up with the analysis remarks (the ones explaining
the reason for the missed optimization).

llvm-svn: 276192

8 years ago[OptDiag] Take the IR Value as a const pointer
Adam Nemet [Wed, 20 Jul 2016 21:44:22 +0000 (21:44 +0000)]
[OptDiag] Take the IR Value as a const pointer

This helps because LoopAccessReport is passed around as a const
reference and we derive the basic block passed as the Value parameter
from the instruction in LoopAccessReport.

llvm-svn: 276191

8 years ago[OptDiag] Wrap a long line
Adam Nemet [Wed, 20 Jul 2016 21:44:18 +0000 (21:44 +0000)]
[OptDiag] Wrap a long line

llvm-svn: 276190

8 years ago[NVPTX] Renamed NVPTXLowerKernelArgs -> NVPTXLowerArgs. NFC.
Artem Belevich [Wed, 20 Jul 2016 21:44:07 +0000 (21:44 +0000)]
[NVPTX] Renamed NVPTXLowerKernelArgs -> NVPTXLowerArgs. NFC.

After r276153 the pass applies to both kernels and regular functions.

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

llvm-svn: 276189

8 years agoFix memory leak introduced in r276159.
Richard Smith [Wed, 20 Jul 2016 21:38:26 +0000 (21:38 +0000)]
Fix memory leak introduced in r276159.

llvm-svn: 276188

8 years agorevert rL276179: [compiler-rt] Fix broken unittest related to 64-bit print format
Etienne Bergeron [Wed, 20 Jul 2016 21:38:02 +0000 (21:38 +0000)]
revert rL276179: [compiler-rt] Fix broken unittest related to 64-bit print format

llvm-svn: 276187

8 years agoRevert r276117 "[XRay] Basic initialization and flag definition for XRay runtime"
Hans Wennborg [Wed, 20 Jul 2016 21:37:38 +0000 (21:37 +0000)]
Revert r276117 "[XRay] Basic initialization and flag definition for XRay runtime"

and also the follow-up "[xray] Only build xray on Linux for now"

Two build errors were reported on the llvm-commits list:

[ 88%] Building CXX object lib/xray/CMakeFiles/clang_rt.xray-x86_64.dir/xray_flags.cc.o
/mnt/b/sanitizer-buildbot1/sanitizer-x86_64-linux/build/llvm/projects/compiler-rt/lib/xray/xray_init.cc:23:10: fatal error: 'llvm/Support/ELF.h' file not found
  #include "llvm/Support/ELF.h"
 ^

and

In file included from /w/src/llvm.org/projects/compiler-rt/lib/xray/xray_interface.cc:16:
/w/src/llvm.org/projects/compiler-rt/lib/xray/xray_interface_internal.h:36:8: error:
no type named 'size_t' in namespace 'std'
std::size_t Entries;
~~~~~^

llvm-svn: 276186

8 years ago[Profile] support directory reading in profile merging
Xinliang David Li [Wed, 20 Jul 2016 21:31:29 +0000 (21:31 +0000)]
[Profile] support directory reading in profile merging

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

llvm-svn: 276185

8 years agoGlobalISel: implement Legalization querying framework.
Tim Northover [Wed, 20 Jul 2016 21:13:29 +0000 (21:13 +0000)]
GlobalISel: implement Legalization querying framework.

This adds an (incomplete, inefficient) framework for deciding what to do with
some operation on a given type.

llvm-svn: 276184

8 years ago[AArch64][FastISel] Select -O0 legal cmpxchg.
Ahmed Bougacha [Wed, 20 Jul 2016 21:12:32 +0000 (21:12 +0000)]
[AArch64][FastISel] Select -O0 legal cmpxchg.

At -O0, cmpxchg survives AtomicExpand: it's mostly straightforward
to select it in fast-isel, and let the pseudo be expanded later.

extractvalues on the result are the tricky part: the generic logic
only works for legal types (and it would be painful to make it
support illegal types), so we can only support i32/i64 cmpxchg.

llvm-svn: 276183

8 years ago[AArch64][FastISel] Select atomic stores into STLR.
Ahmed Bougacha [Wed, 20 Jul 2016 21:12:27 +0000 (21:12 +0000)]
[AArch64][FastISel] Select atomic stores into STLR.

llvm-svn: 276182

8 years ago[GVNHoist] Don't hoist PHI nodes
David Majnemer [Wed, 20 Jul 2016 21:05:01 +0000 (21:05 +0000)]
[GVNHoist] Don't hoist PHI nodes

We hoisted PHIs without respecting their special insertion point in the
block, leading to verfier errors.

This fixes PR28626.

llvm-svn: 276181

8 years agoWhen copying an array into a lambda, destroy temporaries from
John McCall [Wed, 20 Jul 2016 21:02:43 +0000 (21:02 +0000)]
When copying an array into a lambda, destroy temporaries from
the copy-constructor immediately and enter a partial array
cleanup for previously-copied elements.

Fixes PR28595.

llvm-svn: 276180

8 years ago[compiler-rt] Fix broken unittest related to 64-bit print format
Etienne Bergeron [Wed, 20 Jul 2016 20:55:02 +0000 (20:55 +0000)]
[compiler-rt] Fix broken unittest related to 64-bit print format

Summary:
The printf is not working correctly on 64-bit MSVC.

The portable way to print "size_t" is to use "%zx" (size_t in hexa).

Reviewers: rnk

Subscribers: kubabrecka, llvm-commits, wang0109, chrisha

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

llvm-svn: 276179

8 years ago[OpenMP] Allow negative lower bound in array sections based on pointers
Kelvin Li [Wed, 20 Jul 2016 20:45:29 +0000 (20:45 +0000)]
[OpenMP] Allow negative lower bound in array sections based on pointers

OpenMP 4.5 removed the restriction that array section lower bound must be non negative.
This change is to allow negative values for array section based on pointers.
For array section based on array type there is still a restriction: "The array section must be a subset of the original array."

Patch by David S.

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

llvm-svn: 276177

8 years ago[ELF][MIPS] Omit redundant arguments in the `getMipsEFlags` function. NFC
Simon Atanasyan [Wed, 20 Jul 2016 20:30:41 +0000 (20:30 +0000)]
[ELF][MIPS] Omit redundant arguments in the `getMipsEFlags` function.  NFC

llvm-svn: 276176

8 years agoDelete EhInputSection::getOffset.
Rafael Espindola [Wed, 20 Jul 2016 20:19:58 +0000 (20:19 +0000)]
Delete EhInputSection::getOffset.

We no longer need it for relocations in .eh_frame.

The only relocations that point to .eh_frame are the ones trying to
find the output .eh_frame.

This actually fixes a bug in the symbol value code. It was not
handling -1 as an indicator for a piece not being included in the
output.

llvm-svn: 276175

8 years ago[SCCP] Zap multiple return values.
Davide Italiano [Wed, 20 Jul 2016 20:17:13 +0000 (20:17 +0000)]
[SCCP] Zap multiple return values.

We can replace the return values with undef if we replaced all
the call uses with a constant/undef.

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

llvm-svn: 276174

8 years ago[ELF][MIPS] Create PLT entry specific for MIPS ABI version R6
Simon Atanasyan [Wed, 20 Jul 2016 20:15:33 +0000 (20:15 +0000)]
[ELF][MIPS] Create PLT entry specific for MIPS ABI version R6

llvm-svn: 276173

8 years ago[ELF][MIPS] Pick arch flag from the first input file.
Simon Atanasyan [Wed, 20 Jul 2016 20:15:24 +0000 (20:15 +0000)]
[ELF][MIPS] Pick arch flag from the first input file.

LLD still does not produce a correct combination of MIPS ELF flags if
input files have different sets of ELF flags (i.e. EF_MIPS_ARCH_32 and
EF_MIPS_ARCH_32R2). But now we do not stick to "R2" ABI version and can
emit EF_MIPS_ARCH_32R6 for example.

llvm-svn: 276172

8 years ago[LSV] Don't move stores across may-load instrs, and loosen restrictions on moving...
Justin Lebar [Wed, 20 Jul 2016 20:07:37 +0000 (20:07 +0000)]
[LSV] Don't move stores across may-load instrs, and loosen restrictions on moving loads.

Summary:
Previously we wouldn't move loads/stores across instructions that had
side-effects, where that was defined as may-write or may-throw.  But
this is not sufficiently restrictive: Stores can't safely be moved
across instructions that may load.

This patch also adds a DEBUG check that all instructions in our chain
are either loads or stores.

Reviewers: asbirlea

Subscribers: llvm-commits, jholewinski, arsenm, mzolotukhin

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

llvm-svn: 276171

8 years ago[LSV] Vectorize up to side-effecting instructions.
Justin Lebar [Wed, 20 Jul 2016 20:07:34 +0000 (20:07 +0000)]
[LSV] Vectorize up to side-effecting instructions.

Summary:
Previously if we had a chain that contained a side-effecting
instruction, we wouldn't vectorize it at all.  Now we'll vectorize
everything that comes before the side-effecting instruction.

Reviewers: asbirlea

Subscribers: arsenm, jholewinski, llvm-commits, mzolotukhin

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

llvm-svn: 276170

8 years ago[MSSA] Add an overload for getClobberingMemoryAccess.
George Burgess IV [Wed, 20 Jul 2016 19:51:34 +0000 (19:51 +0000)]
[MSSA] Add an overload for getClobberingMemoryAccess.

A seemingly common use for the walker's getClobberingMemoryAccess
function is:

```
MemoryAccess *getClobber(MemorySSAWalker *W, MemoryUseOrDef *MUD) {
  const Instruction *I = MUD->getMemoryInst();
  return W->getClobberingMemoryAccess(I);
}
```

Which is kind of redundant, since walkers will ultimately query MSSA to
find out which MemoryAccess `I` maps to (...which is always `MUD`).

So, this patch adds an overload of getClobberingMemoryAccess that
accepts MemoryAccesses directly. As a result, the Instruction overload
of getClobberingMemoryAccess becomes a lightweight wrapper around our
new overload.

Additionally, this patch un`virtual`izes the Instruction overload of
getClobberingMemoryAccess, since there doesn't seem to be a walker that
benefits from that being virtual, and I can't think of how else one
would implement it. Happy to make it virtual again if we would benefit
from doing so.

llvm-svn: 276169

8 years ago[pdbdump] Use the "flow" style to print out a sequence of uint32_t.
Rui Ueyama [Wed, 20 Jul 2016 19:41:47 +0000 (19:41 +0000)]
[pdbdump] Use the "flow" style to print out a sequence of uint32_t.

Summary: Lists can be written either with "-" or "[]" in YAML.

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

llvm-svn: 276168

8 years ago[OpenMP] Ignore parens in atomic capture
Kelvin Li [Wed, 20 Jul 2016 19:41:17 +0000 (19:41 +0000)]
[OpenMP] Ignore parens in atomic capture

Clang misdiagnoses atomic captures cases that contains parens.
i.e.

  int v, int *p;
#pragma omp atomic capture
{ v = (*p); (*p)++; }

Patch by David S.

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

llvm-svn: 276167

8 years agoFix typo in test runner
Francis Ricci [Wed, 20 Jul 2016 19:37:31 +0000 (19:37 +0000)]
Fix typo in test runner

llvm-svn: 276166

8 years agoFunction names should start with lowercase letters.
Rui Ueyama [Wed, 20 Jul 2016 19:36:41 +0000 (19:36 +0000)]
Function names should start with lowercase letters.

llvm-svn: 276165

8 years agoReturn a vector from createPhdrs instead of return nothing.
Rui Ueyama [Wed, 20 Jul 2016 19:36:39 +0000 (19:36 +0000)]
Return a vector from createPhdrs instead of return nothing.

This way is consistent with createSections.

llvm-svn: 276164

8 years agoReplace parallel arrays with a StringSwitch.
Rui Ueyama [Wed, 20 Jul 2016 19:36:38 +0000 (19:36 +0000)]
Replace parallel arrays with a StringSwitch.

llvm-svn: 276163

8 years agoRemove `else` after `break`.
Rui Ueyama [Wed, 20 Jul 2016 19:36:36 +0000 (19:36 +0000)]
Remove `else` after `break`.

llvm-svn: 276162