platform/upstream/llvm.git
8 years agoRemove extra ';' to appease -Wpedantic
Dean Michael Berris [Thu, 14 Jul 2016 11:46:41 +0000 (11:46 +0000)]
Remove extra ';' to appease -Wpedantic

Summary:

Reviewers: dok

Subscribers: llvm-commits
llvm-svn: 275399

8 years ago[X86][AVX] Regenerate broadcast upgrade tests
Simon Pilgrim [Thu, 14 Jul 2016 11:05:43 +0000 (11:05 +0000)]
[X86][AVX] Regenerate broadcast upgrade tests

llvm-svn: 275398

8 years agoFix formatting
Tobias Grosser [Thu, 14 Jul 2016 10:53:00 +0000 (10:53 +0000)]
Fix formatting

llvm-svn: 275397

8 years agoGPGPU: Map initial schedule to GPU schedule
Tobias Grosser [Thu, 14 Jul 2016 10:51:52 +0000 (10:51 +0000)]
GPGPU: Map initial schedule to GPU schedule

This change now applies ppcg's GPU mapping on our initial schedule. For this
to work, we need to also initialize the set of all names (isl_ids) used in
the scop as well as the program context.

llvm-svn: 275396

8 years agoGPGPU: Do not dump schedule by default
Tobias Grosser [Thu, 14 Jul 2016 10:51:47 +0000 (10:51 +0000)]
GPGPU: Do not dump schedule by default

llvm-svn: 275395

8 years agomark newly failing tests as XFAIL
Pavel Labath [Thu, 14 Jul 2016 10:43:24 +0000 (10:43 +0000)]
mark newly failing tests as XFAIL

llvm-svn: 275394

8 years ago[test] [linux] define PR_SET_PTRACER constants if the system does not provide them
Pavel Labath [Thu, 14 Jul 2016 10:43:21 +0000 (10:43 +0000)]
[test] [linux] define PR_SET_PTRACER constants if the system does not provide them

Android API <= 16 header do not have these symbols defined, but the kernel does support the
relevant calls. And in general, since these calls are on a best-effort basis, it won't hurt even
if we try to run in on a really ancient kernel.

llvm-svn: 275393

8 years ago[NFC] Add full title/author information to "Apply the BLIS matmul optimization pattern"
Roman Gareev [Thu, 14 Jul 2016 10:40:15 +0000 (10:40 +0000)]
[NFC] Add full title/author information to "Apply the BLIS matmul optimization pattern"

llvm-svn: 275392

8 years ago[X86][AVX2] VBROADCASTSSrr/VBROADCASTSSYrr require AVX2 not AVX
Simon Pilgrim [Thu, 14 Jul 2016 10:37:14 +0000 (10:37 +0000)]
[X86][AVX2] VBROADCASTSSrr/VBROADCASTSSYrr require AVX2 not AVX

llvm-svn: 275391

8 years agoGPGPU: compute new schedule from polly scop
Tobias Grosser [Thu, 14 Jul 2016 10:22:25 +0000 (10:22 +0000)]
GPGPU: compute new schedule from polly scop

To do so we copy the necessary information to compute an initial schedule from
polly::Scop to ppcg's scop. Most of the necessary information is directly
available and only needs to be passed on to ppcg, with the exception of 'tagged'
access relations, access relations that additionally carry information about
which memory access an access relation originates from.

We could possibly perform the construction of tagged accesses as part of
ScopInfo, but as this format is currently specific to ppcg we do not do this
yet, but keep this functionality local to our GPU code generation.

After the scop has been initialized, we compute data dependences and ask ppcg to
compute an initial schedule. Some of this functionality is already available in
polly::DependenceInfo and polly::ScheduleOptimizer, but to keep differences
to ppcg small we use ppcg's functionality here. We may later investiage if
a closer integration of these tools makes sense.

llvm-svn: 275390

8 years agoGPGPU: create default initialized PPCG scop and gpu program
Tobias Grosser [Thu, 14 Jul 2016 10:22:19 +0000 (10:22 +0000)]
GPGPU: create default initialized PPCG scop and gpu program

At this stage, we do not yet modify the IR but just generate a default
initialized ppcg_scop and gpu_prog and free both immediately. Both will later be
filled with data from the polly::Scop and are needed to use PPCG for GPU
schedule generation. This commit does not yet perform any GPU code generation,
but ensures that the basic infrastructure has been put in place.

We also add a simple test case to ensure the new code is run and use this
opportunity to verify that GPU_CODEGEN tests are only run if GPU code generation
has been enabled in cmake.

llvm-svn: 275389

8 years ago[clang-rename] add documentation
Benjamin Kramer [Thu, 14 Jul 2016 09:46:07 +0000 (09:46 +0000)]
[clang-rename] add documentation

clang-rename needs at least to have a minimum documentation to provide a
small introduction for new users

Patch by Kirill Bobyrev!

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

llvm-svn: 275388

8 years ago[clang-rename] exit code-related bugfix and code cleanup
Benjamin Kramer [Thu, 14 Jul 2016 09:46:03 +0000 (09:46 +0000)]
[clang-rename] exit code-related bugfix and code cleanup

This patch does the following:

* enforces proper formatting for few files (i.e. deals with 80 linewidth violations and few other things)
* ensures '\n' chars are passed to the output streams instead of "\n" strings
* fixes a bug caused by calling cl::PrintHelpMessage(), which occasionally calls exit(0), so that exit(1) (which is right after cl::PrintHelpMessage line) becomes dead code

Patch by Kirill Bobyrev!

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

llvm-svn: 275387

8 years ago[include-fixer] Correct an incorrecst judgement about prefix scoped qualifiers.
Haojian Wu [Thu, 14 Jul 2016 09:39:12 +0000 (09:39 +0000)]
[include-fixer] Correct an incorrecst judgement about prefix scoped qualifiers.

Summary:
The judgement that checks whether the fully-qualified name has scoped qualifiers
prefix is incorrect. Should always check whether the first matched postion is the
beginning position.

Reviewers: bkramer

Subscribers: cfe-commits

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

llvm-svn: 275386

8 years ago[ELF] r275383 reverted due to buildbot failure
Eugene Leviant [Thu, 14 Jul 2016 09:21:24 +0000 (09:21 +0000)]
[ELF] r275383 reverted due to buildbot failure

llvm-svn: 275385

8 years ago[X86][AVX512F] minor fix of the parameter names
Asaf Badouh [Thu, 14 Jul 2016 08:40:30 +0000 (08:40 +0000)]
[X86][AVX512F] minor fix of the parameter names
add "__" prefix

llvm-svn: 275384

8 years ago[ELF] Allow overriding reserved symbols in linker scripts
Eugene Leviant [Thu, 14 Jul 2016 08:26:41 +0000 (08:26 +0000)]
[ELF] Allow overriding reserved symbols in linker scripts

llvm-svn: 275383

8 years agoThis implements a more optimal algorithm for selecting a base constant in
Sjoerd Meijer [Thu, 14 Jul 2016 07:44:20 +0000 (07:44 +0000)]
This implements a more optimal algorithm for selecting a base constant in
constant hoisting. It not only takes into account the number of uses and the
cost of expressions in which constants appear, but now also the resulting
integer range of the offsets. Thus, the algorithm maximizes the number of uses
within an integer range that will enable more efficient code generation. On
ARM, for example, this will enable code size optimisations because less
negative offsets will be created. Negative offsets/immediates are not supported
by Thumb1 thus preventing more compact instruction encoding.

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

llvm-svn: 275382

8 years agoFix -break-enable/-break-disable commands (MI)
Ilia K [Thu, 14 Jul 2016 07:43:14 +0000 (07:43 +0000)]
Fix -break-enable/-break-disable commands (MI)

* Previously -break-enable mistakenly set BP's enabled flag to false.
* These commands print fake =breakpoint-modified messages, what's not
  needed anymore because that events are come in normal way.
* Add tests for -break-enable/-break-disable commands

Initial patch from xuefangliang@hotmail.com. The test case was improved by me.

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

llvm-svn: 275381

8 years ago[InstCombine] Masked loads with undef masks can fold to normal loads
David Majnemer [Thu, 14 Jul 2016 06:58:42 +0000 (06:58 +0000)]
[InstCombine] Masked loads with undef masks can fold to normal loads

We were able to fold masked loads with an all-ones mask to a normal
load.  However, we couldn't turn a masked load with a mask with mixed
ones and undefs into a normal load.

llvm-svn: 275380

8 years agoSimplify llvm.masked.load w/ undef masks
David Majnemer [Thu, 14 Jul 2016 06:58:37 +0000 (06:58 +0000)]
Simplify llvm.masked.load w/ undef masks

We can always pick the passthru value if the mask is undef: we are
permitted to treat the mask as-if it were filled with zeros.

llvm-svn: 275379

8 years ago[AVX512] Implement EXTLOAD lowering with patterns to select existing VPMOVZX instruct...
Craig Topper [Thu, 14 Jul 2016 06:41:34 +0000 (06:41 +0000)]
[AVX512] Implement EXTLOAD lowering with patterns to select existing VPMOVZX instructions instead of creating CodeGenOnly instructions.

llvm-svn: 275378

8 years agoUse hasFlag instead of hasArg
Dean Michael Berris [Thu, 14 Jul 2016 06:37:46 +0000 (06:37 +0000)]
Use hasFlag instead of hasArg

Summary: Fix the build to use hasFlag instead of hasArg for checking some flags.

Reviewers: echristo

Subscribers: mehdi_amini, cfe-commits

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

llvm-svn: 275377

8 years ago[X86] Fix stupid typo in isel lowering.
Eli Friedman [Thu, 14 Jul 2016 05:48:25 +0000 (05:48 +0000)]
[X86] Fix stupid typo in isel lowering.

Apparently someone miscounted the number of zeros in the immediate.
Fixes https://llvm.org/bugs/show_bug.cgi?id=28544 .

llvm-svn: 275376

8 years agoAMDGPU/R600: Delete/rename intrinsics no longer used by mesa
Matt Arsenault [Thu, 14 Jul 2016 05:47:17 +0000 (05:47 +0000)]
AMDGPU/R600: Delete/rename intrinsics no longer used by mesa

Use the replacement pass to update the tests, and delete old names.

llvm-svn: 275375

8 years agoSet sh_addralign to 1 instead of 0.
Rui Ueyama [Thu, 14 Jul 2016 05:46:24 +0000 (05:46 +0000)]
Set sh_addralign to 1 instead of 0.

ELF spec says that alignment of 0 is equivalent to 1.
Previously, we arbitrary set to 0 or 1, but always setting to 1
makes our program simpler.

llvm-svn: 275374

8 years agoAttempt to unbreak msan bot.
Rui Ueyama [Thu, 14 Jul 2016 05:46:22 +0000 (05:46 +0000)]
Attempt to unbreak msan bot.

r275301 made .got section be aligned on Target->GotEntrySize,
so GotEntrySize must have been initialized. We didn't initialize
it for AMDGPU.

llvm-svn: 275373

8 years agoAMDGPU/R600: Remove intrinsics with no tests and no users
Matt Arsenault [Thu, 14 Jul 2016 05:23:23 +0000 (05:23 +0000)]
AMDGPU/R600: Remove intrinsics with no tests and no users

Mesa removed this path, so nothing is using these anymore.

llvm-svn: 275372

8 years agoAMDGPU: Remove unused intrinsics
Matt Arsenault [Thu, 14 Jul 2016 05:23:19 +0000 (05:23 +0000)]
AMDGPU: Remove unused intrinsics

llvm-svn: 275371

8 years agoAMDGPU: Fix test not actually testing anything
Matt Arsenault [Thu, 14 Jul 2016 05:23:15 +0000 (05:23 +0000)]
AMDGPU: Fix test not actually testing anything

It wasn't actually running the pass, and since it is
missing the llvm prefix, the eh intrinsic was not
really an IntrinsicInst.

Also add missing test for lifetime markers.

llvm-svn: 275370

8 years agoAMDGPU: Remove dead code
Matt Arsenault [Thu, 14 Jul 2016 05:23:08 +0000 (05:23 +0000)]
AMDGPU: Remove dead code

llvm-svn: 275369

8 years agoAdd C++ dependencies to xray runtime
Dean Michael Berris [Thu, 14 Jul 2016 04:58:44 +0000 (04:58 +0000)]
Add C++ dependencies to xray runtime

Summary:
Depends on D21982 which implements the in-memory logging implementation of the
XRay runtime. These additional changes also depends on D20352 which adds the
bulk of XRay flags/dependencies when using the `-fxray-instrument` flag from
Clang.

Reviewers: echristo, rnk, aaron.ballman

Subscribers: mehdi_amini, cfe-commits

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

llvm-svn: 275368

8 years agoXRay: Add entry and exit sleds
Dean Michael Berris [Thu, 14 Jul 2016 04:06:33 +0000 (04:06 +0000)]
XRay: Add entry and exit sleds

Summary:
In this patch we implement the following parts of XRay:

- Supporting a function attribute named 'function-instrument' which currently only supports 'xray-always'. We should be able to use this attribute for other instrumentation approaches.
- Supporting a function attribute named 'xray-instruction-threshold' used to determine whether a function is instrumented with a minimum number of instructions (IR instruction counts).
- X86-specific nop sleds as described in the white paper.
- A machine function pass that adds the different instrumentation marker instructions at a very late stage.
- A way of identifying which return opcode is considered "normal" for each architecture.

There are some caveats here:

1) We don't handle PATCHABLE_RET in platforms other than x86_64 yet -- this means if IR used PATCHABLE_RET directly instead of a normal ret, instruction lowering for that platform might do the wrong thing. We think this should be handled at instruction selection time to by default be unpacked for platforms where XRay is not availble yet.

2) The generated section for X86 is different from what is described from the white paper for the sole reason that LLVM allows us to do this neatly. We're taking the opportunity to deviate from the white paper from this perspective to allow us to get richer information from the runtime library.

Reviewers: sanjoy, eugenis, kcc, pcc, echristo, rnk

Subscribers: niravd, majnemer, atrick, rnk, emaste, bmakam, mcrosier, mehdi_amini, llvm-commits

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

llvm-svn: 275367

8 years ago[SCCP] Pass a Value * instead of templating this function. NFC.
Davide Italiano [Thu, 14 Jul 2016 03:02:34 +0000 (03:02 +0000)]
[SCCP] Pass a Value * instead of templating this function. NFC.

Thanks to Eli for the suggestion!

llvm-svn: 275366

8 years ago[OpenMP] Sema and parsing for 'target parallel for simd' pragma
Kelvin Li [Thu, 14 Jul 2016 02:54:56 +0000 (02:54 +0000)]
[OpenMP] Sema and parsing for 'target parallel for simd' pragma

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

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

llvm-svn: 275365

8 years agoclarify a bit.
Chris Lattner [Thu, 14 Jul 2016 02:52:04 +0000 (02:52 +0000)]
clarify a bit.

llvm-svn: 275364

8 years ago[IPSCCP] Constant fold struct argument/instructions when all the lattice values are...
Davide Italiano [Thu, 14 Jul 2016 02:51:41 +0000 (02:51 +0000)]
[IPSCCP] Constant fold struct argument/instructions when all the lattice values are constant.

This now should also work with the interprocedural variant of the pass.
Slightly easier now that the yak is shaved.

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

llvm-svn: 275363

8 years ago[lld] Update LLD for Archive::child_iterator change in LLVM r275361.
Lang Hames [Thu, 14 Jul 2016 02:35:18 +0000 (02:35 +0000)]
[lld] Update LLD for Archive::child_iterator change in LLVM r275361.

llvm-svn: 275362

8 years ago[Object] Re-apply r275316 now that I have the corresponding LLD patch ready.
Lang Hames [Thu, 14 Jul 2016 02:24:01 +0000 (02:24 +0000)]
[Object] Re-apply r275316 now that I have the corresponding LLD patch ready.

llvm-svn: 275361

8 years agoTeach fast isel about thiscall (and callee-pop) calls.
Nico Weber [Thu, 14 Jul 2016 01:52:51 +0000 (01:52 +0000)]
Teach fast isel about thiscall (and callee-pop) calls.

http://reviews.llvm.org/D22315

llvm-svn: 275360

8 years ago[Scalarizer] PR28108: Skip over nullptr rather than crashing on it.
Mehdi Amini [Thu, 14 Jul 2016 01:31:25 +0000 (01:31 +0000)]
[Scalarizer] PR28108: Skip over nullptr rather than crashing on it.

Summary:
In Scalarizer::gather we see if we already have a scattered form of Op,
and in that case use the new form.

In the particular case of PR28108, the found ValueVector SV has size 2,
where the first Value is nullptr, and the second is indeed a proper Value.
The nullptr then caused an assert to blow when we tried to do
cast<Instruction>(SV[I]).

With this patch we check SV[I] before doing the cast, and if it's nullptr
we just skip over it.

I don't know the Scalarizer well enough to know if this is the best fix
or if something should be done else where to prevent the nullptr from
being in the ValueVector at all, but at least this avoids the crash
and looking at the test case output it looks reasonable.

Reviewers: hfinkel, frasercrmck, wala, mehdi_amini

Subscribers: llvm-commits

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

llvm-svn: 275359

8 years agoAdd missing test for r275347 "[IPRA] Set callee saved registers to none for local...
Mehdi Amini [Thu, 14 Jul 2016 01:31:20 +0000 (01:31 +0000)]
Add missing test for r275347 "[IPRA] Set callee saved registers to none for local function when IPRA is enabled."

llvm-svn: 275358

8 years ago[SCCP] Generalize tryToReplaceInstWithConstant to work also with arguments.
Davide Italiano [Thu, 14 Jul 2016 01:27:29 +0000 (01:27 +0000)]
[SCCP] Generalize tryToReplaceInstWithConstant to work also with arguments.

llvm-svn: 275357

8 years agoAdd a comment mirroring the one in LLVM's Dwarf.h
Adrian Prantl [Thu, 14 Jul 2016 00:42:53 +0000 (00:42 +0000)]
Add a comment mirroring the one in LLVM's Dwarf.h

llvm-svn: 275356

8 years agoMIRParser: Fix MIRParser not reporting nullptr on error.
Matthias Braun [Thu, 14 Jul 2016 00:42:37 +0000 (00:42 +0000)]
MIRParser: Fix MIRParser not reporting nullptr on error.

While some code paths in MIRParserImpl::parse() already returned nullptr
in case of error one of the important ones did not.

llvm-svn: 275355

8 years agoSynchronize LLVM and clang's ObjCDeclSpec::ObjCPropertyAttributeKind.
Adrian Prantl [Thu, 14 Jul 2016 00:41:18 +0000 (00:41 +0000)]
Synchronize LLVM and clang's ObjCDeclSpec::ObjCPropertyAttributeKind.

This adds Clang-specific DWARF constants for nullability and ObjC
class properties that are already generated by clang. This patch adds
dwarfdump support and a more comprehensive testcase.

<rdar://problem/27335745>

llvm-svn: 275354

8 years ago[Object] Revert r275316, Archive::child_iterator changes, while I update lld.
Lang Hames [Thu, 14 Jul 2016 00:37:04 +0000 (00:37 +0000)]
[Object] Revert r275316, Archive::child_iterator changes, while I update lld.

Should fix the bots broken by r275316.

llvm-svn: 275353

8 years ago[ConstantFolding] Fold masked loads
David Majnemer [Thu, 14 Jul 2016 00:29:50 +0000 (00:29 +0000)]
[ConstantFolding] Fold masked loads

We can constant fold a masked load if the operands are appropriately
constant.

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

llvm-svn: 275352

8 years agowww/cxx_status: give more precise links to initialization order wording
Richard Smith [Thu, 14 Jul 2016 00:14:59 +0000 (00:14 +0000)]
www/cxx_status: give more precise links to initialization order wording

llvm-svn: 275351

8 years agoP0305R0: Semantic analysis and code generation for C++17 init-statement for 'if'...
Richard Smith [Thu, 14 Jul 2016 00:11:03 +0000 (00:11 +0000)]
P0305R0: Semantic analysis and code generation for C++17 init-statement for 'if' and 'switch':

  if (stmt; condition) { ... }

Patch by Anton Bikineev! Some minor formatting and comment tweets by me.

llvm-svn: 275350

8 years agoForce a semicolon at the end of the LLVM_ENABLE_BITMASK_ENUMS_IN_NAMESPACE() macro.
Justin Lebar [Wed, 13 Jul 2016 23:52:19 +0000 (23:52 +0000)]
Force a semicolon at the end of the LLVM_ENABLE_BITMASK_ENUMS_IN_NAMESPACE() macro.

This silences a warning about an extra semicolon on gcc.

llvm-svn: 275349

8 years agoAdd EnableIPRA to TargetOptions, and move the cl::opt -enable-ipra to TargetMachine.cpp
Mehdi Amini [Wed, 13 Jul 2016 23:39:46 +0000 (23:39 +0000)]
Add EnableIPRA to TargetOptions, and move the cl::opt -enable-ipra to TargetMachine.cpp

Avoid exposing a cl::opt in a public header and instead promote this
option in the API.
Alternatively, we could land the cl::opt in CommandFlags.h so that
it is available to every tool, but we would still have to find an
option for clang.

llvm-svn: 275348

8 years ago[IPRA] Set callee saved registers to none for local function when IPRA is enabled.
Mehdi Amini [Wed, 13 Jul 2016 23:39:34 +0000 (23:39 +0000)]
[IPRA] Set callee saved registers to none for local function when IPRA is enabled.

IPRA try to optimize caller saved register by propagating register
usage information from callee to caller so it is beneficial to have
caller saved registers compare to callee saved registers when IPRA
is enabled. Please find more detailed explanation here
https://groups.google.com/d/msg/llvm-dev/XRzGhJ9wtZg/tjAJqb0eEgAJ.

This change makes local function do not have any callee preserved
register when IPRA is enabled. A simple test case is also added to
verify this change.

Patch by Vivek Pandya <vivekvpandya@gmail.com>

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

llvm-svn: 275347

8 years ago[JumpThreading] Delete commented out debug code; NFC
Sanjoy Das [Wed, 13 Jul 2016 23:33:20 +0000 (23:33 +0000)]
[JumpThreading] Delete commented out debug code; NFC

llvm-svn: 275346

8 years ago[ConstantFolding] Extend FoldReinterpretLoadFromConstPtr to handle negative offsets
David Majnemer [Wed, 13 Jul 2016 23:33:07 +0000 (23:33 +0000)]
[ConstantFolding] Extend FoldReinterpretLoadFromConstPtr to handle negative offsets

Treat loads which clip before the start of a global initializer the same
way we treat clipping beyond the end of the initializer: use zeros.

llvm-svn: 275345

8 years agoMove a transform from InstCombine to InstSimplify.
David Majnemer [Wed, 13 Jul 2016 23:32:53 +0000 (23:32 +0000)]
Move a transform from InstCombine to InstSimplify.

This transform doesn't require any new instructions, it can safely live
in InstSimplify.

llvm-svn: 275344

8 years agoFix copy/paste bug in r275340.
Michael Kuperstein [Wed, 13 Jul 2016 23:28:00 +0000 (23:28 +0000)]
Fix copy/paste bug in r275340.

llvm-svn: 275343

8 years agoMIRParser: Move SlotMapping and SourceMgr refs to PFS; NFC
Matthias Braun [Wed, 13 Jul 2016 23:27:50 +0000 (23:27 +0000)]
MIRParser: Move SlotMapping and SourceMgr refs to PFS; NFC

Code cleanup: Move references to SlotMapping and SourceMgr into the
PerFunctionMIParsingState to avoid unnecessary passing around in
parameters.

llvm-svn: 275342

8 years ago[DAG] Correctly chain masked loads
Michael Kuperstein [Wed, 13 Jul 2016 23:23:40 +0000 (23:23 +0000)]
[DAG] Correctly chain masked loads

If a masked loads is not added to the chain, it should not reset the chain's
root.

This fixes the remaining part of PR28515.

llvm-svn: 275340

8 years ago[SCCP] Have the logic for replacing insts with constant in a single place.
Davide Italiano [Wed, 13 Jul 2016 23:20:04 +0000 (23:20 +0000)]
[SCCP] Have the logic for replacing insts with constant in a single place.

The code was pretty much copy-pasted between SCCP and IPSCCP. The situation
became clearly worse after I introduced the support for folding structs in
SCCP.  This commit is NFC as we currently (still) skip the replacement
step in IPSCCP, but I'll change this soon.

llvm-svn: 275339

8 years ago[Coverage] Return an ArrayRef to avoid copies (NFC)
Vedant Kumar [Wed, 13 Jul 2016 23:12:26 +0000 (23:12 +0000)]
[Coverage] Return an ArrayRef to avoid copies (NFC)

llvm-svn: 275338

8 years ago[Coverage] Mark a few methods const (NFC)
Vedant Kumar [Wed, 13 Jul 2016 23:12:23 +0000 (23:12 +0000)]
[Coverage] Mark a few methods const (NFC)

llvm-svn: 275337

8 years agoAdded test for setting breakpoints by basename and fullname.
Greg Clayton [Wed, 13 Jul 2016 22:38:54 +0000 (22:38 +0000)]
Added test for setting breakpoints by basename and fullname.

<rdar://problem/24599697>

llvm-svn: 275336

8 years ago[LAA] Don't hold on to DominatorTree in the analysis result
Adam Nemet [Wed, 13 Jul 2016 22:36:35 +0000 (22:36 +0000)]
[LAA] Don't hold on to DominatorTree in the analysis result

llvm-svn: 275335

8 years ago[LAA] Don't hold on to TargetLibraryInfo in the analysis result
Adam Nemet [Wed, 13 Jul 2016 22:36:27 +0000 (22:36 +0000)]
[LAA] Don't hold on to TargetLibraryInfo in the analysis result

llvm-svn: 275334

8 years ago[MIR] Fix one GlobalISel test case that I missed in r275314.
Quentin Colombet [Wed, 13 Jul 2016 22:35:33 +0000 (22:35 +0000)]
[MIR] Fix one GlobalISel test case that I missed in r275314.

llvm-svn: 275333

8 years ago[MI] Clean up some loops over MachineInstr::memoperands(). NFC
Justin Lebar [Wed, 13 Jul 2016 22:35:19 +0000 (22:35 +0000)]
[MI] Clean up some loops over MachineInstr::memoperands().  NFC

Use range-based for loops and llvm::any_of instead of explicit
iterators.

llvm-svn: 275332

8 years ago[MI] Fix MachineInstr::isInvariantLoad.
Justin Lebar [Wed, 13 Jul 2016 22:34:50 +0000 (22:34 +0000)]
[MI] Fix MachineInstr::isInvariantLoad.

Summary:
Previously it would say we had an invariant load if any of the memory
operands were invariant.  But the load should be invariant only if *all*
the memory operands are invariant.

No testcase because this has proven to be very difficult to tickle in
practice.  As just one example, ARM's ldrd instruction, which loads 64
bits into two 32-bit regs, is theoretically affected by this.  But when
it's produced, it loses its memoperands' invariance bits!

Reviewers: jfb

Subscribers: llvm-commits, aemerson

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

llvm-svn: 275331

8 years agoAdd XRay flags to Clang. We implement two flags to control the XRay behaviour:
Aaron Ballman [Wed, 13 Jul 2016 22:32:15 +0000 (22:32 +0000)]
Add XRay flags to Clang. We implement two flags to control the XRay behaviour:

-fxray-instrument: enables XRay annotation of IR
-fxray-instruction-threshold: configures the threshold for function size (looking at IR instructions), and allow LLVM to decide whether to add the nop sleds later on in the process.

Also implements the related xray_always_instrument and xray_never_instrument function attributes.

Patch by Dean Michael Berris.

llvm-svn: 275330

8 years agoMIRParser: Move MachineFunction reference into PFS; NFC
Matthias Braun [Wed, 13 Jul 2016 22:23:23 +0000 (22:23 +0000)]
MIRParser: Move MachineFunction reference into PFS; NFC

Code cleanup: The PerFunctionMIParsingState is per function, moving a
reference into PFS we can avoid passing around the MachineFunction in an
extra parameter most of the time.

Also change most signatures to consistently pass PFS reference first.

llvm-svn: 275329

8 years agoMIRYamlMapping: Update stale comment
Matthias Braun [Wed, 13 Jul 2016 22:23:19 +0000 (22:23 +0000)]
MIRYamlMapping: Update stale comment

llvm-svn: 275328

8 years agoAdd a triple to fix test on bots after 275320.
Nico Weber [Wed, 13 Jul 2016 22:19:40 +0000 (22:19 +0000)]
Add a triple to fix test on bots after 275320.

llvm-svn: 275327

8 years ago[LAA] Don't hold on to DataLayout in the analysis result
Adam Nemet [Wed, 13 Jul 2016 22:18:51 +0000 (22:18 +0000)]
[LAA] Don't hold on to DataLayout in the analysis result

In fact, don't even pass this to the ctor since we can get it from the
module.

llvm-svn: 275326

8 years ago[LAA] Don't hold on to LoopInfo in the analysis result
Adam Nemet [Wed, 13 Jul 2016 22:18:48 +0000 (22:18 +0000)]
[LAA] Don't hold on to LoopInfo in the analysis result

llvm-svn: 275325

8 years ago[test] Add 'env' to fix test failures in windows bots.
Argyrios Kyrtzidis [Wed, 13 Jul 2016 22:03:47 +0000 (22:03 +0000)]
[test] Add 'env' to fix test failures in windows bots.

llvm-svn: 275324

8 years ago[OpenMP] remove duplicate code in ActOnOpenMPRegionStart
Kelvin Li [Wed, 13 Jul 2016 21:51:49 +0000 (21:51 +0000)]
[OpenMP] remove duplicate code in ActOnOpenMPRegionStart

This patch is to remove duplicate code in ActOnOpenMPRegionStart. (NFC)

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

llvm-svn: 275323

8 years ago[LAA] Don't hold on to AliasAnalysis in the analysis result
Adam Nemet [Wed, 13 Jul 2016 21:39:09 +0000 (21:39 +0000)]
[LAA] Don't hold on to AliasAnalysis in the analysis result

llvm-svn: 275322

8 years ago[llvm-cov] Use a thread pool to speed up report generation (NFC)
Vedant Kumar [Wed, 13 Jul 2016 21:38:36 +0000 (21:38 +0000)]
[llvm-cov] Use a thread pool to speed up report generation (NFC)

It's safe to print out source coverage views using multiple threads when
using the -output-dir mode of the `llvm-cov show` sub-command.

While testing this on my development machine, I observed that the speed
up is roughly linear with the number of available cores. Avg. time for
`llvm-cov show ./llvm-as -show-line-counts-or-regions`:

    1 thread: 7.79s user 0.33s system 98% cpu 8.228 total
    4 threads: 7.82s user 0.34s system 283% cpu 2.880 total

llvm-svn: 275321

8 years agoFix a TODO in X86CallFrameOptimization to not rely on a codegen artifact.
Nico Weber [Wed, 13 Jul 2016 21:38:27 +0000 (21:38 +0000)]
Fix a TODO in X86CallFrameOptimization to not rely on a codegen artifact.

This happens to make X86CallFrameOptimization in -O0 / FastISel builds as well,
but it's not clear if the pass should run in that setup.

http://reviews.llvm.org/D22314

llvm-svn: 275320

8 years agoMark the textual headers in the module map for ProfileData
Teresa Johnson [Wed, 13 Jul 2016 21:27:51 +0000 (21:27 +0000)]
Mark the textual headers in the module map for ProfileData

Follow on to r275312.

llvm-svn: 275319

8 years ago[OpenCL] Fixes failures in test/Driver/opencl.cl.
Yaxun Liu [Wed, 13 Jul 2016 21:21:05 +0000 (21:21 +0000)]
[OpenCL] Fixes failures in test/Driver/opencl.cl.

Also fixes strict-aliasing option to only be allowed when OpenCL Version 1.0. Added testcase in test/Frontend/opencl-blocks.cl.

Patch by Aaron En Ye Shi.

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

llvm-svn: 275318

8 years agoExtended LoadStoreVectorizer to vectorize subchains.
Alina Sbirlea [Wed, 13 Jul 2016 21:20:01 +0000 (21:20 +0000)]
Extended LoadStoreVectorizer to vectorize subchains.

Summary:
LSV used to abort vectorizing a chain for interleaved load/store accesses that alias.
Allow a valid prefix of the chain to be vectorized, mark just the prefix and retry vectorizing the remaining chain.

Reviewers: llvm-commits, jlebar, arsenm

Subscribers: mzolotukhin

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

llvm-svn: 275317

8 years ago[Object] Change Archive::child_iterator for better interop with Error/Expected.
Lang Hames [Wed, 13 Jul 2016 21:13:05 +0000 (21:13 +0000)]
[Object] Change Archive::child_iterator for better interop with Error/Expected.

See http://reviews.llvm.org/D22079

Changes the Archive::child_begin and Archive::children to require a reference
to an Error. If iterator increment fails (because the archive header is
damaged) the iterator will be set to 'end()', and the error stored in the
given Error&. The Error value should be checked by the user immediately after
the loop. E.g.:

Error Err;
for (auto &C : A->children(Err)) {
  // Do something with archive child C.
}
// Check the error immediately after the loop.
if (Err)
  return Err;

Failure to check the Error will result in an abort() when the Error goes out of
scope (as guaranteed by the Error class).

llvm-svn: 275316

8 years ago[OpenMP] add more tests for 'distribute parallel for simd' pragma
Kelvin Li [Wed, 13 Jul 2016 20:40:32 +0000 (20:40 +0000)]
[OpenMP] add more tests for 'distribute parallel for simd' pragma

This patch is to add two additional tests for testing 'distribute parallel for simd' pragma with disallowed clauses and loops.

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

llvm-svn: 275315

8 years ago[MIR] Print on the given output instead of stderr.
Quentin Colombet [Wed, 13 Jul 2016 20:36:03 +0000 (20:36 +0000)]
[MIR] Print on the given output instead of stderr.

Currently the MIR framework prints all its outputs (errors and actual
representation) on stderr.

This patch fixes that by printing the regular output in the output
specified with -o.

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

llvm-svn: 275314

8 years ago[PCH/preamble] Make sure that if the preamble/PCH was serialized with errors that...
Argyrios Kyrtzidis [Wed, 13 Jul 2016 20:35:26 +0000 (20:35 +0000)]
[PCH/preamble] Make sure that if the preamble/PCH was serialized with errors that we set diagnostic engine state appropriately.

Otherwise there can be a crash with CFG analysis warnings doing work on invalid AST.

Fixes crash of rdar://26224134

llvm-svn: 275313

8 years agoDefine a module map entry for ProfileData.
Teresa Johnson [Wed, 13 Jul 2016 20:19:09 +0000 (20:19 +0000)]
Define a module map entry for ProfileData.

As per Richard Smith, this should help avoid a modules bug exposed
by my r275216 commit:
http://lab.llvm.org:8011/builders/clang-x86_64-linux-selfhost-modules/builds/17560

llvm-svn: 275312

8 years agoPPCGCodegen: Support compilation without GPU support
Tobias Grosser [Wed, 13 Jul 2016 19:52:24 +0000 (19:52 +0000)]
PPCGCodegen: Support compilation without GPU support

llvm-svn: 275310

8 years agoAMDGPU: Remove last AMDIL intrinsics
Matt Arsenault [Wed, 13 Jul 2016 19:42:06 +0000 (19:42 +0000)]
AMDGPU: Remove last AMDIL intrinsics

llvm-svn: 275309

8 years ago[SCCP] Factor out common code.
Davide Italiano [Wed, 13 Jul 2016 19:33:25 +0000 (19:33 +0000)]
[SCCP] Factor out common code.

llvm-svn: 275308

8 years ago[SCCP] Use early return. NFCI.
Davide Italiano [Wed, 13 Jul 2016 19:23:30 +0000 (19:23 +0000)]
[SCCP] Use early return. NFCI.

llvm-svn: 275307

8 years ago[OpenMP] add more tests for 'distribute simd' pragma
Kelvin Li [Wed, 13 Jul 2016 19:16:56 +0000 (19:16 +0000)]
[OpenMP] add more tests for 'distribute simd' pragma

This patch is to add two additional tests for testing 'distribute simd' pragma with disallowed clauses and loops.

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

llvm-svn: 275306

8 years agoUpdate the readme text.
Rui Ueyama [Wed, 13 Jul 2016 19:14:25 +0000 (19:14 +0000)]
Update the readme text.

llvm-svn: 275305

8 years agoReverting r275284 due to platform-specific test failures
Andrew Kaylor [Wed, 13 Jul 2016 19:09:16 +0000 (19:09 +0000)]
Reverting r275284 due to platform-specific test failures

llvm-svn: 275304

8 years agoImplement FunctionDecl::getDefinition() to be consistent with
Yaron Keren [Wed, 13 Jul 2016 19:04:51 +0000 (19:04 +0000)]
Implement FunctionDecl::getDefinition() to be consistent with
VarDecl, TagDecl, EnumDecl, RecordDecl, CXXRecordDecl.

Use getDefinition in two locations to make the code more readable.

llvm-svn: 275303

8 years agoadd more tests for zexty xor sandwiches
Sanjay Patel [Wed, 13 Jul 2016 18:58:55 +0000 (18:58 +0000)]
add more tests for zexty xor sandwiches

...mmm sandwiches

llvm-svn: 275302

8 years agoAdd GotEntrySize/GotPltEntrySize to ELF target.
Rui Ueyama [Wed, 13 Jul 2016 18:55:14 +0000 (18:55 +0000)]
Add GotEntrySize/GotPltEntrySize to ELF target.

Patch by H.J Lu.

For x86-64 psABI, the entry size of .got and .got.plt sections is 8
bytes for both LP64 and ILP32.  Add GotEntrySize and GotPltEntrySize
to ELF target instead of using size of ELFT::uint.  Now we can generate
a simple working x32 executable.

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

llvm-svn: 275301

8 years ago[X86][SSE] Regenerate truncated shift test
Simon Pilgrim [Wed, 13 Jul 2016 18:50:10 +0000 (18:50 +0000)]
[X86][SSE] Regenerate truncated shift test

Check SSE2 and AVX2 implementations

llvm-svn: 275300

8 years agoRegenerate test
Simon Pilgrim [Wed, 13 Jul 2016 18:46:37 +0000 (18:46 +0000)]
Regenerate test

llvm-svn: 275299

8 years agoRename VAStart -> ImageBase. NFC.
Rui Ueyama [Wed, 13 Jul 2016 18:40:59 +0000 (18:40 +0000)]
Rename VAStart -> ImageBase. NFC.

Config members are named after corresponding command line options.
This patch renames VAStart ImageBase so that they are in line with
--image-base.

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

llvm-svn: 275298