platform/upstream/llvm.git
8 years agoELF: Add more variants of ignored flags.
Peter Collingbourne [Thu, 31 Mar 2016 21:18:34 +0000 (21:18 +0000)]
ELF: Add more variants of ignored flags.

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

llvm-svn: 265058

8 years ago[CMake] Provide the ability to skip stripping when generating dSYMs
Chris Bieneman [Thu, 31 Mar 2016 21:17:19 +0000 (21:17 +0000)]
[CMake] Provide the ability to skip stripping when generating dSYMs

For debugging it is useful to be able to generate dSYM files but not strip the executables. This change adds the ability to skip stripping by setting COMPILER_RT_EXTERNALIZE_DEBUGINFO_SKIP_STRIP=On.

llvm-svn: 265057

8 years agoDefine a utility function to read -O and lto-O options.
Rui Ueyama [Thu, 31 Mar 2016 21:15:31 +0000 (21:15 +0000)]
Define a utility function to read -O and lto-O options.

llvm-svn: 265056

8 years agoWdocumentation parameter fix
Simon Pilgrim [Thu, 31 Mar 2016 21:13:49 +0000 (21:13 +0000)]
Wdocumentation parameter fix

llvm-svn: 265055

8 years agofix typo; NFC
Sanjay Patel [Thu, 31 Mar 2016 21:00:48 +0000 (21:00 +0000)]
fix typo; NFC

llvm-svn: 265054

8 years agoELF: Add flag for controlling LTO optimization level.
Peter Collingbourne [Thu, 31 Mar 2016 21:00:27 +0000 (21:00 +0000)]
ELF: Add flag for controlling LTO optimization level.

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

llvm-svn: 265053

8 years agoFixed signed/unsigned warning
Simon Pilgrim [Thu, 31 Mar 2016 20:57:36 +0000 (20:57 +0000)]
Fixed signed/unsigned warning

llvm-svn: 265052

8 years ago[AArch64] Allow loads with imp-def to be handled in getMemOpBaseRegImmOfsWidth()
Jun Bum Lim [Thu, 31 Mar 2016 20:53:47 +0000 (20:53 +0000)]
[AArch64] Allow loads with imp-def to be handled in getMemOpBaseRegImmOfsWidth()

Summary:
This change will allow loads with imp-def to be clustered in machine-scheduler pass.
areMemAccessesTriviallyDisjoint() can also handle loads with imp-def.

Reviewers: mcrosier, jmolloy, t.p.northover

Subscribers: aemerson, rengolin, mcrosier, llvm-commits

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

llvm-svn: 265051

8 years agoAdd disk_space() to llvm::fs
Mehdi Amini [Thu, 31 Mar 2016 20:48:27 +0000 (20:48 +0000)]
Add disk_space() to llvm::fs

Summary: Adapted from Boost::filesystem.

Reviewers: bruno, silvas

Subscribers: tberghammer, danalbert, llvm-commits, srhines

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

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 265050

8 years ago[PowerPC] Cleanup test/CodeGen/PowerPC/qpx-load-splat.ll
Hal Finkel [Thu, 31 Mar 2016 20:45:00 +0000 (20:45 +0000)]
[PowerPC] Cleanup test/CodeGen/PowerPC/qpx-load-splat.ll

Removing unnecessary attributes and metadata...

llvm-svn: 265049

8 years ago[x86] add memset tests to show another potential improvement
Sanjay Patel [Thu, 31 Mar 2016 20:40:32 +0000 (20:40 +0000)]
[x86] add memset tests to show another potential improvement

llvm-svn: 265048

8 years ago[PowerPC] Add a late MI-level pass for QPX load/splat simplification
Hal Finkel [Thu, 31 Mar 2016 20:39:41 +0000 (20:39 +0000)]
[PowerPC] Add a late MI-level pass for QPX load/splat simplification

Chapter 3 of the QPX manual states that, "Scalar floating-point load
instructions, defined in the Power ISA, cause a replication of the source data
across all elements of the target register." Thus, if we have a load followed
by a QPX splat (from the first lane), the splat is redundant. This adds a late
MI-level pass to remove the redundant splats in some of these cases
(specifically when both occur in the same basic block).

This optimization is scheduled just prior to post-RA scheduling. It can't happen
before anything that might replace the load with some already-computed quantity
(i.e. store-to-load forwarding).

llvm-svn: 265047

8 years agoRevert r265039 "[X86] Merge adjacent stack adjustments in eliminateCallFramePseudoIns...
Hans Wennborg [Thu, 31 Mar 2016 20:27:30 +0000 (20:27 +0000)]
Revert r265039 "[X86] Merge adjacent stack adjustments in eliminateCallFramePseudoInstr (PR27140)"

I think it might have caused these build breakages:
http://lab.llvm.org:8011/builders/clang-x86-win2008-selfhost/builds/7234/steps/build%20stage%202/logs/stdio
http://lab.llvm.org:8011/builders/sanitizer-windows/builds/19566/steps/run%20tests/logs/stdio

llvm-svn: 265046

8 years ago[X86][SSE] Some basic tests for variable shuffles
Simon Pilgrim [Thu, 31 Mar 2016 20:26:30 +0000 (20:26 +0000)]
[X86][SSE] Some basic tests for variable shuffles

We don't really support non-constant shuffle masks, but these tests are for cases where BUILD_VECTOR is made up from vector extracts (as well as undef/zero scalars).

llvm-svn: 265045

8 years agolld: accept and ignore _fbsd suffix in emulation name
Ed Maste [Thu, 31 Mar 2016 20:26:30 +0000 (20:26 +0000)]
lld: accept and ignore _fbsd suffix in emulation name

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

llvm-svn: 265044

8 years agoPreserve extern_weak linkage in CloneModule.
Evgeniy Stepanov [Thu, 31 Mar 2016 20:21:31 +0000 (20:21 +0000)]
Preserve extern_weak linkage in CloneModule.

Only force "extern" linkage if the function used to be a definition
in the source module. Declarations keep their original linkage.

llvm-svn: 265043

8 years ago[index] Fix regression where ObjC method declarations may mistakenly get indexed...
Argyrios Kyrtzidis [Thu, 31 Mar 2016 20:18:22 +0000 (20:18 +0000)]
[index] Fix regression where ObjC method declarations may mistakenly get indexed as definition.

rdar://25372906

llvm-svn: 265042

8 years ago[CMake] Provide the ability to skip stripping when generating dSYMs
Chris Bieneman [Thu, 31 Mar 2016 20:03:19 +0000 (20:03 +0000)]
[CMake] Provide the ability to skip stripping when generating dSYMs

For debugging it is useful to be able to generate dSYM files but not strip the executables. This change adds the ability to skip stripping by setting LLVM_EXTERNALIZE_DEBUGINFO_SKIP_STRIP=On.

llvm-svn: 265041

8 years ago[ARM] Expand v1i64 and v2i64 ctpop.
Benjamin Kramer [Thu, 31 Mar 2016 19:42:04 +0000 (19:42 +0000)]
[ARM] Expand v1i64 and v2i64 ctpop.

The default is legal, which results in 'Cannot select' errors. This is
triggered during selfhost due to a recent cost model change.

llvm-svn: 265040

8 years ago[X86] Merge adjacent stack adjustments in eliminateCallFramePseudoInstr (PR27140)
Hans Wennborg [Thu, 31 Mar 2016 19:26:24 +0000 (19:26 +0000)]
[X86] Merge adjacent stack adjustments in eliminateCallFramePseudoInstr (PR27140)

For code such as:

  void f(int, int);
  void g() {
      f(1, 2);
  }

compiled for 32-bit X86 Linux, Clang would previously generate:

  subl    $12, %esp
  subl    $8, %esp
  pushl   $2
  pushl   $1
  calll   f
  addl    $16, %esp
  addl    $12, %esp
  retl

This patch fixes that by merging adjacent stack adjustments in
eliminateCallFramePseudoInstr().

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

llvm-svn: 265039

8 years agoDiagnostics: remove dodgy handler for bitcode inlineasm diagnostics.
Tim Northover [Thu, 31 Mar 2016 19:19:24 +0000 (19:19 +0000)]
Diagnostics: remove dodgy handler for bitcode inlineasm diagnostics.

Whatever crash it was there to present appears to have been fixed in the
backend now, and it had the nasty side-effect of causing clang to exit(0) and
leave a .o containing goodness knows what even when an error hit.

llvm-svn: 265038

8 years ago[PGO] Avoid instrumenting constants at value sites
Betul Buyukkurt [Thu, 31 Mar 2016 18:41:34 +0000 (18:41 +0000)]
[PGO] Avoid instrumenting constants at value sites

Value profiling should not profile constants and/or constant
expressions when they appear as callees in call instructions.
Constant expressions form when a direct callee has bitcasts or
inttoptr(ptrtint (callee)) nests surrounding it. Value profiling
should avoid instrumenting such cases. Mostly NFC.

llvm-svn: 265037

8 years agoChange eliminateCallFramePseudoInstr() to return an iterator
Hans Wennborg [Thu, 31 Mar 2016 18:33:38 +0000 (18:33 +0000)]
Change eliminateCallFramePseudoInstr() to return an iterator

This will become necessary in a subsequent change to make this method
merge adjacent stack adjustments, i.e. it might erase the previous
and/or next instruction.

It also greatly simplifies the calls to this function from Prolog-
EpilogInserter. Previously, that had a bunch of logic to resume iteration
after the call; now it just continues with the returned iterator.

Note that this changes the behaviour of PEI a little. Previously,
it attempted to re-visit the new instruction created by
eliminateCallFramePseudoInstr(). That code was added in r36625,
but I can't see any reason for it: the new instructions will obviously
not be pseudo instructions, they will not have FrameIndex operands,
and we have already accounted for the stack adjustment.

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

llvm-svn: 265036

8 years agoFix the comment for the function added in r264998.
Akira Hatanaka [Thu, 31 Mar 2016 18:32:38 +0000 (18:32 +0000)]
Fix the comment for the function added in r264998.

llvm-svn: 265035

8 years ago[lit][googletest] Handle upstream gtest output
Daniel Dunbar [Thu, 31 Mar 2016 18:22:55 +0000 (18:22 +0000)]
[lit][googletest] Handle upstream gtest output

Summary:
Upstream googletest prints "Running main() from gtest_main.cc" to stdout prior
to running tests. LLVM removed that print statement in r61540. If a user were
to use lit to run tests that use upstream googletest, however, lit
reports "Running main()" as an invalid test name.

To avoid such a failure, add an extra conditional to `formats/googletest.py`.
Also add tests to demonstrate the modified behavior.

Reviewers: abdulras, ddunbar

Subscribers: ddunbar, llvm-commits, kastiglione

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

llvm-svn: 265034

8 years ago[clang-tidy] Add a new checker to detect missing comma in initializer list.
Etienne Bergeron [Thu, 31 Mar 2016 18:12:23 +0000 (18:12 +0000)]
[clang-tidy] Add a new checker to detect missing comma in initializer list.

Summary:
This checker is able to detect missing comma in
an array of string literals.

```
  const char* A[] = {
    "abc",
    "def"   // missing comma (no compiler warnings)
    "ghi",
  };
```

The ratio of false-positive is reduced by restricting the
size of the array considered and the ratio of missing
comma.

To validate the quantity of false positive, the checker
was tried over LLVM and chromium code and detected these
cases:

[[ http://reviews.llvm.org/D18454 | http://reviews.llvm.org/D18454 ]]
[[https://codereview.chromium.org/1807753002/ | https://codereview.chromium.org/1807753002/]]
[[https://codereview.chromium.org/1826193002/ | https://codereview.chromium.org/1826193002/]]
[[https://codereview.chromium.org/1805713002/ | https://codereview.chromium.org/1805713002/]]

Reviewers: alexfh

Subscribers: LegalizeAdulthood, szdominik, xazax.hun, cfe-commits

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

llvm-svn: 265033

8 years ago[lanai] isBrImm should accept any non-constant immediate.
Jacques Pienaar [Thu, 31 Mar 2016 17:58:55 +0000 (17:58 +0000)]
[lanai] isBrImm should accept any non-constant immediate.

isBrImm should accept any non-constant immediate. Previously it was only accepting LanaiMCExpr ones which was wrong.

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

llvm-svn: 265032

8 years ago[PPC] basic support for Power 9 direct move instructions
Ehsan Amiri [Thu, 31 Mar 2016 17:47:17 +0000 (17:47 +0000)]
[PPC] basic support for Power 9 direct move instructions

http://reviews.llvm.org/D18097

Initial support does not include any patterns to generate this instructions

llvm-svn: 265031

8 years ago[PGO] use emplace_back. NFC.
Rong Xu [Thu, 31 Mar 2016 17:39:33 +0000 (17:39 +0000)]
[PGO] use emplace_back. NFC.

Use emplace_back instead of push_back for simplicity.

llvm-svn: 265030

8 years ago[x86] use SSE/AVX ops for non-zero memsets (PR27100)
Sanjay Patel [Thu, 31 Mar 2016 17:30:06 +0000 (17:30 +0000)]
[x86] use SSE/AVX ops for non-zero memsets (PR27100)

Move the memset check down to the CPU-with-slow-SSE-unaligned-memops case: this allows fast
targets to take advantage of SSE/AVX instructions and prevents slow targets from stepping
into a codegen sinkhole while trying to splat a byte into an XMM reg.

Follow-on bugs exposed by the current codegen are:
https://llvm.org/bugs/show_bug.cgi?id=27141
https://llvm.org/bugs/show_bug.cgi?id=27143

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

llvm-svn: 265029

8 years ago[AMDGPU] enable few disassembler tests that were mistakenly marked as FIXME.
Valery Pykhtin [Thu, 31 Mar 2016 17:28:46 +0000 (17:28 +0000)]
[AMDGPU] enable few disassembler tests that were mistakenly marked as FIXME.

llvm-svn: 265028

8 years agoMore checks in win32-seh-nested-finally.ll after comment on r264966
Hans Wennborg [Thu, 31 Mar 2016 16:42:10 +0000 (16:42 +0000)]
More checks in win32-seh-nested-finally.ll after comment on r264966

llvm-svn: 265027

8 years ago[PowerPC] Attempt to fix fast-isel-i64offset.ll failure
Ulrich Weigand [Thu, 31 Mar 2016 16:38:57 +0000 (16:38 +0000)]
[PowerPC] Attempt to fix fast-isel-i64offset.ll failure

The test case added in r265023 is failing on ninja-x64-msvc-RA-centos6.
Update the test to make less specific assumptions on code generation.

llvm-svn: 265026

8 years agoMinor code cleanup /NFC
Xinliang David Li [Thu, 31 Mar 2016 16:22:17 +0000 (16:22 +0000)]
Minor code cleanup /NFC

llvm-svn: 265025

8 years agoDon't use potentially invalidated iterator
Stephan Bergmann [Thu, 31 Mar 2016 15:42:01 +0000 (15:42 +0000)]
Don't use potentially invalidated iterator

If the lhs is evaluated before the rhs, FuncletI's operator-> can trigger the

  assert(isHandleInSync() && "invalid iterator access!");

at include/llvm/ADT/DenseMap.h:1061.  (Happens e.g. when compiled with GCC 6.)

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

llvm-svn: 265024

8 years ago[PowerPC] Correctly compute 64-bit offsets in fast isel
Ulrich Weigand [Thu, 31 Mar 2016 15:37:06 +0000 (15:37 +0000)]
[PowerPC] Correctly compute 64-bit offsets in fast isel

PPCSimplifyAddress contains this code:

  IntegerType *OffsetTy = ((VT == MVT::i32) ? Type::getInt32Ty(*Context)
                                            : Type::getInt64Ty(*Context));

to determine the type to be used for an index register, if one needs
to be created.  However, the "VT" here is the type of the data being
loaded or stored, *not* the type of an address.  This means that if
a data element of type i32 is accessed using an index that does not
not fit into 32 bits, a wrong address is computed here.

Note that PPCFastISel is only ever used on 64-bit currently, so the type
of an address is actually *always* MVT::i64.  Other parts of the code,
even in this same PPCSimplifyAddress routine, already rely on that fact.
Thus, this patch changes the code to simply unconditionally use
Type::getInt64Ty(*Context) as OffsetTy.

llvm-svn: 265023

8 years ago[PowerPC] Basic support for P9 atomic loads and stores
Nemanja Ivanovic [Thu, 31 Mar 2016 15:26:37 +0000 (15:26 +0000)]
[PowerPC] Basic support for P9 atomic loads and stores

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

This patch provides asm implementation for the following instructions:
lwat, ldat, stwat, stdat, ldmx, mcrxrx

llvm-svn: 265022

8 years ago[AArch64] Handle missing store pair opportunity
Jun Bum Lim [Thu, 31 Mar 2016 14:47:24 +0000 (14:47 +0000)]
[AArch64] Handle missing store pair opportunity

Summary:
This change will handle missing store pair opportunity where the first store
instruction stores zero followed by the non-zero store. For example, this change
will convert :

  str wzr, [x8]
  str w1, [x8, #4]
into:
  stp wzr, w1, [x8]

Reviewers: jmolloy, t.p.northover, mcrosier

Subscribers: flyingforyou, aemerson, rengolin, mcrosier, llvm-commits

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

llvm-svn: 265021

8 years ago[PowerPC] Remove incorrect use of COPY_TO_REGCLASS in fast isel
Ulrich Weigand [Thu, 31 Mar 2016 14:44:50 +0000 (14:44 +0000)]
[PowerPC] Remove incorrect use of COPY_TO_REGCLASS in fast isel

The fast isel pass currently emits a COPY_TO_REGCLASS node to convert
from a F4RC to a F8RC register class during conversion of a
floating-point number to integer. There is actually no support in the
common code instruction printers to emit COPY_TO_REGCLASS nodes, so the
PowerPC back-end has special code there to simply ignore
COPY_TO_REGCLASS.

This is correct *if and only if* the source and destination registers of
COPY_TO_REGCLASS are the same (except for the different register class).
But nothing guarantees this to be the case, and if the register
allocator does end up allocating source and destination to different
registers after all, the back-end simply generates incorrect code. I've
included a test case that shows such incorrect code generation.

However, it seems that COPY_TO_REGCLASS is actually not intended to be
used at the MI layer at all. It is used during SelectionDAG, but always
lowered to a plain COPY before emitting MI. Other back-end's fast isel
passes never emit COPY_TO_REGCLASS at all. I suspect it is simply wrong
for the PowerPC back-end to emit it here.

This patch changes the PowerPC back-end to directly emit COPY instead of
COPY_TO_REGCLASS and removes the special handling in the instruction
printers.

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

llvm-svn: 265020

8 years ago[mips] Range check simm16
Daniel Sanders [Thu, 31 Mar 2016 14:34:00 +0000 (14:34 +0000)]
[mips] Range check simm16

Summary:
There are too many instructions to exhaustively test so addiu and lwc2 are
used as representative examples.

It should be noted that many memory instructions that should have simm16
range checking do not because it is also necessary to support the macro
of the same name which accepts simm32. The range checks for these occur in
the macro expansion.

Reviewers: vkalintiris

Subscribers: dsanders, llvm-commits

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

llvm-svn: 265019

8 years ago[mips] Range check simm11 and mem_simm11.
Daniel Sanders [Thu, 31 Mar 2016 14:23:20 +0000 (14:23 +0000)]
[mips] Range check simm11 and mem_simm11.

Summary:
ldc2/sdc2 now emit slightly worse diagnostics for MIPS-I. The problem
is that they don't trigger the custom parser because all the candidates
are disabled by feature bits. On all other subtargets, the diagnostics are
accurate but are subject to the usual issues of needing to report multiple
ways to correct the code (e.g. smaller offset, enable a CPU feature) but
only being able to report one error.

Reviewers: vkalintiris

Subscribers: dsanders, llvm-commits

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

llvm-svn: 265018

8 years agoDon't vary debug info for lldb-server tests
Pavel Labath [Thu, 31 Mar 2016 14:22:52 +0000 (14:22 +0000)]
Don't vary debug info for lldb-server tests

Summary:
Debug info is used only by the client and lldb-server tests do not even have the client component
running, as they communicate with the server directly. Therefore, running the tests for each
debug info type is unnecessarry.

This adds general ability to mark a test class as not dependent on debug info, and marks all
lldb-server tests as such.

Reviewers: tberghammer, tfiala

Subscribers: lldb-commits

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

llvm-svn: 265017

8 years ago[IFUNC] Introduce GlobalIndirectSymbol as a base class for alias and ifunc
Dmitry Polukhin [Thu, 31 Mar 2016 14:16:21 +0000 (14:16 +0000)]
[IFUNC] Introduce GlobalIndirectSymbol as a base class for alias and ifunc

This patch is a part of http://reviews.llvm.org/D15525

GlobalIndirectSymbol class contains common implementation for both
aliases and ifuncs. This patch should be NFC change that just prepare
common code for ifunc support.

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

llvm-svn: 265016

8 years ago[AMDGPU] Disassembler: support for DPP
Sam Kolton [Thu, 31 Mar 2016 14:15:04 +0000 (14:15 +0000)]
[AMDGPU] Disassembler: support for DPP

Review: http://reviews.llvm.org/D18642
llvm-svn: 265015

8 years ago[mips] Split mem_msa into range checked mem_simm10 and mem_simm10_lsl[123]
Daniel Sanders [Thu, 31 Mar 2016 14:12:01 +0000 (14:12 +0000)]
[mips] Split mem_msa into range checked mem_simm10 and mem_simm10_lsl[123]

Summary:
Also, made test_mi10.s formatting consistent with the majority of the
MC tests.

Reviewers: vkalintiris

Subscribers: dsanders, llvm-commits

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

llvm-svn: 265014

8 years agoPrevent X86ISelLowering from merging volatile loads
Nirav Dave [Thu, 31 Mar 2016 13:40:55 +0000 (13:40 +0000)]
Prevent X86ISelLowering from merging volatile loads

Change isConsecutiveLoads to check that loads are non-volatile as this
is a requirement for any load merges. Propagate change to two callers.

Reviewers: RKSimon

Subscribers: llvm-commits

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

llvm-svn: 265013

8 years agoPass a const SymbolBody to needsGot. NFC.
Rafael Espindola [Thu, 31 Mar 2016 13:38:28 +0000 (13:38 +0000)]
Pass a const SymbolBody to needsGot. NFC.

llvm-svn: 265012

8 years agoFix DWO breakage in r264909
Pavel Labath [Thu, 31 Mar 2016 13:30:04 +0000 (13:30 +0000)]
Fix DWO breakage in r264909

Summary:
In case of Dwo, DIERef stores a compile unit offset in the main object file, and not in the dwo.
The implementation of SymbolFileDWARFDwo::GetDIE inherited from SymbolFileDWARF tried to lookup
the compilation unit in the DWO based on the main object file offset (and failed). I change the
implementation to verify the DIERef indeed references compile unit belonging to this dwo and then
lookup the die based on the die offset alone.

Includes a couple of fixes for mismatched struct/class tags.

Reviewers: tberghammer, clayborg

Subscribers: lldb-commits

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

llvm-svn: 265011

8 years ago[mips] Range check simm9 and fix a bug this revealed.
Daniel Sanders [Thu, 31 Mar 2016 13:15:23 +0000 (13:15 +0000)]
[mips] Range check simm9 and fix a bug this revealed.

Summary:
The bug was that microMIPS's [ls]w[lr]e instructions claimed to support a
12-bit offset when it is only 9-bit.

Reviewers: vkalintiris

Subscribers: llvm-commits, dsanders

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

llvm-svn: 265010

8 years agoFix the alignment check.
Rafael Espindola [Thu, 31 Mar 2016 12:09:36 +0000 (12:09 +0000)]
Fix the alignment check.

We have to check the final value that is written.

I don't think this has any real word implications (unless something
supports unaligned instructions), but unblocks simplifying the handling
of PC relative relocations.

llvm-svn: 265009

8 years ago[docs] Fix a typo, change the style of the clang-tidy release notes a bit.
Alexander Kornienko [Thu, 31 Mar 2016 12:06:54 +0000 (12:06 +0000)]
[docs] Fix a typo, change the style of the clang-tidy release notes a bit.

llvm-svn: 265008

8 years agonote for top-level consts in function decls tidy
Alexander Kornienko [Thu, 31 Mar 2016 12:06:47 +0000 (12:06 +0000)]
note for top-level consts in function decls tidy

Summary: Add missing release note

Reviewers: alexfh

Subscribers: LegalizeAdulthood, cfe-commits

Patch by Matt Kulukundis!

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

llvm-svn: 265007

8 years ago[OpenCL] Added nosvm attribute for OpenCL v2.0.
Anastasia Stulova [Thu, 31 Mar 2016 11:07:22 +0000 (11:07 +0000)]
[OpenCL] Added nosvm attribute for OpenCL v2.0.

It is not widely used and removed from OpenCL v2.1.

This change modifies Clang to parse the attribute for OpenCL
but ignores it afterwards.

Patch by Liu Yaxun (Sam)!

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

llvm-svn: 265006

8 years ago[TTI] Let the cost model estimate ctpop costs based on legality
Benjamin Kramer [Thu, 31 Mar 2016 10:42:40 +0000 (10:42 +0000)]
[TTI] Let the cost model estimate ctpop costs based on legality

PPC has a vector popcount, this lets the vectorizer use the correct cost
for it. Tweak X86 test to use an intrinsic that's actually scalarized (we
have a somewhat efficient lowering for vector popcount using SSE, the
cost model finds that now).

llvm-svn: 265005

8 years ago[OPENMP] Support dumping OpenMP specific constructs.
Alexey Bataev [Thu, 31 Mar 2016 09:30:50 +0000 (09:30 +0000)]
[OPENMP] Support dumping OpenMP specific constructs.

Add proper dumping support for OpenMP declarations, directives and
clauses.

llvm-svn: 265004

8 years ago[OPENMP] Allow skip expression after comma in clauses with lists.
Alexey Bataev [Thu, 31 Mar 2016 09:13:44 +0000 (09:13 +0000)]
[OPENMP] Allow skip expression after comma in clauses with lists.

Compatibility fix for better compatibility with the existing software.

llvm-svn: 265003

8 years ago[mips][microMIPS] Implement MFC*, MFHC* and DMFC* instructions
Zlatko Buljan [Thu, 31 Mar 2016 08:51:24 +0000 (08:51 +0000)]
[mips][microMIPS] Implement MFC*, MFHC* and DMFC* instructions
Differential Revision: http://reviews.llvm.org/D17334

llvm-svn: 265002

8 years agoSilence warnings in OCaml bindings
Jeroen Ketema [Thu, 31 Mar 2016 08:39:42 +0000 (08:39 +0000)]
Silence warnings in OCaml bindings

* LLVMDisposeMessage lives in llvm-c/Core.h, include this file where necessary
* LLVMAddTargetData has been removed, follow suit in the bindings

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

llvm-svn: 265001

8 years agoIndentation fix in SystemZInstrInfo.cpp
Jonas Paulsson [Thu, 31 Mar 2016 08:00:14 +0000 (08:00 +0000)]
Indentation fix in SystemZInstrInfo.cpp

llvm-svn: 265000

8 years ago[CodeGenCXX] Fix ItaniumCXXABI::getAlignmentOfExnObject to return 8-byte
Akira Hatanaka [Thu, 31 Mar 2016 06:36:07 +0000 (06:36 +0000)]
[CodeGenCXX] Fix ItaniumCXXABI::getAlignmentOfExnObject to return 8-byte
alignment on Darwin.

Itanium C++ ABI specifies that _Unwind_Exception should be double-word
aligned (16B). To conform to the ABI, libraries implementing exception
handling declare the struct with __attribute__((aligned)), which aligns
the unwindHeader field (and the end of __cxa_exception) to the default
target alignment (which is typically 16-bytes).

struct __cxa_exception {
  ...
  // struct is declared with __attribute__((aligned)).
  _Unwind_Exception unwindHeader;
};

Based on the assumption that _Unwind_Exception is declared with
__attribute__((aligned)), ItaniumCXXABI::getAlignmentOfExnObject returns
the target default alignment for __attribute__((aligned)). It turns out
that libc++abi, which is used on Darwin, doesn't declare the struct with
the attribute and therefore doesn't guarantee that unwindHeader is
aligned to the alignment specified by the ABI, which in some cases
causes the program to crash because of unaligned memory accesses.

This commit avoids crashes due to unaligned memory accesses by having
getAlignmentOfExnObject return an 8-byte alignment on Darwin. I've only
fixed the problem for Darwin, but we should also figure out whether other
platforms using libc++abi need similar fixes.

rdar://problem/25314277

Differential revision: http://reviews.llvm.org/D18479

llvm-svn: 264998

8 years agoVisual Studio native visualization for clang::TemplateDecl
Mike Spertus [Thu, 31 Mar 2016 06:09:56 +0000 (06:09 +0000)]
Visual Studio native visualization for clang::TemplateDecl

With this change, TemplateDecls display in the Locals Window something like

  template<typename T, typename U> struct A;

llvm-svn: 264997

8 years ago[InstCombine] Fix incorrect rule from rL236202
Sanjoy Das [Thu, 31 Mar 2016 05:14:34 +0000 (05:14 +0000)]
[InstCombine] Fix incorrect rule from rL236202

The rule for SMIN introduced in rL236202 doesn't work as advertised: the
check for Pred == ICmpInst::ICMP_SGT was missing.

llvm-svn: 264996

8 years agoDelete trailing whitespace
Sanjoy Das [Thu, 31 Mar 2016 05:14:29 +0000 (05:14 +0000)]
Delete trailing whitespace

llvm-svn: 264995

8 years ago[SCEV] Track NoWrap properties using MatchBinaryOp, NFC
Sanjoy Das [Thu, 31 Mar 2016 05:14:26 +0000 (05:14 +0000)]
[SCEV] Track NoWrap properties using MatchBinaryOp, NFC

This way once we teach MatchBinaryOp to map more things into arithmetic,
the non-wrapping add recurrence construction would understand it too.
Right now MatchBinaryOp still only understands arithmetic, so this is
solely a code-reorganization change.

llvm-svn: 264994

8 years ago[SCEV] NFC code motion to simplify later change
Sanjoy Das [Thu, 31 Mar 2016 05:14:22 +0000 (05:14 +0000)]
[SCEV] NFC code motion to simplify later change

llvm-svn: 264993

8 years ago[X86] Use MVT instead of EVT in code called after legalization.
Craig Topper [Thu, 31 Mar 2016 04:37:41 +0000 (04:37 +0000)]
[X86] Use MVT instead of EVT in code called after legalization.

llvm-svn: 264992

8 years agoFix -Wdynamic-class-memaccess to skip invalid classes.
Richard Trieu [Thu, 31 Mar 2016 04:18:07 +0000 (04:18 +0000)]
Fix -Wdynamic-class-memaccess to skip invalid classes.

This warning sometimes will infinitely recurse on CXXRecordDecl's from
ill-formed recursive classes that have fields of themselves.  Skip processing
these classes to prevent this from happening.
Fixes https://llvm.org/bugs/show_bug.cgi?id=27142

llvm-svn: 264991

8 years ago[DebugInfo] Subprograms should belong to a CU.
Davide Italiano [Thu, 31 Mar 2016 03:40:07 +0000 (03:40 +0000)]
[DebugInfo] Subprograms should belong to a CU.

Start fixing tests accordingly. There are still
about 35 failures before we can enable this check
in the IR verifier.

llvm-svn: 264990

8 years agoFix LWG issue 2469 - Use piecewise construction in map::operator[].
Eric Fiselier [Thu, 31 Mar 2016 03:13:37 +0000 (03:13 +0000)]
Fix LWG issue 2469 - Use piecewise construction in map::operator[].

map's allocator may only be used to construct objects of 'value_type',
or in this case 'pair<const Key, Value>'. In order to respect this requirement
in operator[], which requires default constructing the 'mapped_type', we have
to use pair's piecewise constructor with '(tuple<Kep>, tuple<>)'.

Unfortunately we still need to provide a fallback implementation for C++03
since we don't have <tuple>. Even worse this fallback is the last remaining
user of '__hash_map_node_destructor' and '__construct_node_with_key'.

This patch also switches try_emplace over to __tree.__emplace_unique_key_args.

llvm-svn: 264989

8 years ago[PowerPC] Load two floats directly instead of using one 64-bit integer load
Hal Finkel [Thu, 31 Mar 2016 02:56:05 +0000 (02:56 +0000)]
[PowerPC] Load two floats directly instead of using one 64-bit integer load

When dealing with complex<float>, and similar structures with two
single-precision floating-point numbers, especially when such things are being
passed around by value, we'll sometimes end up loading both float values by
extracting them from one 64-bit integer load. It looks like this:

  t13: i64,ch = load<LD8[%ref.tmp]> t0, t6, undef:i64
      t16: i64 = srl t13, Constant:i32<32>
    t17: i32 = truncate t16
  t18: f32 = bitcast t17
    t19: i32 = truncate t13
  t20: f32 = bitcast t19

The problem, especially before the P8 where those bitcasts aren't legal (and
get expanded via the stack), is that it would have been better to use two
floating-point loads directly. Here we add a target-specific DAGCombine to do
just that. In short, we turn:

ld 3, 0(5)
stw 3, -8(1)
rldicl 3, 3, 32, 32
stw 3, -4(1)
lfs 3, -4(1)
lfs 0, -8(1)

into:

        lfs 3, 4(5)
        lfs 0, 0(5)

llvm-svn: 264988

8 years ago[DarwinDriver] Increase the number of valid digits for ld64 version string.
Bruno Cardoso Lopes [Thu, 31 Mar 2016 02:45:46 +0000 (02:45 +0000)]
[DarwinDriver] Increase the number of valid digits for ld64 version string.

Previously only 3 digits were valid. Increase it to 5.

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

rdar://problem/24843016

llvm-svn: 264987

8 years agoTeach __tree how to handle map's __value_type
Eric Fiselier [Thu, 31 Mar 2016 02:15:15 +0000 (02:15 +0000)]
Teach __tree how to handle map's __value_type

This patch is fairly large and contains a number of changes. The changes all work towards
allowing __tree to properly handle __value_type esspecially when inserting into the __tree.
I chose not to break this change into smaller patches because it wouldn't be possible to
write meaningful standard-compliant tests for each patch.

It is very similar to r260513 "[libcxx] Teach __hash_table how to handle unordered_map's __hash_value_type".

Changes in <map>
 * Remove __value_type's constructors because it should never be constructed directly.

 * Make map::emplace and multimap::emplace forward to __tree and remove the old definitions

 * Remove "__construct_node" map and multimap member functions. Almost all of the construction is done within __tree.

 * Fix map's move constructor to access "__value_type.__nc" directly and pass this object to __tree::insert.

Changes in <__tree>
 * Add traits to detect, handle, and unwrap, map's "__value_type".

 * Convert methods taking "value_type" to take "__container_value_type" instead. Previously these methods caused
  unwanted implicit conversions from "std::pair<Key, Value>" to "__value_type<Key, Value>".

 * Delete __tree_node and __tree_node_base's constructors and assignment operators. The node types should never be constructed
   because the "__value_" member of __tree_node must be constructed directly by the allocator.

 * Make the __tree_node_destructor class and "__construct_node" methods unwrap "__node_value_type" into "__container_value_type" before invoking the allocator. The user's allocator can only be used to construct and destroy the container's value_type. Passing it map's "__value_type" was incorrect.

 * Cleanup the "__insert" and "__emplace" methods. Have __insert forward to an __emplace function wherever possible to reduce
   code duplication. __insert_unique(value_type const&) and __insert_unique(value_type&&) forward to __emplace_unique_key_args.
   These functions will not allocate a new node if the value is already in the tree.

 * Change the __find* functions to take the "key_type" directly instead of passing in "value_type" and unwrapping the key later.
   This change allows the find functions to be used without having to construct a "value_type" first. This allows for a number
   of optimizations.

 * Teach __move_assign and __assign_multi methods to unwrap map's __value_type.

llvm-svn: 264986

8 years agoUpdate container_test_types.h and cleanup the related tests
Eric Fiselier [Thu, 31 Mar 2016 02:13:14 +0000 (02:13 +0000)]
Update container_test_types.h and cleanup the related tests

llvm-svn: 264985

8 years agoFix case confusion.
Sean Silva [Thu, 31 Mar 2016 01:47:33 +0000 (01:47 +0000)]
Fix case confusion.

The test case was defining and using a function 'notExported()', but
the FileCheck checks were checking for the name 'not_exported'. This
changes the test to use 'notExported' across the board. Also, the test
defined a function 'not_defined()', but doesn't have any checks related
to it. For consistency, this name is changed to 'notDefined'. A later
commit will add checks for 'notDefined'.

Patch by Warren Ristow!

llvm-svn: 264984

8 years agoRevert "Remove useless unreachable. Switch coverage already gives us this. NFC"
Pete Cooper [Thu, 31 Mar 2016 01:23:23 +0000 (01:23 +0000)]
Revert "Remove useless unreachable.  Switch coverage already gives us this.  NFC"

This reverts commit r264945.

The commit only removed an unreachable in a method with a covered switch, but
GCC is likely to warn on this, and the coding standards recommend just leaving
in the unreachable.

llvm-svn: 264983

8 years agoRemove unused variants of make_dynamic_error_code. NFC.
Pete Cooper [Thu, 31 Mar 2016 01:21:50 +0000 (01:21 +0000)]
Remove unused variants of make_dynamic_error_code.  NFC.

make_dynamic_error_code was used to create a std::error_code with
a std::string message.  Now that we are migrating to llvm::Error,
there are no calls to these make_dynamic_error_code methods.

There is one single call to make_dynamic_error_code remaining, the one
inside GenericError::convertToErrorCode().  That method is only called
from File::doParse() which should be a temporary situation.  We need
to work out how to deal with File::parse() caching the error result from
doParse().  Caching errors isn't supported in the new scheme, and probably
isn't needed here, but we need to work that out.

Once thats done, dynamic error and all utilities around it can be deleted.

llvm-svn: 264982

8 years agoUse Expected<T> instead of ErrorOr<T>in yaml reader. NFC
Pete Cooper [Thu, 31 Mar 2016 01:13:04 +0000 (01:13 +0000)]
Use Expected<T> instead of ErrorOr<T>in yaml reader.  NFC

llvm-svn: 264981

8 years agoAdd --help and --long-help options to 'command alias' such that one can now specify...
Enrico Granata [Thu, 31 Mar 2016 01:10:54 +0000 (01:10 +0000)]
Add --help and --long-help options to 'command alias' such that one can now specify a help string for an alias as they are defining it

llvm-svn: 264980

8 years agoChange library search methods to return Optional instead of ErrorOr.
Pete Cooper [Thu, 31 Mar 2016 01:09:35 +0000 (01:09 +0000)]
Change library search methods to return Optional instead of ErrorOr.

These methods weren't really throwing errors.  The only error used
was that a file could not be found, which isn't really an error at all
as we are searching paths and libraries for a file.  All of the callers
also ignored errors and just used the returned path if one was available.

Changing to return Optional<StringRef> as that actually reflects what
we are trying to do here: optionally find a given path.

llvm-svn: 264979

8 years agoFix a bunch more of -Wpessimizing-move issues.
Pete Cooper [Thu, 31 Mar 2016 00:38:02 +0000 (00:38 +0000)]
Fix a bunch more of -Wpessimizing-move issues.

Thanks to Rui for pointing out this warning was firing.

llvm-svn: 264978

8 years agoFix a bunch of -Wpessimizing-move issues.
Pete Cooper [Thu, 31 Mar 2016 00:35:50 +0000 (00:35 +0000)]
Fix a bunch of -Wpessimizing-move issues.

Thanks to Rui for pointing out this warning was firing.

llvm-svn: 264977

8 years agoIntroduce a @llvm.experimental.guard intrinsic
Sanjoy Das [Thu, 31 Mar 2016 00:18:46 +0000 (00:18 +0000)]
Introduce a @llvm.experimental.guard intrinsic

Summary:
As discussed on llvm-dev[1].

This change adds the basic boilerplate code around having this intrinsic
in LLVM:

 - Changes in Intrinsics.td, and the IR Verifier
 - A lowering pass to lower @llvm.experimental.guard to normal
   control flow
 - Inliner support

[1]: http://lists.llvm.org/pipermail/llvm-dev/2016-February/095523.html

Reviewers: reames, atrick, chandlerc, rnk, JosephTremoulet, echristo

Subscribers: mcrosier, llvm-commits

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

llvm-svn: 264976

8 years ago[Sema] Fix PR27122: ICE with enable_if+ill-formed call.
George Burgess IV [Thu, 31 Mar 2016 00:16:25 +0000 (00:16 +0000)]
[Sema] Fix PR27122: ICE with enable_if+ill-formed call.

In some cases, when we encounter a direct function call with an
incorrect number of arguments, we'll emit a diagnostic, and pretend that
the call to the function was valid. For example, in C:

int foo();
int a = foo(1);

Prior to this patch, we'd get an ICE if foo had an enable_if attribute,
because CheckEnableIf assumes that the number of arguments it gets
passed is valid for the function it's passed. Now, we check that the
number of args looks valid prior to checking enable_if conditions.

This fix was not done inside of CheckEnableIf because the problem
presently can only occur in one caller of CheckEnableIf (ActOnCallExpr).
Additionally, checking inside of CheckEnableIf would make us emit
multiple diagnostics for the same error (one "enable_if failed", one
"you gave this function the wrong number of arguments"), which seems
worse than just complaining about the latter.

llvm-svn: 264975

8 years agoConvert a few macho reader/writer helpers to new error handling. NFC.
Pete Cooper [Thu, 31 Mar 2016 00:08:16 +0000 (00:08 +0000)]
Convert a few macho reader/writer helpers to new error handling.  NFC.

These methods were responsible for some of the few remaining calls
to llvm::errorCodeToError.  Converting them makes us have more Error's
in the api and fewer error_code's.

llvm-svn: 264974

8 years agoConvert readBinary to llvm::Error. NFC
Pete Cooper [Wed, 30 Mar 2016 23:58:24 +0000 (23:58 +0000)]
Convert readBinary to llvm::Error.  NFC

llvm-svn: 264973

8 years agoAdd some more triples after r264966
Hans Wennborg [Wed, 30 Mar 2016 23:55:22 +0000 (23:55 +0000)]
Add some more triples after r264966

llvm-svn: 264972

8 years ago[CrashReproducer] Add a module map callback for added headers
Bruno Cardoso Lopes [Wed, 30 Mar 2016 23:54:25 +0000 (23:54 +0000)]
[CrashReproducer] Add a module map callback for added headers

The current ModuleDependencyCollector has a AST listener to collect
header files present in loaded modules, but this isn't enough to collect
all headers needed in the crash reproducer. One of the reasons is that
the AST writer doesn't write symbolic link header paths in the pcm modules,
this makes the listeners on the reader only able to collect the real files.

Since the module maps could contain submodules that use headers which
are symbolic links, not collecting those forbid the reproducer scripts
to regen the modules.

For instance:

usr/include/module.map:
  ...
  module pthread {
    header "pthread.h"
    export *

    module impl {
      header "pthread_impl.h"
      export *
    }
  }
  ...

usr/include/pthread/pthread_impl.h
usr/include/pthread_impl.h -> pthread/pthread_impl.h

The AST dump for the module above:

  <SUBMODULE_HEADER abbrevid=6/> blob data = 'pthread_impl.h'
  <SUBMODULE_TOPHEADER abbrevid=7/> blob data = '/<path_to_sdk>/usr/include/pthread/pthread_impl.h'

Note that we don't have "usr/include/pthread_impl.h" which is requested
by the module.map in case we want to reconstruct the module in the
reproducer. The reason the original symbolic link path isn't used is
because the headers are kept by name and requested through the
FileManager, which unique files and returns the real path only.

To fix that, add a callback to be invoked everytime a header is added
while parsing module maps and hook that up to the module dependecy
collector. This callback is only registered when generating the
reproducer.

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

rdar://problem/24499339

llvm-svn: 264971

8 years ago[VFS] Handle empty entries in directory traversal
Bruno Cardoso Lopes [Wed, 30 Mar 2016 23:54:00 +0000 (23:54 +0000)]
[VFS] Handle empty entries in directory traversal

The VFS YAML files contain empty directory entries to describe that it's
returning from a subdirectory before describing new files in the parent.
In the future, we should properly sort and write YAML files avoiding
such empty dirs and mitigate the extra recurson cost. However, since
this is used by previous existing YAMLs, make the traversal work in
their presence.

rdar://problem/24499339

llvm-svn: 264970

8 years ago[CUDA] Add -disable-llvm-passes to CodeGenCUDA/link-device-bitcode.cu. NFC
Justin Lebar [Wed, 30 Mar 2016 23:45:38 +0000 (23:45 +0000)]
[CUDA] Add -disable-llvm-passes to CodeGenCUDA/link-device-bitcode.cu.  NFC

We already have this flag in most of the file, but we need it everywhere
else, to disable the NVVMReflect pass, which we're explicitly checking
doesn't run here.  (Upcoming changes to llvm will cause it to be run.)

llvm-svn: 264969

8 years agoConvert normalized file to atoms methods to new error handling. NFC.
Pete Cooper [Wed, 30 Mar 2016 23:43:27 +0000 (23:43 +0000)]
Convert normalized file to atoms methods to new error handling.  NFC.

This converts almost all of the error handling in atom creation
to llvm::Error instead of std::error_code.

llvm-svn: 264968

8 years agoFix deduction of __atomic_load's parameter types.
Eric Fiselier [Wed, 30 Mar 2016 23:39:56 +0000 (23:39 +0000)]
Fix deduction of __atomic_load's parameter types.

Summary:
__atomic_load's allows it's first argument to be a pointer to a const type. However the second argument is an output parameter and must be a pointer to non-const.
This patch fixes the signature of __atomic_load generated by clang so that it respects the above requirements.

Reviewers: rsmith, majnemer

Subscribers: cfe-commits

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

llvm-svn: 264967

8 years ago[X86] Enable call frame optimization ("mov to push") not only for optsize (PR26325)
Hans Wennborg [Wed, 30 Mar 2016 23:38:01 +0000 (23:38 +0000)]
[X86] Enable call frame optimization ("mov to push") not only for optsize (PR26325)

The size savings are significant, and from what I can tell, both ICC and GCC do this.

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

llvm-svn: 264966

8 years ago[CUDA] Don't initialize the CUDA toolchain if we don't have any CUDA inputs.
Justin Lebar [Wed, 30 Mar 2016 23:30:25 +0000 (23:30 +0000)]
[CUDA] Don't initialize the CUDA toolchain if we don't have any CUDA inputs.

Summary:
This prevents errors when you invoke clang with a flag that the NVPTX
toolchain doesn't support.  For example, on x86-64,

  clang -mthread-model single -x c++ /dev/null -o /dev/null

should output just one error about "invalid thread model 'single' in
'-mthread-model single' for this target"; x86-64 doesn't support
-mthread-model, but we shouldn't also instantiate a NVPTX target!

Reviewers: echristo

Subscribers: tra, sunfish, cfe-commits

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

llvm-svn: 264965

8 years ago[CUDA] Make unattributed constexpr functions implicitly host+device.
Justin Lebar [Wed, 30 Mar 2016 23:30:21 +0000 (23:30 +0000)]
[CUDA] Make unattributed constexpr functions implicitly host+device.

With this patch, by a constexpr function is implicitly host+device
unless:

 a) it's a variadic function (variadic functions are not allowed on the
    device side), or
 b) it's preceeded by a __device__ overload in a system header.

The restriction on overloading __host__ __device__ functions on the
basis of their CUDA attributes remains in place, but we use (b) to allow
us to define __device__ overloads for constexpr functions in cmath,
which would otherwise be __host__ __device__ and thus not overloadable.

You can disable this behavior with -fno-cuda-host-device-constexpr.

Reviewers: tra, rnk, rsmith

Subscribers: cfe-commits

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

llvm-svn: 264964

8 years ago[CUDA] Add math forward declares to CUDA header wrapper.
Justin Lebar [Wed, 30 Mar 2016 23:30:14 +0000 (23:30 +0000)]
[CUDA] Add math forward declares to CUDA header wrapper.

Summary:
This is necessary for a future patch which will make all constexpr
functions implicitly host+device.  cmath may declare constexpr
functions, but these we do *not* want to be host+device.  The forward
declares added in this patch prevent this (because the rule will be,
constexpr functions become implicitly host+device unless they're
preceeded by a decl with __device__).

Reviewers: tra

Subscribers: cfe-commits, rnk, rsmith

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

llvm-svn: 264963

8 years agoFix MachO test which is failing on a Windows bot.
Pete Cooper [Wed, 30 Mar 2016 23:28:49 +0000 (23:28 +0000)]
Fix MachO test which is failing on a Windows bot.

This is breaking http://lab.llvm.org:8011/builders/lld-x86_64-win7/builds/31647/steps/test%20lld/logs/stdio.

The issue seems to be that it can't write to a file in /tmp, probably because that path doesn't
exist on Windows.  This was failing after I added EXPECT_FALSE(ec) in r264961 for the error
handling migration.

llvm-svn: 264962

8 years agoConvert lld file writing to llvm::Error. NFC.
Pete Cooper [Wed, 30 Mar 2016 23:10:39 +0000 (23:10 +0000)]
Convert lld file writing to llvm::Error.  NFC.

This converts the writeFile method, as well as some of the ones it calls
in the normalized binary file writer and yaml writer.

llvm-svn: 264961

8 years agoAMDGPU: Add frexp_mant + frexp_exp builtins
Matt Arsenault [Wed, 30 Mar 2016 22:57:40 +0000 (22:57 +0000)]
AMDGPU: Add frexp_mant + frexp_exp builtins

llvm-svn: 264960

8 years agoCodeGen: Factor out code for tail call result compatibility check; NFC
Matthias Braun [Wed, 30 Mar 2016 22:46:04 +0000 (22:46 +0000)]
CodeGen: Factor out code for tail call result compatibility check; NFC

llvm-svn: 264959

8 years agoAvoid unnecessary #include; NFC
Matthias Braun [Wed, 30 Mar 2016 22:45:58 +0000 (22:45 +0000)]
Avoid unnecessary #include; NFC

llvm-svn: 264958