platform/upstream/llvm.git
9 years ago[MemCpyOpt] Pass Instruction to IRBuilder, no need for NextNode. NFC.
Ahmed Bougacha [Thu, 21 May 2015 00:08:35 +0000 (00:08 +0000)]
[MemCpyOpt] Pass Instruction to IRBuilder, no need for NextNode. NFC.

We're erasing the instructions anyway.

llvm-svn: 237861

9 years ago[opaque pointer type] Pass explicit pointee type in another case of GEP constant...
David Blaikie [Thu, 21 May 2015 00:06:38 +0000 (00:06 +0000)]
[opaque pointer type] Pass explicit pointee type in another case of GEP constant folding

llvm-svn: 237860

9 years agoFix build error
Andrew Kaylor [Wed, 20 May 2015 23:58:44 +0000 (23:58 +0000)]
Fix build error

llvm-svn: 237859

9 years ago[MemCpyOpt] Don't move the memset when optimizing memset+memcpy.
Ahmed Bougacha [Wed, 20 May 2015 23:55:16 +0000 (23:55 +0000)]
[MemCpyOpt] Don't move the memset when optimizing memset+memcpy.

Fixes PR23599, another miscompile introduced by r235232: when there is
another dependency on the destination of the created memset (i.e., the
part of the original destination that the memcpy doesn't depend on)
between the memcpy and the original memset, we would insert the created
memset after the memcpy, and thus after the other dependency.

Instead, insert the created memset right after the old one.

llvm-svn: 237858

9 years ago[LLD] Make lastOrdinal atomic to avoid race conditions.
Lang Hames [Wed, 20 May 2015 23:44:37 +0000 (23:44 +0000)]
[LLD] Make lastOrdinal atomic to avoid race conditions.

No test case: We don't have a good way to test race conditions.

llvm-svn: 237857

9 years agoCheck for bool-like conversion in conditional expressions.
Richard Trieu [Wed, 20 May 2015 23:29:18 +0000 (23:29 +0000)]
Check for bool-like conversion in conditional expressions.

Add a check for bool-like conversions for the condition expression of
conditional operators.  This is similiar to the checking of condition
expressions of if statements, for-loops, while-loops, and do-while loops.
Specificially, this is to fix the problem of assert("message") not triggering
-Wstring-conversion when the assert macro uses a conditional operator.

llvm-svn: 237856

9 years agoFix build warning
Andrew Kaylor [Wed, 20 May 2015 23:28:03 +0000 (23:28 +0000)]
Fix build warning

llvm-svn: 237855

9 years ago[WinEH] C++ EH state numbering fixes
Andrew Kaylor [Wed, 20 May 2015 23:22:24 +0000 (23:22 +0000)]
[WinEH] C++ EH state numbering fixes

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

llvm-svn: 237854

9 years ago[WinEH] Store pointers to the LSDA in the exception registration object
Reid Kleckner [Wed, 20 May 2015 23:08:04 +0000 (23:08 +0000)]
[WinEH] Store pointers to the LSDA in the exception registration object

We aren't yet emitting the LSDA yet, so this will still fail to
assemble.

llvm-svn: 237852

9 years agoDon't generate comments in the DebugLocStream unless required. NFC.
Pete Cooper [Wed, 20 May 2015 22:51:27 +0000 (22:51 +0000)]
Don't generate comments in the DebugLocStream unless required.  NFC.

The ByteStreamer here wasn't taking account of whether the asm streamer was text based and verbose.  Only with that combination should we emit comments.

This change makes sure that we only actually convert a Twine to a string using Twine::str() if we need the comment.  This saves about 10000 small allocations on a test case involving the verify-use_list-order bitcode going through llc with debug info.

Note, this is NFC as the comments would ultimately never be emitted unless required.

Reviewed by Duncan Exon Smith and David Blaikie.

llvm-svn: 237851

9 years ago[OpenMP] Make default OpenMP library (the one selected with just -fopenmp)
Richard Smith [Wed, 20 May 2015 22:48:44 +0000 (22:48 +0000)]
[OpenMP] Make default OpenMP library (the one selected with just -fopenmp)
configurable in the CMake build. There shouldn't be any change in default
behavior.

Derived from a patch by Daniel Jasper!

llvm-svn: 237850

9 years agoRevert "Add bool to DebugLocDwarfExpression to control emitting comments."
Pete Cooper [Wed, 20 May 2015 22:37:48 +0000 (22:37 +0000)]
Revert "Add bool to DebugLocDwarfExpression to control emitting comments."

This reverts commit 0037b6bcbc874aa1b93d7ce3ad8dba3753ee2d9d (r237827).

David Blaikie suggested some alternatives to this which are better.  Reverting to apply a better solution later.

llvm-svn: 237849

9 years ago[darwin] fix libcompiler_rt.dylib build
Nick Kledzik [Wed, 20 May 2015 22:37:46 +0000 (22:37 +0000)]
[darwin] fix libcompiler_rt.dylib build

The dylib build of compiler-rt has been broken on darwin since the
directory restructuring to push some things down into /builtins/.

llvm-svn: 237848

9 years ago[LLD] Fix an out-of-order-initialization bug that was introduced in r237841 by
Lang Hames [Wed, 20 May 2015 22:35:20 +0000 (22:35 +0000)]
[LLD] Fix an out-of-order-initialization bug that was introduced in r237841 by
moving a field in MachOLinkingContext.

llvm-svn: 237847

9 years ago[LLD] Revert r237842 - it went in without a proper commit message.
Lang Hames [Wed, 20 May 2015 22:33:34 +0000 (22:33 +0000)]
[LLD] Revert r237842 - it went in without a proper commit message.

llvm-svn: 237846

9 years agoChange CMake variable prefix to LIBOMP
Jonathan Peyton [Wed, 20 May 2015 22:33:24 +0000 (22:33 +0000)]
Change CMake variable prefix to LIBOMP

Cached CMake variables need to have a prefix so they don't collide with other
projects. This change (a lot of simple changes) simply prefixes cached variables
with LIBOMP_ and sets all of these variables to UPPERCASE which is convention.
e.g., os => LIBOMP_OS, ompt_support => LIBOMP_OMPT_SUPPORT.

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

llvm-svn: 237845

9 years agoHave TestNumThreads use std::thread instead of pthreads so that it can work cross...
Adrian McCarthy [Wed, 20 May 2015 22:32:44 +0000 (22:32 +0000)]
Have TestNumThreads use std::thread instead of pthreads so that it can work cross-platform.

llvm-svn: 237844

9 years agoRevert r237828 "[X86] Remove unused node after morphing it from shr to and."
Hans Wennborg [Wed, 20 May 2015 22:31:55 +0000 (22:31 +0000)]
Revert r237828 "[X86] Remove unused node after morphing it from shr to and."

This caused assertions during DAG combine: PR23601.

llvm-svn: 237843

9 years agoy
Lang Hames [Wed, 20 May 2015 22:26:06 +0000 (22:26 +0000)]
y

llvm-svn: 237842

9 years ago[LLD] Add support for the -stack_size option to Darwin ld.
Lang Hames [Wed, 20 May 2015 22:10:50 +0000 (22:10 +0000)]
[LLD] Add support for the -stack_size option to Darwin ld.

llvm-svn: 237841

9 years ago[doc] Update Lexicon with C++ unwinder acronyms
Nick Kledzik [Wed, 20 May 2015 22:04:06 +0000 (22:04 +0000)]
[doc] Update Lexicon with C++ unwinder acronyms

llvm-svn: 237840

9 years agoEvaluate union cast subexpressions when the cast value is unused
Reid Kleckner [Wed, 20 May 2015 21:59:25 +0000 (21:59 +0000)]
Evaluate union cast subexpressions when the cast value is unused

Fixes PR23597.

llvm-svn: 237839

9 years ago[opaque pointer type] Pass explicit type to Load instruction creation in AutoUpgrade
David Blaikie [Wed, 20 May 2015 21:46:30 +0000 (21:46 +0000)]
[opaque pointer type] Pass explicit type to Load instruction creation in AutoUpgrade

llvm-svn: 237838

9 years ago[Target/ARM] Only enable OptimizeBarrierPass at -O1 and above.
Davide Italiano [Wed, 20 May 2015 21:40:38 +0000 (21:40 +0000)]
[Target/ARM] Only enable OptimizeBarrierPass at -O1 and above.

Ideally this is going to be and LLVM IR pass (shared, among others
with AArch64), but for the time being just enable it if consumers
ask us for optimization and not unconditionally.

Discussed with Tim Northover on IRC.

llvm-svn: 237837

9 years ago[lib/Fuzzer] more docs
Kostya Serebryany [Wed, 20 May 2015 21:03:03 +0000 (21:03 +0000)]
[lib/Fuzzer] more docs

llvm-svn: 237836

9 years agoRefactored some common functionality into MaybeParseMicrosoftDeclSpecs; NFC.
Aaron Ballman [Wed, 20 May 2015 20:58:33 +0000 (20:58 +0000)]
Refactored some common functionality into MaybeParseMicrosoftDeclSpecs; NFC.

llvm-svn: 237835

9 years ago[lld] Use lit's shell to run tests on Windows by default
Reid Kleckner [Wed, 20 May 2015 20:41:45 +0000 (20:41 +0000)]
[lld] Use lit's shell to run tests on Windows by default

It's a lot faster than bash.

Also use FileCheck instead of grep to search through a binary file.
Cygwin's grep isn't working here for unknown reasons that probably
aren't worth investigating.

llvm-svn: 237834

9 years agoAsmParser: Require a terminating null character when creating memory buffer.
Alex Lorenz [Wed, 20 May 2015 20:41:27 +0000 (20:41 +0000)]
AsmParser: Require a terminating null character when creating memory buffer.

This commit modifies the memory buffer creation in the AsmParser library so
that it requires a terminating null character. The LLLexer in the AsmParser
library checks for EOF only when it sees a null character, thus it would
be best to require it when creating a memory buffer so that the memory
buffer constructor can verify that a terminating null character is indeed
present.

Reviewers: Duncan P. N. Exon Smith, Matthias Braun

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

llvm-svn: 237833

9 years agoCopy lit shell changes from clang to clang-tools-extra, excluding some failing tests
Reid Kleckner [Wed, 20 May 2015 20:33:18 +0000 (20:33 +0000)]
Copy lit shell changes from clang to clang-tools-extra, excluding some failing tests

llvm-svn: 237832

9 years agoDefault dst value for platform put-file.
Chaoren Lin [Wed, 20 May 2015 20:23:23 +0000 (20:23 +0000)]
Default dst value for platform put-file.

Summary: It should default to working-dir/src-filename if dst is not specified.

Reviewers: clayborg, flackr

Reviewed By: flackr

Subscribers: lldb-commits

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

llvm-svn: 237831

9 years ago[opaque pointer type] LoadInst: assert that the explicit type matches the implicit one
David Blaikie [Wed, 20 May 2015 20:22:31 +0000 (20:22 +0000)]
[opaque pointer type] LoadInst: assert that the explicit type matches the implicit one

llvm-svn: 237830

9 years agoMC: Remove most remaining uses of MCSymbolData::getSymbol(), NFC
Duncan P. N. Exon Smith [Wed, 20 May 2015 20:18:16 +0000 (20:18 +0000)]
MC: Remove most remaining uses of MCSymbolData::getSymbol(), NFC

Remove most remaining calls to `MCSymbolData::getSymbol()`, instead
using the already available `MCSymbol` directly.

llvm-svn: 237829

9 years ago[X86] Remove unused node after morphing it from shr to and.
Benjamin Kramer [Wed, 20 May 2015 20:10:26 +0000 (20:10 +0000)]
[X86] Remove unused node after morphing it from shr to and.

In some cases it won't get cleaned up properly leading to crashes
downstream. PR23353.

Based on a patch by Davide Italiano.

llvm-svn: 237828

9 years agoAdd bool to DebugLocDwarfExpression to control emitting comments.
Pete Cooper [Wed, 20 May 2015 19:50:03 +0000 (19:50 +0000)]
Add bool to DebugLocDwarfExpression to control emitting comments.

DebugLocDwarfExpression::EmitOp was creating temporary strings by concatenating Twine's.

When emitting to object files, these comments are thrown away.

This commit adds a boolean to the constructor of the DwarfExpression to control whether it will actually emit
any comments.  This prevents it from even generating the temporary comments which would have been thrown away anyway.

llvm-svn: 237827

9 years agoMC: Stop using MCSymbolData::getSymbol() in WinCOFF, NFC
Duncan P. N. Exon Smith [Wed, 20 May 2015 19:34:08 +0000 (19:34 +0000)]
MC: Stop using MCSymbolData::getSymbol() in WinCOFF, NFC

Move APIs over from `MCSymbolData` to `MCSymbol`.

llvm-svn: 237826

9 years agoSince the asan report function doesn't gather bp or sp,
Jim Ingham [Wed, 20 May 2015 19:15:43 +0000 (19:15 +0000)]
Since the asan report function doesn't gather bp or sp,
don't put those values in the Structured Data we make up
from the report.

<rdar://problem/21038887>

llvm-svn: 237824

9 years agoUse a SmallString buffer instead of a std::string for debug info path lookup. NFC.
Pete Cooper [Wed, 20 May 2015 19:12:14 +0000 (19:12 +0000)]
Use a SmallString buffer instead of a std::string for debug info path lookup.  NFC.

This code appends the filename to the directory then looks that up in a StringMap.  We should be using the existing Twine::toStringRef method instead of Twine::str() as most times we'll succeed in the lookup.

Its possible that we should also consider allowing StringMap to lookup a key using a Twine in addition to a StringRef but that would complicate the code with little known benefit above and beyond this change.

This saves 170k temporary allocations when running llc on the verify_use_list_order bitcode with debug info for x86.

llvm-svn: 237823

9 years agoDAGCombiner: Continue combining if FoldConstantArithmetic() fails.
Matthias Braun [Wed, 20 May 2015 18:54:02 +0000 (18:54 +0000)]
DAGCombiner: Continue combining if FoldConstantArithmetic() fails.

DAG.FoldConstantArithmetic() can fail even though both operands are
Constants if OpaqueConstants are involved. Continue trying other combine
possibilities in tis case.

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

Somewhat related to PR21801 / rdar://19211454

llvm-svn: 237822

9 years agoReapply r237539 with a fix for the Chromium build.
James Molloy [Wed, 20 May 2015 18:41:25 +0000 (18:41 +0000)]
Reapply r237539 with a fix for the Chromium build.

Make sure if we're truncating a constant that would then be sign extended
that the sign extension of the truncated constant is the same as the
original constant.

> Canonicalize min/max expressions correctly.
>
> This patch introduces a canonical form for min/max idioms where one operand
> is extended or truncated. This often happens when the other operand is a
> constant. For example:
>
> %1 = icmp slt i32 %a, i32 0
> %2 = sext i32 %a to i64
> %3 = select i1 %1, i64 %2, i64 0
>
> Would now be canonicalized into:
>
> %1 = icmp slt i32 %a, i32 0
> %2 = select i1 %1, i32 %a, i32 0
> %3 = sext i32 %2 to i64
>
> This builds upon a patch posted by David Majenemer
> (https://www.marc.info/?l=llvm-commits&m=143008038714141&w=2). That pass
> passively stopped instcombine from ruining canonical patterns. This
> patch additionally actively makes instcombine canonicalize too.
>
> Canonicalization of expressions involving a change in type from int->fp
> or fp->int are not yet implemented.

llvm-svn: 237821

9 years agoARM: Fix comment and make it slightly more readable
Matthias Braun [Wed, 20 May 2015 18:40:06 +0000 (18:40 +0000)]
ARM: Fix comment and make it slightly more readable

llvm-svn: 237820

9 years agoRevert some of "Silence some CMake 3.3 dev warnings in compiler-rt"
Reid Kleckner [Wed, 20 May 2015 18:39:59 +0000 (18:39 +0000)]
Revert some of "Silence some CMake 3.3 dev warnings in compiler-rt"

This reverts part of r237808.

The CMP0057 warnings came from an old development build of CMake that
nobody else has. We don't need the cruft.

llvm-svn: 237819

9 years ago[CodeGen] Check x86_64-arguments.c tests on AVX as well. NFC.
Ahmed Bougacha [Wed, 20 May 2015 18:39:16 +0000 (18:39 +0000)]
[CodeGen] Check x86_64-arguments.c tests on AVX as well.  NFC.

We used to only check the differing tests on AVX, but we might
as well check all of them.

llvm-svn: 237818

9 years agoImplement attach to process on Windows.
Zachary Turner [Wed, 20 May 2015 18:31:17 +0000 (18:31 +0000)]
Implement attach to process on Windows.

Differential Revision: http://reviews.llvm.org/D9801
Reviewed by: Adrian McCarthy

llvm-svn: 237817

9 years agoMC: Use MCSymbol in LocalCommon, NFC
Duncan P. N. Exon Smith [Wed, 20 May 2015 18:25:40 +0000 (18:25 +0000)]
MC: Use MCSymbol in LocalCommon, NFC

Switch from MCSymbolData to MCSymbol in LocalCommon.

llvm-svn: 237816

9 years ago[modules] Support merging a parsed default argument with an imported hidden one for...
Richard Smith [Wed, 20 May 2015 18:24:21 +0000 (18:24 +0000)]
[modules] Support merging a parsed default argument with an imported hidden one for non-type and template template parameters too.

llvm-svn: 237815

9 years ago[modules] Support merging a parsed default function/template argument with an importe...
Richard Smith [Wed, 20 May 2015 17:50:35 +0000 (17:50 +0000)]
[modules] Support merging a parsed default function/template argument with an imported but hidden one.

llvm-svn: 237814

9 years agoStart a to-do list for libc++
Marshall Clow [Wed, 20 May 2015 17:39:54 +0000 (17:39 +0000)]
Start a to-do list for libc++

llvm-svn: 237813

9 years agoFix icmp lowering
Pawel Bylica [Wed, 20 May 2015 17:21:09 +0000 (17:21 +0000)]
Fix icmp lowering

Summary:
During icmp lowering it can happen that a constant value can be larger than expected (see the code around the change).
APInt::getMinSignedBits() must be checked again as the shift before can change the constant sign to positive.
I'm not sure it is the best fix possible though.

Test Plan: Regression test included.

Reviewers: resistor, chandlerc, spatel, hfinkel

Reviewed By: hfinkel

Subscribers: hfinkel, llvm-commits

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

llvm-svn: 237812

9 years agoUse Intrinsic::ID instead of unsigned. NFC.
Pete Cooper [Wed, 20 May 2015 17:17:45 +0000 (17:17 +0000)]
Use Intrinsic::ID instead of unsigned.  NFC.

This is after LLVM r237810 which made Function::getIntrinsicID() return an Intrinsic::ID.

llvm-svn: 237811

9 years agoChange Function::getIntrinsicID() to return an Intrinsic::ID. NFC.
Pete Cooper [Wed, 20 May 2015 17:16:39 +0000 (17:16 +0000)]
Change Function::getIntrinsicID() to return an Intrinsic::ID.  NFC.

Now that Intrinsic::ID is a typed enum, we can forward declare it and so return it from this method.

This updates all users which were either using an unsigned to store it, or had a now unnecessary cast.

llvm-svn: 237810

9 years agoTemporary delete the test while we're investigating crashes in LLVMObject it causes.
Alexey Samsonov [Wed, 20 May 2015 17:01:06 +0000 (17:01 +0000)]
Temporary delete the test while we're investigating crashes in LLVMObject it causes.

llvm-svn: 237809

9 years agoSilence some CMake 3.3 dev warnings in compiler-rt
Reid Kleckner [Wed, 20 May 2015 16:56:17 +0000 (16:56 +0000)]
Silence some CMake 3.3 dev warnings in compiler-rt

Fix a trivial instance of CMP0054 that came up on llvmdev.

The other warnings were CMP0057, which is about using the same file as a
MAIN_DEPENDENCY multiple times.  The old behavior hasn't been a problem
yet, so I silenced the warning and filed PR23595 to document the issue
if someone cares.

llvm-svn: 237808

9 years agoMC: Add MCSymbolData back to MCAssembler dump
Duncan P. N. Exon Smith [Wed, 20 May 2015 16:34:36 +0000 (16:34 +0000)]
MC: Add MCSymbolData back to MCAssembler dump

r237490 accidentally dropped MCSymbolData from the MCAssembler dump.
Add it back underneath the MCSymbol dump.  Remove the MCSymbol dump from
MCSymbolData, since this would cause an infinite co-recursion, and
besides, that back pointer is going away.

llvm-svn: 237807

9 years agoInstrProf: Change this triple back to %itanium_abi_triple
Justin Bogner [Wed, 20 May 2015 16:25:35 +0000 (16:25 +0000)]
InstrProf: Change this triple back to %itanium_abi_triple

In my rush to fix the linux bots in r237805, I accidentally committed
a change to the triple. Revert that part.

llvm-svn: 237806

9 years agoInstrProf: Remove darwin-specific section names from this test
Justin Bogner [Wed, 20 May 2015 16:21:26 +0000 (16:21 +0000)]
InstrProf: Remove darwin-specific section names from this test

llvm-svn: 237805

9 years agoInstrProf: Increment the profile counter for all types of destructor
Justin Bogner [Wed, 20 May 2015 16:16:23 +0000 (16:16 +0000)]
InstrProf: Increment the profile counter for all types of destructor

-fprofile-instr-generate does not emit counter increment intrinsics
for Dtor_Deleting and Dtor_Complete destructors with assigned
counters. This causes unnecessary [-Wprofile-instr-out-of-date]
warnings during profile-use runs even if the source has never been
modified since profile collection.

Patch by Betul Buyukkurt. Thanks!

llvm-svn: 237804

9 years agoMC: Update MCAssembler to use MCSymbol, NFC
Duncan P. N. Exon Smith [Wed, 20 May 2015 16:02:11 +0000 (16:02 +0000)]
MC: Update MCAssembler to use MCSymbol, NFC

Use `MCSymbol` over `MCSymbolData` where both are needed.

llvm-svn: 237803

9 years agoCodeGen: Remove some trailing whitespace. NFC
Justin Bogner [Wed, 20 May 2015 15:53:59 +0000 (15:53 +0000)]
CodeGen: Remove some trailing whitespace. NFC

llvm-svn: 237802

9 years ago[YAML] Make Node's destructor non-virtual.
Benjamin Kramer [Wed, 20 May 2015 15:38:29 +0000 (15:38 +0000)]
[YAML] Make Node's destructor non-virtual.

Nodes aren't supposed to be destroyed polymorphically. Also make all subclasses
final to avoid non-virtual dtor warnings.

llvm-svn: 237801

9 years agoAdd diagnostic for unsigned integer comparisions
Tobias Grosser [Wed, 20 May 2015 15:37:11 +0000 (15:37 +0000)]
Add diagnostic for unsigned integer comparisions

llvm-svn: 237800

9 years agoMC: Use MCSymbol in MachObjectWriter, NFC
Duncan P. N. Exon Smith [Wed, 20 May 2015 15:16:14 +0000 (15:16 +0000)]
MC: Use MCSymbol in MachObjectWriter, NFC

Replace uses of `MCSymbolData` with `MCSymbol` where both are needed, so
we can remove the backpointer.

llvm-svn: 237799

9 years agoMC: Use MCSymbol in MCObjectWriter::isWeak(), NFC
Duncan P. N. Exon Smith [Wed, 20 May 2015 15:10:03 +0000 (15:10 +0000)]
MC: Use MCSymbol in MCObjectWriter::isWeak(), NFC

Continue to prefer `MCSymbol` when we need both.

llvm-svn: 237798

9 years agoGet Triple::getARMCPUForArch() to use TargetParser
Renato Golin [Wed, 20 May 2015 15:05:07 +0000 (15:05 +0000)]
Get Triple::getARMCPUForArch() to use TargetParser

First ARMTargetParser FIXME, conservatively changing the way we parse CPUs
in the back-end. Still not perfect, with a lot of special cases, but moving
towards a more generic solution.

Moving all logic to the target parser made some unwritten assumptions
about architectures in Clang to break. I've added a lot of architectures
required by Clang, and default to CPUs that Clang believes it should
(and I agree).

I've also added a lot of unit tests, with the correct CPU for each
architecture, and Clang seems to be working correctly, too.

It also became clear that using "unsigned ID" as the argument for the get
methods makes it hard to know what ID, so I also changed the argument names
to match the enum type names.

llvm-svn: 237797

9 years agoDrop redundant condition
Tobias Grosser [Wed, 20 May 2015 15:04:27 +0000 (15:04 +0000)]
Drop redundant condition

This condition was accidentally introduced in r211875.

llvm-svn: 237796

9 years agoUnit tests for the getSwappedBytes(double) fix from r237673.
Pawel Bylica [Wed, 20 May 2015 14:57:43 +0000 (14:57 +0000)]
Unit tests for the getSwappedBytes(double) fix from r237673.

llvm-svn: 237795

9 years agoSilencing a -Wsign-compare warning; NFC.
Aaron Ballman [Wed, 20 May 2015 14:53:50 +0000 (14:53 +0000)]
Silencing a -Wsign-compare warning; NFC.

llvm-svn: 237794

9 years agoAVX-512: fixed algorithm of building vectors of i1 elements
Elena Demikhovsky [Wed, 20 May 2015 14:32:03 +0000 (14:32 +0000)]
AVX-512: fixed algorithm of building vectors of i1 elements
fixed extract-insert i1 element,
load i1, zextload i1 should be with "and $1, %reg" to prevent loading garbage.
added a bunch of new tests.

llvm-svn: 237793

9 years agoRevert r237789 - [mips] The naming convention for private labels is ABI dependant.
Daniel Sanders [Wed, 20 May 2015 14:18:59 +0000 (14:18 +0000)]
Revert r237789 - [mips] The naming convention for private labels is  ABI dependant.

It works, but I've noticed that I missed several callers of createMCAsmInfo()
and many don't have a TargetMachine to provide.

llvm-svn: 237792

9 years ago[ARM] Add needed symbols during dynamic executable linking
Denis Protivensky [Wed, 20 May 2015 13:39:33 +0000 (13:39 +0000)]
[ARM] Add needed symbols during dynamic executable linking

These include _GLOBAL_OFFSET_TABLE_ and _DYNAMIC.

llvm-svn: 237791

9 years ago[mips] Fix ehframe-indirect.ll test.
Daniel Sanders [Wed, 20 May 2015 13:19:19 +0000 (13:19 +0000)]
[mips] Fix ehframe-indirect.ll test.

Summary:
-check-prefix replaces the default CHECK prefix rather than adding to it and
must be explicitly re-added.

Also added the N32 cases.

Reviewers: petarj

Reviewed By: petarj

Subscribers: tberghammer, llvm-commits

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

llvm-svn: 237790

9 years ago[mips] The naming convention for private labels is ABI dependant.
Daniel Sanders [Wed, 20 May 2015 13:16:42 +0000 (13:16 +0000)]
[mips] The naming convention for private labels is ABI dependant.

Summary:
For N32/N64, private labels begin with '.L' but for O32 they begin with '$'.

MCAsmInfo now has an initializer function which can be used to provide information from the TargetMachine to control the assembly syntax.

Reviewers: vkalintiris

Reviewed By: vkalintiris

Subscribers: jfb, sandeep, llvm-commits, rafael

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

llvm-svn: 237789

9 years ago[OPENMP] Fix codegen for ordered loop directives.
Alexey Bataev [Wed, 20 May 2015 13:12:48 +0000 (13:12 +0000)]
[OPENMP] Fix codegen for ordered loop directives.

loops with ordered clause must be generated the same way as dynamic loops, but with static scheduleing.

llvm-svn: 237788

9 years ago[MSVC] Handle out-of-line definition of static data member correctly (fix for http...
Alexey Bataev [Wed, 20 May 2015 11:57:02 +0000 (11:57 +0000)]
[MSVC] Handle out-of-line definition of static data member correctly (fix for llvm.org/PR21164), by Alexey Frolov

There are 3 cases of defining static const member:

initialized inside the class, not defined outside the class.
initialized inside the class, defined outside the class.
not initialized inside the class, defined outside the class.
Revision r213304 was supposed to fix the linkage problem of case (1), but mistakenly it made case (2) behave the same.
As a result, out-of-line definition of static data member is not handled correctly.
Proposed patch distinguishes between cases (1) and (2) and allows to properly emit static const members under –fms-compatibility option.

This fixes http://llvm.org/PR21164.
Differential Revision: http://reviews.llvm.org/D9850

llvm-svn: 237787

9 years ago[StatepointLowering] Support of the gc.relocates for invoke statepoints.
Igor Laevsky [Wed, 20 May 2015 11:37:25 +0000 (11:37 +0000)]
[StatepointLowering] Support of the gc.relocates for invoke statepoints.

This change implements support for lowering of the gc.relocates tied to the invoke statepoint.
This is acomplished by storing frame indices of the lowered values in "StatepointRelocatedValues" map inside FunctionLoweringInfo instead of storing them in per-basic block structure StatepointLowering.
After this change StatepointLowering is used only during "LowerStatepoint" call and it is not necessary to store it as a field in SelectionDAGBuilder anymore.

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

llvm-svn: 237786

9 years agoUse base-pointer address space when creating new access functions
Tobias Grosser [Wed, 20 May 2015 11:02:12 +0000 (11:02 +0000)]
Use base-pointer address space when creating new access functions

llvm-svn: 237785

9 years agoAllow skipping imports in the module visitor.
Manuel Klimek [Wed, 20 May 2015 10:29:23 +0000 (10:29 +0000)]
Allow skipping imports in the module visitor.

Skip imports when we know that we do not need to visit any imports
because we've already deserialized the redecls from a module.

llvm-svn: 237782

9 years agoFix handling of hijacked events in synchronous mode
Ilia K [Wed, 20 May 2015 10:15:47 +0000 (10:15 +0000)]
Fix handling of hijacked events in synchronous mode

Summary:
This patch includes the following changes:
* Fix Target::Launch to handle hijacked event in synchronous mode
* Improve MiStartupOptionsTestCase tests to expect *stopped (MI)
* Add SBProcess::GetStopEventForStopID
* Add ProcessModID::SetStopEventForLastNaturalStopID/GetStopEventForStopID
* Add const qualifier to ProcessModID::GetLastNaturalStopID
* Add SBProcess::GetStopEventForStopID
* Don't broadcast hijacked event in Target::Launch
* Add CMICmnLLDBDebugger::CheckIfNeedToRebroadcastStopEvent/RebroadcastStopEvent

Test Plan: ./dotest.py -v --executable $BUILDDIR/bin/lldb tools/lldb-mi/startup_options/

Reviewers: zturner, jingham, clayborg, abidh

Reviewed By: clayborg

Subscribers: abidh, zturner, lldb-commits, clayborg, jingham

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

llvm-svn: 237781

9 years ago[mips] [IAS] Factor out .set nomacro warning. NFC.
Toma Tabacu [Wed, 20 May 2015 08:54:45 +0000 (08:54 +0000)]
[mips] [IAS] Factor out .set nomacro warning. NFC.

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: llvm-commits

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

llvm-svn: 237780

9 years agoAdd printing and testing to ScopArrayInfo
Tobias Grosser [Wed, 20 May 2015 08:05:31 +0000 (08:05 +0000)]
Add printing and testing to ScopArrayInfo

Being here, we extend the interface to return the element type and not a pointer
to the element type. We also provide a function to get the size (in bytes) of
the elements stored in this array.

We currently still store the element size as an innermost dimension in
ScopArrayInfo, which is somehow inconsistent and should be addressed in future
patches.

llvm-svn: 237779

9 years ago[X86] Add _mm256_set_m128 and its 5 variants.
Michael Kuperstein [Wed, 20 May 2015 07:46:52 +0000 (07:46 +0000)]
[X86] Add _mm256_set_m128 and its 5 variants.

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

llvm-svn: 237778

9 years agoFix CGRecordLayouts description to say it maps clang types not llvm types
Yaron Keren [Wed, 20 May 2015 07:15:28 +0000 (07:15 +0000)]
Fix CGRecordLayouts description to say it maps clang types not llvm types
and de-duplicate data fields names from comments according to the coding
standard.

llvm-svn: 237776

9 years ago[TableGen] Make some variable names consistent with their type names and just general...
Craig Topper [Wed, 20 May 2015 05:40:13 +0000 (05:40 +0000)]
[TableGen] Make some variable names consistent with their type names and just generally consistent across all of the overloads.

llvm-svn: 237775

9 years ago[TableGen] Fix a memory leak.
Craig Topper [Wed, 20 May 2015 05:40:09 +0000 (05:40 +0000)]
[TableGen] Fix a memory leak.

llvm-svn: 237774

9 years ago[TableGen] Don't override convertValue for some of the Init types when it does the...
Craig Topper [Wed, 20 May 2015 05:40:06 +0000 (05:40 +0000)]
[TableGen] Don't override convertValue for some of the Init types when it does the same thing as the base class implementation.

llvm-svn: 237773

9 years ago[X86] Implement the local-exec TLS model for Windows targets
David Majnemer [Wed, 20 May 2015 04:45:26 +0000 (04:45 +0000)]
[X86] Implement the local-exec TLS model for Windows targets

We know that _tls_index is zero for local-exec TLS variables because
they are always defined in the executable.

llvm-svn: 237772

9 years ago[clang-cl] Map /GA to -ftls-model=local-exec
David Majnemer [Wed, 20 May 2015 04:39:56 +0000 (04:39 +0000)]
[clang-cl] Map /GA to -ftls-model=local-exec

The /GA switch informs the compiler that it may assume that all TLS
access refers to the executable's index: 0.

llvm-svn: 237771

9 years agoMC: Use MCSymbol in most of ELFObjectWriter, NFC
Duncan P. N. Exon Smith [Wed, 20 May 2015 04:39:01 +0000 (04:39 +0000)]
MC: Use MCSymbol in most of ELFObjectWriter, NFC

Stop using MCSymbolData where we also need MCSymbol.

llvm-svn: 237770

9 years ago[OPENMP] -fopenmp enables OpenMP support (fix for http://llvm.org/PR23492)
Alexey Bataev [Wed, 20 May 2015 04:24:19 +0000 (04:24 +0000)]
[OPENMP] -fopenmp enables OpenMP support (fix for llvm.org/PR23492)

-fopenmp turns on OpenMP support and links libiomp5 as OpenMP library. Also there is -fopenmp={libiomp5|libgomp} option that allows to override effect of -fopenmp and link libgomp library (if -fopenmp=libgomp is specified).
Differential Revision: http://reviews.llvm.org/D9736

llvm-svn: 237769

9 years agoFix for aggregate copying of variable length arrays.
Alexey Bataev [Wed, 20 May 2015 03:46:04 +0000 (03:46 +0000)]
Fix for aggregate copying of variable length arrays.

Patch fixes codegen for aggregate copying of VLAs. Currently method CodeGenFunction::EmitAggregateCopy() does not support copying of VLAs. Patch checks if the size of the type is 0, then checks if the type is actually a variable-length array. Then it calculates total length for this array and calculates total size of the array in bytes:

<total number of elements in array> * aligned_sizeof(ElementType) (if copy assignment is requested).
If simple copying is requested, size is calculated like:

<total number of elements in array> * aligned_sizeof(ElementType) - aligned_sizeof(ElementType) + sizeof(ElementType).
memcpy() is used with this calculated size of the VLA.
Differential Revision: http://reviews.llvm.org/D9851

llvm-svn: 237768

9 years agoFix building and testing libc++ with GCC.
Eric Fiselier [Wed, 20 May 2015 03:15:01 +0000 (03:15 +0000)]
Fix building and testing libc++ with GCC.

The changes in src/exception.cpp and cmake/Modules/HandleLibCXXABI.cmake fix a
bug when building libc++ with GCC. Because GCC does not support __has_include
we need to explicitly tell it that we are building against libc++abi via the
preprocessor definition `LIBCXX_BUILDING_LIBCXXABI`.

The changes in include/ratio are to work around CWG defect
1712 (constexpr variable template declarations). GCC 4.8 and before has not
adopted the resolution to this defect.

The changes in include/exception work around an issue where is_final is used
without it being defined in type_traits.

llvm-svn: 237767

9 years agoSupport: Introduce LLVM_FALLTHROUGH macro.
Peter Collingbourne [Wed, 20 May 2015 02:44:14 +0000 (02:44 +0000)]
Support: Introduce LLVM_FALLTHROUGH macro.

llvm-svn: 237766

9 years agoAdd a GCStrategy for CoreCLR
Swaroop Sridhar [Wed, 20 May 2015 01:07:23 +0000 (01:07 +0000)]
Add a GCStrategy for CoreCLR

This change adds a new GC strategy for supporting the CoreCLR runtime.

This strategy is currently identical to Statepoint-example GC,
but is necessary for several upcoming changes specific to CoreCLR, such as:

1. Base-pointers not explicitly reported for interior pointers
2. Different format for stack-map encoding
3. Location of Safe-point polls: polls are only needed before loop-back edges and before tail-calls (not needed at function-entry)
4. Runtime specific handshake between calls to managed/unmanaged functions.

llvm-svn: 237753

9 years ago[GDBRemoteCommunicationClient] Increase timeout for qfProcessInfo packet.
Siva Chandra [Wed, 20 May 2015 00:30:31 +0000 (00:30 +0000)]
[GDBRemoteCommunicationClient] Increase timeout for qfProcessInfo packet.

Summary:
The test in TestPlatformCommand which runs "platform process list" has
been timing out for Android when running running dosep.py with
LLDB_TEST_THREADS=8. This patch increases the packet timeout to a large
value of 1min to accommodate the long time required for a response for
the qfProcessInfo packet on Android.

Test Plan: LLDB_TEST_THREADS=8 ./dosep.py on Android.

Reviewers: chaoren

Reviewed By: chaoren

Subscribers: tberghammer, lldb-commits

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

llvm-svn: 237752

9 years ago[bpf] fix build
Alexei Starovoitov [Wed, 20 May 2015 00:20:26 +0000 (00:20 +0000)]
[bpf] fix build

llvm-svn: 237751

9 years agoMC: Take MCSymbol in MachObjectWriter::getSymbolAddress(), NFC
Duncan P. N. Exon Smith [Wed, 20 May 2015 00:02:39 +0000 (00:02 +0000)]
MC: Take MCSymbol in MachObjectWriter::getSymbolAddress(), NFC

Pass through an `MCSymbol` instead of an `MCSymbolData` so we can get
rid of the back pointer.

llvm-svn: 237750

9 years agoMC: Use MCSymbol in MCAsmLayout::getSymbolOffset(), NFC
Duncan P. N. Exon Smith [Tue, 19 May 2015 23:53:20 +0000 (23:53 +0000)]
MC: Use MCSymbol in MCAsmLayout::getSymbolOffset(), NFC

Continue to canonicalize on MCSymbol instead of MCSymbolData when both
are needed.

llvm-svn: 237749

9 years agoFactor out LTO detection to common configuration.
Peter Collingbourne [Tue, 19 May 2015 23:50:13 +0000 (23:50 +0000)]
Factor out LTO detection to common configuration.

This will allow us to test other sanitizers with LTO.

llvm-svn: 237747

9 years agoCFI: Remove <utility> include.
Peter Collingbourne [Tue, 19 May 2015 23:50:11 +0000 (23:50 +0000)]
CFI: Remove <utility> include.

It is unused, and causes a test failure on Darwin.

llvm-svn: 237746

9 years agoFix race condition in thread test.
Eric Fiselier [Tue, 19 May 2015 23:41:04 +0000 (23:41 +0000)]
Fix race condition in thread test.

llvm-svn: 237745

9 years ago[PlaceSafepoints] Stop special casing some intrinsics
Philip Reames [Tue, 19 May 2015 23:40:11 +0000 (23:40 +0000)]
[PlaceSafepoints] Stop special casing some intrinsics

We were special casing a handful of intrinsics as not needing a safepoint before them.  After running into another valid case - memset - I took a closer look and realized that almost no intrinsics need to have a safepoint poll before them.  Restructure the code to make that apparent so that we stop hitting these bugs.  The only intrinsics which need a safepoint poll before them are ones which can run arbitrary code.

llvm-svn: 237744