platform/upstream/llvm.git
9 years agoRevert "Fix a build breakage. Looks like the LLVM side of this change has been reverted"
David Majnemer [Thu, 4 Dec 2014 21:26:25 +0000 (21:26 +0000)]
Revert "Fix a build breakage. Looks like the LLVM side of this change has been reverted"

This reverts commit r223375.  We need to use unique_ptr to build with
LLVM r223183.

llvm-svn: 223388

9 years agoCMake: build DLLs in the right directory and include them in the 'install' target...
Hans Wennborg [Thu, 4 Dec 2014 21:01:49 +0000 (21:01 +0000)]
CMake: build DLLs in the right directory and include them in the 'install' target (PR21719)

When CMake builds a dynamic library on Windows, the .dll file's location is
determined by the RUNTIME_OUTPUT_DIRECTORY, which we were previously not
setting.

This means for example that clang_rt.asan_dynamic-i386.dll will get built
and installed in the same directory as the corresponding .lib file,
instead of being built in the bin/ directory and not installed at all.

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

llvm-svn: 223387

9 years agoRoll gofrontend to 2a85649c19e1.
Peter Collingbourne [Thu, 4 Dec 2014 20:39:58 +0000 (20:39 +0000)]
Roll gofrontend to 2a85649c19e1.

llvm-svn: 223385

9 years agoAdd attributes for AMDGPU register limits.
Matt Arsenault [Thu, 4 Dec 2014 20:38:18 +0000 (20:38 +0000)]
Add attributes for AMDGPU register limits.

This is a performance hint that can be applied to kernels
to attempt to limit the number of used registers.

llvm-svn: 223384

9 years ago[x86] Fix isOffsetSuitableForCodeModel kernel code model offset
Bruno Cardoso Lopes [Thu, 4 Dec 2014 20:36:06 +0000 (20:36 +0000)]
[x86] Fix isOffsetSuitableForCodeModel kernel code model offset

Offset == 0 is a valid offset for kernel code model according to the
x86_64 System V ABI. Found by inspection, no testcase.

llvm-svn: 223383

9 years ago[AArch64] Combining Load and IntToFp should check for neon availability
Weiming Zhao [Thu, 4 Dec 2014 20:25:50 +0000 (20:25 +0000)]
[AArch64] Combining Load and IntToFp should check for neon availability

llvm-svn: 223382

9 years agoFix yet another unseen regression caused by r223113
Asiri Rathnayake [Thu, 4 Dec 2014 19:34:59 +0000 (19:34 +0000)]
Fix yet another unseen regression caused by r223113

r223113 added support for ARM modified immediate assembly syntax. Which
assumes all immediate operands are prefixed with a '#'. This assumption
is wrong as per the ARMARM - which recommends that all '#' characters be
treated optional. The current patch fixes this regression and adds a test
case. A follow-up patch will expand the test coverage to other instructions.

llvm-svn: 223381

9 years agoFix thumbv4t indirect calls
Jonathan Roelofs [Thu, 4 Dec 2014 19:34:50 +0000 (19:34 +0000)]
Fix thumbv4t indirect calls

So there are a couple of issues with indirect calls on thumbv4t. First, the most
'obvious' instruction, 'blx' isn't available until v5t. And secondly, the
next-most-obvious sequence: 'mov lr, pc; bx rN' doesn't DTRT in thumb code
because the saved off pc has its thumb bit cleared, so when the callee returns
we end up in ARM mode.... yuck.

The solution is to 'bl' to a nearby landing pad with a 'bx rN' in it.

We could cut down on code size by sharing the landing pads between call sites
that are close enough, but for the moment let's do correctness first and look at
performance later.

Patch by: Iain Sandoe

http://reviews.llvm.org/D6519

llvm-svn: 223380

9 years agoWe should not pretend that an int is a valid ObjC pointer. If your number truly is...
Enrico Granata [Thu, 4 Dec 2014 19:31:51 +0000 (19:31 +0000)]
We should not pretend that an int is a valid ObjC pointer. If your number truly is a pointer, po (id)myNumber is a better alternative. Fixes rdar://16585032

llvm-svn: 223379

9 years agoAdd a test case for argument type coercion in an invoke of a vararg function
Philip Reames [Thu, 4 Dec 2014 19:13:45 +0000 (19:13 +0000)]
Add a test case for argument type coercion in an invoke of a vararg function

This would have caught the bug I fixed in 223370.

llvm-svn: 223378

9 years agoRemove dead code from SymbolFileDWARF:
Greg Clayton [Thu, 4 Dec 2014 18:49:24 +0000 (18:49 +0000)]
Remove dead code from SymbolFileDWARF:

lldb::TypeSP
SymbolFileDWARF::FindDefinitionTypeForDIE (
    DWARFCompileUnit* dwarf_cu,
    const DWARFDebugInfoEntry *die,
    const lldb_private::ConstString &type_name);

This function isn't used as it has been replaced by:

lldb::TypeSP
SymbolFileDWARF::FindDefinitionTypeForDWARFDeclContext (
    const DWARFDeclContext &die_decl_ctx);

I am about to change the way we resolve C/C++ class/struct/union types and want to clean up SymbolFileDWARF before I start.

llvm-svn: 223376

9 years agoFix a build breakage. Looks like the LLVM side of this change has been reverted
Enrico Granata [Thu, 4 Dec 2014 18:39:40 +0000 (18:39 +0000)]
Fix a build breakage. Looks like the LLVM side of this change has been reverted

llvm-svn: 223375

9 years agoAdd a section to Statepoint docs mentioning shared bugzilla search and standard maili...
Philip Reames [Thu, 4 Dec 2014 18:33:28 +0000 (18:33 +0000)]
Add a section to Statepoint docs mentioning shared bugzilla search and standard mailing lists

llvm-svn: 223374

9 years agoRevert "Rewrite InputGraph's Group"
Rui Ueyama [Thu, 4 Dec 2014 18:29:03 +0000 (18:29 +0000)]
Revert "Rewrite InputGraph's Group"

This reverts commit r223330 because it broke Darwin and ELF
linkers in a way that we couldn't have caught with the existing
test cases.

llvm-svn: 223373

9 years agoDetect if the linker is gold and if so always use --gc-sections.
Rafael Espindola [Thu, 4 Dec 2014 17:54:35 +0000 (17:54 +0000)]
Detect if the linker is gold and if so always use --gc-sections.

llvm-svn: 223372

9 years agoRevert "r223364 - Revert r223347 which has caused crashes on bootstrap bots."
Hal Finkel [Thu, 4 Dec 2014 17:45:19 +0000 (17:45 +0000)]
Revert "r223364 - Revert r223347 which has caused crashes on bootstrap bots."

Reapply r223347, with a fix to not crash on uninserted instructions (or more
precisely, instructions in uninserted blocks). bugpoint was able to reduce the
test case somewhat, but it is still somewhat large (and relies on setting
things up to be simplified during inlining), so I've not included it here.
Nevertheless, it is clear what is going on and why.

Original commit message:

Restrict somewhat the memory-allocation pointer cmp opt from r223093

Based on review comments from Richard Smith, restrict this optimization from
applying to globals that might resolve lazily to other dynamically-loaded
modules, and also from dynamic allocas (which might be transformed into malloc
calls). In short, take extra care that the compared-to pointer is really
simultaneously live with the memory allocation.

llvm-svn: 223371

9 years agoFix a typo: use of cast where dyn_cast was intended
Philip Reames [Thu, 4 Dec 2014 17:27:58 +0000 (17:27 +0000)]
Fix a typo: use of cast where dyn_cast was intended

This bug has the effect of converting a test of isGCRelocate(InvokeInst*) from a false return to a crash.

This may be the root cause of the crash Joerg reported against r223137, but I'm still waiting for a clean build of clang to complete to be able to confirm.  Once I've confirmed the issue, I'll submit a test case separately.

llvm-svn: 223370

9 years agotest-release.sh: Add a way to specify --build to configure
Daniel Sanders [Thu, 4 Dec 2014 17:15:35 +0000 (17:15 +0000)]
test-release.sh: Add a way to specify --build to configure

Summary:
I currently have to specify --build=mips-linux-gnu or --build=mipsel-linux-gnu
to configure in order to successfully recurse a 32-bit build of the compiler on
my mips64-linux-gnu and mips64el-linux-gnu targets. This is a bug and will be
fixed but in the meantime it will be useful to have a way to work around this.

Reviewers: tstellarAMD

Subscribers: llvm-commits

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

llvm-svn: 223369

9 years agoRemove dead code. NFC.
Rafael Espindola [Thu, 4 Dec 2014 16:59:36 +0000 (16:59 +0000)]
Remove dead code. NFC.

This interface was added 2 years ago but users never developed.

llvm-svn: 223368

9 years agoclang-format: [JS] Don't put top-level dict literals on a single line.
Daniel Jasper [Thu, 4 Dec 2014 16:07:17 +0000 (16:07 +0000)]
clang-format: [JS] Don't put top-level dict literals on a single line.

These are often used for enums which apparently are easier to read if
formatted with one element per line.

llvm-svn: 223367

9 years agoFix a minor regression introduced in r223113
Asiri Rathnayake [Thu, 4 Dec 2014 14:49:07 +0000 (14:49 +0000)]
Fix a minor regression introduced in r223113

r223113 added support for ARM modified immediate assembly syntax. That patch
has broken support for immediate expressions, as in:
    add r0, #(4 * 4)
It wasn't caught because we don't have any tests for this feature. This patch
fixes this regression and adds test cases.

llvm-svn: 223366

9 years agoUse size_type in the interface exposed by SmallVector.
Rafael Espindola [Thu, 4 Dec 2014 14:40:35 +0000 (14:40 +0000)]
Use size_type in the interface exposed by SmallVector.

This matches std::vector and should avoid unnecessary masking to 32 bits
when calling them on o 64 bits system.

llvm-svn: 223365

9 years agoRevert r223347 which has caused crashes on bootstrap bots.
Alexander Potapenko [Thu, 4 Dec 2014 14:22:27 +0000 (14:22 +0000)]
Revert r223347 which has caused crashes on bootstrap bots.

llvm-svn: 223364

9 years agoRevert "[Thumb/Thumb2] Added restrictions on PC, LR, SP in the register list for...
Rafael Espindola [Thu, 4 Dec 2014 14:10:20 +0000 (14:10 +0000)]
Revert "[Thumb/Thumb2] Added restrictions on PC, LR, SP in the register list for PUSH/POP/LDM/STM. <Differential Revision: reviews.llvm.org/D6090>"

This reverts commit r223356.

It was failing check-all (MC/ARM/thumb.s in particular).

llvm-svn: 223363

9 years ago[X86] Improve a dag-combine that handles a vector extract -> zext sequence.
Michael Kuperstein [Thu, 4 Dec 2014 13:49:51 +0000 (13:49 +0000)]
[X86] Improve a dag-combine that handles a vector extract -> zext sequence.

The current DAG combine turns a sequence of extracts from <4 x i32> followed by zexts into a store followed by scalar loads.
According to measurements by Martin Krastev (see PR 21269) for x86-64, a sequence of an extract, movs and shifts gives better performance. However, for 32-bit x86, the previous sequence still seems better.

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

llvm-svn: 223360

9 years ago[ELF] Adjust ELF header entry symbol value if this symbol is microMIPS encoded
Simon Atanasyan [Thu, 4 Dec 2014 13:43:35 +0000 (13:43 +0000)]
[ELF] Adjust ELF header entry symbol value if this symbol is microMIPS encoded

To find an AtomLayout object for the given symbol I replace the
`Layout::findAtomAddrByName` method by `Layout::findAtomLayoutByName` method.

llvm-svn: 223359

9 years agoFix PR21684 - Ellipsis following an 'auto' parameter sans name/ID
Faisal Vali [Thu, 4 Dec 2014 12:40:21 +0000 (12:40 +0000)]
Fix PR21684 - Ellipsis following an 'auto' parameter sans name/ID
should indicate a c++ parameter pack not a c-variadic.

int i = [](auto...) { return 0; }(); // OK now.

llvm-svn: 223357

9 years ago[Thumb/Thumb2] Added restrictions on PC, LR, SP in the register list for PUSH/POP...
Jyoti Allur [Thu, 4 Dec 2014 11:52:49 +0000 (11:52 +0000)]
[Thumb/Thumb2] Added restrictions on PC, LR, SP in the register list for PUSH/POP/LDM/STM. <Differential Revision: reviews.llvm.org/D6090>

llvm-svn: 223356

9 years ago[msan] Put the coverage files for coverage-levels.cc into a temporary dir.
Alexander Potapenko [Thu, 4 Dec 2014 11:35:32 +0000 (11:35 +0000)]
[msan] Put the coverage files for coverage-levels.cc into a temporary dir.

llvm-svn: 223355

9 years ago[X86] Simplify code. NFC.
Andrea Di Biagio [Thu, 4 Dec 2014 11:21:44 +0000 (11:21 +0000)]
[X86] Simplify code. NFC.

Replaced some logic that checked if a build_vector node is doing a splat of a
non-undef value with a call to method BuildVectorSDNode::getSplatValue().
No functional change intended.

llvm-svn: 223354

9 years agoCleanup of the fix done recently for a lldb-mi hang on OSX.
Hafiz Abid Qadeer [Thu, 4 Dec 2014 11:05:31 +0000 (11:05 +0000)]
Cleanup of the fix done recently for a lldb-mi hang on OSX.
It was observed that we dont need to set stdin to unbuffered and setting console
to non-canonical mode.

Patch originally came from "Ilia K <ki.stfu@gmail.com>"

llvm-svn: 223353

9 years agoMake getInsertArgumentAdjuster insert extra arguments to the end by default.
Alexander Kornienko [Thu, 4 Dec 2014 11:00:56 +0000 (11:00 +0000)]
Make getInsertArgumentAdjuster insert extra arguments to the end by default.

llvm-svn: 223352

9 years agotest-release.sh: Correct the logged configure command to match the one actually issued.
Daniel Sanders [Thu, 4 Dec 2014 11:00:09 +0000 (11:00 +0000)]
test-release.sh: Correct the logged configure command to match the one actually issued.

--disable-timestamps was added to the configure command way back in r142647 but
the command that echos this command to the log was not updated at the time.

llvm-svn: 223351

9 years agoUse DomTree in MachineSink to sink over diamonds.
Patrik Hagglund [Thu, 4 Dec 2014 10:36:42 +0000 (10:36 +0000)]
Use DomTree in MachineSink to sink over diamonds.

According to a previous FIXME comment we now not only look at MBB
successors, but also handle code sinking past them:

  x = computation
  if () {} else {}
  use x

The instruction could be sunk over the whole diamond for the
if/then/else (or loop, etc), allowing it to be sunk into other blocks
after that.

Modified test added in r204522, due to one spill less present.

Minor fixes in comments.

Patch provided by Jonas Paulsson. Reviewed by Hal Finkel.

llvm-svn: 223350

9 years ago[InstCombine] Minor optimization for bswap with binary ops
Simon Pilgrim [Thu, 4 Dec 2014 09:44:01 +0000 (09:44 +0000)]
[InstCombine] Minor optimization for bswap with binary ops

Added instcombine optimizations for BSWAP with AND/OR/XOR ops:

OP( BSWAP(x), BSWAP(y) ) -> BSWAP( OP(x, y) )
OP( BSWAP(x), CONSTANT ) -> BSWAP( OP(x, BSWAP(CONSTANT) ) )

Since its just a one liner, I've also added BSWAP to the DAGCombiner equivalent as well:

fold (OP (bswap x), (bswap y)) -> (bswap (OP x, y))

Refactored bswap-fold tests to use FileCheck instead of just checking that the bswaps had gone.

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

llvm-svn: 223349

9 years agoMasked Load / Store Intrinsics - the CodeGen part.
Elena Demikhovsky [Thu, 4 Dec 2014 09:40:44 +0000 (09:40 +0000)]
Masked Load / Store Intrinsics - the CodeGen part.
I'm recommiting the codegen part of the patch.
The vectorizer part will be send to review again.

Masked Vector Load and Store Intrinsics.
Introduced new target-independent intrinsics in order to support masked vector loads and stores. The loop vectorizer optimizes loops containing conditional memory accesses by generating these intrinsics for existing targets AVX2 and AVX-512. The vectorizer asks the target about availability of masked vector loads and stores.
Added SDNodes for masked operations and lowering patterns for X86 code generator.
Examples:
<16 x i32> @llvm.masked.load.v16i32(i8* %addr, <16 x i32> %passthru, i32 4 /* align */, <16 x i1> %mask)
declare void @llvm.masked.store.v8f64(i8* %addr, <8 x double> %value, i32 4, <8 x i1> %mask)

Scalarizer for other targets (not AVX2/AVX-512) will be done in a separate patch.

http://reviews.llvm.org/D6191

llvm-svn: 223348

9 years agoRestrict somewhat the memory-allocation pointer cmp opt from r223093
Hal Finkel [Thu, 4 Dec 2014 09:22:28 +0000 (09:22 +0000)]
Restrict somewhat the memory-allocation pointer cmp opt from r223093

Based on review comments from Richard Smith, restrict this optimization from
applying to globals that might resolve lazily to other dynamically-loaded
modules, and also from dynamic allocas (which might be transformed into malloc
calls). In short, take extra care that the compared-to pointer is really
simultaneously live with the memory allocation.

llvm-svn: 223347

9 years agoAdd missing test file
Jean-Daniel Dupas [Thu, 4 Dec 2014 09:20:13 +0000 (09:20 +0000)]
Add missing test file

llvm-svn: 223346

9 years agoclang-format: More restrictively classify import declarations.
Daniel Jasper [Thu, 4 Dec 2014 08:57:27 +0000 (08:57 +0000)]
clang-format: More restrictively classify import declarations.

Before:
  import::SomeFunction(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa);

After:
  import::SomeFunction(aaaaaaaaaaaaaaaaaaaaaaaaaaa,
                       aaaaaaaaaaaaaaaaaaaaaaaaaaaaa);

llvm-svn: 223345

9 years agoclang-formatted ranged loops and assignment, NFC.
Yaron Keren [Thu, 4 Dec 2014 08:30:39 +0000 (08:30 +0000)]
clang-formatted ranged loops and assignment, NFC.

llvm-svn: 223344

9 years agoAdd mach-o LC_RPATH support to llvm-objdump
Jean-Daniel Dupas [Thu, 4 Dec 2014 07:37:02 +0000 (07:37 +0000)]
Add mach-o LC_RPATH support to llvm-objdump

Summary: Add rpath load command support in Mach-O object and update llvm-objdump to use it.

Subscribers: llvm-commits

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

llvm-svn: 223343

9 years ago[OPENMP] Codegen for 'omp master' directive
Alexey Bataev [Thu, 4 Dec 2014 07:23:53 +0000 (07:23 +0000)]
[OPENMP] Codegen for 'omp master' directive
Patch adds 2 library functions to OpenMPRuntime class - int32 kmpc_master(ident_t *, int32 gtid) and void kmpc_end_master(ident_t *, int32 gtid);
For 'omp master' directive the next code is generated:

if (__kmpc_master(loc, gtid)) {
    <Associated structured block>;
      __kmpc_end_master(log, gtid);
}

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

llvm-svn: 223342

9 years ago[PECOFF] Improve /export compatibility.
Rui Ueyama [Thu, 4 Dec 2014 06:09:39 +0000 (06:09 +0000)]
[PECOFF] Improve /export compatibility.

Looks like the rule of /export is more complicated than
I was thinking. If /export:foo, for example, is given, and
if the actual symbol name in an object file is _foo@<number>,
we need to export that symbol as foo, not as the mangled name.

If only /export:_foo@<number> is given, the symbol is exported
as _foo@<number>.

If both /export:foo and /export:_foo@<number> are given,
they are considered as duplicates, and the linker needs to
choose the unmangled name.

The basic idea seems that the linker needs to export a symbol
with the same name as given as /export.

We exported mangled symbols. This patch fixes that issue.

llvm-svn: 223341

9 years agoAlways emit kernel arg info for SPIR.
Sameer Sahasrabuddhe [Thu, 4 Dec 2014 05:30:58 +0000 (05:30 +0000)]
Always emit kernel arg info for SPIR.

http://llvm.org/bugs/show_bug.cgi?id=21555

Currently, kernel argument metadata is omitted unless the
"-cl-kernel-arg-info" option is specified. But the SPIR 1.2 spec
requires that all metadata except kernel_arg_name should always be
emitted, and kernel_arg_name is only emitted when
"-cl-kernel-arg-info" is specified.

Patch ported by Ryan Burn from the Khronos SPIR generator.
https://github.com/KhronosGroup/SPIR

llvm-svn: 223340

9 years ago[X86] Clean up whitespace as well as minor coding style
Michael Liao [Thu, 4 Dec 2014 05:20:33 +0000 (05:20 +0000)]
[X86] Clean up whitespace as well as minor coding style

llvm-svn: 223339

9 years agoCodeGen: refactor ARM builtin handling
Saleem Abdulrasool [Thu, 4 Dec 2014 04:52:37 +0000 (04:52 +0000)]
CodeGen: refactor ARM builtin handling

Create a helper function to construct a value for the ARM hint intrinsic
rather than inling the construction.  In order to avoid the use of the sentinel
value, inline the use of intrinsic instruction retrieval.  NFC.

llvm-svn: 223338

9 years agoRevert "Add missing test dependency and use a more canonical target name."
Rafael Espindola [Thu, 4 Dec 2014 04:33:32 +0000 (04:33 +0000)]
Revert "Add missing test dependency and use a more canonical target name."

This reverts commit r223336.

NAKAMURA Takumi did the same thing in r223332!

Sorry about the noise.

llvm-svn: 223337

9 years agoAdd missing test dependency and use a more canonical target name.
Rafael Espindola [Thu, 4 Dec 2014 04:30:56 +0000 (04:30 +0000)]
Add missing test dependency and use a more canonical target name.

llvm-svn: 223336

9 years ago[Hexagon] Adding lit exception if Hexagon isn't built.
Colin LeMahieu [Thu, 4 Dec 2014 04:28:38 +0000 (04:28 +0000)]
[Hexagon] Adding lit exception if Hexagon isn't built.

llvm-svn: 223335

9 years ago[Hexagon] Marking some instructions as CodeGenOnly=0 and adding disassembly tests.
Colin LeMahieu [Thu, 4 Dec 2014 03:41:21 +0000 (03:41 +0000)]
[Hexagon] Marking some instructions as CodeGenOnly=0 and adding disassembly tests.

llvm-svn: 223334

9 years agoCMake: try to actually fix the regexes for setting HOST_LINK_VERSION this time (PR21268)
Hans Wennborg [Thu, 4 Dec 2014 01:59:58 +0000 (01:59 +0000)]
CMake: try to actually fix the regexes for setting HOST_LINK_VERSION this time (PR21268)

The regex should not accept an empty version number.

The previous attempt at r223106 failed, and the build was still erroring:

  CMake Error at tools/clang/CMakeLists.txt:269 (string):
    string sub-command REGEX, mode REPLACE regex "[^0-9]*([0-9.]*).*" matched
    an empty string.

llvm-svn: 223333

9 years agoIntroduce "llvm-ranlib" as a name of targets since Object/archive-symtab.test require...
NAKAMURA Takumi [Thu, 4 Dec 2014 01:34:11 +0000 (01:34 +0000)]
Introduce "llvm-ranlib" as a name of targets since Object/archive-symtab.test requires llvm-ranlib.

llvm-svn: 223332

9 years agoSort by alphabetical order.
NAKAMURA Takumi [Thu, 4 Dec 2014 01:27:53 +0000 (01:27 +0000)]
Sort by alphabetical order.

llvm-svn: 223331

9 years agoRewrite InputGraph's Group
Rui Ueyama [Thu, 4 Dec 2014 01:09:06 +0000 (01:09 +0000)]
Rewrite InputGraph's Group

The aim of this patch is to reduce the excessive abstraction from
the InputGraph. We found that even a simple thing, such as sorting
input files (Mach-O) or adding a new file to the input file list
(PE/COFF), is nearly impossible with the InputGraph abstraction,
because it hides too much information behind it. As a result,
we invented complex interactions between components (e.g.
notifyProgress() mechanism) and tricky code to work around that
limitation. There were many occasions that we needed to write
awkward code.

This patch is a first step to make it cleaner. As a first step,
this removes Group class from the InputGraph. The grouping feature
is now directly handled by the Resolver. notifyProgress is removed
since we no longer need that. I could have cleaned it up even more,
but in order to keep the patch minimum, I focused on Group.

SimpleFileNode class, a container of File objects, is now limited
to have only one File. We shold have done this earlier.
We used to allow putting multiple File objects to FileNode.
Although SimpleFileNode usually has only one file, the Driver class
actually used that capability. I modified the Driver class a bit,
so that one FileNode is created for each input File.

We should now probably remove SimpleFileNode and directly store
File objects to the InputGraph in some way, because a container
that can contain only one object is useless. This is a TODO.

Mach-O input files are now sorted before they are passe to the
Resolver. DarwinInputGraph class is no longer needed, so removed.

PECOFF still has hacky code to add a new file to the input file list.
This will be cleaned up in another patch.

llvm-svn: 223330

9 years ago[X86] Restore X86 base pointer after call to llvm.eh.sjlj.setjmp
Michael Liao [Thu, 4 Dec 2014 00:56:38 +0000 (00:56 +0000)]
[X86] Restore X86 base pointer after call to llvm.eh.sjlj.setjmp

Commit on

- This patch fixes the bug described in
  http://lists.cs.uiuc.edu/pipermail/llvmdev/2013-May/062343.html

The fix allocates an extra slot just below the GPRs and stores the base pointer
there. This is done only for functions containing llvm.eh.sjlj.setjmp that also
need a base pointer. Because code containing llvm.eh.sjlj.setjmp saves all of
the callee-save GPRs in the prologue, the offset to the extra slot can be
computed before prologue generation runs.

Impact at run-time on affected functions is::

  - One extra store in the prologue, The store saves the base pointer.
  - One extra load after a llvm.eh.sjlj.setjmp. The load restores the base pointer.

Because the extra slot is just above a gap between frame-pointer-relative and
base-pointer-relative chunks of memory, there is no impact on other offset
calculations other than ensuring there is room for the extra slot.

http://reviews.llvm.org/D6388

Patch by Arch Robison <arch.robison@intel.com>

llvm-svn: 223329

9 years ago[PowerPC] 'cc' should be an alias only to 'cr0'
Hal Finkel [Thu, 4 Dec 2014 00:46:20 +0000 (00:46 +0000)]
[PowerPC] 'cc' should be an alias only to 'cr0'

We had mistakenly believed that GCC's 'cc' referred to the entire
condition-code register (cr0 through cr7) -- and implemented this in r205630 to
fix PR19326, but 'cc' is actually an alias only to 'cr0'. This is causing LLVM
to clobber too much with legacy code with inline asm using the 'cc' clobber.

Fixes PR21451.

llvm-svn: 223328

9 years agoMinor typo and link fixes for Statepoint documentation
Philip Reames [Thu, 4 Dec 2014 00:45:23 +0000 (00:45 +0000)]
Minor typo and link fixes for Statepoint documentation

llvm-svn: 223327

9 years ago[PECOFF] Improve compatibility of /export option.
Rui Ueyama [Thu, 4 Dec 2014 00:31:34 +0000 (00:31 +0000)]
[PECOFF] Improve compatibility of /export option.

llvm-svn: 223326

9 years agoHexagonMCInst.h: Qualify constants explicitly to appease msc17.
NAKAMURA Takumi [Thu, 4 Dec 2014 00:26:39 +0000 (00:26 +0000)]
HexagonMCInst.h: Qualify constants explicitly to appease msc17.

llvm-svn: 223325

9 years agoFor copy, cmake needs the full path to llvm-ar.
Rafael Espindola [Thu, 4 Dec 2014 00:23:58 +0000 (00:23 +0000)]
For copy, cmake needs the full path to llvm-ar.

This should fix the windows build.

llvm-svn: 223324

9 years agoAllow target to specify prefix for labels
Matt Arsenault [Thu, 4 Dec 2014 00:06:57 +0000 (00:06 +0000)]
Allow target to specify prefix for labels

Use the MCAsmInfo instead of the DataLayout, and allow
specifying a custom prefix for labels specifically. HSAIL
requires that labels begin with @, but global symbols with &.

llvm-svn: 223323

9 years agoA few more checks for gc.statepoints in the Verifier
Philip Reames [Thu, 4 Dec 2014 00:01:48 +0000 (00:01 +0000)]
A few more checks for gc.statepoints in the Verifier

This is simply a grab bag of unrelated checks:
- A statepoint call can't be marked readonly or readnone
- We don't currently support inline asm or varadic target functions.  Both could be supported, but don't currently work.
- I forgot to check that the number of call arguments actually matched the wrapped callee in my previous change.  Included here.

llvm-svn: 223322

9 years agoAdd missing dependency on llvm-ar. Should hopefully fix the bots.
Rafael Espindola [Thu, 4 Dec 2014 00:00:36 +0000 (00:00 +0000)]
Add missing dependency on llvm-ar. Should hopefully fix the bots.

llvm-svn: 223321

9 years agoAdd test for __umulh
Reid Kleckner [Wed, 3 Dec 2014 23:52:26 +0000 (23:52 +0000)]
Add test for __umulh

llvm-svn: 223319

9 years ago[PowerPC] Fix inline asm memory operands not to use r0
Hal Finkel [Wed, 3 Dec 2014 23:40:13 +0000 (23:40 +0000)]
[PowerPC] Fix inline asm memory operands not to use r0

On PowerPC, inline asm memory operands might be expanded as 0($r), where $r is
a register containing the address. As a result, this register cannot be r0, and
we need to enforce this register subclass constraint to prevent miscompiling
the code (we'd get this constraint for free with the usual instruction
definitions, but that scheme has no knowledge of how we end up printing inline
asm memory operands, and so here we need to do it 'by hand'). We can accomplish
this within the current address-mode selection framework by introducing an
explicit COPY_TO_REGCLASS node.

Fixes PR21443.

llvm-svn: 223318

9 years ago[RegAllocFast] Handle implicit definitions conservatively.
Quentin Colombet [Wed, 3 Dec 2014 23:38:08 +0000 (23:38 +0000)]
[RegAllocFast] Handle implicit definitions conservatively.

Prior to this commit, physical registers defined implicitly were considered free
right after their definition, i.e.. like dead definitions. Therefore, their uses
had to immediately follow their definitions, otherwise the related register may
be reused to allocate a virtual register.

This commit fixes this assumption by keeping implicit definitions alive until
they are actually used. The downside is that if the implicit definition was dead
(and not marked at such), we block an otherwise available register. This is
however conservatively correct and makes the fast register allocator much more
robust in particular regarding the scheduling of the instructions.

Fixes PR21700.

llvm-svn: 223317

9 years agoImplement __umulh with __int128 arithmetic
Reid Kleckner [Wed, 3 Dec 2014 23:36:14 +0000 (23:36 +0000)]
Implement __umulh with __int128 arithmetic

Use the same approach as _umul128, but just return the high half.

llvm-svn: 223316

9 years agoThis reverts commit r223306 and r223277.
Rafael Espindola [Wed, 3 Dec 2014 23:29:34 +0000 (23:29 +0000)]
This reverts commit r223306 and  r223277.

The code is using uninitialized memory and failing on linux.

llvm-svn: 223315

9 years ago[msan] allow -fsanitize-coverage=N together with -fsanitize=memory, compiler-rt part
Kostya Serebryany [Wed, 3 Dec 2014 23:29:14 +0000 (23:29 +0000)]
[msan] allow -fsanitize-coverage=N together with -fsanitize=memory, compiler-rt part

llvm-svn: 223314

9 years ago[msan] allow -fsanitize-coverage=N together with -fsanitize=memory, llvm part
Kostya Serebryany [Wed, 3 Dec 2014 23:28:26 +0000 (23:28 +0000)]
[msan] allow -fsanitize-coverage=N together with -fsanitize=memory, llvm part

llvm-svn: 223312

9 years ago[msan] allow -fsanitize-coverage=N together with -fsanitize=memory, clang part
Kostya Serebryany [Wed, 3 Dec 2014 23:27:45 +0000 (23:27 +0000)]
[msan] allow -fsanitize-coverage=N together with -fsanitize=memory, clang part

llvm-svn: 223311

9 years agoTest commit.
Jacques Pienaar [Wed, 3 Dec 2014 23:21:02 +0000 (23:21 +0000)]
Test commit.

llvm-svn: 223310

9 years agoMake llvm-ar a real build target and install it.
Rafael Espindola [Wed, 3 Dec 2014 23:17:24 +0000 (23:17 +0000)]
Make llvm-ar a real build target and install it.

llvm-svn: 223309

9 years agoImprove the comments on PutSTDIN, GetSTDOUT, and GetSTDERR.
Zachary Turner [Wed, 3 Dec 2014 23:15:14 +0000 (23:15 +0000)]
Improve the comments on PutSTDIN, GetSTDOUT, and GetSTDERR.

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

llvm-svn: 223308

9 years agoAdd a test-case for lit xunit output
Chris Matthews [Wed, 3 Dec 2014 23:01:35 +0000 (23:01 +0000)]
Add a test-case for lit xunit output

llvm-svn: 223307

9 years agoMove tests for llvm-objdump for universal files to X86 directory to fix build bots.
Kevin Enderby [Wed, 3 Dec 2014 23:00:16 +0000 (23:00 +0000)]
Move tests for llvm-objdump for universal files to X86 directory to fix build bots.

llvm-svn: 223306

9 years agoDon't allow test-suite names with . in them in xml output
Chris Matthews [Wed, 3 Dec 2014 22:59:15 +0000 (22:59 +0000)]
Don't allow test-suite names with . in them in xml output

llvm-svn: 223305

9 years agoSplit the set of identified struct types into opaque and non-opaque ones.
Rafael Espindola [Wed, 3 Dec 2014 22:36:37 +0000 (22:36 +0000)]
Split the set of identified struct types into opaque and non-opaque ones.

The non-opaque part can be structurally uniqued. To keep this to just
a hash lookup, we don't try to unique cyclic types.

Also change the type mapping algorithm to be optimistic about a type
not being recursive and only create a new type when proven to be wrong.
This is not as strong as trying to speculate that we can keep the source
type, but is simpler (no speculation to revert) and more powerfull
than what we had before (we don't copy non-recursive types at least).

I initially wrote this to try to replace the name based type merging.
It is not strong enough to replace it, but is is a useful addition.

With this patch the number of named struct types is a clang lto bootstrap goes
from 49674 to 15986.

llvm-svn: 223278

9 years agoAdd support to llvm-objdump for Mach-O universal files and archives with -macho.
Kevin Enderby [Wed, 3 Dec 2014 22:29:40 +0000 (22:29 +0000)]
Add support to llvm-objdump for Mach-O universal files and archives with -macho.

llvm-svn: 223277

9 years agofix typos, grammar, formatting; NFC
Sanjay Patel [Wed, 3 Dec 2014 22:28:05 +0000 (22:28 +0000)]
fix typos, grammar, formatting; NFC

llvm-svn: 223276

9 years agoStrength Verifier checks around the types involved in a statepoint
Philip Reames [Wed, 3 Dec 2014 22:23:24 +0000 (22:23 +0000)]
Strength Verifier checks around the types involved in a statepoint

Add checks that the types in a gc.statepoint sequence match the wrapper callee and that relocating a pointer doesn't change it's type.

llvm-svn: 223275

9 years agocorrect spelling, NFC
Matthias Braun [Wed, 3 Dec 2014 22:10:39 +0000 (22:10 +0000)]
correct spelling, NFC

llvm-svn: 223274

9 years agoManually call ModulesDidLoad when the executable is loaded.
Zachary Turner [Wed, 3 Dec 2014 22:04:31 +0000 (22:04 +0000)]
Manually call ModulesDidLoad when the executable is loaded.

This is a temporary workaround to get deferred breakpoint
resolution working until Bug 21720 is addressed.  Even with this
workaround, it will only resolve deferred breakpoints in the
executable module, and not in a shared library.

llvm-svn: 223273

9 years agoCorrectly shutdown when DoDestroy is called with an active exception.
Zachary Turner [Wed, 3 Dec 2014 22:04:18 +0000 (22:04 +0000)]
Correctly shutdown when DoDestroy is called with an active exception.

Previously if we got a DoDestroy while stopped at a breakpoint, we
would detach and then say the process had exited.  This is completely
wrong, as it resulted in the python script incorrectly assuming that
the process had actually exited and trying to delete the image, when
in fact it had done no such thing.

The fix employed here is that when we get a DoDestroy, we do 3 steps:

1) initiate a termination sequence on the process
2) If we were stopped handling an exception of any kind, mask it and
   let the program resume, causing the program to see the termination
   request and exit on its own.
3) Let the program exit normally, and close all of our handles before
   returning control back to DoDestroy.

This fixes Bug 21722 and Bug 21723.

llvm-svn: 223272

9 years agoCUDA host device code with two code paths
Reid Kleckner [Wed, 3 Dec 2014 21:53:36 +0000 (21:53 +0000)]
CUDA host device code with two code paths

Summary:
Allow CUDA host device functions with two code paths using __CUDA_ARCH__
to differentiate between code path being compiled.

For example:
  __host__ __device__ void host_device_function(void) {
  #ifdef __CUDA_ARCH__
    device_only_function();
  #else
    host_only_function();
  #endif
  }

Patch by Jacques Pienaar.

Reviewed By: rnk

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

llvm-svn: 223271

9 years ago[SimplifyLibCalls] Improve double->float shrinking to consider constants
Matthias Braun [Wed, 3 Dec 2014 21:46:33 +0000 (21:46 +0000)]
[SimplifyLibCalls] Improve double->float shrinking to consider constants

This allows cases like float x; fmin(1.0, x); to be optimized to fminf(1.0f, x);

rdar://19049359

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

llvm-svn: 223270

9 years ago[SimplifyLibCalls] Enable double to float shrinking for copysign
Matthias Braun [Wed, 3 Dec 2014 21:46:29 +0000 (21:46 +0000)]
[SimplifyLibCalls] Enable double to float shrinking for copysign

rdar://19049359

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

llvm-svn: 223269

9 years ago[Hexagon] Converting member InstrDesc to static variable.
Colin LeMahieu [Wed, 3 Dec 2014 21:40:25 +0000 (21:40 +0000)]
[Hexagon] Converting member InstrDesc to static variable.

llvm-svn: 223268

9 years agoCast vtable address points to i32 (...)** to enable more globalopt
Reid Kleckner [Wed, 3 Dec 2014 21:00:21 +0000 (21:00 +0000)]
Cast vtable address points to i32 (...)** to enable more globalopt

We currently use i32 (...)** as the type of the vptr field in the LLVM
struct type. LLVM's GlobalOpt prefers any bitcasts to be on the side of
the data being stored rather than on the pointer being stored to.

Reviewers: majnemer

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

llvm-svn: 223267

9 years agoTeach EvaluatedExprVisitor that the condition and unselected branches of a
Richard Smith [Wed, 3 Dec 2014 21:00:20 +0000 (21:00 +0000)]
Teach EvaluatedExprVisitor that the condition and unselected branches of a
_Generic expression are unevaluated.

llvm-svn: 223266

9 years agoFix grammar-o.
Nico Weber [Wed, 3 Dec 2014 20:58:23 +0000 (20:58 +0000)]
Fix grammar-o.

llvm-svn: 223265

9 years ago[Hexagon] Converting subclass members to an implicit operand.
Colin LeMahieu [Wed, 3 Dec 2014 20:23:22 +0000 (20:23 +0000)]
[Hexagon] Converting subclass members to an implicit operand.

llvm-svn: 223264

9 years agorange-for some things
David Blaikie [Wed, 3 Dec 2014 19:58:49 +0000 (19:58 +0000)]
range-for some things

llvm-svn: 223263

9 years agoSimplify CodeGenRegBank::inferMatchingSuperRegClass & its caller by passing an iterat...
David Blaikie [Wed, 3 Dec 2014 19:58:48 +0000 (19:58 +0000)]
Simplify CodeGenRegBank::inferMatchingSuperRegClass & its caller by passing an iterator rather than index

llvm-svn: 223262

9 years agoSimplify ownership of RegClasses by using list<CodeGenRegisterClass> instead of vecto...
David Blaikie [Wed, 3 Dec 2014 19:58:45 +0000 (19:58 +0000)]
Simplify ownership of RegClasses by using list<CodeGenRegisterClass> instead of vector<CodeGenRegisterClass*>

This complicates a few algorithms due to not having random access, but
not by a huge degree I don't think (open to debate/design
discussion/etc).

llvm-svn: 223261

9 years agoRange-for some stuff related to RegClasses, and comment cases where range-for isn...
David Blaikie [Wed, 3 Dec 2014 19:58:41 +0000 (19:58 +0000)]
Range-for some stuff related to RegClasses, and comment cases where range-for isn't suitable.

llvm-svn: 223260

9 years agoMake the Verifier more strict about gc.statepoints
Philip Reames [Wed, 3 Dec 2014 19:53:15 +0000 (19:53 +0000)]
Make the Verifier more strict about gc.statepoints

The recently added documentation for statepoints claimed that we checked the parameters of the various intrinsics for validity.  This patch adds the code to actually do so.  I also removed a couple of redundant checks for conditions which are checked elsewhere in the Verifier and simplified the logic using the helper functions from Statepoint.h.

llvm-svn: 223259

9 years agoASan CMakeLists.txt: fix bad indent; NFC
Hans Wennborg [Wed, 3 Dec 2014 19:05:42 +0000 (19:05 +0000)]
ASan CMakeLists.txt: fix bad indent; NFC

llvm-svn: 223258

9 years agoAdd TableGen info for Power8.
Will Schmidt [Wed, 3 Dec 2014 18:46:30 +0000 (18:46 +0000)]
Add TableGen info for Power8.
This is based on the Power7 version, with units added and renamed to match P8.

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

llvm-svn: 223257

9 years agoChange the name to be in style.
Roman Divacky [Wed, 3 Dec 2014 18:39:44 +0000 (18:39 +0000)]
Change the name to be in style.

llvm-svn: 223255