platform/upstream/llvm.git
8 years ago[ADT] C++11ify SmallVector::erase's arguments from iterator to const_iterator
David Blaikie [Thu, 24 Mar 2016 20:25:51 +0000 (20:25 +0000)]
[ADT] C++11ify SmallVector::erase's arguments from iterator to const_iterator

llvm-svn: 264330

8 years agoAdd lowering support for llvm.experimental.deoptimize
Sanjoy Das [Thu, 24 Mar 2016 20:23:29 +0000 (20:23 +0000)]
Add lowering support for llvm.experimental.deoptimize

Summary:
Only adds support for "naked" calls to llvm.experimental.deoptimize.
Support for round-tripping through RewriteStatepointsForGC will come
as a separate patch (should be simpler than this one).

Reviewers: reames

Subscribers: sanjoy, mcrosier, llvm-commits

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

llvm-svn: 264329

8 years ago[Hexagon] Add support for run-time stack overflow checking
Krzysztof Parzyszek [Thu, 24 Mar 2016 20:20:07 +0000 (20:20 +0000)]
[Hexagon] Add support for run-time stack overflow checking

Patch by Sundeep Kushwaha.

llvm-svn: 264328

8 years ago[asan] Intercept all Heap* related imports from ucrtbase.dll
Reid Kleckner [Thu, 24 Mar 2016 20:19:48 +0000 (20:19 +0000)]
[asan] Intercept all Heap* related imports from ucrtbase.dll

ucrtbase.dll appears to be built with some kind of cross-module
inlining, because there are calls to imported Heap* routines sprinkled
throughout the code. This inlining defeats our attempts to hotpatch
malloc, _malloc_base, and related functions. Failing to intercept an
allocation or deallocation results in a crash when the program attempts
to deallocate or reallocate memory with the wrong allocator.

This change patches the IAT of ucrtbase.dll to replace the addresses of
the imported Heap* functions with implementations provided by ASan.  We
don't globally intercept the win32 Heap* functions because they are
typically used by system DLLs that run before ASan initializes.
Eventually, we may want to intercept them, but for now I think this is
the minimal change that will keep ASan stable.

Reviewers: samsonov

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

llvm-svn: 264327

8 years ago[ThinLTO] Use bulk importing in llvm-link
Teresa Johnson [Thu, 24 Mar 2016 19:52:20 +0000 (19:52 +0000)]
[ThinLTO] Use bulk importing in llvm-link

Summary:
Use bulk importing so we can avoid the use of post-pass metadata
linking. Cloned the ModuleLazyLoaderCache from the FunctionImport pass
to facilitate this.

Reviewers: joker.eph

Subscribers: dexonsmith, llvm-commits, joker.eph

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

llvm-svn: 264326

8 years ago[clang-tidy] Add support for different char-types for the readability-redundant-strin...
Etienne Bergeron [Thu, 24 Mar 2016 19:42:36 +0000 (19:42 +0000)]
[clang-tidy] Add support for different char-types for the readability-redundant-string-cstr checker.

Summary:
The current checker is able to recognize std::string but does not recognize other string variants.
This patch is adding the support for any string defined with basic_string without considering the
the underlying char type.

The most common variant is: 'std::wstring' based on 'wchar_t'.

There are also other string variants added to the standard: u16string, u32string, etc...

Reviewers: alexfh

Subscribers: mamai, dblaikie, cfe-commits

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

llvm-svn: 264325

8 years ago[Hexagon] Generate PIC-specific versions of save/restore routines
Krzysztof Parzyszek [Thu, 24 Mar 2016 19:18:48 +0000 (19:18 +0000)]
[Hexagon] Generate PIC-specific versions of save/restore routines

In PIC mode, the registers R14, R15 and R28 are reserved for use by
the PLT handling code. This causes all functions to clobber these
registers. While this is not new for regular function calls, it does
also apply to save/restore functions, which do not follow the standard
ABI conventions with respect to the volatile/non-volatile registers.

Patch by Jyotsna Verma.

llvm-svn: 264324

8 years agoChange ADL to produce lookup results in a deterministic order. This fixes some
Richard Smith [Thu, 24 Mar 2016 19:12:22 +0000 (19:12 +0000)]
Change ADL to produce lookup results in a deterministic order. This fixes some
rare issues with nondeterministic diagnostic order, and some very common issues
with nondeterministic module builds.

llvm-svn: 264323

8 years agoSimplify AArch64 isRelRelative
Adhemerval Zanella [Thu, 24 Mar 2016 19:12:14 +0000 (19:12 +0000)]
Simplify AArch64 isRelRelative

This patch simplifies the isRelRelative for AArch64 and add the missing
ones for bootstrap and test-suite.  It also adds more testing for
shared object creation.

llvm-svn: 264322

8 years agoStop relying on mapped_iterator's function having a result_type. That facility
Richard Smith [Thu, 24 Mar 2016 19:10:58 +0000 (19:10 +0000)]
Stop relying on mapped_iterator's function having a result_type. That facility
is deprecated in modern C++ and unnecessary since decltype can be used to query
the relevant type.

llvm-svn: 264321

8 years ago[Statepoints] Fix yet another issue around gc pointer uniqueing
Sanjoy Das [Thu, 24 Mar 2016 18:57:39 +0000 (18:57 +0000)]
[Statepoints] Fix yet another issue around gc pointer uniqueing

Given that StatepointLowering now uniques derived pointers before
putting them in the per-statepoint spill map, we may end up with missing
entries for derived pointers when we visit a gc.relocate on a pointer
that was de-duplicated away.

Fix this by keeping two maps, one mapping gc pointers to their
de-duplicated values, and one mapping a de-duplicated value to the slot
it is spilled in.

llvm-svn: 264320

8 years agoMinor cosmestic changes (NFC)
Sanjoy Das [Thu, 24 Mar 2016 18:57:31 +0000 (18:57 +0000)]
Minor cosmestic changes (NFC)

 - Reflow comments
 - Rename function

llvm-svn: 264319

8 years ago[Docs] Updating CMake docs to include LLVM_OPTIMIZED_TABLEGEN
Chris Bieneman [Thu, 24 Mar 2016 18:46:43 +0000 (18:46 +0000)]
[Docs] Updating CMake docs to include LLVM_OPTIMIZED_TABLEGEN

This is based on feedback on llvm-commits from Sean Silvas.

llvm-svn: 264318

8 years ago[debuginfo] Include dwo_name in the split unit to improve dwp diagnostics
David Blaikie [Thu, 24 Mar 2016 18:37:08 +0000 (18:37 +0000)]
[debuginfo] Include dwo_name in the split unit to improve dwp diagnostics

When multiple DWP files are merged together and duplicate DWO IDs are
found it's currently difficult to give an actionable error message - the
DW_AT_name of the CU could be provided, but might be identical (if the
same source file is built into two different configurations), which
doesn't help the user identify the problem.

When no intermediate DWP files are generated, the path to the two DWO
files could be provided - but is lost once the DWOs are merged into a
DWP.

So, include the name of the DWO (dwo_name) in the split file so that
collissions involving a source CU from a DWP can be better diagnosed.

(improvements to llvm-dwp using this to come shortly)

llvm-svn: 264316

8 years agoFix a missing comma between two string literals.
Etienne Bergeron [Thu, 24 Mar 2016 18:29:24 +0000 (18:29 +0000)]
Fix a missing comma between two string literals.

Summary:
The two literals are currently appended.

I'm not sure what was broken by this. Please double check carefully.

Silly bug found by an on-going checker for clang-tidy.

Reviewers: alexfh, arsenm, rnk

Subscribers: cfe-commits

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

llvm-svn: 264315

8 years ago[docs] Clarify Error example in Programmer's Manual.
Lang Hames [Thu, 24 Mar 2016 18:05:21 +0000 (18:05 +0000)]
[docs] Clarify Error example in Programmer's Manual.

llvm-svn: 264314

8 years ago[LLE] Check for mismatching types between the store and the load earlier
Adam Nemet [Thu, 24 Mar 2016 17:59:26 +0000 (17:59 +0000)]
[LLE] Check for mismatching types between the store and the load earlier

isDependenceDistanceOfOne asserts that the store and the load access
through the same type.  This function is also used by
removeDependencesFromMultipleStores so we need to make sure we filter
out mismatching types before reaching this point.

Now we do this when the initial candidates are gathered.

This is a refinement of the fix made in r262267.

Fixes PR27048.

llvm-svn: 264313

8 years agoUse None to construct an empty ArrayRef. NFC.
Pete Cooper [Thu, 24 Mar 2016 17:39:34 +0000 (17:39 +0000)]
Use None to construct an empty ArrayRef.  NFC.

Suggested by David Blaikie in response to r264234.

llvm-svn: 264311

8 years agodon't hardcode the name of the llc checks script
Sanjay Patel [Thu, 24 Mar 2016 17:30:38 +0000 (17:30 +0000)]
don't hardcode the name of the llc checks script

We lose the 'utils' directory name in our advertising line with
this change. We could retain that, but I don't see the point.
This removes a dependency for making the script apply to more than
'llc'. Ie, we'll want to change the script name if it works with
opt/clang too.

llvm-svn: 264310

8 years ago[MC][mips] Add MipsMCInstrAnalysis class and register it as MC instruction analyzer
Simon Atanasyan [Thu, 24 Mar 2016 17:18:14 +0000 (17:18 +0000)]
[MC][mips] Add MipsMCInstrAnalysis class and register it as MC instruction analyzer

The `MipsMCInstrAnalysis` class overrides the `evaluateBranch` method
and calculates target addresses for branch and calls instructions.
That allows llvm-objdump to print functions' names in branch instructions
in the disassemble mode.

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

llvm-svn: 264309

8 years agoRemove unnecessary redirect from test
Sanjoy Das [Thu, 24 Mar 2016 17:18:00 +0000 (17:18 +0000)]
Remove unnecessary redirect from test

llvm-svn: 264308

8 years agoreorganize llc checks script to allow more flexibility, part 2; NFCI
Sanjay Patel [Thu, 24 Mar 2016 17:15:42 +0000 (17:15 +0000)]
reorganize llc checks script to allow more flexibility, part 2; NFCI

The goal is to enhance this script to be used with opt and clang:
Break 'main' into functions and change variable names to be more
generic because we want to handle more than x86 asm output.

llvm-svn: 264307

8 years agoFix gold tests for llvm-readobj format change.
Rafael Espindola [Thu, 24 Mar 2016 16:45:41 +0000 (16:45 +0000)]
Fix gold tests for llvm-readobj format change.

llvm-svn: 264306

8 years ago[X86][XOP] Fixed instruction postfixes to more closely match operands
Simon Pilgrim [Thu, 24 Mar 2016 16:31:30 +0000 (16:31 +0000)]
[X86][XOP] Fixed instruction postfixes to more closely match operands

Suggested by Sanjay in D18189 as the multiple folding options in XOP instructions can be tricky

llvm-svn: 264305

8 years ago[ELF] Follow-up to r264300. Update test case expectations to reflect recent changes...
Simon Atanasyan [Thu, 24 Mar 2016 16:30:20 +0000 (16:30 +0000)]
[ELF] Follow-up to r264300. Update test case expectations to reflect recent changes in llvm-readobj. NFC.

llvm-svn: 264304

8 years agoBitcodeWriter: Move abbreviation for GenericDINode; almost NFC
Duncan P. N. Exon Smith [Thu, 24 Mar 2016 16:30:18 +0000 (16:30 +0000)]
BitcodeWriter: Move abbreviation for GenericDINode; almost NFC

Simplify ValueEnumerator and WriteModuleMetadata by shifting the logic
for the METADATA_GENERIC_DEBUG abbreviation into WriteGenericDINode.
(This is just like r264302, but for GenericDINode.)

The only change is that the abbreviation is emitted later in the
bitcode, just before the first `GenericDINode` record.  This shouldn't
be observable though.

llvm-svn: 264303

8 years agoBitcodeWriter: Move abbreviation for DILocation; almost NFC
Duncan P. N. Exon Smith [Thu, 24 Mar 2016 16:25:51 +0000 (16:25 +0000)]
BitcodeWriter: Move abbreviation for DILocation; almost NFC

Simplify ValueEnumerator and WriteModuleMetadata by shifting the logic
for the METADATA_LOCATION abbreviation into WriteDILocation.

The only change is that the abbreviation is emitted later in the
bitcode, just before the first `DILocation` record.  This shouldn't be
observable though.

llvm-svn: 264302

8 years agoBitcodeWriter: Split out named metadata; almost NFC
Duncan P. N. Exon Smith [Thu, 24 Mar 2016 16:16:08 +0000 (16:16 +0000)]
BitcodeWriter: Split out named metadata; almost NFC

Split writeNamedMetadata out of WriteModuleMetadata to write named
metadata, and createNamedMetadataAbbrev for the abbreviation.

There should be no effective functionality change, although the layout
of the bitcode will change.  Previously, the abbreviation was emitted at
the top of the block, but now it is delayed until immediately before the
named metadata records are emitted.

llvm-svn: 264301

8 years ago[llvm-readobj] Decode st_other symbol's flags
Simon Atanasyan [Thu, 24 Mar 2016 16:10:37 +0000 (16:10 +0000)]
[llvm-readobj] Decode st_other symbol's flags

The patch supports common STV_xxx visibility flags and MIPS specific
STO_MIPS_xxx flags.

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

llvm-svn: 264300

8 years agoBitcode: Module* -> Module&, NFC
Duncan P. N. Exon Smith [Thu, 24 Mar 2016 16:01:46 +0000 (16:01 +0000)]
Bitcode: Module* -> Module&, NFC

llvm-svn: 264299

8 years agoAVX-512: Generate KTEST instead of TEST fir i1 vectors
Elena Demikhovsky [Thu, 24 Mar 2016 15:53:45 +0000 (15:53 +0000)]
AVX-512: Generate KTEST instead of TEST fir i1 vectors

KTEST instruction may be used instead of TEST in this case:

%int_sel3 = bitcast <8 x i1> %sel3 to i8
%res = icmp eq i8 %int_sel3, zeroinitializer
br i1 %res, label %L2, label %L1

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

llvm-svn: 264298

8 years agoErrorTest.cpp: Move instantiations out of anonymous namespace. gcc didn't complain.
NAKAMURA Takumi [Thu, 24 Mar 2016 15:40:46 +0000 (15:40 +0000)]
ErrorTest.cpp: Move instantiations out of anonymous namespace. gcc didn't complain.

llvm-svn: 264297

8 years agoCodeGen: extend RHS when splitting ATOMIC_CMP_SWAP_WITH_SUCCESS.
Tim Northover [Thu, 24 Mar 2016 15:38:38 +0000 (15:38 +0000)]
CodeGen: extend RHS when splitting ATOMIC_CMP_SWAP_WITH_SUCCESS.

If the operation's type has been promoted during type legalization, we
need to account for the fact that the high bits of the comparison
operand are likely unspecified.

The LHS is usually zero-extended, but MIPS sign extends it, so we have
to be slightly careful.

Patch by Simon Dardis.

llvm-svn: 264296

8 years agoAMDGPU/SI: Add Polaris support
Tom Stellard [Thu, 24 Mar 2016 15:31:05 +0000 (15:31 +0000)]
AMDGPU/SI: Add Polaris support

Patch By: Sonny Jiang

llvm-svn: 264295

8 years ago[X86][XOP] Merged 128/256 bit 4op instruction definitions. NFCI.
Simon Pilgrim [Thu, 24 Mar 2016 15:28:02 +0000 (15:28 +0000)]
[X86][XOP] Merged 128/256 bit 4op instruction definitions. NFCI.

llvm-svn: 264294

8 years agoDefine ErrorInfo::ID explicitly.
NAKAMURA Takumi [Thu, 24 Mar 2016 15:26:43 +0000 (15:26 +0000)]
Define ErrorInfo::ID explicitly.

llvm-svn: 264293

8 years agoFix another case where we were unconditionally linking linkonce GVs.
Rafael Espindola [Thu, 24 Mar 2016 15:23:01 +0000 (15:23 +0000)]
Fix another case where we were unconditionally linking linkonce GVs.

With this I think that now llvm-link,  lld and the gold plugin should
agree on which symbol is kept.

llvm-svn: 264292

8 years agoError.cpp: Fix a warning. [-Wpedantic]
NAKAMURA Takumi [Thu, 24 Mar 2016 15:19:39 +0000 (15:19 +0000)]
Error.cpp: Fix a warning. [-Wpedantic]

llvm-svn: 264291

8 years agoErrorTest.cpp: Fix an expression, possibly typo.
NAKAMURA Takumi [Thu, 24 Mar 2016 15:19:22 +0000 (15:19 +0000)]
ErrorTest.cpp: Fix an expression, possibly typo.

llvm-svn: 264290

8 years agoDsiable FormatStyle::GetStyleOfFile test case for mingw.
Eric Liu [Thu, 24 Mar 2016 14:59:39 +0000 (14:59 +0000)]
Dsiable FormatStyle::GetStyleOfFile test case for mingw.

llvm-svn: 264289

8 years agoFix resolution of linkonce symbols in comdats.
Rafael Espindola [Thu, 24 Mar 2016 14:58:44 +0000 (14:58 +0000)]
Fix resolution of linkonce symbols in comdats.

After comdat processing, the symbols still go through regular symbol
resolution.

We were not doing it for linkonce symbols since they are lazy linked.

This fixes pr27044.

llvm-svn: 264288

8 years ago[mips] Range check vsplat_simm5 and vsplat_simm10
Daniel Sanders [Thu, 24 Mar 2016 14:53:40 +0000 (14:53 +0000)]
[mips] Range check vsplat_simm5 and vsplat_simm10

Summary:

Reviewers: vkalintiris

Subscribers: llvm-commits, dsanders

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

llvm-svn: 264287

8 years ago[CMAKE] Try to find the correct globbing expression
Johannes Doerfert [Thu, 24 Mar 2016 14:31:49 +0000 (14:31 +0000)]
[CMAKE] Try to find the correct globbing expression

llvm-svn: 264286

8 years agoRemove unsafe AssertZext after promoting result of FP_TO_FP16
Pirama Arumuga Nainar [Thu, 24 Mar 2016 14:06:03 +0000 (14:06 +0000)]
Remove unsafe AssertZext after promoting result of FP_TO_FP16

Summary:
Some target lowerings of FP_TO_FP16, for instance ARM's vcvtb.f16.f32
instruction, do not guarantee that the top 16 bits are zeroed out.
Remove the unsafe AssertZext and add tests to exercise this.

Reviewers: jmolloy, sbaranga, kristof.beyls, aadg

Subscribers: llvm-commits, srhines, aemerson

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

llvm-svn: 264285

8 years ago[FIX] Handle accesses to "null" in MemIntrinsics
Johannes Doerfert [Thu, 24 Mar 2016 13:50:04 +0000 (13:50 +0000)]
[FIX] Handle accesses to "null" in MemIntrinsics

  This fixes PR27035. While we now exclude MemIntrinsics from the
  polyhedral model if they would access "null" we could exploit this
  even more, e.g., remove all parameter combinations that would lead to
  the execution of this statement from the context.

llvm-svn: 264284

8 years agoRestrict clang-format to lib/ [NFC]
Johannes Doerfert [Thu, 24 Mar 2016 13:49:39 +0000 (13:49 +0000)]
Restrict clang-format to lib/ [NFC]

llvm-svn: 264283

8 years ago[PowerPC] Disable direct moves for extractelement and bitcast in 32-bit mode
Nemanja Ivanovic [Thu, 24 Mar 2016 13:40:33 +0000 (13:40 +0000)]
[PowerPC] Disable direct moves for extractelement and bitcast in 32-bit mode

This patch corresponds to review:
http://reviews.llvm.org/D17711

It disables direct moves on these operations in 32-bit mode since the patterns
assume 64-bit registers. The final patch is slightly different from the
Phabricator review as the bitcast operations needed to be disabled in 32-bit
mode as well. This fixes PR26617.

llvm-svn: 264282

8 years agoRecommitted r263425 "Supporting all entities declared in lexical scope in LLVM debug...
Amjad Aboud [Thu, 24 Mar 2016 13:30:41 +0000 (13:30 +0000)]
Recommitted r263425 "Supporting all entities declared in lexical scope in LLVM debug info."
After fixing PR26942 (the fix is included in this commit).

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

llvm-svn: 264281

8 years agoRecommitted r263424 "Supporting all entities declared in lexical scope in LLVM debug...
Amjad Aboud [Thu, 24 Mar 2016 13:30:16 +0000 (13:30 +0000)]
Recommitted r263424 "Supporting all entities declared in lexical scope in LLVM debug info."
After fixing PR26942 (the fix is included in this commit).

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

llvm-svn: 264280

8 years ago[mips] Range check simm10
Daniel Sanders [Thu, 24 Mar 2016 13:26:59 +0000 (13:26 +0000)]
[mips] Range check simm10

Summary:

Reviewers: vkalintiris

Subscribers: llvm-commits, dsanders

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

llvm-svn: 264279

8 years agoAdded support for different VFSs in format::getStyle. Disable platform-related test...
Eric Liu [Thu, 24 Mar 2016 13:22:42 +0000 (13:22 +0000)]
Added support for different VFSs in format::getStyle. Disable platform-related test case for MS compilers to avoid breaking buildbot.

llvm-svn: 264277

8 years agoRevert "Added support for different VFSs in format::getStyle."
Eric Liu [Thu, 24 Mar 2016 13:22:37 +0000 (13:22 +0000)]
Revert "Added support for different VFSs in format::getStyle."

This reverts commit r264253. It is breaking the buildbot http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/2203

llvm-svn: 264276

8 years agoRevert "removed redundant comment in format::getStyle."
Eric Liu [Thu, 24 Mar 2016 13:22:28 +0000 (13:22 +0000)]
Revert "removed redundant comment in format::getStyle."

This reverts commit r264254.

llvm-svn: 264275

8 years ago[FIX] Verify the alias group before returning it
Johannes Doerfert [Thu, 24 Mar 2016 13:22:16 +0000 (13:22 +0000)]
[FIX] Verify the alias group before returning it

Similar to r262612 we need to check not only the pointer SCEV and the
type of an alias group but also the actual access instruction. The
reason is again the same: The pointer SCEV is not flow sensitive but the
access function is. In r262612 we avoided consolidating alias groups
even though the pointer SCEV and the type were the same but the access
function was not. Here it is simpler as we can simply check all members
of an alias group against the given access instruction.

llvm-svn: 264274

8 years ago[DOCS] Exclude python and shell scripts
Johannes Doerfert [Thu, 24 Mar 2016 13:21:12 +0000 (13:21 +0000)]
[DOCS] Exclude python and shell scripts

llvm-svn: 264273

8 years agoAdd namespace for struct [NFC]
Johannes Doerfert [Thu, 24 Mar 2016 13:20:52 +0000 (13:20 +0000)]
Add namespace for struct [NFC]

  This will clean up the doxygen documentation.

llvm-svn: 264272

8 years agoFollow-up for r264261, adding a comment explaining what the testcase does.
Kuba Brecka [Thu, 24 Mar 2016 13:20:38 +0000 (13:20 +0000)]
Follow-up for r264261, adding a comment explaining what the testcase does.

llvm-svn: 264271

8 years agoRemove obsolete CMD option [NFC]
Johannes Doerfert [Thu, 24 Mar 2016 13:19:51 +0000 (13:19 +0000)]
Remove obsolete CMD option [NFC]

llvm-svn: 264270

8 years agoRemove obsolete code
Johannes Doerfert [Thu, 24 Mar 2016 13:19:16 +0000 (13:19 +0000)]
Remove obsolete code

  Since r261226 we should not see this situation any more, if so it is probably
  a bug that would only be hidden.

llvm-svn: 264269

8 years agoRemove weird comment [NFC]
Johannes Doerfert [Thu, 24 Mar 2016 13:16:49 +0000 (13:16 +0000)]
Remove weird comment [NFC]

llvm-svn: 264268

8 years agoMake needsPlt a plain function instead of a template.
Rafael Espindola [Thu, 24 Mar 2016 12:55:27 +0000 (12:55 +0000)]
Make needsPlt a plain function instead of a template.

llvm-svn: 264267

8 years ago[OMPT] Fix parallel_id and task_id in loop_end with schedule static
Jonas Hahnfeld [Thu, 24 Mar 2016 12:52:20 +0000 (12:52 +0000)]
[OMPT] Fix parallel_id and task_id in loop_end with schedule static

For serialized parallel regions, wrong ids were reported. Now the same code is
used as in kmp_dispatch.cpp which emits the correct ids.

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

llvm-svn: 264266

8 years ago[OMPT] Test ids reported by ompt_get_{parallel,task}_id
Jonas Hahnfeld [Thu, 24 Mar 2016 12:52:11 +0000 (12:52 +0000)]
[OMPT] Test ids reported by ompt_get_{parallel,task}_id

llvm-svn: 264265

8 years ago[OMPT] Fix duplicate implicit_task_end events for master thread with GCC
Jonas Hahnfeld [Thu, 24 Mar 2016 12:52:04 +0000 (12:52 +0000)]
[OMPT] Fix duplicate implicit_task_end events for master thread with GCC

For non-serialized parallel regions the master thread issued two callbacks:
The first one in kmp_gsupport.c and the second in __kmp_join_call. Therefore
only trigger the callback in kmp_gsupport.c for serialized parallel regions.

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

llvm-svn: 264264

8 years agoFix Sphinx errors with documentation build.
Aaron Ballman [Thu, 24 Mar 2016 12:34:44 +0000 (12:34 +0000)]
Fix Sphinx errors with documentation build.

llvm-svn: 264263

8 years agoMark R_AARCH64_CONDBR19 as relative.
Rafael Espindola [Thu, 24 Mar 2016 12:16:46 +0000 (12:16 +0000)]
Mark R_AARCH64_CONDBR19 as relative.

llvm-svn: 264262

8 years ago[tsan] Fix fork() and fork-based tests for OS X
Kuba Brecka [Thu, 24 Mar 2016 11:54:33 +0000 (11:54 +0000)]
[tsan] Fix fork() and fork-based tests for OS X

On OS X, fork() under TSan asserts (in debug builds only) because REAL(fork) calls some intercepted functions, which check that no internal locks are held via CheckNoLocks(). But the wrapper of fork intentionally holds some locks. This patch fixes that by using ScopedIgnoreInterceptors during the call to REAL(fork). After that, all the fork-based tests seem to pass on OS X, so let's just remove all the UNSUPPORTED: darwin annotations we have.

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

llvm-svn: 264261

8 years ago[X86][XOP] Support for VPPERM byte shuffle instruction
Simon Pilgrim [Thu, 24 Mar 2016 11:52:43 +0000 (11:52 +0000)]
[X86][XOP] Support for VPPERM byte shuffle instruction

This patch begins adding support for lowering to the XOP VPPERM instruction - adding the X86ISD::VPPERM opcode.

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

llvm-svn: 264260

8 years ago[tsan] Use direct syscalls for internal_mmap and internal_munmap on OS X
Kuba Brecka [Thu, 24 Mar 2016 11:50:21 +0000 (11:50 +0000)]
[tsan] Use direct syscalls for internal_mmap and internal_munmap on OS X

On OS X, internal_mmap just uses mmap, which can invoke callbacks into libmalloc (e.g. when MallocStackLogging is enabled). This can subsequently call other intercepted functions, and this breaks our Darwin-specific ThreadState initialization. Let's use direct syscalls in internal_mmap and internal_munmap. Added a testcase.

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

llvm-svn: 264259

8 years ago[mips] Tidy up cnMIPS tablegen definitions. NFC.
Daniel Sanders [Thu, 24 Mar 2016 11:40:48 +0000 (11:40 +0000)]
[mips] Tidy up cnMIPS tablegen definitions. NFC.

Summary:
In particular, make the cnMIPS predicates much more obvious and prefer
  def ... : ... {
    let Foo = bar;
  }
over:
  let Foo = bar in
  def ... : ...;

Reviewers: vkalintiris

Subscribers: dsanders, llvm-commits

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

llvm-svn: 264258

8 years agoRevert "Added support for different VFSs in format::getStyle."
Eric Liu [Thu, 24 Mar 2016 11:25:28 +0000 (11:25 +0000)]
Revert "Added support for different VFSs in format::getStyle."

This reverts commit r264253. It is breaking the buildbot http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/2203

llvm-svn: 264257

8 years agoRevert "removed redundant comment in format::getStyle."
Eric Liu [Thu, 24 Mar 2016 11:24:49 +0000 (11:24 +0000)]
Revert "removed redundant comment in format::getStyle."

This reverts commit r264254.

llvm-svn: 264256

8 years agoFix sequence point warning. NFC.
Vasileios Kalintiris [Thu, 24 Mar 2016 10:53:28 +0000 (10:53 +0000)]
Fix sequence point warning. NFC.

llvm-svn: 264255

8 years agoremoved redundant comment in format::getStyle.
Eric Liu [Thu, 24 Mar 2016 10:50:26 +0000 (10:50 +0000)]
removed redundant comment in format::getStyle.

llvm-svn: 264254

8 years agoAdded support for different VFSs in format::getStyle.
Eric Liu [Thu, 24 Mar 2016 10:50:17 +0000 (10:50 +0000)]
Added support for different VFSs in format::getStyle.

Summary:
Previously, format::getStyle assumes that the given file resides in
the real file system, which prevents the use of virtual file system in testing etc.
This patch adds a parameter in format::getStyle interface so that users can specify
the right file system. By default, the file system is the real file system.

Reviewers: djasper, klimek

Subscribers: cfe-commits, klimek

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

llvm-svn: 264253

8 years agoTest commit access to clang repo.
Eric Liu [Thu, 24 Mar 2016 10:21:00 +0000 (10:21 +0000)]
Test commit access to clang repo.

Summary: Test commit access to clang repo.

Reviewers: cfe-commits

Subscribers: klimek

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

llvm-svn: 264252

8 years ago[clang-tidy] misc-assign-operator-signature checker checks return value of all assign...
Gabor Horvath [Thu, 24 Mar 2016 10:12:08 +0000 (10:12 +0000)]
[clang-tidy] misc-assign-operator-signature checker checks return value of all assign operators

The return value of every assign operator should be Type&, not only for copy and move assign operators.

Patch by Adam Balogh!

Reviewers: hokein, alexfh

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

llvm-svn: 264251

8 years ago[llvm-nm] Fix r264247
James Molloy [Thu, 24 Mar 2016 09:23:51 +0000 (09:23 +0000)]
[llvm-nm] Fix r264247

I committed the test changes successfully but managed to miss the actual code change! (lack of git -a)

llvm-svn: 264249

8 years ago[mips][microMIPS] Add CodeGen support for DIV, MOD, DIVU, MODU, DDIV, DMOD, DDIVU...
Zlatko Buljan [Thu, 24 Mar 2016 09:22:45 +0000 (09:22 +0000)]
[mips][microMIPS] Add CodeGen support for DIV, MOD, DIVU, MODU, DDIV, DMOD, DDIVU and DMODU instructions
Differential Revision: http://reviews.llvm.org/D17137

llvm-svn: 264248

8 years ago[llvm-nm] Correct -P ELF output
James Molloy [Thu, 24 Mar 2016 09:18:09 +0000 (09:18 +0000)]
[llvm-nm] Correct -P ELF output

Correctly add a space between the address and size when outputting in posix mode (-P).

llvm-svn: 264247

8 years ago[mips][microMIPS] Implement MTC*, MTHC* and DMTC* instructions
Hrvoje Varga [Thu, 24 Mar 2016 08:02:09 +0000 (08:02 +0000)]
[mips][microMIPS] Implement MTC*, MTHC* and DMTC* instructions
Differential Revision: http://reviews.llvm.org/D17328

llvm-svn: 264246

8 years ago[mips][microMIPS] Fix for "Cannot copy registers" assertion
Hrvoje Varga [Thu, 24 Mar 2016 06:05:35 +0000 (06:05 +0000)]
[mips][microMIPS] Fix for "Cannot copy registers" assertion
Differential Revision: http://reviews.llvm.org/D17068

llvm-svn: 264245

8 years ago[LAA] Formatting fix in previous change
Adam Nemet [Thu, 24 Mar 2016 05:15:24 +0000 (05:15 +0000)]
[LAA] Formatting fix in previous change

llvm-svn: 264244

8 years ago[LAA] Support memchecks involving loop-invariant addresses
Adam Nemet [Thu, 24 Mar 2016 04:28:47 +0000 (04:28 +0000)]
[LAA] Support memchecks involving loop-invariant addresses

We used to only allow SCEVAddRecExpr for pointer expressions in order to
be able to compute the bounds.  However this is also trivially possible
for loop-invariant addresses (scUnknown) since then the bounds are the
address itself.

Interestingly, we used allow this for the special case when the
loop-invariant address happens to also be an SCEVAddRecExpr (in an outer
loop).

There are a couple more loops that are vectorized in SPEC after this.
My guess is that the main reason we don't see more because for example a
loop-invariant load is vectorized into a splat vector with several
vector-inserts.  This is likely to make the vectorization unprofitable.
I.e. we don't notice that a later LICM will move all of this out of the
loop so the cost estimate should really be 0.

llvm-svn: 264243

8 years ago[OpenCL] Add ocl and spir version for spir target
Xiuli Pan [Thu, 24 Mar 2016 03:57:17 +0000 (03:57 +0000)]
[OpenCL] Add ocl and spir version for spir target

Summary: Add opencl.spir.version and opencl.ocl.version metadata for CodeGen to identify OpenCL version.

Reviewers: yaxunl, Anastasia

Subscribers: cfe-commits, pekka.jaaskelainen

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

llvm-svn: 264241

8 years ago[Support] Add conversions between Expected<T> and ErrorOr<T>.
Lang Hames [Thu, 24 Mar 2016 02:00:10 +0000 (02:00 +0000)]
[Support] Add conversions between Expected<T> and ErrorOr<T>.

More utilities to help with std::error_code -> Error transitions.

llvm-svn: 264238

8 years ago[libFuzzer] don't report memory leaks if we are dying due to a timeout (just use...
Kostya Serebryany [Thu, 24 Mar 2016 01:32:08 +0000 (01:32 +0000)]
[libFuzzer] don't report memory leaks if we are dying due to a timeout (just use _Exit instead of exit in the timeout callback)

llvm-svn: 264237

8 years agoAdd release notes for the removal of the silent include of altivec.h.
Eric Christopher [Thu, 24 Mar 2016 01:28:25 +0000 (01:28 +0000)]
Add release notes for the removal of the silent include of altivec.h.

llvm-svn: 264236

8 years agoThe time when -faltivec (or, on clang only, -maltivec) will magically
Eric Christopher [Thu, 24 Mar 2016 01:26:08 +0000 (01:26 +0000)]
The time when -faltivec (or, on clang only, -maltivec) will magically
include altivec.h has come and gone.

Rationale: This causes modules, rewrite-includes, etc to be sad and
people should just include altivec.h in their source.

llvm-svn: 264235

8 years agoAvoid UB when creating empty atoms. NFC.
Pete Cooper [Thu, 24 Mar 2016 01:16:06 +0000 (01:16 +0000)]
Avoid UB when creating empty atoms.  NFC.

The stack-size.yaml test had an empty atom content array.  This is
legal, but asking a BumpPtrAllocator for 0 sized data may not be
legal.  Instead just avoid requesting any data when we can just return
an empty ArrayRef instead.

llvm-svn: 264234

8 years agoAvoid UB deref of nullptr to reference. NFC.
Pete Cooper [Thu, 24 Mar 2016 01:14:10 +0000 (01:14 +0000)]
Avoid UB deref of nullptr to reference.  NFC.

Its possible for file to have no entry atom which means that there
is no atom to check for being a thumb function.  Instead just skip
the thumb check and set the entry address to 0, which matches the
current behaviour of getting a default initialised int from a map.

llvm-svn: 264233

8 years agoUse a memcpy to avoid unaligned store UB.
Pete Cooper [Thu, 24 Mar 2016 01:05:17 +0000 (01:05 +0000)]
Use a memcpy to avoid unaligned store UB.

On a 32-bit output, we may write LC_MAIN (which contains a uint64_t) to
an unaligned address.  This changes it to use a memcpy instead which is UB safe.

llvm-svn: 264232

8 years agoUse unaligned read to fix UB. NFC.
Pete Cooper [Thu, 24 Mar 2016 01:03:44 +0000 (01:03 +0000)]
Use unaligned read to fix UB.  NFC.

We were casting a potentially unaligned pointer to uint32_t and
dereferencing.  As the pointer ultimately comes from the object file,
there's no way to guarantee alignment, so use the little32_t read instead.

Also, little32_t knows about endianness, so in theory this may have broken on
big endian machines.

llvm-svn: 264231

8 years ago[libFuzzer] use fdopen+vfprintf instead of fsnprintf+write
Kostya Serebryany [Thu, 24 Mar 2016 00:57:32 +0000 (00:57 +0000)]
[libFuzzer] use fdopen+vfprintf instead of fsnprintf+write

llvm-svn: 264230

8 years agoDisplay const/volatile/restrict qualifiers in Visual Studio visualizations
Mike Spertus [Thu, 24 Mar 2016 00:38:54 +0000 (00:38 +0000)]
Display const/volatile/restrict qualifiers in Visual Studio visualizations

llvm-svn: 264229

8 years agoParsed alignment should be a power of 2.
Pete Cooper [Thu, 24 Mar 2016 00:36:37 +0000 (00:36 +0000)]
Parsed alignment should be a power of 2.

The .o path always makes sure to store a power of 2 value in the
Section alignment.  However, the YAML code didn't verify this.

Added verification and updated all the tests which had a 3 but meant
to have 2^3.

llvm-svn: 264228

8 years agoModules builds are necessarily compile actions, but they don't
Eric Christopher [Thu, 24 Mar 2016 00:34:02 +0000 (00:34 +0000)]
Modules builds are necessarily compile actions, but they don't
necessarily produce object files. Turn off split dwarf if we're not
producing a file that the driver believes is an object file.

llvm-svn: 264227

8 years agoNFC: clarify comment on lock-free macros
JF Bastien [Thu, 24 Mar 2016 00:20:44 +0000 (00:20 +0000)]
NFC: clarify comment on lock-free macros

Used by both libstdc++ and libc++.

llvm-svn: 264226

8 years ago[X86][SSE] Added tests to ensure that consecutive loads including any/all volatiles...
Simon Pilgrim [Thu, 24 Mar 2016 00:14:37 +0000 (00:14 +0000)]
[X86][SSE] Added tests to ensure that consecutive loads including any/all volatiles are not combined

llvm-svn: 264225

8 years ago[PS4] Guarantee an instruction after a 'noreturn' call.
Paul Robinson [Thu, 24 Mar 2016 00:10:03 +0000 (00:10 +0000)]
[PS4] Guarantee an instruction after a 'noreturn' call.

We need the "return address" of a noreturn call to be within the
bounds of the calling function; TrapUnreachable turns 'unreachable'
into a 'ud2' instruction, which has that desired effect.

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

llvm-svn: 264224