platform/upstream/llvm.git
10 years agoImplement ProcessMonitor::Kill for FreeBSD
Ed Maste [Tue, 1 Apr 2014 14:30:56 +0000 (14:30 +0000)]
Implement ProcessMonitor::Kill for FreeBSD

On FreeBSD ptrace(PT_KILL) is used to terminate the traced process
(as if PT_CONTINUE had been used with SIGKILL as the signal to be
delivered), and is the desired behaviour for ProcessPOSIX::DoDestroy.

On Linux, after ptrace(PTRACE_KILL) the traced process still exists
and can be interrogated.  It is only upon resume that it exits as though
it received SIGKILL.

For now I'm committing only the FreeBSD change, until the Linux change
(review D3159) is successfully tested.

http://llvm.org/pr18894

llvm-svn: 205315

10 years agoARM: teach LLVM that Cortex-A7 is very similar to A8.
Tim Northover [Tue, 1 Apr 2014 14:10:07 +0000 (14:10 +0000)]
ARM: teach LLVM that Cortex-A7 is very similar to A8.

llvm-svn: 205314

10 years agoAttempting to fix r205124, which had failed asserts when built with MSVC.
Aaron Ballman [Tue, 1 Apr 2014 13:56:35 +0000 (13:56 +0000)]
Attempting to fix r205124, which had failed asserts when built with MSVC.

Suggestion from Yaron Keren.

llvm-svn: 205313

10 years agoAdd support for IEEE754 quad precision comparison functions.
Joerg Sonnenberger [Tue, 1 Apr 2014 13:42:56 +0000 (13:42 +0000)]
Add support for IEEE754 quad precision comparison functions.
From GuanHong Liu.

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

llvm-svn: 205312

10 years ago[ASan] Fix Android build
Alexey Samsonov [Tue, 1 Apr 2014 13:42:16 +0000 (13:42 +0000)]
[ASan] Fix Android build

llvm-svn: 205311

10 years agoAdd support for dynamic ASan runtime (on Linux) to Clang driver.
Alexey Samsonov [Tue, 1 Apr 2014 13:31:10 +0000 (13:31 +0000)]
Add support for dynamic ASan runtime (on Linux) to Clang driver.

Based on http://llvm-reviews.chandlerc.com/D3043 by Yuri Gribov!

llvm-svn: 205310

10 years agoARM: add cyclone CPU with ZeroCycleZeroing feature.
Tim Northover [Tue, 1 Apr 2014 13:22:02 +0000 (13:22 +0000)]
ARM: add cyclone CPU with ZeroCycleZeroing feature.

The Cyclone CPU is similar to swift for most LLVM purposes, but does have two
preferred instructions for zeroing a VFP register. This teaches LLVM about
them.

llvm-svn: 205309

10 years ago[ASan] Optional support for dynamic ASan runtime on Linux.
Alexey Samsonov [Tue, 1 Apr 2014 13:16:30 +0000 (13:16 +0000)]
[ASan] Optional support for dynamic ASan runtime on Linux.

Based on http://llvm-reviews.chandlerc.com/D3042 by Yuri Gribov!

llvm-svn: 205308

10 years agoclang-format: Support configurable list of foreach-macros.
Daniel Jasper [Tue, 1 Apr 2014 12:55:11 +0000 (12:55 +0000)]
clang-format: Support configurable list of foreach-macros.

This fixes llvm.org/PR17242.

Patch by Brian Green, thank you!

llvm-svn: 205307

10 years agoAdd errno import missed in r205246
Ed Maste [Tue, 1 Apr 2014 12:49:21 +0000 (12:49 +0000)]
Add errno import missed in r205246

llvm-svn: 205306

10 years ago[mips] Renamed ParseAnyRegisterWithoutDollar to MatchAnyRegisterWithoutDollar
Daniel Sanders [Tue, 1 Apr 2014 12:35:23 +0000 (12:35 +0000)]
[mips] Renamed ParseAnyRegisterWithoutDollar to MatchAnyRegisterWithoutDollar

This is for consistency with other functions. The Parse* functions consume
tokens and the Match* functions don't.

No functional change.

llvm-svn: 205305

10 years agoFixing an MSVC warning about widening the result of a 32-bit shift implicitly. No...
Aaron Ballman [Tue, 1 Apr 2014 12:24:25 +0000 (12:24 +0000)]
Fixing an MSVC warning about widening the result of a 32-bit shift implicitly. No functional change intended.

llvm-svn: 205304

10 years agoARM64: add a few bits of polynomial intrinsic codegen.
Tim Northover [Tue, 1 Apr 2014 12:23:08 +0000 (12:23 +0000)]
ARM64: add a few bits of polynomial intrinsic codegen.

llvm-svn: 205303

10 years agoARM64: add intrinsic for pmull (p64 x p64 = p128) operations.
Tim Northover [Tue, 1 Apr 2014 12:22:37 +0000 (12:22 +0000)]
ARM64: add intrinsic for pmull (p64 x p64 = p128) operations.

llvm-svn: 205302

10 years agoFixing warnings in the MSVC build. No functional changes intended.
Aaron Ballman [Tue, 1 Apr 2014 12:22:20 +0000 (12:22 +0000)]
Fixing warnings in the MSVC build. No functional changes intended.

llvm-svn: 205301

10 years ago[TSan] Make this test more portable
Alexey Samsonov [Tue, 1 Apr 2014 11:51:50 +0000 (11:51 +0000)]
[TSan] Make this test more portable

llvm-svn: 205300

10 years ago[sanitizer] one more stress test for the deadlock detector; this one stresses the...
Kostya Serebryany [Tue, 1 Apr 2014 11:35:55 +0000 (11:35 +0000)]
[sanitizer] one more stress test for the deadlock detector; this one stresses the slow path with a global lock

llvm-svn: 205299

10 years ago[mips] Extend ParseJumpTarget to support the full symbol expression syntax.
Daniel Sanders [Tue, 1 Apr 2014 10:41:48 +0000 (10:41 +0000)]
[mips] Extend ParseJumpTarget to support the full symbol expression syntax.

Summary:
This should fix the issues the D3222 caused in lld. Testcase is based on
the one that failed in the buildbot.

Depends on D3233

Reviewers: matheusalmeida, vmedic

Reviewed By: matheusalmeida

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

llvm-svn: 205298

10 years ago[mips] Use AsmLexer::peekTok() to resolve the conflict between $reg and $sym
Daniel Sanders [Tue, 1 Apr 2014 10:40:14 +0000 (10:40 +0000)]
[mips] Use AsmLexer::peekTok() to resolve the conflict between $reg and $sym

Summary:
Parsing registers no longer consume the $ token before it's confirmed whether it really has a register or not, therefore it's no longer impossible to match symbols if registers were tried first.

Depends on D3232

Reviewers: matheusalmeida, vmedic

Reviewed By: matheusalmeida

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

llvm-svn: 205297

10 years agoARM64: add missing ldN/stN intrinsics and enable tests.
Tim Northover [Tue, 1 Apr 2014 10:37:47 +0000 (10:37 +0000)]
ARM64: add missing ldN/stN intrinsics and enable tests.

llvm-svn: 205296

10 years ago[mips] Hoist Parser.Lex() calls out of MatchAnyRegisterNameWithoutDollar()
Daniel Sanders [Tue, 1 Apr 2014 10:37:46 +0000 (10:37 +0000)]
[mips] Hoist Parser.Lex() calls out of MatchAnyRegisterNameWithoutDollar()

Summary:
No functional change

Depends on D3222

Reviewers: matheusalmeida, vmedic

Reviewed By: matheusalmeida

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

llvm-svn: 205295

10 years agoARM64: add patterns for more lane-wise ld1/st1 operations.
Tim Northover [Tue, 1 Apr 2014 10:37:09 +0000 (10:37 +0000)]
ARM64: add patterns for more lane-wise ld1/st1 operations.

llvm-svn: 205294

10 years agoARM64: fix bug in ld3r (1d) SelectionDAG.
Tim Northover [Tue, 1 Apr 2014 10:37:03 +0000 (10:37 +0000)]
ARM64: fix bug in ld3r (1d) SelectionDAG.

llvm-svn: 205293

10 years ago[mips] Rewrite MipsAsmParser and MipsOperand.
Daniel Sanders [Tue, 1 Apr 2014 10:35:28 +0000 (10:35 +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: 205292

10 years agoAdd FreeBSD support to sanitizers' procmaps facilities
Viktor Kutuzov [Tue, 1 Apr 2014 10:34:21 +0000 (10:34 +0000)]
Add FreeBSD support to sanitizers' procmaps facilities

llvm-svn: 205291

10 years agoFix definition of the __sanitizer_passwd structure on FreeBSD
Viktor Kutuzov [Tue, 1 Apr 2014 10:29:42 +0000 (10:29 +0000)]
Fix definition of the __sanitizer_passwd structure on FreeBSD

llvm-svn: 205290

10 years agoRecover TableGen/LangRef, make it official
Renato Golin [Tue, 1 Apr 2014 09:51:49 +0000 (09:51 +0000)]
Recover TableGen/LangRef, make it official

Making the new TableGen documentation official and marking the old file as
"Moved". Also, reverting the original LangRef as the normative formal
description of the language, while keeping the "new" LangRef as LangIntro
for the less inlcined to reading language grammars.

We should remove TableGenFundamentals.rst one day, but for now, just a
warning that it moved will have to do, while we make sure there are no more
links to it from elsewhere.

llvm-svn: 205289

10 years ago[x86] Do not convert to cmp32 for Atom arch by Sergey Okunev
Alexey Volkov [Tue, 1 Apr 2014 08:13:07 +0000 (08:13 +0000)]
[x86] Do not convert to cmp32 for Atom arch by Sergey Okunev

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

llvm-svn: 205288

10 years agoDebugInfo: Avoid creating unnecessary/empty line tables and remove the special case...
David Blaikie [Tue, 1 Apr 2014 08:07:52 +0000 (08:07 +0000)]
DebugInfo: Avoid creating unnecessary/empty line tables and remove the special case of '0' in DwarfCompileUnit::initStmtList by just always using a label difference

This moves one case of raw text checking down into the MCStreamer
interfaces in the form of a virtual function, even if we ultimately end
up consolidating on the one-or-many line tables issue one day, this is
nicer in the interim. This just generally streamlines a bunch of use
cases into a common code path.

llvm-svn: 205287

10 years agoDebugInfo: Emit relocation to debug_line section when emitting asm for asm
David Blaikie [Tue, 1 Apr 2014 07:35:52 +0000 (07:35 +0000)]
DebugInfo: Emit relocation to debug_line section when emitting asm for asm

I don't think this is reachable by any frontend (why would you transform
asm to asm+debug info?) but it helps tidy up some of this code, avoid
the weird special case of "emit the first CU, store the label, then emit
the rest" in MCDwarfLineTable::Emit by instead having the
DWARF-for-assembly case use the same codepath as DwarfDebug.cpp, by
registering the label of the debug_line section, thus causing it to be
emitted. (with a special case in asm output to just emit the label since
asm output uses the .loc directives, etc, rather than the debug_loc
directly)

llvm-svn: 205286

10 years agoAdd defensive check that argument may be null in call to compareConversionFunctions...
Ted Kremenek [Tue, 1 Apr 2014 07:23:18 +0000 (07:23 +0000)]
Add defensive check that argument may be null in call to compareConversionFunctions() on incorrect code.

I'm looking into getting a reduced test case, but it's not
immediately available.

Fixes <rdar://problem/16344806>

llvm-svn: 205285

10 years ago[PECOFF] Make PECOFFFileNode::parse idempotent.
Rui Ueyama [Tue, 1 Apr 2014 06:18:19 +0000 (06:18 +0000)]
[PECOFF] Make PECOFFFileNode::parse idempotent.

PECOFFFileNode::parse can be called twice -- once by WinLink driver and
once more by Driver. We want to make sure that the second call won't mess
up the internal data.

llvm-svn: 205284

10 years ago[PECOFF] Treat .imp as an import library file.
Rui Ueyama [Tue, 1 Apr 2014 06:11:09 +0000 (06:11 +0000)]
[PECOFF] Treat .imp as an import library file.

Some Clang build uses .imp not .lib file extension for an import library file,
so we need to treat such file as a library file.

Ideally we should not rely on file extensions to detect file type. Instead
we should use magic bytes at beginning of a file. The GNU-compatible driver
actually does that but it made writing unit tests hard, so I chose an ad-hoc
approach for now.

llvm-svn: 205283

10 years agoMS ABI: Support mangling of return-types deducing to local types
David Majnemer [Tue, 1 Apr 2014 05:29:46 +0000 (05:29 +0000)]
MS ABI: Support mangling of return-types deducing to local types

The MS ABI forces us into catch-22 when it comes to functions which
return types which are local:

 - A function is mangled with it's return type.
 - A type is mangled with it's surrounding context.

Avoid this by mangling auto and decltype(autp) directly into the
function's return type.  Using this mangling has the double advantage of
being compatible with the C++ standard without crashing the compiler.

N.B. For the curious, the MSVC mangling leads to collisions amongst
template functions and either crashes when faced with local types or is
otherwise incapable of returning them.

llvm-svn: 205282

10 years agoRemove FIXMEs. The scope of a Variable is always a lexical scope; there is
Adrian Prantl [Tue, 1 Apr 2014 03:50:01 +0000 (03:50 +0000)]
Remove FIXMEs. The scope of a Variable is always a lexical scope; there is
nothing to be gained from switching this over to a DIScopeRef.

llvm-svn: 205281

10 years ago[core] support .gnu.linkonce sections
Shankar Easwaran [Tue, 1 Apr 2014 03:49:55 +0000 (03:49 +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 in a binary.

.gnu.linkonce based symbol resolution achieves that.

Review : http://llvm-reviews.chandlerc.com/D3242

llvm-svn: 205280

10 years agoLTO type uniquing: store the Decl field of a DIImportedEntity as a DIRef.
Adrian Prantl [Tue, 1 Apr 2014 03:41:04 +0000 (03:41 +0000)]
LTO type uniquing: store the Decl field of a DIImportedEntity as a DIRef.
No other functionality changes, DIBuilder testcase is included in a paired
CFE commit.

This relaxes the assertion in isScopeRef to also accept subclasses of
DIScope.

llvm-svn: 205279

10 years agoAdapt CGDebugInfo to interface changes in DIBuilder/DIImportedEntity.
Adrian Prantl [Tue, 1 Apr 2014 03:41:01 +0000 (03:41 +0000)]
Adapt CGDebugInfo to interface changes in DIBuilder/DIImportedEntity.
The Decl field in a DIImportedEntity is now a DIRef.
Paired commit with LLVM.

llvm-svn: 205278

10 years agoAdd a comment about type-uniquing ObjC types.
Adrian Prantl [Tue, 1 Apr 2014 03:40:59 +0000 (03:40 +0000)]
Add a comment about type-uniquing ObjC types.

llvm-svn: 205277

10 years ago[analyzer] Lock checker: Allow pthread_mutex_init to reinitialize a destroyed lock.
Jordan Rose [Tue, 1 Apr 2014 03:40:53 +0000 (03:40 +0000)]
[analyzer] Lock checker: Allow pthread_mutex_init to reinitialize a destroyed lock.

Patch by Daniel Fahlgren!

llvm-svn: 205276

10 years ago[analyzer] Lock checker: make sure locks aren't used after being destroyed.
Jordan Rose [Tue, 1 Apr 2014 03:40:47 +0000 (03:40 +0000)]
[analyzer] Lock checker: make sure locks aren't used after being destroyed.

Patch by Daniel Fahlgren!

llvm-svn: 205275

10 years ago[analyzer] Add double-unlock detection to PthreadLockChecker.
Jordan Rose [Tue, 1 Apr 2014 03:40:38 +0000 (03:40 +0000)]
[analyzer] Add double-unlock detection to PthreadLockChecker.

We've decided to punt on supporting recursive locks for now; the common case
is non-recursive.

Patch by Daniel Fahlgren!

llvm-svn: 205274

10 years agoAdd failing testcase for DR305. Looks like we didn't implement the resolution
Richard Smith [Tue, 1 Apr 2014 01:58:11 +0000 (01:58 +0000)]
Add failing testcase for DR305. Looks like we didn't implement the resolution
here in the simple-template-id case.

llvm-svn: 205273

10 years agoDisable this-return optimizations when targeting iOS 5 and earlier.
Bob Wilson [Tue, 1 Apr 2014 01:38:16 +0000 (01:38 +0000)]
Disable this-return optimizations when targeting iOS 5 and earlier.

Clang implements the part of the ARM ABI saying that certain functions
(e.g., constructors and destructors) return "this", but Apple's version of
gcc and llvm-gcc did not. The libstdc++ dylib on iOS 5 was built with
llvm-gcc, which means that clang cannot safely assume that code from the C++
runtime will correctly follow the ABI. It is also possible to run into this
problem when linking with other libraries built with gcc or llvm-gcc. Even
though there is no way to reliably detect that situation, it is most likely
to come up when targeting older versions of iOS. Disabling the optimization
for any code targeting iOS 5 solves the libstdc++ problem and has a reasonably
good chance of fixing the issue for other older libraries as well.
<rdar://problem/16377159>

llvm-svn: 205272

10 years agoFix up compression related test cases
David Blaikie [Tue, 1 Apr 2014 00:27:28 +0000 (00:27 +0000)]
Fix up compression related test cases

Fallout from r205261, ensure it doesn't matter how we disable compressed
debug info, even if zlib is missing and that we warn when we don't have
zlib and don't warn when we do, all while silently suppressing these
tests on the systems they weren't intended for...

llvm-svn: 205271

10 years agoMS ABI: Simplify MangleByte further
David Majnemer [Tue, 1 Apr 2014 00:05:57 +0000 (00:05 +0000)]
MS ABI: Simplify MangleByte further

It turns out that the ranges where the '?' <letter> manglings occur are
identical to the ranges of ASCII characters OR'd with 0x80.

Thanks to Richard Smith for the insight!

No functional change.

llvm-svn: 205270

10 years agoComment to describe the debug_loc.dwo constants
David Blaikie [Mon, 31 Mar 2014 23:50:20 +0000 (23:50 +0000)]
Comment to describe the debug_loc.dwo constants

Code review feedback from Eric Christopher on r204697

llvm-svn: 205268

10 years agoComment necessity of early initialization
David Blaikie [Mon, 31 Mar 2014 23:47:13 +0000 (23:47 +0000)]
Comment necessity of early initialization

Code review feedback from Eric Christopher on r204261.

I didn't want to go into too much detail (the revision history should
provide the full stuff) - but I can add more if that's preferred.

Also moved this up to right by the construction of the MCAsmInfo so
there's less chance that other things might sneak in in between.

llvm-svn: 205267

10 years agoMCJIT: ensure that cygwin is identified properly
Saleem Abdulrasool [Mon, 31 Mar 2014 23:42:23 +0000 (23:42 +0000)]
MCJIT: ensure that cygwin is identified properly

Cygwin is now a proper environment rather than an OS.  This updates the MCJIT
tests to avoid execution on Cygwin.  This fixes native cygwin tests.

llvm-svn: 205266

10 years agoWarn when requesting compress-debug-sections and zlib is not available
David Blaikie [Mon, 31 Mar 2014 23:29:38 +0000 (23:29 +0000)]
Warn when requesting compress-debug-sections and zlib is not available

Another shot in the dark, since I do have zlib installed. Will be
watching the bots for fallout.

llvm-svn: 205265

10 years agoMove partial/runtime unrolling late in the pipeline
Hal Finkel [Mon, 31 Mar 2014 23:23:51 +0000 (23:23 +0000)]
Move partial/runtime unrolling late in the pipeline

The generic (concatenation) loop unroller is currently placed early in the
standard optimization pipeline. This is a good place to perform full unrolling,
but not the right place to perform partial/runtime unrolling. However, most
targets don't enable partial/runtime unrolling, so this never mattered.

However, even some x86 cores benefit from partial/runtime unrolling of very
small loops, and follow-up commits will enable this. First, we need to move
partial/runtime unrolling late in the optimization pipeline (importantly, this
is after SLP and loop vectorization, as vectorization can drastically change
the size of a loop), while keeping the full unrolling where it is now. This
change does just that.

llvm-svn: 205264

10 years agoInstrProf: lit.cfg magic for running tests from source
Duncan P. N. Exon Smith [Mon, 31 Mar 2014 23:14:28 +0000 (23:14 +0000)]
InstrProf: lit.cfg magic for running tests from source

Implement magic in compiler-rt to enable llvm-lit to be invoked on the
source tree in lib/profile.  This relies on a paired commit in the llvm
tree that exposes a new built-in parameter.

<rdar://problem/16458307>

llvm-svn: 205263

10 years agolit: Set a base directory for compiler-rt tests
Duncan P. N. Exon Smith [Mon, 31 Mar 2014 23:14:10 +0000 (23:14 +0000)]
lit: Set a base directory for compiler-rt tests

Setting this parameter enables llvm-lit to run on source directories for
compiler-rt test suites that implement magic in their lit.cfg.

<rdar://problem/16458307>

llvm-svn: 205262

10 years agoDebugInfo compression: Enable compression before any sections are created.
David Blaikie [Mon, 31 Mar 2014 23:13:30 +0000 (23:13 +0000)]
DebugInfo compression: Enable compression before any sections are created.

For those playing at home this produced some fairly subtle behavior. The
sections created in InitMCObjectFileInfo were created without compressed
debug info (a mistake, but not necessarily /broken). Since these
sections were almost always referenced by the existing MCSection object,
this almost worked.

This got weird when we got to handling the relocations for a section.
See ELFObjectWriter::WriteSection where we compute the true section for
a relocation section by simply stripping the ".rela" prefix and then
looking up that section - doing so hit the compression codepath, looked
up .zdebug_blah and found a newly constructed empty section... thus,
things got weird.

This is untestable without a cross-project test (let me know if people
would prefer that to no testing).

llvm-svn: 205261

10 years agoRevert "SLPVectorizer: Ignore users that are insertelements we can reschedule them"
Arnold Schwaighofer [Mon, 31 Mar 2014 23:05:56 +0000 (23:05 +0000)]
Revert "SLPVectorizer: Ignore users that are insertelements we can reschedule them"

This reverts commit r205018.

Conflicts:
lib/Transforms/Vectorize/SLPVectorizer.cpp
test/Transforms/SLPVectorizer/X86/insert-element-build-vector.ll

This is breaking libclc build.

llvm-svn: 205260

10 years ago<rdar://problem/16424592>
Enrico Granata [Mon, 31 Mar 2014 23:02:25 +0000 (23:02 +0000)]
<rdar://problem/16424592>

For some reason, the libc++ vector<bool> data formatter was essentially a costly no-up, doing everything required of it, except actually generating the child values!

This restores its functionality

llvm-svn: 205259

10 years agoShifting into the sign bit is UB as discussed on IRC. Explicitly use the
Joerg Sonnenberger [Mon, 31 Mar 2014 22:53:57 +0000 (22:53 +0000)]
Shifting into the sign bit is UB as discussed on IRC. Explicitly use the
BitWord type for the constants to avoid this.

llvm-svn: 205257

10 years agoInstrProf: Add simple compiler-rt test
Duncan P. N. Exon Smith [Mon, 31 Mar 2014 22:45:37 +0000 (22:45 +0000)]
InstrProf: Add simple compiler-rt test

Add the test infrastructure for testing lib/profile and a single test.
This initial commit only enables the tests on Darwin, but they'll be
enabled on Linux soon after.

<rdar://problem/16458307>

llvm-svn: 205256

10 years agoImplement the 'optnone' attribute, which suppresses most optimizations
Paul Robinson [Mon, 31 Mar 2014 22:29:15 +0000 (22:29 +0000)]
Implement the 'optnone' attribute, which suppresses most optimizations
on a function.

llvm-svn: 205255

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