OSDN Git Service

android-x86/external-llvm.git
8 years agoRemangle intrinsics names when types are renamed
Artur Pilipenko [Thu, 23 Jun 2016 15:25:09 +0000 (15:25 +0000)]
Remangle intrinsics names when types are renamed

This is a fix for the problem mentioned in "LTO and intrinsics mangling" llvm-dev mail thread:
http://lists.llvm.org/pipermail/llvm-dev/2016-April/098387.html

Reviewers: mehdi_amini, reames

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273568 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[SystemZ] Let z13 also support FeatureMiscellaneousExtensions.
Jonas Paulsson [Thu, 23 Jun 2016 15:12:06 +0000 (15:12 +0000)]
[SystemZ] Let z13 also support FeatureMiscellaneousExtensions.

This processor feature had been left out by mistake from the z13
ProcessorModel.

Reviewed by Ulrich Weigand.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273567 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoRevert "[misched] Extend scheduler to handle unsupported features"
Simon Dardis [Thu, 23 Jun 2016 14:54:47 +0000 (14:54 +0000)]
Revert "[misched] Extend scheduler to handle unsupported features"

This reverts commit r273551.

Patch contained a wrong check for isUnsupported.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273565 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoExplicitly specify the ANSI version of these Win32 APIs. While these are seemingly...
Aaron Ballman [Thu, 23 Jun 2016 14:45:54 +0000 (14:45 +0000)]
Explicitly specify the ANSI version of these Win32 APIs. While these are seemingly unrelated changes, they are all NFC because we currently default to the ANSI versions of the APIs when building for Windows. This simply makes the ANSI usage explicit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273564 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[LoopUnrollAnalyzer] Fix a bug in UnrolledInstAnalyzer::visitLoad.
Michael Zolotukhin [Thu, 23 Jun 2016 14:31:31 +0000 (14:31 +0000)]
[LoopUnrollAnalyzer] Fix a bug in UnrolledInstAnalyzer::visitLoad.

When simplifying a load we need to make sure that the type of the
simplified value matches the type of the instruction we're processing.
In theory, we can handle casts here as we deal with constant data, but
since it's not implemented at the moment, we at least need to bail out.

This fixes PR28262.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273562 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[AMDGPU] Enable absolute expression initializer for amd_kernel_code_t fields.
Valery Pykhtin [Thu, 23 Jun 2016 14:13:06 +0000 (14:13 +0000)]
[AMDGPU] Enable absolute expression initializer for amd_kernel_code_t fields.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273561 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[X86][AVX512] Added AVX512F vector sign extend tests
Simon Pilgrim [Thu, 23 Jun 2016 14:01:45 +0000 (14:01 +0000)]
[X86][AVX512] Added AVX512F vector sign extend tests

Now that Elena has confirmed that PR26474 has been fixed

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273560 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAllow DeadStoreElimination to track combinations of partial later wrties
Hal Finkel [Thu, 23 Jun 2016 13:46:39 +0000 (13:46 +0000)]
Allow DeadStoreElimination to track combinations of partial later wrties

DeadStoreElimination can currently remove a small store rendered unnecessary by
a later larger one, but could not remove a larger store rendered unnecessary by
a series of later smaller ones. This adds that capability.

It works by keeping a map, which is used as an effective interval map, for each
store later overwritten only partially, and filling in that interval map as
more such stores are discovered. No additional walking or aliasing queries are
used. In the map forms an interval covering the the entire earlier store, then
it is dead and can be removed. The map is used as an interval map by storing a
mapping between the ending offset and the beginning offset of each interval.

I discovered this problem when investigating a performance issue with code like
this on PowerPC:

  #include <complex>
  using namespace std;

  complex<float> bar(complex<float> C);
  complex<float> foo(complex<float> C) {
    return bar(C)*C;
  }

which produces this:

  define void @_Z4testSt7complexIfE(%"struct.std::complex"* noalias nocapture sret %agg.result, i64 %c.coerce) {
  entry:
    %ref.tmp = alloca i64, align 8
    %tmpcast = bitcast i64* %ref.tmp to %"struct.std::complex"*
    %c.sroa.0.0.extract.shift = lshr i64 %c.coerce, 32
    %c.sroa.0.0.extract.trunc = trunc i64 %c.sroa.0.0.extract.shift to i32
    %0 = bitcast i32 %c.sroa.0.0.extract.trunc to float
    %c.sroa.2.0.extract.trunc = trunc i64 %c.coerce to i32
    %1 = bitcast i32 %c.sroa.2.0.extract.trunc to float
    call void @_Z3barSt7complexIfE(%"struct.std::complex"* nonnull sret %tmpcast, i64 %c.coerce)
    %2 = bitcast %"struct.std::complex"* %agg.result to i64*
    %3 = load i64, i64* %ref.tmp, align 8
    store i64 %3, i64* %2, align 4 ; <--- ***** THIS SHOULD NOT BE HERE ****
    %_M_value.realp.i.i = getelementptr inbounds %"struct.std::complex", %"struct.std::complex"* %agg.result, i64 0, i32 0, i32 0
    %4 = lshr i64 %3, 32
    %5 = trunc i64 %4 to i32
    %6 = bitcast i32 %5 to float
    %_M_value.imagp.i.i = getelementptr inbounds %"struct.std::complex", %"struct.std::complex"* %agg.result, i64 0, i32 0, i32 1
    %7 = trunc i64 %3 to i32
    %8 = bitcast i32 %7 to float
    %mul_ad.i.i = fmul fast float %6, %1
    %mul_bc.i.i = fmul fast float %8, %0
    %mul_i.i.i = fadd fast float %mul_ad.i.i, %mul_bc.i.i
    %mul_ac.i.i = fmul fast float %6, %0
    %mul_bd.i.i = fmul fast float %8, %1
    %mul_r.i.i = fsub fast float %mul_ac.i.i, %mul_bd.i.i
    store float %mul_r.i.i, float* %_M_value.realp.i.i, align 4
    store float %mul_i.i.i, float* %_M_value.imagp.i.i, align 4
    ret void
  }

the problem here is not just that the i64 store is unnecessary, but also that
it blocks further backend optimizations of the other uses of that i64 value in
the backend.

In the future, we might want to add a special case for handling smaller
accesses (e.g. using a bit vector) if the map mechanism turns out to be
noticeably inefficient. A sorted vector is also a possible replacement for the
map for small numbers of tracked intervals.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273559 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[mips] Don't derive the default ABI from the CPU in the backend.
Daniel Sanders [Thu, 23 Jun 2016 12:42:53 +0000 (12:42 +0000)]
[mips] Don't derive the default ABI from the CPU in the backend.

Summary:
The backend has no reason to behave like a driver and should generally do
as it's told (and error out if it can't) instead of trying to figure out
what the API user meant. The default ABI is still derived from the arch
component as a concession to backwards compatibility.

API-users that previously passed an explicit CPU and a triple that was
inconsistent with the CPU (e.g. mips-linux-gnu and mips64r2) may get a
different ABI to what they got before. However, it's expected that there
are no such users on the basis that CodeGen has been asserting that the
triple is consistent with the selected ABI for several releases. API-users
that were consistent or passed '' or 'generic' as the CPU will see no
difference.

Reviewers: sdardis, rafael

Subscribers: rafael, dsanders, sdardis, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273557 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[ARM] Use member initializers in ARMSubtarget. NFCI
Diana Picus [Thu, 23 Jun 2016 12:04:33 +0000 (12:04 +0000)]
[ARM] Use member initializers in ARMSubtarget. NFCI

Move most of the initializations in ARMSubtarget::initializeEnvironment to
member initializers.

Change suggested by Matthias Braun (see http://reviews.llvm.org/D21432).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273556 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[mips][ias] Integers are not registers.
Daniel Sanders [Thu, 23 Jun 2016 10:54:09 +0000 (10:54 +0000)]
[mips][ias] Integers are not registers.

Summary:
When parseAnyRegister() encounters a symbol alias, it parses integers and adds
a corresponding expression to the operand list. This is clearly wrong since the
only operands that parseAnyRegister() should be accepting are registers.

It's not clear why this code was added and there are no test cases that cover
it. I think it might be leftover from when searchSymbolAlias() was more widely
used.

Reviewers: sdardis

Subscribers: dsanders, sdardis, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273555 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[llc] Remove exit-on-error flag (PR27759)
Diana Picus [Thu, 23 Jun 2016 09:49:56 +0000 (09:49 +0000)]
[llc] Remove exit-on-error flag (PR27759)

This flag was introduced in r269655 with the new diagnostic handler for llc. Its
purpose was to keep the old behavior for some of the tests that didn't recover
well after an error. Those tests have been fixed, so now it's safe to remove the
flag entirely.

Fixes PR27759.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273554 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[misched] Extend scheduler to handle unsupported features
Simon Dardis [Thu, 23 Jun 2016 09:22:11 +0000 (09:22 +0000)]
[misched] Extend scheduler to handle unsupported features

Currently isComplete = 1 requires that every instruction must
be described, declared unsupported or marked as having no
scheduling information for a processor.

For some backends such as MIPS, this requirement entails
long regex lists of instructions that are unsupported.

This patch teaches Tablegen to skip over instructions that
are associated with unsupported feature when checking if the
scheduling model is complete.

Patch by: Daniel Sanders

Contributions by: Simon Dardis

Reviewers: MatzeB

Differential Reviewer: http://reviews.llvm.org/D20522

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273551 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[AMDGPU] Remove exit-on-error in test (PR27761)
Diana Picus [Thu, 23 Jun 2016 09:19:16 +0000 (09:19 +0000)]
[AMDGPU] Remove exit-on-error in test (PR27761)

The exit-on-error flag was necessary in order to avoid an assertion when
handling DYNAMIC_STACKALLOC nodes in SelectionDAGLegalize.

We can avoid the assertion by creating some dummy nodes. This enables us to
remove the exit-on-error flag on the first 2 run lines (SI), but on the third
run line (R600) we would run into another assertion when trying to reserve
indirect registers. This patch also replaces that assertion with an early exit
from the function.

Fixes PR27761.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273550 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[mips] Fix dext/dins definitions
Simon Dardis [Thu, 23 Jun 2016 09:06:20 +0000 (09:06 +0000)]
[mips] Fix dext/dins definitions

dext and dins, along with their 'm' and 'u' variants are defined in mips64r2,
not mips64.

Reviewers: dsanders, vkalintiris

Differential Review: http://reviews.llvm.org/D21608

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273549 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[IfConversion] Bugfix: Don't use undef flag while adding use operands.
Jonas Paulsson [Thu, 23 Jun 2016 08:13:20 +0000 (08:13 +0000)]
[IfConversion] Bugfix: Don't use undef flag while adding use operands.

IfConversion used to always add the undef flag when adding a use operand
on a newly predicated instruction. This would be an operand for the register
being conditionally redefined. Due to the undef flag, the liveness of this
register prior to the predicated instruction would get lost.

This patch changes this so that such use operands are added only when the
register is live, without the undef flag.

Reviewed by Quentin Colombet.
http://reviews.llvm.org/D209077

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273545 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[ARM] Do not test for CPUs, use SubtargetFeatures (Part 1). NFCI
Diana Picus [Thu, 23 Jun 2016 07:47:35 +0000 (07:47 +0000)]
[ARM] Do not test for CPUs, use SubtargetFeatures (Part 1). NFCI

This is a cleanup commit similar to r271555, but for ARM.

The end goal is to get rid of the isSwift / isCortexXY / isWhatever methods.

Since the ARM backend seems to have quite a lot of calls to these methods, I
intend to submit 5-6 subtarget features at a time, instead of one big lump.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273544 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[AVX512] Remove masked unpack intrinsics and autoupgrade to vectorshuffle and selects.
Craig Topper [Thu, 23 Jun 2016 07:37:33 +0000 (07:37 +0000)]
[AVX512] Remove masked unpack intrinsics and autoupgrade to vectorshuffle and selects.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273543 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[X86] Add assert to ensure only 128-bit vector types are used. 256 or 512-bit would...
Craig Topper [Thu, 23 Jun 2016 07:37:26 +0000 (07:37 +0000)]
[X86] Add assert to ensure only 128-bit vector types are used. 256 or 512-bit would require lane handling which is missing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273542 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[modules] Good ol' JIT is gone.
Vassil Vassilev [Thu, 23 Jun 2016 07:33:03 +0000 (07:33 +0000)]
[modules] Good ol' JIT is gone.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273541 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAdd missing include. Should fix modules builds.
Vassil Vassilev [Thu, 23 Jun 2016 07:30:12 +0000 (07:30 +0000)]
Add missing include. Should fix modules builds.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273540 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[LLVM][MIPS] Introduce 64 bit atomic check in CheckAtomic.cmake
Sagar Thakur [Thu, 23 Jun 2016 06:39:35 +0000 (06:39 +0000)]
[LLVM][MIPS] Introduce 64 bit atomic check in CheckAtomic.cmake

Patch by Nitesh Jain.

Summary: On some target like MIPS32 we need to explicitly link atomic library for 64 bit atomic operations. This module then can be used in LLDB (http://reviews.llvm.org/D20464) or Libcxx (http://reviews.llvm.org/D16613) for explicitly link to atomic library.

Reviewers: chandlerc, beanz
Differential: reviews.llvm.org/D20896

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273534 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoFix doubly included header
Matt Arsenault [Thu, 23 Jun 2016 02:34:51 +0000 (02:34 +0000)]
Fix doubly included header

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273528 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[libFuzzer] Add standard license info and comment header to AFLDriverTest.cpp
Vitaly Buka [Thu, 23 Jun 2016 02:19:36 +0000 (02:19 +0000)]
[libFuzzer] Add standard license info and comment header to AFLDriverTest.cpp

Summary: Add license info and brief description of file to AFLDriverTest.cpp.

Reviewers: kcc, aizatsky

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273527 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoUse C++ comments for large block comment.
Eric Christopher [Thu, 23 Jun 2016 01:33:38 +0000 (01:33 +0000)]
Use C++ comments for large block comment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273526 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAMDGPU: readlane/writelane do not read exec
Matt Arsenault [Thu, 23 Jun 2016 01:26:16 +0000 (01:26 +0000)]
AMDGPU: readlane/writelane do not read exec

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273525 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoFix unused variable warning by folding the temporary into the debug statement.
Eric Christopher [Thu, 23 Jun 2016 00:42:00 +0000 (00:42 +0000)]
Fix unused variable warning by folding the temporary into the debug statement.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273523 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[SCCP] Don't assume all Constants are ConstantInt
David Majnemer [Thu, 23 Jun 2016 00:14:29 +0000 (00:14 +0000)]
[SCCP] Don't assume all Constants are ConstantInt

This fixes PR28269.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273521 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[ADT] Add a range variant of std::transform
David Majnemer [Thu, 23 Jun 2016 00:14:26 +0000 (00:14 +0000)]
[ADT] Add a range variant of std::transform

This will be used in a followup change in clang.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273520 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[IRObjectFile] Try to be defensive, add a break.
Davide Italiano [Thu, 23 Jun 2016 00:07:31 +0000 (00:07 +0000)]
[IRObjectFile] Try to be defensive, add a break.

Suggested by Sean Silva.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273519 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoRevert r273456, "Preserve DebugInfo when replacing values in DAGCombiner" as it cause...
Peter Collingbourne [Thu, 23 Jun 2016 00:06:17 +0000 (00:06 +0000)]
Revert r273456, "Preserve DebugInfo when replacing values in DAGCombiner" as it caused pr28270.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273518 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[llvm-cov] Fix a buggy lit test
Vedant Kumar [Wed, 22 Jun 2016 23:58:03 +0000 (23:58 +0000)]
[llvm-cov] Fix a buggy lit test

There is no check prefix for "WHOLE-FILE": this particular line was
supposed to use the "ALL" prefix.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273517 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[codeview] Add EFLAGS to the list of CodeView register numbers
Reid Kleckner [Wed, 22 Jun 2016 23:50:19 +0000 (23:50 +0000)]
[codeview] Add EFLAGS to the list of CodeView register numbers

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273516 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAMDGPU: Fix liveness when expanding m0 loop
Matt Arsenault [Wed, 22 Jun 2016 23:40:57 +0000 (23:40 +0000)]
AMDGPU: Fix liveness when expanding m0 loop

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273514 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[RS4GC] Use StringRef; NFC
Sanjoy Das [Wed, 22 Jun 2016 23:32:46 +0000 (23:32 +0000)]
[RS4GC] Use StringRef; NFC

Spotted during random inspection.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273512 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoChange that to include MCMachObjectWriter.h
Reid Kleckner [Wed, 22 Jun 2016 23:30:43 +0000 (23:30 +0000)]
Change that to include MCMachObjectWriter.h

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273511 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAdd one more missing MCObjectWriter.h include
Reid Kleckner [Wed, 22 Jun 2016 23:28:12 +0000 (23:28 +0000)]
Add one more missing MCObjectWriter.h include

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273510 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoFix instance of -Wdelete-incomplete
Reid Kleckner [Wed, 22 Jun 2016 23:25:26 +0000 (23:25 +0000)]
Fix instance of -Wdelete-incomplete

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273508 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoPrune some includes from headers and sink some inline functions
Reid Kleckner [Wed, 22 Jun 2016 23:23:08 +0000 (23:23 +0000)]
Prune some includes from headers and sink some inline functions

MCSymbol.h shouldn't pull in MCAssembler.h, just MCFragment.h.
MCLinkerOptimizationHint.h shouldn't need MCMachObjectWriter.h.  The
rest is fixing the fallout.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273507 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[PM]: LoopAccessInfo simple refactoring
Xinliang David Li [Wed, 22 Jun 2016 23:20:59 +0000 (23:20 +0000)]
[PM]: LoopAccessInfo simple refactoring

To make definition of mov ctors easier.
Differential Revision: http://reviews.llvm.org/D21563

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273506 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[pdb] Treat a stream size of ~0U as 0
Reid Kleckner [Wed, 22 Jun 2016 22:42:24 +0000 (22:42 +0000)]
[pdb] Treat a stream size of ~0U as 0

My PDBs always have this size for stream 11. Not sure why.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273504 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[MachO] Finish moving fat header swap functions to MachO.h
Chris Bieneman [Wed, 22 Jun 2016 22:19:08 +0000 (22:19 +0000)]
[MachO] Finish moving fat header swap functions to MachO.h

This is a follow-up to r273479. At the time I wrote r273479 I didn't connect the dots that the functions I was adding had to exist somewhere. Turns out, they do. This finishes moving the functions to MachO.h.

Existing MachO fat header tests like test/tools/llvm-readobj/Inputs/macho-universal-archive.x86_64.i386 execute this code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273502 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[ImplicitNullChecks] Hoist trivial depdendencies if possible
Sanjoy Das [Wed, 22 Jun 2016 22:16:51 +0000 (22:16 +0000)]
[ImplicitNullChecks] Hoist trivial depdendencies if possible

When trying to convert a loading instruction into a FAULTING_LOAD, we
sometimes face code like this:

  if %R10 is not null:
    %R9<def> = MOV32ri Immediate
    %R9<def, tied> = AND32rm %R9, 0x20(%R10)
  else:
    goto TRAP

In these cases we would like to use the AND32rm instruction as the
faulting operation by hoisting the "depedency" def-ing %R9 also above
the control flow, transforming the program into:

  %R9<def> = MOV32ri Immediate
  %R9<def, tied> = FAULTING_LOAD_OP(AND32rm %R9, 0x20(%R10), FailPath: TRAP)

This change teaches ImplicitNullChecks to do the above, when safe.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273501 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoUse shouldAssumeDSOLocal.
Rafael Espindola [Wed, 22 Jun 2016 22:09:17 +0000 (22:09 +0000)]
Use shouldAssumeDSOLocal.

With this it handle -fPIE.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273499 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoExtract a few variables to make 'if' smaller. NFC.
Rafael Espindola [Wed, 22 Jun 2016 21:56:34 +0000 (21:56 +0000)]
Extract a few variables to make 'if' smaller. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273497 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAMDGPU/SI: Define an intrinsic to expose ds_swizzle_b32
Changpeng Fang [Wed, 22 Jun 2016 21:33:49 +0000 (21:33 +0000)]
AMDGPU/SI: Define an intrinsic to expose ds_swizzle_b32

Reviewers: tstellarAMD, arsenm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273496 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[codeview] Write LF_UDT_SRC_LINE records (PR28251)
Hans Wennborg [Wed, 22 Jun 2016 21:22:13 +0000 (21:22 +0000)]
[codeview] Write LF_UDT_SRC_LINE records (PR28251)

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273495 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoDo not require __STDC_LIMIT_MACROS and others
Pawel Bylica [Wed, 22 Jun 2016 21:15:51 +0000 (21:15 +0000)]
Do not require __STDC_LIMIT_MACROS and others

Summary: Do not require __STDC_LIMIT_MACROS and __STDC_CONSTANT_MACROS macros to be defined globally. They are not needed for C++11 compliant standard headers.

Reviewers: joerg, jyknight

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273493 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[CMake] LLVM_BINARY_DIR was not being properly set in LLVMConfig.cmake
Chris Bieneman [Wed, 22 Jun 2016 21:01:19 +0000 (21:01 +0000)]
[CMake] LLVM_BINARY_DIR was not being properly set in LLVMConfig.cmake

LLVMConfig.cmake needs to set LLVM_BINARY_DIR differently based on whether or not it is the build directory or the install directory. The build directory just needs to set the value from the configuration, the install directory needs to set it to the install prefix.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273479 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[MachO] Adding a few missing swapStruct functions
Chris Bieneman [Wed, 22 Jun 2016 21:01:17 +0000 (21:01 +0000)]
[MachO] Adding a few missing swapStruct functions

These are just missing swap functions for handling endian conversion.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273478 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[codeview] Fix the alignment padding that we add to list records
Reid Kleckner [Wed, 22 Jun 2016 20:59:17 +0000 (20:59 +0000)]
[codeview] Fix the alignment padding that we add to list records

Tweak the big-types.ll test case to catch this bug. We just need an
enumerator name that doesn't have a length that is a multiple of 4.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273477 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[IRObjectFile] Propagate .weak attribute correctly for ASM symbols.
Davide Italiano [Wed, 22 Jun 2016 20:48:15 +0000 (20:48 +0000)]
[IRObjectFile] Propagate .weak attribute correctly for ASM symbols.

PR: 28256
Differential Revision:  http://reviews.llvm.org/D21616

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273474 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoUpdate header documentation for API deliberately made public
Daniel Berlin [Wed, 22 Jun 2016 20:31:12 +0000 (20:31 +0000)]
Update header documentation for API deliberately made public

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273473 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoIR: Introduce Module::global_objects().
Peter Collingbourne [Wed, 22 Jun 2016 20:29:42 +0000 (20:29 +0000)]
IR: Introduce Module::global_objects().

This is a convenience iterator that allows clients to enumerate the
GlobalObjects within a Module.

Also start using it in a few places where it is obviously the right thing
to use.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273470 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAMDGPU: Run verifier after 2nd run of SIShrinkInstructions
Matt Arsenault [Wed, 22 Jun 2016 20:26:24 +0000 (20:26 +0000)]
AMDGPU: Run verifier after 2nd run of SIShrinkInstructions

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273469 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAMDGPU: Fix verifier errors in SILowerControlFlow
Matt Arsenault [Wed, 22 Jun 2016 20:15:28 +0000 (20:15 +0000)]
AMDGPU: Fix verifier errors in SILowerControlFlow

The main sin this was committing was using terminator
instructions in the middle of the block, and then
not updating the block successors / predecessors.
Split the blocks up to avoid this and introduce new
pseudo instructions for branches taken with exec masking.

Also use a pseudo instead of emitting s_endpgm and erasing
it in the special case of a non-void return.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273467 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Hexagon] Add SDAG preprocessing step to expose shifted addressing modes
Krzysztof Parzyszek [Wed, 22 Jun 2016 20:08:27 +0000 (20:08 +0000)]
[Hexagon] Add SDAG preprocessing step to expose shifted addressing modes

Transform: (store ch addr (add x (add (shl y c) e)))
       to: (store ch addr (add x (shl (add y d) c))),
where e = (shl d c) for some integer d.
The purpose of this is to enable generation of loads/stores with
shifted addressing mode, i.e. mem(x+y<<#c). For that, the shift
value c must be 0, 1 or 2.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273466 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[UpdateCompilerUsed] API rename and cleanup, suggested by Rafaael.
Davide Italiano [Wed, 22 Jun 2016 19:50:42 +0000 (19:50 +0000)]
[UpdateCompilerUsed] API rename and cleanup, suggested by Rafaael.

* UpdateCompilerUsed() -> updateCompilerUsed()
* ThinLTO doesn't use the API so we can remove the include
* Clean up unused #include <functional> from the header
* Rename #ifdef guard comment to be correct.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273461 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[MBFI]: Add a new suboption for graph viewer
Xinliang David Li [Wed, 22 Jun 2016 19:26:44 +0000 (19:26 +0000)]
[MBFI]: Add a new suboption for graph viewer

 -view-machine-block-freq-propagation-dags currently
support integer and fraction as the suboptions. This
patch adds the 'count' suboption to display actual
profile count if available.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273460 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[ValueTracking] improve ComputeNumSignBits for vector constants
Sanjay Patel [Wed, 22 Jun 2016 19:20:59 +0000 (19:20 +0000)]
[ValueTracking] improve ComputeNumSignBits for vector constants

This is similar to the computeKnownBits improvement in rL268479.
There's probably more we can do for vector logic instructions, but
this should let us see non-splat constant masking ops that can
become vector selects instead of and/andn/or sequences.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273459 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[AArch64] Remove an overly aggressive assert.
Chad Rosier [Wed, 22 Jun 2016 19:18:52 +0000 (19:18 +0000)]
[AArch64] Remove an overly aggressive assert.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273458 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoStart using shouldAssumeDSOLocal on Hexagon.
Rafael Espindola [Wed, 22 Jun 2016 19:09:14 +0000 (19:09 +0000)]
Start using shouldAssumeDSOLocal on Hexagon.

Include a token test showing that access to private is now the same as
to internal.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273457 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoPreserve DebugInfo when replacing values in DAGCombiner
Nirav Dave [Wed, 22 Jun 2016 19:03:26 +0000 (19:03 +0000)]
Preserve DebugInfo when replacing values in DAGCombiner

Recommiting after fixing over-aggressive assertion

[DAG] Previously debug values would transfer debuginfo for the selected
start node for a replacement which allows for debug to be dropped.

Push debug value transfer to occur with node/value replacement in
SelectionDAG, remove now extraneous transfers of debug values.

This refixes PR9817 which was being incompletely checked in the
testsuite.

Reviewers: jyknight

Subscribers: dblaikie, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273456 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAMDGPU: Add convergent flag to INLINEASM instruction.
Wei Ding [Wed, 22 Jun 2016 18:51:08 +0000 (18:51 +0000)]
AMDGPU: Add convergent flag to INLINEASM instruction.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273455 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[codeview] Add IntroducingVirtual debug info flag
Reid Kleckner [Wed, 22 Jun 2016 18:31:14 +0000 (18:31 +0000)]
[codeview] Add IntroducingVirtual debug info flag

CodeView needs to know if a virtual method was introduced in the current
class, and base classes may not have complete type information, so we
need to thread this bit through from the frontend.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273453 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoRemoving whitespace from test commit rL273447
Jason Henline [Wed, 22 Jun 2016 18:01:11 +0000 (18:01 +0000)]
Removing whitespace from test commit rL273447

Undoing the trivial change I introduced in rL273447.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273449 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAMDGPU: Make FrameLowering stack alignment 16
Matt Arsenault [Wed, 22 Jun 2016 17:47:39 +0000 (17:47 +0000)]
AMDGPU: Make FrameLowering stack alignment 16

We don't need it to be that high. The natural alignment
for a single workitem's stack is 16.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273448 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAdd whitespace to check commit access
Jason Henline [Wed, 22 Jun 2016 17:40:02 +0000 (17:40 +0000)]
Add whitespace to check commit access

No functional changes. Just adding whitespace in a comment in order to
check that I am able to push a commit to the repo.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273447 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[codeview] Fix trivial bug in OneMethodRecord::isIntroducingVirtual
Reid Kleckner [Wed, 22 Jun 2016 17:32:59 +0000 (17:32 +0000)]
[codeview] Fix trivial bug in OneMethodRecord::isIntroducingVirtual

These should be equality comparisons. Fixes assertions while
self-hosting clang with codeview debug info.

Ultimately this is going to be covered by real tests for virtual method
emission, so I'm not adding a "don't crash on this input" test that I'll
remove soon afterwards.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273446 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[asan] Do not instrument accesses to profiling globals
Vedant Kumar [Wed, 22 Jun 2016 17:30:58 +0000 (17:30 +0000)]
[asan] Do not instrument accesses to profiling globals

It's only useful to asan-itize profiling globals while debugging llvm's
profiling instrumentation passes. Enabling asan along with instrprof or
gcov instrumentation shouldn't incur extra overhead.

This patch is in the same spirit as r264805 and r273202, which disabled
tsan instrumentation of instrprof/gcov globals.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273444 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[codeview] Defer emission of all referenced complete records
Reid Kleckner [Wed, 22 Jun 2016 17:15:28 +0000 (17:15 +0000)]
[codeview] Defer emission of all referenced complete records

This is the motivating example:
  struct B { int b; };
  struct A { B *b; };
  int f(A *p) { return p->b->b; }

Clang emits complete types for both A and B because they are required to
be complete, but our CodeView emission would only emit forward
declarations of A and B. This was a consequence of the fact that the A*
type must reference the forward declaration of A, which doesn't
reference B at all.

We can't eagerly emit complete definitions of A and B when we request
the forward declaration's type index because of recursive types like
linked lists. If we did that, our stack usage could get out of hand, and
it would be possible to lower a type while attempting to lower a type,
and we would need to double check if our type is already present in the
TypeIndexMap after all recursive getTypeIndex calls.

Instead, defer complete type emission until after all type lowering has
completed. This ensures that all referenced complete types are emitted,
and that type lowering is not re-entrant.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273443 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[BFI]: NFC refactoring
Xinliang David Li [Wed, 22 Jun 2016 17:12:12 +0000 (17:12 +0000)]
[BFI]: NFC refactoring

move getBlockProfileCount implementation to the
base class so that MBFI can share too.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273442 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[SystemZ] Recognize RISBG opportunities involving a truncate
Zhan Jun Liau [Wed, 22 Jun 2016 16:16:27 +0000 (16:16 +0000)]
[SystemZ] Recognize RISBG opportunities involving a truncate

Summary:
Recognize RISBG opportunities where the end result is narrower than the
original input - where a truncate separates the shift/and operations.

The motivating case is some code in postgres which looks like:

srlg %r2, %r0, 11
nilh %r2, 255

Reviewers: uweigand

Author: RolandF

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273433 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Hexagon] Handle expansion of cmpxchg
Krzysztof Parzyszek [Wed, 22 Jun 2016 16:07:10 +0000 (16:07 +0000)]
[Hexagon] Handle expansion of cmpxchg

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273432 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[codeview] Remove ClassInfoMap
Reid Kleckner [Wed, 22 Jun 2016 16:06:42 +0000 (16:06 +0000)]
[codeview] Remove ClassInfoMap

From a design perspective, complete record type emission should not
depend on information from other complete record types.

Currently this map is unused, and needlessly accumulates data throughout
compilation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273431 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[MBFI]: show branch probability in DOT graph
Xinliang David Li [Wed, 22 Jun 2016 16:04:51 +0000 (16:04 +0000)]
[MBFI]: show branch probability in DOT graph

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273430 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agollvm-ar: reduce some duplication, NFC
Saleem Abdulrasool [Wed, 22 Jun 2016 15:44:25 +0000 (15:44 +0000)]
llvm-ar: reduce some duplication, NFC

Improve the previous change by using a local function to reduce the duplication
of the object file scanning.  NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273429 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoUpgrade old memset/memcpy signatures (without isVolatile argument) in tests
Artur Pilipenko [Wed, 22 Jun 2016 15:16:06 +0000 (15:16 +0000)]
Upgrade old memset/memcpy signatures (without isVolatile argument) in tests

We no longer have corresponding code in autoupgrade and the vast majority of the tests were fixed long time ago. Fix the remaining few. One of the verifier test cases is marked as XFAIL because it was passing only because the signature was incorrect.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273428 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoNFC. Move Verifier::verifyIntrinsicType to Intrinsics.h
Artur Pilipenko [Wed, 22 Jun 2016 14:56:33 +0000 (14:56 +0000)]
NFC. Move Verifier::verifyIntrinsicType to Intrinsics.h

Move Verifier::verifyIntrinsicType to Intrinsics::matchIntrinsicsType. Will be used to accumulate overloaded types of a given intrinsic by the upcoming patch to fix intrinsics names when overloaded types are renamed.

Reviewed By: reames

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273424 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[InstSimplify] add ashr tests including vector types
Sanjay Patel [Wed, 22 Jun 2016 14:18:04 +0000 (14:18 +0000)]
[InstSimplify] add ashr tests including vector types

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273421 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[SLPVectorizer][X86] Added ceil/floor/nearbyint/rint/trunc vectorization tests
Simon Pilgrim [Wed, 22 Jun 2016 14:07:46 +0000 (14:07 +0000)]
[SLPVectorizer][X86] Added ceil/floor/nearbyint/rint/trunc vectorization tests

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273420 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[InstSimplify] regenerate checks
Sanjay Patel [Wed, 22 Jun 2016 14:00:16 +0000 (14:00 +0000)]
[InstSimplify] regenerate checks

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273419 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[llvm-readobj] - Teach llvm-readobj to print dependencies of SHT_GNU_verdef and refac...
George Rimar [Wed, 22 Jun 2016 13:43:38 +0000 (13:43 +0000)]
[llvm-readobj] - Teach llvm-readobj to print dependencies of SHT_GNU_verdef and refactor dumping method.

This patch changes single method of llvm-readobj.
It teaches SHT_GNU_verdef dumper to print version dependencies,
also it removes few fields from output that can be dumped with other keys
and slightly refactors code.
Testcase was also modified to match the changes.
Change is required for testcases of upcoming lld patches.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273417 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoRegenerated test
Simon Pilgrim [Wed, 22 Jun 2016 12:58:15 +0000 (12:58 +0000)]
Regenerated test

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273404 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[SDAG] Remove FixedArgs parameter from CallLoweringInfo::setCallee
Krzysztof Parzyszek [Wed, 22 Jun 2016 12:54:25 +0000 (12:54 +0000)]
[SDAG] Remove FixedArgs parameter from CallLoweringInfo::setCallee

The setCallee function will set the number of fixed arguments based
on the size of the argument list. The FixedArgs parameter was often
explicitly set to 0, leading to a lack of consistent value for non-
vararg functions.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273403 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoDelete more dead code.
Rafael Espindola [Wed, 22 Jun 2016 12:44:16 +0000 (12:44 +0000)]
Delete more dead code.

Found by gcc 6.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273402 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[LTO] Move UpdateCompilerUsed.h from lib/ to include/
Davide Italiano [Wed, 22 Jun 2016 04:52:43 +0000 (04:52 +0000)]
[LTO] Move UpdateCompilerUsed.h from lib/ to include/

I plan to use it in lld soon.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273380 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[X86] Remove GCC builtins from masked integer cmp and ucmp instrinsics so we can...
Craig Topper [Wed, 22 Jun 2016 04:47:42 +0000 (04:47 +0000)]
[X86] Remove GCC builtins from masked integer cmp and ucmp instrinsics so we can emit native IR in clang.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273376 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agollvm-ar: be more clever about default format
Saleem Abdulrasool [Wed, 22 Jun 2016 04:03:28 +0000 (04:03 +0000)]
llvm-ar: be more clever about default format

Try to be more clever about selecting the default format.  When an existing
archive is used, use the type of the archive to determine the format.  When
existing members are present, use the first member's format to determine the
format to use.  If we are creating an empty archive (MRI mode) or are adding
non-object members, default to the current behaviour of using the host type due
to the lack of a better alternative.  This aids in cross-compilation on Darwin
to non-Darwin platforms which rely on GNU format archives.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273373 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[OCaml] Add functions for accessing metadata nodes.
Peter Zotov [Wed, 22 Jun 2016 03:30:24 +0000 (03:30 +0000)]
[OCaml] Add functions for accessing metadata nodes.

Patch by Xinyu Zhuang.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273370 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAdd an option to enable MBFI dot viewer for a given function
Xinliang David Li [Wed, 22 Jun 2016 02:12:54 +0000 (02:12 +0000)]
Add an option to enable MBFI dot viewer for a given function

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273366 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAMDGPU: Fix gcc warnings
Matt Arsenault [Wed, 22 Jun 2016 01:53:49 +0000 (01:53 +0000)]
AMDGPU: Fix gcc warnings

Mostly removing dead code. Apparently gcc's warning
for unused functions is better

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273363 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[codeview] Improve names of types in scopes and member function ids
Reid Kleckner [Wed, 22 Jun 2016 01:32:56 +0000 (01:32 +0000)]
[codeview] Improve names of types in scopes and member function ids

We now include namespace scope info in LF_FUNC_ID records and we emit
LF_MFUNC_ID records for member functions as we should.

Class names are now fully qualified, which is what MSVC does.

Add a little bit of scaffolding to handle ThisAdjustment when it arrives
in DISubprogram.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273358 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[codeview] Add missing test from r273294
Reid Kleckner [Wed, 22 Jun 2016 01:17:05 +0000 (01:17 +0000)]
[codeview] Add missing test from r273294

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273355 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[asan] Do not instrument pointers with address space attributes
Anna Zaks [Wed, 22 Jun 2016 00:15:52 +0000 (00:15 +0000)]
[asan] Do not instrument pointers with address space attributes

Do not instrument pointers with address space attributes since we cannot track
them anyway. Instrumenting them results in false positives in ASan and a
compiler crash in TSan. (The compiler should not crash in any case, but that's
a different problem.)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273339 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoIR: Allow metadata attachments on declarations, and fix lazy loaded metadata issue...
Peter Collingbourne [Tue, 21 Jun 2016 23:42:48 +0000 (23:42 +0000)]
IR: Allow metadata attachments on declarations, and fix lazy loaded metadata issue with globals.

This change is motivated by an upcoming change to the metadata representation
used for CFI. The indirect function call checker needs type information for
external function declarations in order to correctly generate jump table
entries for such declarations. We currently associate such type information
with declarations using a global metadata node, but I plan [1] to move all
such metadata to global object attachments.

In bitcode, metadata attachments for function declarations appear in the
global metadata block. This seems reasonable to me because I expect metadata
attachments on declarations to be uncommon. In the long term I'd also expect
this to be the case for CFI, because we'd want to use some specialized bitcode
format for this metadata that could be read as part of the ThinLTO thin-link
phase, which would mean that it would not appear in the global metadata block.

To solve the lazy loaded metadata issue I was seeing with D20147, I use the
same bitcode representation for metadata attachments for global variables as I
do for function declarations. Since there's a use case for metadata attachments
in the global metadata block, we might as well use that representation for
global variables as well, at least until we have a mechanism for lazy loading
global variables.

In the assembly format, the metadata attachments appear after the "declare"
keyword in order to avoid a parsing ambiguity.

[1] http://lists.llvm.org/pipermail/llvm-dev/2016-June/100462.html

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273336 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoClang format change /NFC
Xinliang David Li [Tue, 21 Jun 2016 23:36:12 +0000 (23:36 +0000)]
Clang format change /NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273335 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[build] Fixed build break for OCaml bindings.
Artem Belevich [Tue, 21 Jun 2016 23:10:37 +0000 (23:10 +0000)]
[build] Fixed build break for OCaml bindings.

After r273302 LLVM_SYSTEM_LIBS may have entries that already have
-l prefix and we need to deal with that.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273333 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoMake DeadMachineInstructionElim preserve CFG
Matt Arsenault [Tue, 21 Jun 2016 23:01:17 +0000 (23:01 +0000)]
Make DeadMachineInstructionElim preserve CFG

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273330 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Kryo] Enable loop prefetcher.
Haicheng Wu [Tue, 21 Jun 2016 22:47:56 +0000 (22:47 +0000)]
[Kryo] Enable loop prefetcher.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273329 91177308-0d34-0410-b5e6-96231b3b80d8