platform/upstream/llvm.git
8 years ago[ScopInfo] Scalar access do not have indirect base pointers.
Michael Kruse [Tue, 4 Oct 2016 17:33:34 +0000 (17:33 +0000)]
[ScopInfo] Scalar access do not have indirect base pointers.

ScopArrayInfo used to determine base pointer origins by looking up whether the
base pointer is a load. The "base pointer" for scalar accesses is the
llvm::Value being accessed. This is only a symbolic base pointer, it
represents the alloca variable (.s2a or .phiops) generated for it at code
generation.

This patch disables determining base pointer origin for scalars.
A test case where this caused a crash will be added in the next commit. In that
test SAI tried to get the origin base pointer that was only declared later,
therefore not existing. This is probably only possible for scalars used in
PHINode incoming blocks.

llvm-svn: 283232

8 years agoSerialize remark argument as a mapping to get proper quotation for the value.
Adam Nemet [Tue, 4 Oct 2016 17:05:04 +0000 (17:05 +0000)]
Serialize remark argument as a mapping to get proper quotation for the value.

llvm-svn: 283231

8 years agoAllow derived classes of OptimizationRemarkAnalysis in YAML
Adam Nemet [Tue, 4 Oct 2016 17:05:01 +0000 (17:05 +0000)]
Allow derived classes of OptimizationRemarkAnalysis in YAML

llvm-svn: 283230

8 years agoAdd a comment.
Rui Ueyama [Tue, 4 Oct 2016 16:47:49 +0000 (16:47 +0000)]
Add a comment.

llvm-svn: 283229

8 years ago[Sema] Format a comment line so that it fits 80 columns. NFC
Alex Lorenz [Tue, 4 Oct 2016 16:06:37 +0000 (16:06 +0000)]
[Sema] Format a comment line so that it fits 80 columns. NFC

llvm-svn: 283228

8 years ago[MS] Move hex long long sign compat hack to -fms-compatibility
Reid Kleckner [Tue, 4 Oct 2016 15:57:49 +0000 (15:57 +0000)]
[MS] Move hex long long sign compat hack to -fms-compatibility

Treating large 0x*LL literals as signed instead of unsigned is not a
conforming language extension, so move it out of -fms-extensions.

Came up in PR30605

llvm-svn: 283227

8 years ago[ELF] - Do not crash on MIPS if there is no object files in input.
George Rimar [Tue, 4 Oct 2016 15:19:20 +0000 (15:19 +0000)]
[ELF] - Do not crash on MIPS if there is no object files in input.

If we have input without object files, for example if we have only .so
code crashes in checkFlags(), getPicFlags(), getArchFlags() functions.

Patch fixes the issue.

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

llvm-svn: 283226

8 years ago[SLPVectorizer] Add a test with non-vectorizable IR.
Alexey Bataev [Tue, 4 Oct 2016 15:07:23 +0000 (15:07 +0000)]
[SLPVectorizer] Add a test with non-vectorizable IR.

llvm-svn: 283225

8 years agoFix some false-positives with cppcoreguidelines-pro-type-member-init. Handle classes...
Aaron Ballman [Tue, 4 Oct 2016 14:48:05 +0000 (14:48 +0000)]
Fix some false-positives with cppcoreguidelines-pro-type-member-init. Handle classes with default constructors that are defaulted or are not present in the AST.
Classes with virtual methods or virtual bases are not trivially default constructible, so their members and bases need to be initialized.

Patch by Malcolm Parsons.

llvm-svn: 283224

8 years ago[OpenMP] fix segfault when a variable referenced in reduction clause is a reference...
David Sheinkman [Tue, 4 Oct 2016 14:41:36 +0000 (14:41 +0000)]
[OpenMP] fix segfault when a variable referenced in reduction clause is a reference parameter\nDifferential Revision: reviews.llvm.org/D24524

llvm-svn: 283223

8 years agoMark #2759 as ready and #2755 as complete
Marshall Clow [Tue, 4 Oct 2016 14:39:58 +0000 (14:39 +0000)]
Mark #2759 as ready and #2755 as complete

llvm-svn: 283222

8 years ago[ScopInfo] Make simplifySCoP() public. NFC.
Michael Kruse [Tue, 4 Oct 2016 14:14:33 +0000 (14:14 +0000)]
[ScopInfo] Make simplifySCoP() public. NFC.

This function may need to be called after the scop construction. The upcoming
DeLICM will use this to cleanup statement that all write accesses have been
removed from.

llvm-svn: 283221

8 years agoMark #2598 as ready
Marshall Clow [Tue, 4 Oct 2016 14:08:50 +0000 (14:08 +0000)]
Mark #2598 as ready

llvm-svn: 283220

8 years ago[RS4GC] Handle ShuffleVector instruction in findBasePointer
Anna Thomas [Tue, 4 Oct 2016 13:48:37 +0000 (13:48 +0000)]
[RS4GC] Handle ShuffleVector instruction in findBasePointer

Summary:
This patch modifies the findBasePointer to handle the shufflevector instruction.

Tests run: RS4GC tests, local downstream tests.

Reviewers: reames, sanjoy

Subscribers: llvm-commits

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

llvm-svn: 283219

8 years agoMark #2739 as ready
Marshall Clow [Tue, 4 Oct 2016 13:41:56 +0000 (13:41 +0000)]
Mark #2739 as ready

llvm-svn: 283218

8 years ago[ThinLTO] Spell `llvm-ar` correctly.
Davide Italiano [Tue, 4 Oct 2016 13:16:00 +0000 (13:16 +0000)]
[ThinLTO] Spell `llvm-ar` correctly.

llvm-svn: 283217

8 years agoRemove duplicated typedef. NFC.
Rafael Espindola [Tue, 4 Oct 2016 13:09:59 +0000 (13:09 +0000)]
Remove duplicated typedef. NFC.

llvm-svn: 283216

8 years agoFix IntegerType::MAX_INT_BITS value
Andrey Bokhanko [Tue, 4 Oct 2016 12:43:46 +0000 (12:43 +0000)]
Fix IntegerType::MAX_INT_BITS value

IntegerType::MAX_INT_BITS is apparently not in sync with Type::SubclassData
size. This patch fixes this.

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

llvm-svn: 283215

8 years ago[ELF] Don't discard excluded section if -r is used
Eugene Leviant [Tue, 4 Oct 2016 12:05:42 +0000 (12:05 +0000)]
[ELF] Don't discard excluded section if -r is used

This conforms to GNU ld/gold behavior and fixes crash in case
excluded section also has associated relocation section

llvm-svn: 283214

8 years ago[ELF] - Removed "invalid-" prefix from testcase. NFC.
George Rimar [Tue, 4 Oct 2016 11:51:38 +0000 (11:51 +0000)]
[ELF] - Removed "invalid-" prefix from testcase. NFC.

llvm-svn: 283213

8 years ago[Power9] Exploit D-Form VSX Scalar memory ops that target full VSX register set
Nemanja Ivanovic [Tue, 4 Oct 2016 11:25:52 +0000 (11:25 +0000)]
[Power9] Exploit D-Form VSX Scalar memory ops that target full VSX register set

This patch corresponds to review:

The newly added VSX D-Form (register + offset) memory ops target the upper half
of the VSX register set. The existing ones target the lower half. In order to
unify these and have the ability to target all the VSX registers using D-Form
operations, this patch defines Pseudo-ops for the loads/stores which are
expanded post-RA. The expansion then choses the correct opcode based on the
register that was allocated for the operation.

llvm-svn: 283212

8 years agoFix a documentation warning.
Haojian Wu [Tue, 4 Oct 2016 10:40:52 +0000 (10:40 +0000)]
Fix a documentation warning.

llvm-svn: 283211

8 years ago[change-namespace] Fix a misplaced case when there is no trailing newline character...
Haojian Wu [Tue, 4 Oct 2016 10:35:53 +0000 (10:35 +0000)]
[change-namespace] Fix a misplaced case when there is no trailing newline character at the end of the file.

Reviewers: ioeric

Subscribers: cfe-commits

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

llvm-svn: 283210

8 years ago[mips][fastisel] Consider soft-float an unsupported floating point mode
Simon Dardis [Tue, 4 Oct 2016 10:35:07 +0000 (10:35 +0000)]
[mips][fastisel] Consider soft-float an unsupported floating point mode

Treat soft-float as unsupported for fast-isel. Additionally, ensure we check
that lowering f32 arguments also considers the case of soft-float mode.

Reviewers: ehostunreach, vkalintiris, zoran.jovanovic

Differential Review: https://reviews.llvm.org/D24505

llvm-svn: 283209

8 years ago[ELF] - Do not hang if broken object has option descriptor in .MIPS.options with...
George Rimar [Tue, 4 Oct 2016 10:23:07 +0000 (10:23 +0000)]
[ELF] - Do not hang if broken object has option descriptor in .MIPS.options with size of zero.

Previously lld would hang in infinite loop in this case,
patch fixes the issue. Object was found during AFL run.

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

llvm-svn: 283208

8 years agoDo not find friend function definitions inside non-instantiated class.
Serge Pavlov [Tue, 4 Oct 2016 10:11:43 +0000 (10:11 +0000)]
Do not find friend function definitions inside non-instantiated class.

Previously if a file-level function was defined inside befriending
template class, it always was treated as defined. For instance, the code like:
```
  int func(int x);
  template<typename T> class C1 {
    friend int func(int x) { return x; }
  };
  template<typename T> class C2 {
    friend int func(int x) { return x; }
  };
```
could not be compiled due to function redefinition, although not of the templates
is instantiated. Moreover, the body of friend function can contain use of template
parameters, attempt to get definition of such function outside any instantiation
causes compiler abnormal termination.

Other compilers (gcc, icc) follow viewpoint that the body of the function defined
in friend declaration becomes available when corresponding class is instantiated.
This patch implements this viewpoint in clang.

Definitions introduced by friend declarations in template classes are not added
to the redeclaration chain of corresponding function. Only when the template is
instantiated, instantiation of the function definition is placed to the chain.

The fix was made in collaboration with Richard Smith.

This change fixes PR8035, PR17923, PR22307 and PR25848.

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

llvm-svn: 283207

8 years agoMinor cleanups in clang-format.el.
Manuel Klimek [Tue, 4 Oct 2016 09:53:04 +0000 (09:53 +0000)]
Minor cleanups in clang-format.el.

- Enable lexical binding
- Formatting
- Enable file name completion for the clang-format-executable variable
- Add a missing docstring
- When available, use bufferpos-to-filepos and filepos-to-bufferpos. These functions given more precise mapping than byte-to-position and position-bytes.
- Rename arguments of clang-format-region to match the docstring
- Instead of binding local variables to nil and then assigning them, bind them directly to their values
- Make use of the fact that insert-file-contents returns the number of characters it inserted
- Use cl-destructuring-bind to make the code a bit shorter
- Use standard iteration (dolist) instead of mapc with a lambda, which is more common and shorter
- Remove a message that was most likely only present for debugging purposes

Patch by Philipp Stephani.

llvm-svn: 283206

8 years agoFix windows builtbot error.
Haojian Wu [Tue, 4 Oct 2016 09:49:20 +0000 (09:49 +0000)]
Fix windows builtbot error.

llvm-svn: 283205

8 years ago[Object/ELF] - Do not crash on invalid sh_offset value of REL[A] section.
George Rimar [Tue, 4 Oct 2016 09:25:39 +0000 (09:25 +0000)]
[Object/ELF] - Do not crash on invalid sh_offset value of REL[A] section.

Previously code would access invalid memory and may crash,
patch fixes the issue.

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

llvm-svn: 283204

8 years ago[SelectionDAG] Fix calling convention in expansion of ?MULO.
whitequark [Tue, 4 Oct 2016 09:07:49 +0000 (09:07 +0000)]
[SelectionDAG] Fix calling convention in expansion of ?MULO.

The SMULO/UMULO DAG nodes, when not directly supported by the target,
expand to a multiplication twice as wide. In case that the resulting
type is not legal, an __mul?i3 intrinsic is used. Since the type is
not legal, the legalizer cannot directly call the intrinsic with
the wide arguments; instead, it "pre-lowers" them by splitting them
in halves.

The "pre-lowering" code in essence made assumptions about
the calling convention, specifically that i(N*2) values will be
split into two iN values and passed in consecutive registers in
little-endian order. This, naturally, breaks on a big-endian system,
such as our OR1K out-of-tree backend.

Thanks to James Miller <james@aatch.net> for help in debugging.

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

llvm-svn: 283203

8 years ago[clang-move] Make it support both relative and absolute file path arguments.
Haojian Wu [Tue, 4 Oct 2016 09:05:31 +0000 (09:05 +0000)]
[clang-move] Make it support both relative and absolute file path arguments.

Reviewers: ioeric

Subscribers: beanz, mgorny, cfe-commits

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

llvm-svn: 283202

8 years ago[ELF] - Do not crash on invalid symbol index.
George Rimar [Tue, 4 Oct 2016 09:02:42 +0000 (09:02 +0000)]
[ELF] - Do not crash on invalid symbol index.

Relative to PR30540.

If .symtab has invalid type in elf, no bodies are created and any relocation
that tries to access them will fail.
The same can happen if symbol index is just incorrect.

This was revealed by "id_000005,sig_11,src_000000,op_flip2,pos_420"

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

llvm-svn: 283201

8 years ago[ELF] Set max page size to 64K for AArch64
Eugene Leviant [Tue, 4 Oct 2016 08:58:55 +0000 (08:58 +0000)]
[ELF] Set max page size to 64K for AArch64

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

llvm-svn: 283200

8 years agoRevert "[XRay] Check in Clang whether XRay supports the target when -fxray-instrument...
Dean Michael Berris [Tue, 4 Oct 2016 08:54:51 +0000 (08:54 +0000)]
Revert "[XRay] Check in Clang whether XRay supports the target when -fxray-instrument is passed"

This reverts 283193 -- broke the build.

llvm-svn: 283199

8 years ago[ELF] - Do not crash if symbol type set to TLS when there is no tls sections.
George Rimar [Tue, 4 Oct 2016 08:52:51 +0000 (08:52 +0000)]
[ELF] - Do not crash if symbol type set to TLS when there is no tls sections.

id_000021,sig_11,src_000002,op_flip1,pos_92 from PR30540

does not have TLS sections, but type
of one of the symbol is broken and set to STT_TLS,
what resulted in a crash. Patch fixes crash.

DIfferential revision: https://reviews.llvm.org/D25083

llvm-svn: 283198

8 years ago[ELF] - Do not crash if common symbol has alignment 0.
George Rimar [Tue, 4 Oct 2016 08:49:52 +0000 (08:49 +0000)]
[ELF] - Do not crash if common symbol has alignment 0.

Testcase contains a common symbol with zero alignment,
previously lld would crash, patch fixes that.

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

llvm-svn: 283197

8 years ago[Object/ELF] - Avoid possible crash in getExtendedSymbolTableIndex().
George Rimar [Tue, 4 Oct 2016 08:44:03 +0000 (08:44 +0000)]
[Object/ELF] - Avoid possible crash in getExtendedSymbolTableIndex().

When using broken input object found using AFL,
getExtendedSymbolTableIndex() crashed because ShndxTable
was empty as object does not contain SHT_SYMTAB_SHNDX section.

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

llvm-svn: 283196

8 years agoRevert r283106, "Wdocumentation fix"
NAKAMURA Takumi [Tue, 4 Oct 2016 08:32:33 +0000 (08:32 +0000)]
Revert r283106, "Wdocumentation fix"

It should depend on r283094 and r283182.

llvm-svn: 283195

8 years ago[ELF][MIPS] Do not accept non-zero GP0 value for relocatable object only
Simon Atanasyan [Tue, 4 Oct 2016 08:24:25 +0000 (08:24 +0000)]
[ELF][MIPS] Do not accept non-zero GP0 value for relocatable object only

Follow-up to r282716. Reject input files with non-zero GP0 value only in
case of relocatable object generation. In other case we can handle
arbitrary GP0 value so it does not have a sense to make the restriction
so wide.

llvm-svn: 283194

8 years ago[XRay] Check in Clang whether XRay supports the target when -fxray-instrument is...
Dean Michael Berris [Tue, 4 Oct 2016 08:22:47 +0000 (08:22 +0000)]
[XRay] Check in Clang whether XRay supports the target when -fxray-instrument is passed

Added the code which explicitly emits an error in Clang in case
`-fxray-instrument` is passed, but XRay is not supported for the
selected target.

Author: rSerge

Reviewers: dberris, rsmith, aaron.ballman, rnk

Subscribers: cfe-commits, iid_iunknown

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

llvm-svn: 283193

8 years agoConsistent fp denormal mode names. NFC.
Sjoerd Meijer [Tue, 4 Oct 2016 08:03:36 +0000 (08:03 +0000)]
Consistent fp denormal mode names. NFC.

This fixes the inconsistency of the fp denormal option names: in LLVM this was
DenormalType, but in Clang this is DenormalMode which seems better.

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

llvm-svn: 283192

8 years agoFix a test case failure on Apple PPC.
Nemanja Ivanovic [Tue, 4 Oct 2016 07:37:38 +0000 (07:37 +0000)]
Fix a test case failure on Apple PPC.

llvm-svn: 283191

8 years ago[Power9] Part-word VSX integer scalar loads/stores and sign extend instructions
Nemanja Ivanovic [Tue, 4 Oct 2016 06:59:23 +0000 (06:59 +0000)]
[Power9] Part-word VSX integer scalar loads/stores and sign extend instructions

This patch corresponds to review:
https://reviews.llvm.org/D23155

This patch removes the VSHRC register class (based on D20310) and adds
exploitation of the Power9 sub-word integer loads into VSX registers as well
as vector sign extensions.
The new instructions are useful for a few purposes:

    Int to Fp conversions of 1 or 2-byte values loaded from memory
    Building vectors of 1 or 2-byte integers with values loaded from memory
    Storing individual 1 or 2-byte elements from integer vectors

This patch implements all of those uses.

llvm-svn: 283190

8 years ago[cmake] Reintroduce (ldconfig-compatible) SOVERSIONs on shared libraries
Michal Gorny [Tue, 4 Oct 2016 06:09:18 +0000 (06:09 +0000)]
[cmake] Reintroduce (ldconfig-compatible) SOVERSIONs on shared libraries

Reintroduce versioning of shared libraries via SOVERSION, addressing
the issues with the previous design, since Gentoo is relying
on shared-split install of LLVM. The SOVERSIONs were originally
introduced in r229720 for all libraries, and removed in r252093 in favor
of custom SONAME. As far as I understand, the major concern with the old
versioning was that the used versions were incompatible with ldconfig.

Having considered that, this commit introduce SOVERSIONS with the
following considerations:

1. SOVERSIONs are formed of major & minor version concatenated -- i.e.
for 4.0 its .so.40. This matches the common practice where the first
version number indicates ABI breakage, and therefore fixes the issues
with ldconfig. Additionally, VERSION with the remaining verion
components appended is used, however this is not strictly necessary.

2. The versioning is only applied to libraries with no explicit SONAME
specified -- i.e. it won't apply to libLLVM but only to the split
libraries. It will also apply to libraries installed by the subprojects.

3. The versioning is only done on *nix systems, Darwin excluded. This
matches the current use of SONAME.

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

llvm-svn: 283189

8 years ago[cmake] Use separate doctrees to prevent races between Sphinx instances
Michal Gorny [Tue, 4 Oct 2016 06:09:14 +0000 (06:09 +0000)]
[cmake] Use separate doctrees to prevent races between Sphinx instances

Use separate doctrees between different Sphinx builders in order to
prevent race condition issues due to multiple Sphinx instances accessing
the same doctree cache in parallel.

Bug: https://llvm.org/bugs/show_bug.cgi?id=23781

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

llvm-svn: 283188

8 years ago[libFuzzer] remove dfsan support and some related stale code. This is not being used...
Kostya Serebryany [Tue, 4 Oct 2016 06:08:46 +0000 (06:08 +0000)]
[libFuzzer] remove dfsan support and some related stale code. This is not being used and as is is pretty weak anyway

llvm-svn: 283187

8 years agoFinish adding the individual instruction tests to the x86 unwinder
Jason Molenda [Tue, 4 Oct 2016 05:10:06 +0000 (05:10 +0000)]
Finish adding the individual instruction tests to the x86 unwinder
unittests.  If I have time, I'd like to see if I can write some
tests of the eh_frame augmentation which is a wholly separate code
path (it seems like maybe it should be rolled into the main instruction
scanning codepath, to be honest, and operate on the generated
UnwindPlan instead of bothering with raw instructions at all).

Outside the eh_frame augmentation, I'm comfortable that this unwind
generator is being tested well now.

llvm-svn: 283186

8 years ago[sanitizer-coverage] remove stale code, second attempt after failed r282994
Kostya Serebryany [Tue, 4 Oct 2016 04:18:30 +0000 (04:18 +0000)]
[sanitizer-coverage] remove stale code, second attempt after failed r282994

llvm-svn: 283185

8 years ago[X86] Add MOV8rm_NOREX to switch in isReallyTriviallyReMaterializable to match MOV8rm.
Craig Topper [Tue, 4 Oct 2016 03:11:44 +0000 (03:11 +0000)]
[X86] Add MOV8rm_NOREX to switch in isReallyTriviallyReMaterializable to match MOV8rm.

llvm-svn: 283184

8 years agoRevert "[sanitizer-coverage] remove stale code" at it breaks Windows bot.
Vitaly Buka [Tue, 4 Oct 2016 02:59:03 +0000 (02:59 +0000)]
Revert "[sanitizer-coverage] remove stale code" at it breaks Windows bot.

This reverts commit r282994.

llvm-svn: 283183

8 years agoRevert "[analyzer] Improve CloneChecker diagnostics" as its depends on reverted r283092
Vitaly Buka [Tue, 4 Oct 2016 02:40:35 +0000 (02:40 +0000)]
Revert "[analyzer] Improve CloneChecker diagnostics" as its depends on reverted r283092

This reverts commit r283094.

llvm-svn: 283182

8 years agoRevert "[analyzer] Add extra notes to ObjCDeallocChecker" as its depends on reverted...
Vitaly Buka [Tue, 4 Oct 2016 02:36:58 +0000 (02:36 +0000)]
Revert "[analyzer] Add extra notes to ObjCDeallocChecker" as its depends on reverted r283092

This reverts commit r283093.

llvm-svn: 283181

8 years agoRevert "[analyzer] Extend bug reports with extra notes" to fix Windows bot.
Vitaly Buka [Tue, 4 Oct 2016 02:19:17 +0000 (02:19 +0000)]
Revert "[analyzer] Extend bug reports with extra notes" to fix Windows bot.

This reverts commit r283092.

llvm-svn: 283180

8 years agoRevert "[analyzer] A blind attempt to fix a buildbot" as it does not help.
Vitaly Buka [Tue, 4 Oct 2016 02:19:12 +0000 (02:19 +0000)]
Revert "[analyzer] A blind attempt to fix a buildbot" as it does not help.

This reverts commit r283141.

llvm-svn: 283179

8 years ago[libFuzzer] change the probabilities so that we choose only the inputs that are known...
Kostya Serebryany [Tue, 4 Oct 2016 01:51:44 +0000 (01:51 +0000)]
[libFuzzer] change the probabilities so that we choose only the inputs that are known to be minimal inputs for at least one coverage feature (works only with -shrink=1 for now)

llvm-svn: 283178

8 years agoAMDGPU: Refactor indirect vector lowering
Matt Arsenault [Tue, 4 Oct 2016 01:41:05 +0000 (01:41 +0000)]
AMDGPU: Refactor indirect vector lowering

Allow inserting multiple instructions in the
expanded loop.

llvm-svn: 283177

8 years agoFix TestNestedAliases.py
Zachary Turner [Tue, 4 Oct 2016 01:34:39 +0000 (01:34 +0000)]
Fix TestNestedAliases.py

I missed an if/else branch when doing the conversion.

llvm-svn: 283176

8 years agoAMDGPU: Factor SGPR spilling into separate functions
Matt Arsenault [Tue, 4 Oct 2016 01:14:56 +0000 (01:14 +0000)]
AMDGPU: Factor SGPR spilling into separate functions

llvm-svn: 283175

8 years agoRemove unused parameter.
Rui Ueyama [Tue, 4 Oct 2016 01:03:03 +0000 (01:03 +0000)]
Remove unused parameter.

I do not fully understand how to use these classes yet, but
seems like these arguments are not used, since without them
all tests still pass. In order to simplify the situation,
I'll remove them now.

llvm-svn: 283174

8 years agoEarly return. NFC.
Rui Ueyama [Tue, 4 Oct 2016 00:46:36 +0000 (00:46 +0000)]
Early return. NFC.

llvm-svn: 283173

8 years agoRevert "Codegen: Tail-duplicate during placement."
Kyle Butt [Tue, 4 Oct 2016 00:38:23 +0000 (00:38 +0000)]
Revert "Codegen: Tail-duplicate during placement."

This reverts commit ff234efbe23528e4f4c80c78057b920a51f434b2.

Causing crashes on aarch64 build.

llvm-svn: 283172

8 years agoFix test when using remote debugging.
Pavel Labath [Tue, 4 Oct 2016 00:32:20 +0000 (00:32 +0000)]
Fix test when using remote debugging.

Summary:
Use os.getcwd() instead of get_process_working_directory() as prefix for
souce file.

Reviewers: labath

Subscribers: lldb-commits

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

llvm-svn: 283171

8 years ago[coroutines] Switch to using std::experimental namespace per P0057R5
Gor Nishanov [Tue, 4 Oct 2016 00:31:16 +0000 (00:31 +0000)]
[coroutines] Switch to using std::experimental namespace per P0057R5

Summary:
Look for coroutine_traits and friends in std::experimental namespace.
Patch (mostly) by EricWF.

Reviewers: cfe-commits, EricWF, rsmith

Subscribers: majnemer, mehdi_amini

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

llvm-svn: 283170

8 years ago[lit] Remove workaround for Python 2.5
Brian Gesiak [Tue, 4 Oct 2016 00:15:37 +0000 (00:15 +0000)]
[lit] Remove workaround for Python 2.5

Summary:
The minimum version of Python necessary to run the LLVM test suite is
2.7. Code to work around Python 2.5 and lower isn't necessary.

Reviewers: ddunbar, echristo, delcypher, beanz

Subscribers: llvm-commits, mehdi_amini

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

llvm-svn: 283169

8 years agoTry to fix failing tests when running remote test suite.
Zachary Turner [Tue, 4 Oct 2016 00:09:44 +0000 (00:09 +0000)]
Try to fix failing tests when running remote test suite.

llvm-svn: 283168

8 years agoFix the data formatter for std::multiset in libc++ - this is a trivial amount of...
Enrico Granata [Tue, 4 Oct 2016 00:07:42 +0000 (00:07 +0000)]
Fix the data formatter for std::multiset in libc++ - this is a trivial amount of extra change on top of multimap

Also, proper formatting..

llvm-svn: 283167

8 years agoSupport configurable path to LLVM src
Vitaly Buka [Tue, 4 Oct 2016 00:06:23 +0000 (00:06 +0000)]
Support configurable path to LLVM src

llvm-svn: 283166

8 years agoMake GlobalsAA ignore dead constant expressions.
Eli Friedman [Tue, 4 Oct 2016 00:03:55 +0000 (00:03 +0000)]
Make GlobalsAA ignore dead constant expressions.

Slightly improves the precision of GlobalsAA in certain situations, and
makes the behavior of optimization passes more predictable.

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

llvm-svn: 283165

8 years agoCodegen: Tail-duplicate during placement.
Kyle Butt [Tue, 4 Oct 2016 00:00:09 +0000 (00:00 +0000)]
Codegen: Tail-duplicate during placement.

The tail duplication pass uses an assumed layout when making duplication
decisions. This is fine, but passes up duplication opportunities that
may arise when blocks are outlined. Because we want the updated CFG to
affect subsequent placement decisions, this change must occur during
placement.

In order to achieve this goal, TailDuplicationPass is split into a
utility class, TailDuplicator, and the pass itself. The pass delegates
nearly everything to the TailDuplicator object, except for looping over
the blocks in a function. This allows the same code to be used for tail
duplication in both places.

This change, in concert with outlining optional branches, allows
triangle shaped code to perform much better, esepecially when the
taken/untaken branches are correlated, as it creates a second spine when
the tests are small enough.

llvm-svn: 283164

8 years agoMark a couple more Issaquah issues as done: 2578 and 2738
Marshall Clow [Mon, 3 Oct 2016 23:42:31 +0000 (23:42 +0000)]
Mark a couple more Issaquah issues as done: 2578 and 2738

llvm-svn: 283163

8 years agoChange a couple of 'template <typename's to 'template <class' which is what we use...
Marshall Clow [Mon, 3 Oct 2016 23:40:48 +0000 (23:40 +0000)]
Change a couple of 'template <typename's to 'template <class' which is what we use in the rest of the library.

llvm-svn: 283162

8 years agoAdd tests to make sure that is_constructible<cv-void> is false. We already checked...
Marshall Clow [Mon, 3 Oct 2016 23:39:52 +0000 (23:39 +0000)]
Add tests to make sure that is_constructible<cv-void> is false. We already checked 'unqualified void'. This was brought up by LWG#2738

llvm-svn: 283161

8 years agoChanges to the std::multimap formatter to make it work against trunk libc++
Enrico Granata [Mon, 3 Oct 2016 23:33:00 +0000 (23:33 +0000)]
Changes to the std::multimap formatter to make it work against trunk libc++

Fixes rdar://28237486

llvm-svn: 283160

8 years agoModernize some code related to Args usage / implementation.
Zachary Turner [Mon, 3 Oct 2016 23:20:36 +0000 (23:20 +0000)]
Modernize some code related to Args usage / implementation.

Mostly this involves simplifying some logical constructs and using
some ranges instead of index-based iteration.  NFC

llvm-svn: 283159

8 years ago[MSSA] Allow unittests to use BasicAA when building.
George Burgess IV [Mon, 3 Oct 2016 23:12:35 +0000 (23:12 +0000)]
[MSSA] Allow unittests to use BasicAA when building.

We now build MemorySSA in its ctor, instead of waiting until the user
calls MemorySSA::getWalker. This silently changed our unittests, since
we add BasicAA to AAResults *after* constructing MemorySSA (...but
before calling MemorySSA::getWalker).

None of them broke because we do most of our "did this get optimized
correctly?" tests in .ll files.

llvm-svn: 283158

8 years agoRefactor the Args class.
Zachary Turner [Mon, 3 Oct 2016 22:51:09 +0000 (22:51 +0000)]
Refactor the Args class.

There were a number of issues with the Args class preventing
efficient use of strings and incoporating LLVM's StringRef class.
The two biggest were:

1. Backing memory stored in a std::string, so we would frequently
   have to use const_cast to get a mutable buffer for passing to
   various low level APIs.
2. backing std::strings stored in a std::list, which doesn't
   provide random access.

I wanted to solve these two issues so that we could provide
StringRef access to the underlying arguments, and also a way
to provide range-based access to the underlying argument array
while still providing convenient c-style access via an argv style
const char**.

The solution here is to store arguments in a single "entry" class
which contains the backing memory, a StringRef with precomputed
length, and the quote char.  The backing memory is a manually
allocated const char* so that it is not invalidated when the
container is resized, and there is a separate argv array provided
for c-style access.

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

llvm-svn: 283157

8 years agoadd a simple test case to validate test id()
Todd Fiala [Mon, 3 Oct 2016 22:49:13 +0000 (22:49 +0000)]
add a simple test case to validate test id()

Since we count on it in a few places, the test verifies that the
test instance has an id() method that returns something non-None.

llvm-svn: 283156

8 years ago[coroutines] Adding builtins for coroutine intrinsics and backendutil support.
Gor Nishanov [Mon, 3 Oct 2016 22:44:48 +0000 (22:44 +0000)]
[coroutines] Adding builtins for coroutine intrinsics and backendutil support.

Summary:
With this commit simple coroutines can be created in plain C using coroutine builtins.

Reviewers: rnk, EricWF, rsmith

Subscribers: modocache, mgorny, mehdi_amini, beanz, cfe-commits

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

llvm-svn: 283155

8 years ago[WebAssembly] Update to more stack-machine-oriented terminology.
Dan Gohman [Mon, 3 Oct 2016 22:43:53 +0000 (22:43 +0000)]
[WebAssembly] Update to more stack-machine-oriented terminology.

WebAssembly has officially switched from being an AST to being a stack
machine. Update various bits of terminology and README.md entries
accordingly.

llvm-svn: 283154

8 years ago[WebAssemby] Clean up an obsolete comment.
Dan Gohman [Mon, 3 Oct 2016 22:32:21 +0000 (22:32 +0000)]
[WebAssemby] Clean up an obsolete comment.

The comment is present inside the body of GetVRegDef.

llvm-svn: 283153

8 years ago[lit] Use argparse instead of optparse
Chris Bieneman [Mon, 3 Oct 2016 22:12:42 +0000 (22:12 +0000)]
[lit] Use argparse instead of optparse

Summary:
optparse is deprecated in Python 2.7, which is the minimum version of
Python required to run the LLVM test suite. Replace its usage in lit
with argparse, optparse's 2.7 replacement module.

argparse has several benefits over optparse, but this commit does not
make use of those benefits yet. Instead, it simply uses the new API,
and attempts to keep the number of changes to a minimum.

Confirmed that lit's test suite, as well as LLVM's regression test suite,
still pass with these changes.

Patch By Brian Gesiak!

Reviewers: ddunbar, echristo, beanz, delcypher

Subscribers: llvm-commits, mehdi_amini

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

llvm-svn: 283152

8 years agoTargetMachine: Make the win32-macho workaround more specific.
Matthias Braun [Mon, 3 Oct 2016 22:12:37 +0000 (22:12 +0000)]
TargetMachine: Make the win32-macho workaround more specific.

This is to avoid problems with win32 + ELF which surprisingly happens a
lot in practice: If a user just specifies -march on the commandline the
object format changes along with the architecture to ELF in many
instances while the OS stays with the default/host OS.

llvm-svn: 283151

8 years ago[WebAssembly] Delete an unused function. NFC.
Dan Gohman [Mon, 3 Oct 2016 22:06:28 +0000 (22:06 +0000)]
[WebAssembly] Delete an unused function. NFC.

llvm-svn: 283150

8 years agoSet some tests to an unknown vendor and OS
Matthias Braun [Mon, 3 Oct 2016 21:58:20 +0000 (21:58 +0000)]
Set some tests to an unknown vendor and OS

This avoids llc using the hosts OS/vendor as defaults and triggering
unwanted behaviour in the tests. This should deal with the buildbot
breakages on windows after r283140.

llvm-svn: 283149

8 years ago[LTO] Fix test to not depend on the exact address of symbols, just their linkage
Mehdi Amini [Mon, 3 Oct 2016 21:40:50 +0000 (21:40 +0000)]
[LTO] Fix test to not depend on the exact address of symbols, just their linkage

llvm-svn: 283148

8 years ago[WebAssembly] Fix indentation. NFC.
Dan Gohman [Mon, 3 Oct 2016 21:33:09 +0000 (21:33 +0000)]
[WebAssembly] Fix indentation. NFC.

llvm-svn: 283147

8 years ago[WebAssembly] Rename OPERAND_FP32IMM to OPERAND_F32IMM.
Dan Gohman [Mon, 3 Oct 2016 21:31:31 +0000 (21:31 +0000)]
[WebAssembly] Rename OPERAND_FP32IMM to OPERAND_F32IMM.

WebAssembly documentation consistently says "f32" rather than "fp32" to
describe 32-bit floating-point.

llvm-svn: 283146

8 years agoObjectiveC: fix a seg fault when deserialing redeclaration of ObjCMethodDecl.
Manman Ren [Mon, 3 Oct 2016 21:26:46 +0000 (21:26 +0000)]
ObjectiveC: fix a seg fault when deserialing redeclaration of ObjCMethodDecl.

The deserialization of redeclartion can cause seg fault since getCanonicalDecl
of the redeclaration returns the lookup result on the ObjCContainerDecl,
which can be null if FindExternalVisibleDeclsByName is not done updating
the lookup results.

The fix is to return the redeclaration itself as the canonical decl. Note that
the handling for redeclaration of ObjCMethodDecl is not in line with other
redeclarables.

rdar://28488466

llvm-svn: 283145

8 years ago[AArch64][RegisterBankInfo] Add getSameKindofOperandsMapping.
Quentin Colombet [Mon, 3 Oct 2016 20:20:13 +0000 (20:20 +0000)]
[AArch64][RegisterBankInfo] Add getSameKindofOperandsMapping.

Refactor the code so that the same function can be used for all
instructions with all the same operands for up to 3 operands.

This is going to be useful for cast instructions.
NFC.

llvm-svn: 283144

8 years ago[RDF] Fix liveness propagation through shadows
Krzysztof Parzyszek [Mon, 3 Oct 2016 20:17:20 +0000 (20:17 +0000)]
[RDF] Fix liveness propagation through shadows

Each shadow only represents data flow that is restricted to its reaching
def. Propagating more than that could lead to spurious register liveness,
resulting in extra (incorrectly) block live-ins.

llvm-svn: 283143

8 years agoAArch64Subtarget: Remove unused CPUString field
Matthias Braun [Mon, 3 Oct 2016 20:17:02 +0000 (20:17 +0000)]
AArch64Subtarget: Remove unused CPUString field

llvm-svn: 283142

8 years ago[analyzer] A blind attempt to fix a buildbot after r283092.
Artem Dergachev [Mon, 3 Oct 2016 20:12:12 +0000 (20:12 +0000)]
[analyzer] A blind attempt to fix a buildbot after r283092.

The msvc compiler seems to crash compiling the BugReport class.

llvm-svn: 283141

8 years agoX86: Do not produce GOT relocations on windows
Matthias Braun [Mon, 3 Oct 2016 20:11:24 +0000 (20:11 +0000)]
X86: Do not produce GOT relocations on windows

Windows has no GOT relocations the way elf/darwin has. Some people use
x86_64-pc-win32-macho to build EFI firmware; Do not produce GOT
relocations for this target.

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

llvm-svn: 283140

8 years ago[esan] Fix ESan test failure on Debian Sid bot
Qin Zhao [Mon, 3 Oct 2016 20:03:10 +0000 (20:03 +0000)]
[esan] Fix ESan test failure on Debian Sid bot

Summary:
Handles early allocation from dlsym by allocating memory from a local
static buffer.

Reviewers: bruening

Subscribers: kubabrecka

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

llvm-svn: 283139

8 years agoAdd unit tests for StringSwitch.
Zachary Turner [Mon, 3 Oct 2016 19:56:50 +0000 (19:56 +0000)]
Add unit tests for StringSwitch.

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

llvm-svn: 283138

8 years ago[PruneEH] Be correct in the face IPO
Sanjoy Das [Mon, 3 Oct 2016 19:35:30 +0000 (19:35 +0000)]
[PruneEH] Be correct in the face IPO

This fixes one spot I had missed in r265762.  Credit goes to Philip
Reames for spotting this one!

llvm-svn: 283137

8 years ago[sancov] using env for better portability
Mike Aizatsky [Mon, 3 Oct 2016 19:22:05 +0000 (19:22 +0000)]
[sancov] using env for better portability

llvm-svn: 283136

8 years agoAdded more comments to tooling::Replacements.
Eric Liu [Mon, 3 Oct 2016 19:14:30 +0000 (19:14 +0000)]
Added more comments to tooling::Replacements.

Summary: Also test phabricator commit processing.

Subscribers: klimek, cfe-commits

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

llvm-svn: 283135

8 years agoRefactor LICM pass in preparation for LoopSink pass.
Dehao Chen [Mon, 3 Oct 2016 18:52:08 +0000 (18:52 +0000)]
Refactor LICM pass in preparation for LoopSink pass.

Summary: LoopSink pass uses some common function in LICM. This patch refactor the LICM code to make it usable by LoopSink pass (https://reviews.llvm.org/D22778).

Reviewers: davidxl, danielcdh, hfinkel, chandlerc

Subscribers: hfinkel, llvm-commits

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

llvm-svn: 283134

8 years ago[AMDGPU] Pass optimization level to SelectionDAGISel
Konstantin Zhuravlyov [Mon, 3 Oct 2016 18:47:26 +0000 (18:47 +0000)]
[AMDGPU] Pass optimization level to SelectionDAGISel

llvm-svn: 283133