platform/upstream/llvm.git
10 years ago[Stackmaps] Update the stackmap format to use 64-bit relocations for the function...
Juergen Ributzka [Mon, 31 Mar 2014 22:14:04 +0000 (22:14 +0000)]
[Stackmaps] Update the stackmap format to use 64-bit relocations for the function address and properly align all entries.

This commit updates the stackmap format to version 1 to indicate the
reorganizaion of several fields. This was done in order to align stackmap
entries to their natural alignment and to minimize padding.

Fixes <rdar://problem/16005902>

llvm-svn: 205254

10 years ago[X86] Adjust cost of FP_TO_UINT v4f64->v4i32 as well
Adam Nemet [Mon, 31 Mar 2014 21:54:48 +0000 (21:54 +0000)]
[X86] Adjust cost of FP_TO_UINT v4f64->v4i32 as well

Pretty obvious follow-on to r205159 to also handle conversion from double
besides float.

Fixes <rdar://problem/16373208>

llvm-svn: 205253

10 years agoR600/SI: Remove leftover pattern splitting 64-bit ors.
Matt Arsenault [Mon, 31 Mar 2014 21:46:46 +0000 (21:46 +0000)]
R600/SI: Remove leftover pattern splitting 64-bit ors.

It's now matched to the scalar 64-bit or and split later if
necessary.'

llvm-svn: 205252

10 years agoMS ABI: Add a test for Unicode literals
David Majnemer [Mon, 31 Mar 2014 21:46:09 +0000 (21:46 +0000)]
MS ABI: Add a test for Unicode literals

This adds coverage for Unicode code points which are encoded with
non-zero values in the upper half of the wchar_t.

No functionality change.

llvm-svn: 205251

10 years agoMS ABI: Simplify endian swapping code
David Majnemer [Mon, 31 Mar 2014 21:46:05 +0000 (21:46 +0000)]
MS ABI: Simplify endian swapping code

No functionality change.

llvm-svn: 205250

10 years agoRemove redundant template specialization that just duplicates the partial
Richard Smith [Mon, 31 Mar 2014 21:31:04 +0000 (21:31 +0000)]
Remove redundant template specialization that just duplicates the partial
specialization that would otherwise be selected.

llvm-svn: 205249

10 years agoRegister allocator: set CSRFirstUseCost to 5 for ARM64.
Manman Ren [Mon, 31 Mar 2014 21:06:36 +0000 (21:06 +0000)]
Register allocator: set CSRFirstUseCost to 5 for ARM64.

A value of 5 means if we have a split or spill option that has a really
low cost (1 << 14 is the entry frequency), we will choose to spill
or split the really cold path before using a callee-saved register.

This gives us the performance benefit on SPECInt2k and is also conservative.

rdar://16162005

llvm-svn: 205248

10 years agoChange shouldSplitVectorElementType to better match the description.
Matt Arsenault [Mon, 31 Mar 2014 20:54:58 +0000 (20:54 +0000)]
Change shouldSplitVectorElementType to better match the description.

Pass the entire vector type, and not just the element.

llvm-svn: 205247

10 years agoWorkaround test trace output dir creation race condition
Ed Maste [Mon, 31 Mar 2014 20:36:38 +0000 (20:36 +0000)]
Workaround test trace output dir creation race condition

Since dosep.ty started invoking multiple tests in parallel, the FreeBSD
buildbot occasionally has a failure due to os.mkdir returning EEXIST.
Silently ignore that exception, but reraise any other.

llvm-svn: 205246

10 years agoFix MSVC warning.
Rui Ueyama [Mon, 31 Mar 2014 20:04:37 +0000 (20:04 +0000)]
Fix MSVC warning.

This patch is to fix the following warning when compiled with MSVC 64 bit.

  warning C4334: '<<' : result of 32-bit shift implicitly converted to 64
  bits (was 64-bit shift intended?)

llvm-svn: 205245

10 years agoR600/SI: Implement shouldConvertConstantLoadToIntImm
Matt Arsenault [Mon, 31 Mar 2014 19:54:27 +0000 (19:54 +0000)]
R600/SI: Implement shouldConvertConstantLoadToIntImm

llvm-svn: 205244

10 years agoAdd an optional ability to expand larger BUILD_VECTORs with shuffles
Hal Finkel [Mon, 31 Mar 2014 19:42:55 +0000 (19:42 +0000)]
Add an optional ability to expand larger BUILD_VECTORs with shuffles

This adds the ability to expand large (meaning with more than two unique
defined values) BUILD_VECTOR nodes in terms of SCALAR_TO_VECTOR and (legal)
vector shuffles. There is now no limit of the size we are capable of expanding
this way, although we don't currently do this for vectors with many unique
values because of the default implementation of TLI's
shouldExpandBuildVectorWithShuffles function.

There is currently no functional change to any existing targets because the new
capabilities are not used unless some target overrides the TLI
shouldExpandBuildVectorWithShuffles function. As a result, I've not included a
test case for the new functionality in this commit, but regression tests will
(at least) be added soon when I commit support for the PPC QPX vector
instruction set.

The benefit of committing this now is that it makes the
shouldExpandBuildVectorWithShuffles callback, which had to be added for other
reasons regardless, fully functional. I suspect that other targets will
also benefit from tuning the heuristic.

llvm-svn: 205243

10 years agoR600: Compute masked bits for min and max
Matt Arsenault [Mon, 31 Mar 2014 19:35:33 +0000 (19:35 +0000)]
R600: Compute masked bits for min and max

llvm-svn: 205242

10 years agoFix one thread timeout logic
Ed Maste [Mon, 31 Mar 2014 19:28:14 +0000 (19:28 +0000)]
Fix one thread timeout logic

This should fix the seemingly-random failures observed on the FreeBSD
buildbot.

llvm-svn: 205241

10 years agoDon't relocate with sections if there might be a paired relocation.
Rafael Espindola [Mon, 31 Mar 2014 19:00:23 +0000 (19:00 +0000)]
Don't relocate with sections if there might be a paired relocation.

llvm-svn: 205240

10 years agoCheck-in binary to isolate the lld test form a changing llvm-mc.
Rafael Espindola [Mon, 31 Mar 2014 18:56:30 +0000 (18:56 +0000)]
Check-in binary to isolate the lld test form a changing llvm-mc.

llvm-svn: 205238

10 years agoRevert: [mips] Rewrite MipsAsmParser and MipsOperand.' due to buildbot errors in...
Daniel Sanders [Mon, 31 Mar 2014 18:51:43 +0000 (18:51 +0000)]
Revert: [mips] Rewrite MipsAsmParser and MipsOperand.' due to buildbot errors in lld tests.

It's currently unable to parse 'sym + imm' without surrounding parenthesis.

llvm-svn: 205237

10 years agoR600: Add BFE, BFI, and BFM intrinsics to help with writing tests.
Matt Arsenault [Mon, 31 Mar 2014 18:21:18 +0000 (18:21 +0000)]
R600: Add BFE, BFI, and BFM intrinsics to help with writing tests.

llvm-svn: 205236

10 years agoR600: Add target nodes for BFM and BFI
Matt Arsenault [Mon, 31 Mar 2014 18:21:13 +0000 (18:21 +0000)]
R600: Add target nodes for BFM and BFI

llvm-svn: 205235

10 years agoUnify __declspec attribute argument parsing with the common attribute argument parsin...
Aaron Ballman [Mon, 31 Mar 2014 18:18:43 +0000 (18:18 +0000)]
Unify __declspec attribute argument parsing with the common attribute argument parsing code.

This removes a diagnostic that is no longer required (the semantic engine now properly handles attribute syntax so __declspec and __attribute__ spellings no longer get mismatched). This caused several testcases to need updating for a slightly different wording.

llvm-svn: 205234

10 years agoARM: fix typo
Saleem Abdulrasool [Mon, 31 Mar 2014 18:09:10 +0000 (18:09 +0000)]
ARM: fix typo

llvm-svn: 205233

10 years agoNow that this test is assembly, make the checks a bit stronger.
Rafael Espindola [Mon, 31 Mar 2014 18:01:50 +0000 (18:01 +0000)]
Now that this test is assembly, make the checks a bit stronger.

This will be used for a followup patch.

llvm-svn: 205232

10 years ago[PowerPC] Don't ever expand BUILD_VECTOR of v2i64 with shuffles
Hal Finkel [Mon, 31 Mar 2014 17:48:16 +0000 (17:48 +0000)]
[PowerPC] Don't ever expand BUILD_VECTOR of v2i64 with shuffles

If we have two unique values for a v2i64 build vector, this will always result
in two vector loads if we expand using shuffles. Only one is necessary.

llvm-svn: 205231

10 years agoAdd a TLI hook to control when BUILD_VECTOR might be expanded using shuffles
Hal Finkel [Mon, 31 Mar 2014 17:48:10 +0000 (17:48 +0000)]
Add a TLI hook to control when BUILD_VECTOR might be expanded using shuffles

There are two general methods for expanding a BUILD_VECTOR node:
  1. Use SCALAR_TO_VECTOR on the defined scalar values and then shuffle
     them together.
  2. Build the vector on the stack and then load it.

Currently, we use a fixed heuristic: If there are only one or two unique
defined values, then we attempt an expansion in terms of SCALAR_TO_VECTOR and
vector shuffles (provided that the required shuffle mask is legal). Otherwise,
always expand via the stack. Even when SCALAR_TO_VECTOR is not legal, this
can still be a good idea depending on what tricks the target can play when
lowering the resulting shuffle. If the target can't do anything special,
however, and if SCALAR_TO_VECTOR is expanded via the stack, this heuristic
leads to sub-optimal code (two stack loads instead of one).

Because only the target knows whether the SCALAR_TO_VECTORs and shuffles for a
build vector of a particular type are likely to be optimial, this adds a new
TLI function: shouldExpandBuildVectorWithShuffles which takes the vector type
and the count of unique defined values. If this function returns true, then
method (1) will be used, subject to the constraint that all of the necessary
shuffles are legal (as determined by isShuffleMaskLegal). If this function
returns false, then method (2) is always used.

This commit does not enhance the current code to support expanding a
build_vector with more than two unique values using shuffles, but I'll commit
an implementation of the more-general case shortly.

llvm-svn: 205230

10 years ago[mips] Rewrite MipsAsmParser and MipsOperand.
Daniel Sanders [Mon, 31 Mar 2014 17:43:46 +0000 (17:43 +0000)]
[mips] Rewrite MipsAsmParser and MipsOperand.

Summary:
Highlights:
- Registers are resolved much later (by the render method).
  Prior to that point, GPR32's/GPR64's are GPR's regardless of register
  size. Similarly FGR32's/FGR64's/AFGR64's are FGR's regardless of register
  size or FR mode. Numeric registers can be anything.
- All registers are parsed the same way everywhere (even when handling
  symbol aliasing)
  - One consequence is that all registers can be specified numerically
    almost anywhere (e.g. $fccX, $wX). The exception is symbol aliasing
    but that can be easily resolved.
- Removes the need for the hasConsumedDollar hack
- Parenthesis and Bracket suffixes are handled generically
- Micromips instructions are parsed directly instead of going through the
  standard encodings first.
- rdhwr accepts all 32 registers, and the following instructions that previously
  xfailed now work:
    ddiv, ddivu, div, divu, cvt.l.[ds], se[bh], wsbh, floor.w.[ds], c.ngl.d,
    c.sf.s, dsbh, dshd, madd.s, msub.s, nmadd.s, nmsub.s, swxc1
- Diagnostics involving registers point at the correct character (the $)
- There's only one kind of immediate in MipsOperand. LSA immediates are handled
  by the predicate and renderer.

Lowlights:
- Hardcoded '$zero' in the div patterns is handled with a hack.
  MipsOperand::isReg() will return true for a k_RegisterIndex token
  with Index == 0 and getReg() will return ZERO for this case. Note that it
  doesn't return ZERO_64 on isGP64() targets.
- I haven't cleaned up all of the now-unused functions.
  Some more of the generic parser could be removed too (integers and relocs
  for example).
- insve.df needed a custom decoder to handle the implicit fourth operand that
  was needed to make it parse correctly. The difficulty was that the matcher
  expected a Token<'0'> but gets an Imm<0>. Adding an implicit zero solved this.

Reviewers: matheusalmeida, vmedic

Reviewed By: matheusalmeida

Differential Revision: http://llvm-reviews.chandlerc.com/D3222

llvm-svn: 205229

10 years agoDisable each MachineFunctionPass for 'optnone' functions, unless that
Paul Robinson [Mon, 31 Mar 2014 17:43:35 +0000 (17:43 +0000)]
Disable each MachineFunctionPass for 'optnone' functions, unless that
pass normally runs at optimization level None, or is part of the
register allocation pipeline.

llvm-svn: 205228

10 years agoTwo updated tests for MinGW 32 and 64 exception handling code generation.
Yaron Keren [Mon, 31 Mar 2014 17:34:15 +0000 (17:34 +0000)]
Two updated tests for MinGW 32 and 64 exception handling code generation.

llvm-svn: 205227

10 years agoIntroduced an attribute syntax-neutral method for parsing attribute arguments that...
Aaron Ballman [Mon, 31 Mar 2014 17:32:39 +0000 (17:32 +0000)]
Introduced an attribute syntax-neutral method for parsing attribute arguments that is currently being used by GNU and C++-style attributes. This allows C++11 attributes with argument lists to be handled properly, fixing the "deprecated", "type_visibility", and capability-related attributes with arguments.

llvm-svn: 205226

10 years agoMS ABI: mangleStringLiteral shouldn't rely on the host's endianness
David Majnemer [Mon, 31 Mar 2014 17:18:53 +0000 (17:18 +0000)]
MS ABI: mangleStringLiteral shouldn't rely on the host's endianness

No test case is needed, the one in-tree is sufficient.  The build-bot
never emailed me because something else had upset it.

llvm-svn: 205225

10 years agoRevert "[core] support .gnu.linkonce sections"
Shankar Easwaran [Mon, 31 Mar 2014 17:12:06 +0000 (17:12 +0000)]
Revert "[core] support .gnu.linkonce sections"

This reverts commit 5d5ca72a7876c3dd3dd1db83dc6a0d74be9e2cd1.

Discuss on a better design to raise error when there is a similar group with Gnu
linkonce sections and COMDAT sections.

llvm-svn: 205224

10 years agoMS ABI: Document the '\xc1' to '\xda' manglings
David Majnemer [Mon, 31 Mar 2014 17:09:09 +0000 (17:09 +0000)]
MS ABI: Document the '\xc1' to '\xda' manglings

No functionality change.

llvm-svn: 205223

10 years ago[PowerPC] Correct P7 dispatch unit allocation for vector instructions
Hal Finkel [Mon, 31 Mar 2014 17:02:10 +0000 (17:02 +0000)]
[PowerPC] Correct P7 dispatch unit allocation for vector instructions

llvm-svn: 205222

10 years agoThis patch fixes LTO's RecordStreamer so that it records symbols in the MCExpr
Tom Roeder [Mon, 31 Mar 2014 16:59:13 +0000 (16:59 +0000)]
This patch fixes LTO's RecordStreamer so that it records symbols in the MCExpr
part of an asm .symver directive as being used. This prevents referenced
functions from being internalized and deleted.

Without the patch to LTOModule.cpp, the test case will produce the error:

LLVM ERROR: A @@ version cannot be undefined.

llvm-svn: 205221

10 years agoRemove unused diagnostic + dead test for it.
Benjamin Kramer [Mon, 31 Mar 2014 16:55:01 +0000 (16:55 +0000)]
Remove unused diagnostic + dead test for it.

llvm-svn: 205220

10 years agoSupport: generalise object type handling for Windows
Saleem Abdulrasool [Mon, 31 Mar 2014 16:34:41 +0000 (16:34 +0000)]
Support: generalise object type handling for Windows

This generalises the object file type parsing to all Windows environments.  This
is used by cygwin as well as MSVC environments for MCJIT.  This also makes the
triple more similar to Chandler's suggestion of a separate field for the object
file format.

llvm-svn: 205219

10 years agoMS ABI: Make test introduced in r205217 more robust
David Majnemer [Mon, 31 Mar 2014 16:30:00 +0000 (16:30 +0000)]
MS ABI: Make test introduced in r205217 more robust

Don't assume any particular IR Value name, pattern match the names from
the GEP instructions instead.

llvm-svn: 205218

10 years agoMS ABI: Use the proper type for inalloca args
David Majnemer [Mon, 31 Mar 2014 16:12:47 +0000 (16:12 +0000)]
MS ABI: Use the proper type for inalloca args

Summary:
The definition of a type later in a translation unit may change it's
type from {}* to (%struct.foo*)*.  Earlier function definitions may use
the former while more recent definitions might use the later.  This is
fine until they interact with one another (like one calling the other).
In these cases, a bitcast is needed because the inalloca must match the
function call but the store to the lvalue which initializes the argument
slot has to match the rvalue's type.

This technique is along the same lines with what the other,
non-inalloca, codepaths perform.

This fixes PR19287.

Reviewers: rnk

CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D3224

llvm-svn: 205217

10 years agoPR19099 - revert r203483
Eli Bendersky [Mon, 31 Mar 2014 16:11:57 +0000 (16:11 +0000)]
PR19099 - revert r203483

Now that r205212 was committed, r203483 is no longer necessary; it was a
temporary workaround that only handled a small number of the problematic cases.

llvm-svn: 205216

10 years agoARM: change parameter names of the ELFARMAsmBackend constructor
Christian Pirker [Mon, 31 Mar 2014 16:06:39 +0000 (16:06 +0000)]
ARM: change parameter names of the ELFARMAsmBackend constructor

I removed the underscore at the beginning of the parameter name,
because of a comment from Tim.

llvm-svn: 205215

10 years agoTest commit.
Robert Khasanov [Mon, 31 Mar 2014 16:01:38 +0000 (16:01 +0000)]
Test commit.

llvm-svn: 205214

10 years ago[mips] Fix use of uninitialized value reported by the sanitizer-x86_64-linux-bootstra...
Daniel Sanders [Mon, 31 Mar 2014 15:58:58 +0000 (15:58 +0000)]
[mips] Fix use of uninitialized value reported by the sanitizer-x86_64-linux-bootstrap buildbot

llvm-svn: 205213

10 years agoFix for PR19099 - NVPTX produces invalid symbol names.
Eli Bendersky [Mon, 31 Mar 2014 15:56:26 +0000 (15:56 +0000)]
Fix for PR19099 - NVPTX produces invalid symbol names.

This is a more thorough fix for the issue than r203483. An IR pass will run
before NVPTX codegen to make sure there are no invalid symbol names that can't
be consumed by the ptxas assembler.

llvm-svn: 205212

10 years agoFixing MSVC windows build. Please respect code order when ifdefing out MSVC specifics :)
Colin Riley [Mon, 31 Mar 2014 15:48:33 +0000 (15:48 +0000)]
Fixing MSVC windows build. Please respect code order when ifdefing out MSVC specifics :)

llvm-svn: 205211

10 years agoARM64: enable aarch64-neon-intrinsics.c test
Tim Northover [Mon, 31 Mar 2014 15:47:09 +0000 (15:47 +0000)]
ARM64: enable aarch64-neon-intrinsics.c test

This adds support for the various NEON intrinsics used by
aarch64-neon-intrinsics.c (originally written for AArch64) and enables the
test.

My implementations are designed to be semantically correct, the actual code
quality looks like its a wash between the two backends, and is frequently
different (hence the large number of CHECK changes).

llvm-svn: 205210

10 years agoARM64: add extra patterns for scalar shifts
Tim Northover [Mon, 31 Mar 2014 15:46:46 +0000 (15:46 +0000)]
ARM64: add extra patterns for scalar shifts

llvm-svn: 205209

10 years agoARM64: add extra scalar neg pattern & tests.
Tim Northover [Mon, 31 Mar 2014 15:46:42 +0000 (15:46 +0000)]
ARM64: add extra scalar neg pattern & tests.

llvm-svn: 205208

10 years agoARM64: add patterns for scalar sqdmlal & sqdmlsl.
Tim Northover [Mon, 31 Mar 2014 15:46:38 +0000 (15:46 +0000)]
ARM64: add patterns for scalar sqdmlal & sqdmlsl.

llvm-svn: 205207

10 years agoARM64: add more patterns for commuted fmsub operations.
Tim Northover [Mon, 31 Mar 2014 15:46:34 +0000 (15:46 +0000)]
ARM64: add more patterns for commuted fmsub operations.

llvm-svn: 205206

10 years agoARM64: shuffle patterns around for fmin/fmax & add tests.
Tim Northover [Mon, 31 Mar 2014 15:46:30 +0000 (15:46 +0000)]
ARM64: shuffle patterns around for fmin/fmax & add tests.

llvm-svn: 205205

10 years agoARM64: add more scalar patterns for usqadd & suqadd.
Tim Northover [Mon, 31 Mar 2014 15:46:26 +0000 (15:46 +0000)]
ARM64: add more scalar patterns for usqadd & suqadd.

llvm-svn: 205204

10 years agoARM64: add more scalar patterns for reciprocal ops.
Tim Northover [Mon, 31 Mar 2014 15:46:22 +0000 (15:46 +0000)]
ARM64: add more scalar patterns for reciprocal ops.

llvm-svn: 205203

10 years agoARM64: add i64 scalar pattern for @llvm.arm64.abs
Tim Northover [Mon, 31 Mar 2014 15:46:17 +0000 (15:46 +0000)]
ARM64: add i64 scalar pattern for @llvm.arm64.abs

This will be used by the Clang front-end code for vabsd_s64.

llvm-svn: 205202

10 years agoPost-commit review coding style change: renaming HasAttribute to hasAttribute. No...
Aaron Ballman [Mon, 31 Mar 2014 15:26:40 +0000 (15:26 +0000)]
Post-commit review coding style change: renaming HasAttribute to hasAttribute. No functional changes.

llvm-svn: 205201

10 years ago[mips] Implement missing relocations in the integrated assembler.
Daniel Sanders [Mon, 31 Mar 2014 15:15:02 +0000 (15:15 +0000)]
[mips] Implement missing relocations in the integrated assembler.

%got_hi, %got_lo, %call_hi, %call_lo, %higher, and %highest are now recognised
by MipsAsmParser::getVariantKind().

To prevent future issues with missing entries in this StringSwitch, I've added
an assertion to the default case.

llvm-svn: 205200

10 years ago[OPENMP] clang-formatted include/clang/AST/StmtOpenMP.h
Alexander Musman [Mon, 31 Mar 2014 15:08:32 +0000 (15:08 +0000)]
[OPENMP] clang-formatted include/clang/AST/StmtOpenMP.h

llvm-svn: 205199

10 years agoSema: Require external linkage for dll attributes
Nico Rieck [Mon, 31 Mar 2014 14:56:58 +0000 (14:56 +0000)]
Sema: Require external linkage for dll attributes

llvm-svn: 205198

10 years agoSema: Check dll attributes on redeclarations
Nico Rieck [Mon, 31 Mar 2014 14:56:15 +0000 (14:56 +0000)]
Sema: Check dll attributes on redeclarations

A redeclaration may not add dllimport or dllexport attributes. dllexport is
sticky and can be omitted on redeclarations while dllimport cannot.

llvm-svn: 205197

10 years ago[mips] Remove R_MIPS_GOT which isn't used and shares the same number as R_MIPS_GOT16
Daniel Sanders [Mon, 31 Mar 2014 14:47:41 +0000 (14:47 +0000)]
[mips] Remove R_MIPS_GOT which isn't used and shares the same number as R_MIPS_GOT16

Unlike my previous commit, don't try to remove the corresponding VK_Mips_GOT yet
even though it shares the same assembly text since that is used.

llvm-svn: 205196

10 years agoRevert r205194 - [mips] Removed R_MIPS_GOT. It's identical to R_MIPS_GOT16.
Daniel Sanders [Mon, 31 Mar 2014 14:34:36 +0000 (14:34 +0000)]
Revert r205194 - [mips] Removed R_MIPS_GOT. It's identical to   R_MIPS_GOT16.

There's a couple additional bits I missed.

llvm-svn: 205195

10 years ago[mips] Removed R_MIPS_GOT. It's identical to R_MIPS_GOT16.
Daniel Sanders [Mon, 31 Mar 2014 14:30:05 +0000 (14:30 +0000)]
[mips] Removed R_MIPS_GOT. It's identical to R_MIPS_GOT16.

llvm-svn: 205194

10 years agoclang-format: Solve issues found and fixed by clang-tidy.
Daniel Jasper [Mon, 31 Mar 2014 14:23:49 +0000 (14:23 +0000)]
clang-format: Solve issues found and fixed by clang-tidy.

llvm-svn: 205193

10 years ago[msan] Remove an extra top frame from track-origins=2 reports.
Evgeniy Stepanov [Mon, 31 Mar 2014 14:18:55 +0000 (14:18 +0000)]
[msan] Remove an extra top frame from track-origins=2 reports.

llvm-svn: 205192

10 years agoCapitalize the D in parseDirectiveGpDWord.
Rafael Espindola [Mon, 31 Mar 2014 14:15:07 +0000 (14:15 +0000)]
Capitalize the D in parseDirectiveGpDWord.

DWord seems to be the canonical way to camel case dword in llvm.

Thanks to Daniel Sander for noticing.

llvm-svn: 205191

10 years agoRemove unused private typedef
Dmitri Gribenko [Mon, 31 Mar 2014 14:14:13 +0000 (14:14 +0000)]
Remove unused private typedef

llvm-svn: 205190

10 years agoclang/tools/driver/Makefile: Quick fix corresponding to r205181.
NAKAMURA Takumi [Mon, 31 Mar 2014 14:11:11 +0000 (14:11 +0000)]
clang/tools/driver/Makefile: Quick fix corresponding to r205181.

llvm-svn: 205189

10 years agoR600/SI: Implement SIInstrInfo::isTriviallyRematerializable()
Tom Stellard [Mon, 31 Mar 2014 14:01:56 +0000 (14:01 +0000)]
R600/SI: Implement SIInstrInfo::isTriviallyRematerializable()

llvm-svn: 205188

10 years agoR600/SI: Lower i64 SELECT by bitcasting to a vector type
Tom Stellard [Mon, 31 Mar 2014 14:01:55 +0000 (14:01 +0000)]
R600/SI: Lower i64 SELECT by bitcasting to a vector type

This allows allows us to replace ISD::EXTRACT_ELEMENT, which is lowered
using shifts, with ISD::EXTRACT_VECTOR_ELT, which is a no-op.

llvm-svn: 205187

10 years agoR600/SI: Return the correct index for VGPRs in getHWRegIndex()
Tom Stellard [Mon, 31 Mar 2014 14:01:52 +0000 (14:01 +0000)]
R600/SI: Return the correct index for VGPRs in getHWRegIndex()

The register index is stored in the low 8-bits of the encoding.

llvm-svn: 205186

10 years agoFixed issue with microMIPS JAL instruction.
Zoran Jovanovic [Mon, 31 Mar 2014 14:00:10 +0000 (14:00 +0000)]
Fixed issue with microMIPS JAL instruction.
Differential Revision: http://llvm-reviews.chandlerc.com/D3200

llvm-svn: 205185

10 years ago[sanitizer] Test that we can compile C++ code on the target platform.
Evgeniy Stepanov [Mon, 31 Mar 2014 13:50:13 +0000 (13:50 +0000)]
[sanitizer] Test that we can compile C++ code on the target platform.

llvm-svn: 205184

10 years ago[CMake] Rename add_compiler_rt_static_runtime to add_compiler_rt_runtime.
Alexey Samsonov [Mon, 31 Mar 2014 13:45:36 +0000 (13:45 +0000)]
[CMake] Rename add_compiler_rt_static_runtime to add_compiler_rt_runtime.

Soon there will be an option to build compiler-rt parts as shared libraries
on Linux. Extracted from http://llvm-reviews.chandlerc.com/D3042
by Yuri Gribov.

llvm-svn: 205183

10 years agollvm/test/MC/Mips/mips64r2/valid-xfail.s: This REQUIRES asserts. Seems it doesn't...
NAKAMURA Takumi [Mon, 31 Mar 2014 13:30:02 +0000 (13:30 +0000)]
llvm/test/MC/Mips/mips64r2/valid-xfail.s: This REQUIRES asserts. Seems it doesn't fail with -Asserts.

llvm-svn: 205182

10 years agoReapplying r204952 a second time.
Aaron Ballman [Mon, 31 Mar 2014 13:14:44 +0000 (13:14 +0000)]
Reapplying r204952 a second time.

Clean up the __has_attribute implementation without modifying its behavior.

Replaces the tablegen-driven AttrSpellings.inc, which lived in the lexing layer with AttrHasAttributeImpl.inc, which lives in the basic layer. Updates the preprocessor to call through to this new functionality which can take additional information into account (such as scopes and syntaxes).

Expose the ability for parts of the compiler to ask whether an attribute is supported for a given spelling (including scope), syntax, triple and language options.

llvm-svn: 205181

10 years ago[mips] Added a full set of instruction test cases for all ISA's (but not ASE's).
Daniel Sanders [Mon, 31 Mar 2014 12:13:12 +0000 (12:13 +0000)]
[mips] Added a full set of instruction test cases for all ISA's (but not ASE's).

Summary:
Where those ISA's are not currently supported, the test is run with the smallest
superset of that ISA.

Some instructions are valid but don't pass yet. These have been placed in the
valid-xfail.s's which will XPASS if _any_ instruction starts working.

The valid.s's do not verify the encoding yet. There are also no tests checking that instructions from neighbouring ISA's are not accepted.

Reviewers: matheusalmeida

Reviewed By: matheusalmeida

Differential Revision: http://llvm-reviews.chandlerc.com/D3214

llvm-svn: 205180

10 years agoLook at shuffles of build_vectors in DAGCombiner::visitEXTRACT_VECTOR_ELT
Hal Finkel [Mon, 31 Mar 2014 11:43:19 +0000 (11:43 +0000)]
Look at shuffles of build_vectors in DAGCombiner::visitEXTRACT_VECTOR_ELT

When the loop vectorizer vectorizes code that uses the loop induction variable,
we often end up with IR like this:

  %b1 = insertelement <2 x i32> undef, i32 %v, i32 0
  %b2 = shufflevector <2 x i32> %b1, <2 x i32> undef, <2 x i32> zeroinitializer
  %i = add <2 x i32> %b2, <i32 2, i32 3>

If the add in this example is not legal (as is the case on PPC with VSX), it
will be scalarized, and we'll end up with a number of extract_vector_elt nodes
with the vector shuffle as the input operand, and that vector shuffle is fed by
one or more build_vector nodes. By the time that vector operations are
expanded, visitEXTRACT_VECTOR_ELT will not create new extract_vector_elt by
looking through the vector shuffle (to make sure that no illegal operations are
created), and so the extract_vector_elt -> vector shuffle -> build_vector is
never simplified to an operand of the build vector.

By looking at build_vectors through a shuffle we fix this particular situation,
preventing a vector from being built, only to be deconstructed again (for the
scalarized add) -- an expensive proposition when this all needs to be done via
the stack. We probably want a more comprehensive fix here where we look back
recursively through any shuffles to any build_vectors or scalar_to_vectors,
etc. but that can come later.

llvm-svn: 205179

10 years agoSlightly improve the readability of MicrosoftVTableContext::computeVTablePaths()...
Timur Iskhodzhanov [Mon, 31 Mar 2014 11:01:51 +0000 (11:01 +0000)]
Slightly improve the readability of MicrosoftVTableContext::computeVTablePaths().  No functionality changes.

llvm-svn: 205178

10 years ago[mips] Check emitted code for llvm.bswap.i32 on MIPS16/MIPS64 and llvm.bswap.i64...
Daniel Sanders [Mon, 31 Mar 2014 11:00:04 +0000 (11:00 +0000)]
[mips] Check emitted code for llvm.bswap.i32 on MIPS16/MIPS64 and llvm.bswap.i64 on MIPS16.

While reviewing r204163, I noticed that the MIPS16 test only checked for a .ent
directive and didn't actually check the code emitted. Fixed this and added a
check for llvm.bswap.i32 on MIPS64 at the same time.

llvm-svn: 205177

10 years ago[TSan] Follow-up for r205175: typo fix in the test.
Alexander Potapenko [Mon, 31 Mar 2014 10:51:13 +0000 (10:51 +0000)]
[TSan] Follow-up for r205175: typo fix in the test.

llvm-svn: 205176

10 years ago[TSan] Replace several Printf() calls with Report() to ease debugging.
Alexander Potapenko [Mon, 31 Mar 2014 10:46:07 +0000 (10:46 +0000)]
[TSan] Replace several Printf() calls with Report() to ease debugging.

llvm-svn: 205175

10 years agoARM64: fix a couple of signed/unsigned comparison warnings.
Tim Northover [Mon, 31 Mar 2014 10:21:36 +0000 (10:21 +0000)]
ARM64: fix a couple of signed/unsigned comparison warnings.

llvm-svn: 205174

10 years ago[yaml2obj] Add support for ELF e_flags.
Daniel Sanders [Mon, 31 Mar 2014 09:44:05 +0000 (09:44 +0000)]
[yaml2obj] Add support for ELF e_flags.

Summary:
The FileHeader mapping now accepts an optional Flags sequence that accepts
the EF_<arch>_<flag> constants. When not given, Flags defaults to zero.

Reviewers: atanasyan

Reviewed By: atanasyan

CC: llvm-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D3213

llvm-svn: 205173

10 years agoAdded _rdtsc intrinsics by Robert Khasanov
Alexey Volkov [Mon, 31 Mar 2014 08:08:46 +0000 (08:08 +0000)]
Added _rdtsc intrinsics by Robert Khasanov

Differential Revision: http://llvm-reviews.chandlerc.com/D3212

llvm-svn: 205172

10 years agoTry to fix MSan bootstrap bot: make ARM64Disassembler::getInstruction() always initia...
Alexey Samsonov [Mon, 31 Mar 2014 07:59:33 +0000 (07:59 +0000)]
Try to fix MSan bootstrap bot: make ARM64Disassembler::getInstruction() always initialize Size argument.

llvm-svn: 205171

10 years agoCorrect OS conditionals following r204977 and r204978.
Yaron Keren [Mon, 31 Mar 2014 07:59:14 +0000 (07:59 +0000)]
Correct OS conditionals following r204977 and r204978.

Previously, MinGW OS was Triple::MinGW and Cygwin was Triple::Cygwin
and now it is Triple::Win32 with Environment being GNU or Cygwin.
So,

  TheTriple.getOS() == Triple::Win32

is replaced by

  TheTriple.isWindowsMSVCEnvironment()

and

  (TheTriple.getOS() == Triple::MinGW32 || TheTriple.getOS() == Triple::Cygwin)

is replaced by

  TheTriple.isOSCygMing()

llvm-svn: 205170

10 years agoRemove unused variable
Dmitri Gribenko [Mon, 31 Mar 2014 07:52:35 +0000 (07:52 +0000)]
Remove unused variable

llvm-svn: 205169

10 years ago[sanitizer] speed up the bitvector-based deadlock detector by ~15% (iterate over...
Kostya Serebryany [Mon, 31 Mar 2014 07:23:50 +0000 (07:23 +0000)]
[sanitizer] speed up the bitvector-based deadlock detector by ~15% (iterate over the currently held locks using the array, not the bitvector. Bitvector is not the best data structure to iterate over)

llvm-svn: 205168

10 years agoARM64: remove currently trivial switch statement
Tim Northover [Mon, 31 Mar 2014 07:20:13 +0000 (07:20 +0000)]
ARM64: remove currently trivial switch statement

llvm-svn: 205167

10 years ago[C++11] Mark more classes in the X86 target as 'final'.
Craig Topper [Mon, 31 Mar 2014 06:53:13 +0000 (06:53 +0000)]
[C++11] Mark more classes in the X86 target as 'final'.

llvm-svn: 205166

10 years agoMark a couple of the X86 target classes as final. Allows the compiler to de-virtualiz...
Craig Topper [Mon, 31 Mar 2014 06:22:15 +0000 (06:22 +0000)]
Mark a couple of the X86 target classes as final. Allows the compiler to de-virtualize some internal calls.

llvm-svn: 205165

10 years ago[OPENMP] Implemented 'copyin' clause
Alexey Bataev [Mon, 31 Mar 2014 03:36:38 +0000 (03:36 +0000)]
[OPENMP] Implemented 'copyin' clause

llvm-svn: 205164

10 years ago[core] support .gnu.linkonce sections
Shankar Easwaran [Mon, 31 Mar 2014 03:16:37 +0000 (03:16 +0000)]
[core] support .gnu.linkonce sections

.gnu.linkonce sections are similar to section groups. They were supported before
section groups existed and provided a way to resolve COMDAT sections using a
different design. There are few implementations that use .gnu.linkonce sections
to store simple floating point constants which doesnot require complex section
group support but need a way to store only one copy of the floating point
constant. .gnu.linkonce based symbol resolution achieves that.

llvm-svn: 205163

10 years agoARM64CollectLOH.cpp: Tweak \param. [-Wdocumentation]
NAKAMURA Takumi [Mon, 31 Mar 2014 01:10:26 +0000 (01:10 +0000)]
ARM64CollectLOH.cpp: Tweak \param. [-Wdocumentation]

llvm-svn: 205162

10 years ago[ARM64] Fix materialization of an fp128 zero immediate. There currently
Chandler Carruth [Mon, 31 Mar 2014 00:02:10 +0000 (00:02 +0000)]
[ARM64] Fix materialization of an fp128 zero immediate. There currently
is not a pattern to lower this with clever instructions that zero the
register, so restrict the zero immediate legality special case to f64
and f32 (the only two sizes which fmov seems to directly support). Fixes
backend errors when building code such as libxml.

llvm-svn: 205161

10 years agoAdd documentation for the pcs attribute, based on r129534's commit message.
Nico Weber [Sun, 30 Mar 2014 19:45:58 +0000 (19:45 +0000)]
Add documentation for the pcs attribute, based on r129534's commit message.

llvm-svn: 205160

10 years ago[X86] Adjust cost of FP_TO_UINT v8f32->v8i32
Adam Nemet [Sun, 30 Mar 2014 18:07:13 +0000 (18:07 +0000)]
[X86] Adjust cost of FP_TO_UINT v8f32->v8i32

There is no direct AVX instruction to convert to unsigned.  I have some ideas
how we may be able to do this with three vector instructions but the current
backend just bails on this to get it scalarized.

See the comment why we need to adjust the cost returned by BasicTTI.

The test is a bit roundabout (and checks assembly rather than bit code) because
I'd like it to work even if at some point we could vectorize this conversion.

Fixes <rdar://problem/16371920>

llvm-svn: 205159

10 years agoRTTI: refactor the uniqueness question into CGCXXABI.
Tim Northover [Sun, 30 Mar 2014 17:32:48 +0000 (17:32 +0000)]
RTTI: refactor the uniqueness question into CGCXXABI.

This also brings the code into closer conformance with usual LLVM
coding style and other surrounding conventions.

llvm-svn: 205158

10 years agoPR18929:
Stepan Dyatkovskiy [Sun, 30 Mar 2014 17:09:54 +0000 (17:09 +0000)]
PR18929:
According to ARM assembler language hash symbol is optional before immediates.
For example, see here for more details:
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0473j/dom1359731154529.html

llvm-svn: 205157

10 years agoMS ABI: Correct typo in mangleStringLiteral
David Majnemer [Sun, 30 Mar 2014 16:38:02 +0000 (16:38 +0000)]
MS ABI: Correct typo in mangleStringLiteral

No functionality change.

llvm-svn: 205156

10 years agoMS ABI: Simplify mangleTemplateArgs
David Majnemer [Sun, 30 Mar 2014 16:30:54 +0000 (16:30 +0000)]
MS ABI: Simplify mangleTemplateArgs

No functionality change.

llvm-svn: 205154

10 years agoMake use of previously generated stores in SelectionDAGLegalize::ExpandExtractFromVec...
Hal Finkel [Sun, 30 Mar 2014 15:10:18 +0000 (15:10 +0000)]
Make use of previously generated stores in SelectionDAGLegalize::ExpandExtractFromVectorThroughStack

When expanding EXTRACT_VECTOR_ELT and EXTRACT_SUBVECTOR using
SelectionDAGLegalize::ExpandExtractFromVectorThroughStack, we store the entire
vector and then load the piece we want. This is fine in isolation, but
generating a new store (and corresponding stack slot) for each extraction ends
up producing code of poor quality. When we scalarize a vector operation (using
SelectionDAG::UnrollVectorOp for example) we generate one EXTRACT_VECTOR_ELT
for each element in the vector. This used to generate one stored copy of the
vector for each element in the vector. Now we search the uses of the vector for
a suitable store before generating a new one, which results in much more
efficient scalarization code.

llvm-svn: 205153