platform/upstream/llvm.git
10 years agoRemove unused field MacroInstantiation::TheMacro. No behavior change.
Nico Weber [Thu, 24 Jul 2014 16:29:04 +0000 (16:29 +0000)]
Remove unused field MacroInstantiation::TheMacro. No behavior change.

llvm-svn: 213874

10 years agoLet the integrated assembler understand .warning, PR20428.
Nico Weber [Thu, 24 Jul 2014 16:26:06 +0000 (16:26 +0000)]
Let the integrated assembler understand .warning, PR20428.

llvm-svn: 213873

10 years agoInclude relative path for header outside the current directory.
Joerg Sonnenberger [Thu, 24 Jul 2014 16:04:46 +0000 (16:04 +0000)]
Include relative path for header outside the current directory.

llvm-svn: 213872

10 years agoRemove dead code.
Rafael Espindola [Thu, 24 Jul 2014 16:02:28 +0000 (16:02 +0000)]
Remove dead code.

Every user has been switched to using EngineBuilder.

llvm-svn: 213871

10 years ago[Refactor] Remove containsLoop to find innermost loops
Johannes Doerfert [Thu, 24 Jul 2014 15:59:06 +0000 (15:59 +0000)]
[Refactor] Remove containsLoop to find innermost loops

  Use the fact that if we visit a for node first in pre and next in post order
  we know we did not visit any children, thus we found an innermost loop.

  + Test case for an innermost loop with a conditional inside

llvm-svn: 213870

10 years agoRemove the last use of llvm::ExecutionEngine::create.
Rafael Espindola [Thu, 24 Jul 2014 15:54:23 +0000 (15:54 +0000)]
Remove the last use of llvm::ExecutionEngine::create.

llvm-svn: 213869

10 years ago[Mips] Replace assembler code by YAML to make the 'exe-dynsym.test' test
Simon Atanasyan [Thu, 24 Jul 2014 15:42:11 +0000 (15:42 +0000)]
[Mips] Replace assembler code by YAML to make the 'exe-dynsym.test' test
target independent.

llvm-svn: 213868

10 years agoAArch64: refactor ReconstructShuffle function
Tim Northover [Thu, 24 Jul 2014 15:39:55 +0000 (15:39 +0000)]
AArch64: refactor ReconstructShuffle function

Quite a bit of cruft had accumulated as we realised the various different cases
it had to handle and squeezed them in where possible. This refactoring mostly
flattens the logic and special-cases. The result is slightly longer, but I
think clearer.

Should be no functionality change.

llvm-svn: 213867

10 years agoFix r213824 on windows
Duncan P. N. Exon Smith [Thu, 24 Jul 2014 15:16:23 +0000 (15:16 +0000)]
Fix r213824 on windows

llvm-svn: 213866

10 years agoImproving the "integer constant too large" diagnostics based on post-commit feedback...
Aaron Ballman [Thu, 24 Jul 2014 14:51:23 +0000 (14:51 +0000)]
Improving the "integer constant too large" diagnostics based on post-commit feedback from Richard Smith. Amends r213657.

llvm-svn: 213865

10 years agoAdd scoped-noalias metadata
Hal Finkel [Thu, 24 Jul 2014 14:25:39 +0000 (14:25 +0000)]
Add scoped-noalias metadata

This commit adds scoped noalias metadata. The primary motivations for this
feature are:
  1. To preserve noalias function attribute information when inlining
  2. To provide the ability to model block-scope C99 restrict pointers

Neither of these two abilities are added here, only the necessary
infrastructure. In fact, there should be no change to existing functionality,
only the addition of new features. The logic that converts noalias function
parameters into this metadata during inlining will come in a follow-up commit.

What is added here is the ability to generally specify noalias memory-access
sets. Regarding the metadata, alias-analysis scopes are defined similar to TBAA
nodes:

!scope0 = metadata !{ metadata !"scope of foo()" }
!scope1 = metadata !{ metadata !"scope 1", metadata !scope0 }
!scope2 = metadata !{ metadata !"scope 2", metadata !scope0 }
!scope3 = metadata !{ metadata !"scope 2.1", metadata !scope2 }
!scope4 = metadata !{ metadata !"scope 2.2", metadata !scope2 }

Loads and stores can be tagged with an alias-analysis scope, and also, with a
noalias tag for a specific scope:

... = load %ptr1, !alias.scope !{ !scope1 }
... = load %ptr2, !alias.scope !{ !scope1, !scope2 }, !noalias !{ !scope1 }

When evaluating an aliasing query, if one of the instructions is associated
with an alias.scope id that is identical to the noalias scope associated with
the other instruction, or is a descendant (in the scope hierarchy) of the
noalias scope associated with the other instruction, then the two memory
accesses are assumed not to alias.

Note that is the first element of the scope metadata is a string, then it can
be combined accross functions and translation units. The string can be replaced
by a self-reference to create globally unqiue scope identifiers.

[Note: This overview is slightly stylized, since the metadata nodes really need
to just be numbers (!0 instead of !scope0), and the scope lists are also global
unnamed metadata.]

Existing noalias metadata in a callee is "cloned" for use by the inlined code.
This is necessary because the aliasing scopes are unique to each call site
(because of possible control dependencies on the aliasing properties). For
example, consider a function: foo(noalias a, noalias b) { *a = *b; } that gets
inlined into bar() { ... if (...) foo(a1, b1); ... if (...) foo(a2, b2); } --
now just because we know that a1 does not alias with b1 at the first call site,
and a2 does not alias with b2 at the second call site, we cannot let inlining
these functons have the metadata imply that a1 does not alias with b2.

llvm-svn: 213864

10 years agoFixing an MSVC conversion warning about implicitly converting the shift results to...
Aaron Ballman [Thu, 24 Jul 2014 14:24:59 +0000 (14:24 +0000)]
Fixing an MSVC conversion warning about implicitly converting the shift results to 64-bits. No functional change intended.

llvm-svn: 213863

10 years agoSetting the documentation heading for #pragma unroll, which should not be with the...
Aaron Ballman [Thu, 24 Jul 2014 14:13:59 +0000 (14:13 +0000)]
Setting the documentation heading for #pragma unroll, which should not be with the heading for #pragma clang loop.

llvm-svn: 213862

10 years agoFix endian test for big-endian hosts
Ed Maste [Thu, 24 Jul 2014 13:28:16 +0000 (13:28 +0000)]
Fix endian test for big-endian hosts

The uint16_t cast truncated the magic value to 0x00000304, making the
first byte 0 (eByteOrderInvalid) on big endian hosts.

Reported by Justin Hibbits.

llvm-svn: 213861

10 years ago[Target] Teach the query interfaces for lowering of extloads and
Chandler Carruth [Thu, 24 Jul 2014 12:20:53 +0000 (12:20 +0000)]
[Target] Teach the query interfaces for lowering of extloads and
truncstores to support EVTs and return expand for non-simple ones.

This makes them more consistent with the isLegal... query style methods
and makes using them simpler in many scenarios.

No functionality actually changed.

llvm-svn: 213860

10 years agoAA metadata refactoring (introduce AAMDNodes)
Hal Finkel [Thu, 24 Jul 2014 12:16:19 +0000 (12:16 +0000)]
AA metadata refactoring (introduce AAMDNodes)

In order to enable the preservation of noalias function parameter information
after inlining, and the representation of block-level __restrict__ pointer
information (etc.), additional kinds of aliasing metadata will be introduced.
This metadata needs to be carried around in AliasAnalysis::Location objects
(and MMOs at the SDAG level), and so we need to generalize the current scheme
(which is hard-coded to just one TBAA MDNode*).

This commit introduces only the necessary refactoring to allow for the
introduction of other aliasing metadata types, but does not actually introduce
any (that will come in a follow-up commit). What it does introduce is a new
AAMDNodes structure to hold all of the aliasing metadata nodes associated with
a particular memory-accessing instruction, and uses that structure instead of
the raw MDNode* in AliasAnalysis::Location, etc.

No functionality change intended.

llvm-svn: 213859

10 years agoAdd FreeBSD support to Asan test cases that use mmap() with MAP_ANON
Viktor Kutuzov [Thu, 24 Jul 2014 12:05:13 +0000 (12:05 +0000)]
Add FreeBSD support to Asan test cases that use mmap() with MAP_ANON
Differential Revision: http://reviews.llvm.org/D4561

llvm-svn: 213858

10 years agoPrune redundant libdeps.
NAKAMURA Takumi [Thu, 24 Jul 2014 11:45:27 +0000 (11:45 +0000)]
Prune redundant libdeps.

llvm-svn: 213857

10 years agoPrune dependency to MC from each target disassembler.
NAKAMURA Takumi [Thu, 24 Jul 2014 11:45:11 +0000 (11:45 +0000)]
Prune dependency to MC from each target disassembler.

llvm-svn: 213856

10 years ago[CMake] tools/lto: Prune redundant libdep(s).
NAKAMURA Takumi [Thu, 24 Jul 2014 11:44:44 +0000 (11:44 +0000)]
[CMake] tools/lto: Prune redundant libdep(s).

llvm-svn: 213855

10 years ago[CMake] LineEditorTests: Add Support to link_components.
NAKAMURA Takumi [Thu, 24 Jul 2014 11:44:33 +0000 (11:44 +0000)]
[CMake] LineEditorTests: Add Support to link_components.

Even if LLVMSupport is added in add_unittests, LLVMSupport may be here as consistency.

llvm-svn: 213854

10 years ago[CMake] LexTests: Prune redundant libdep(s).
NAKAMURA Takumi [Thu, 24 Jul 2014 11:44:03 +0000 (11:44 +0000)]
[CMake] LexTests: Prune redundant libdep(s).

llvm-svn: 213853

10 years agoMachO: use "arm64" as the triple name in modules.
Tim Northover [Thu, 24 Jul 2014 10:25:34 +0000 (10:25 +0000)]
MachO: use "arm64" as the triple name in modules.

Current versions of ld64 can't cope with "aarch64" being stored. I'm fixing
that, but in the transitionary period we'll need to still emit "arm64".

rdar://problem/17783765

llvm-svn: 213852

10 years agoPlug memory leaks.
Benjamin Kramer [Thu, 24 Jul 2014 10:23:33 +0000 (10:23 +0000)]
Plug memory leaks.

Most of the changes are mechanic std::unique_ptr insertions. All leaks were
detected by LeakSanitizer.

llvm-svn: 213851

10 years ago[ARM] Make the assembler reject unpredictable pre/post-indexed ARM STRH instructions.
Tilmann Scheller [Thu, 24 Jul 2014 09:55:46 +0000 (09:55 +0000)]
[ARM] Make the assembler reject unpredictable pre/post-indexed ARM STRH instructions.

The ARM ARM prohibits STRH instructions with writeback into the source register. With this commit this constraint is now enforced and we stop assembling STRH instructions with unpredictable behavior.

llvm-svn: 213850

10 years ago[mips] Fix ll and sc instructions
Daniel Sanders [Thu, 24 Jul 2014 09:47:14 +0000 (09:47 +0000)]
[mips] Fix ll and sc instructions

Summary: The ll and sc instructions for r6 and non-r6 are misplaced. This patch fixes that.

Patch by Jyun-Yan You

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

llvm-svn: 213847

10 years ago[OPENMP] Initial parsing and sema analysis for clause 'seq_cst' of 'atomic' directive.
Alexey Bataev [Thu, 24 Jul 2014 08:55:34 +0000 (08:55 +0000)]
[OPENMP] Initial parsing and sema analysis for clause 'seq_cst' of 'atomic' directive.

llvm-svn: 213846

10 years ago[clang-tidy] Fix a heap use-after-free bug detected by asan.
Benjamin Kramer [Thu, 24 Jul 2014 08:34:42 +0000 (08:34 +0000)]
[clang-tidy] Fix a heap use-after-free bug detected by asan.

llvm-svn: 213845

10 years agoR600: Match rcp node on pre-SI
Matt Arsenault [Thu, 24 Jul 2014 06:59:24 +0000 (06:59 +0000)]
R600: Match rcp node on pre-SI

llvm-svn: 213844

10 years agoR600: Fix LowerSDIV24
Matt Arsenault [Thu, 24 Jul 2014 06:59:20 +0000 (06:59 +0000)]
R600: Fix LowerSDIV24

Use ComputeNumSignBits instead of checking for i8 / i16 which only
worked when AMDIL was lying about having legal i8 / i16.

If an integer is known to fit in 24-bits, we can
do division faster with float ops.

llvm-svn: 213843

10 years ago[OPENMP] Initial parsing and sema analysis for clause 'capture' in 'atomic' directive.
Alexey Bataev [Thu, 24 Jul 2014 06:46:57 +0000 (06:46 +0000)]
[OPENMP] Initial parsing and sema analysis for clause 'capture' in 'atomic' directive.

llvm-svn: 213842

10 years agoMS ABI: -fno-rtti-data wasn't data-free enough
David Majnemer [Thu, 24 Jul 2014 06:09:19 +0000 (06:09 +0000)]
MS ABI: -fno-rtti-data wasn't data-free enough

While -fno-rtti-data would correctly avoid referencing the RTTI complete
object locator in the VFTable itself, it would emit them anyway.

llvm-svn: 213841

10 years agoAdd support for nullptr template arguments to template type diffing.
Richard Trieu [Thu, 24 Jul 2014 04:24:50 +0000 (04:24 +0000)]
Add support for nullptr template arguments to template type diffing.

llvm-svn: 213840

10 years agoRemove unused substitution.
Rafael Espindola [Thu, 24 Jul 2014 04:09:04 +0000 (04:09 +0000)]
Remove unused substitution.

llvm-svn: 213839

10 years ago[modules] Slightly expand module semantics documentation.
Richard Smith [Thu, 24 Jul 2014 03:42:38 +0000 (03:42 +0000)]
[modules] Slightly expand module semantics documentation.

llvm-svn: 213838

10 years agoSimplify MacroInfo lifetime management. We don't need three different functions
Richard Smith [Thu, 24 Jul 2014 03:25:00 +0000 (03:25 +0000)]
Simplify MacroInfo lifetime management. We don't need three different functions
to destroy one of these.

llvm-svn: 213837

10 years agoIR: Fix comment from r213824
Duncan P. N. Exon Smith [Thu, 24 Jul 2014 02:56:59 +0000 (02:56 +0000)]
IR: Fix comment from r213824

llvm-svn: 213836

10 years ago[OPENMP] Fixed DSA detecting for function parameters: by default they must be private.
Alexey Bataev [Thu, 24 Jul 2014 02:33:58 +0000 (02:33 +0000)]
[OPENMP] Fixed DSA detecting for function parameters: by default they must be private.

llvm-svn: 213835

10 years agoTake the canonical type when forming a canonical template argument with
Richard Smith [Thu, 24 Jul 2014 02:27:39 +0000 (02:27 +0000)]
Take the canonical type when forming a canonical template argument with
'nullptr' value. Fixes profiling of such template arguments to always give the
same value.

llvm-svn: 213834

10 years agoRemove a stray semicolon. [-Wpedantic]
NAKAMURA Takumi [Thu, 24 Jul 2014 02:11:24 +0000 (02:11 +0000)]
Remove a stray semicolon. [-Wpedantic]

llvm-svn: 213833

10 years agoUpdate library dependencies.
NAKAMURA Takumi [Thu, 24 Jul 2014 02:10:42 +0000 (02:10 +0000)]
Update library dependencies.

llvm-svn: 213832

10 years agoR600: Implement enableClusterLoads()
Matt Arsenault [Thu, 24 Jul 2014 02:10:17 +0000 (02:10 +0000)]
R600: Implement enableClusterLoads()

llvm-svn: 213831

10 years ago[AArch64] Fix a bug generating incorrect instruction when building small vector.
Kevin Qin [Thu, 24 Jul 2014 02:05:42 +0000 (02:05 +0000)]
[AArch64] Fix a bug generating incorrect instruction when building small vector.

This bug is introduced by r211144. The element of operand may be
smaller than the element of result, but previous commit can
only handle the contrary condition. This commit is to handle this
scenario and generate optimized codes like ZIP1.

llvm-svn: 213830

10 years agoAdd debug asserts / sanity checks to
Jason Molenda [Thu, 24 Jul 2014 01:53:11 +0000 (01:53 +0000)]
Add debug asserts / sanity checks to
GDBRemoteRegisterContext::ReadRegisterBytes and
GDBRemoteRegisterContext::WriteRegisterBytes to ensure we don't try
to read/write off the end of the register buffer.  This should never
happen but we've had some target confusion in the past where it
did; adding the checks is prudent to avoid crashing here if it happens
again.

<rdar://problem/16450971>
<rdar://problem/16458182>

llvm-svn: 213829

10 years agoIncrease the gdb-remote packet timeout for the first packet we send
Jason Molenda [Thu, 24 Jul 2014 01:36:24 +0000 (01:36 +0000)]
Increase the gdb-remote packet timeout for the first packet we send
to the remote side (QStartNoAckMode) - it may take a little longer
than normal to get a reply.

In debugserver, hardcode the priority for several threads so they
aren't de-prioritized when a user app is using system resources.
Also, set the names of the threads.

<rdar://problem/17509866>

llvm-svn: 213828

10 years ago[AArch64] Disable some optimization cases for type conversion from sint to fp, becaus...
Jiangning Liu [Thu, 24 Jul 2014 01:29:59 +0000 (01:29 +0000)]
[AArch64] Disable some optimization cases for type conversion from sint to fp, because those optimization cases are micro-architecture dependent and only make sense for Cyclone. A new predicate Cyclone is introduced in .td file.

llvm-svn: 213827

10 years agoFixed PR20411 - bug in getINSERTPS()
Filipe Cabecinhas [Thu, 24 Jul 2014 01:28:21 +0000 (01:28 +0000)]
Fixed PR20411 - bug in getINSERTPS()

When we had a vector_shuffle where we had an input from each vector, we
could miscompile it because we were assuming the input from V2 wouldn't
be moved from where it was on the vector.

Added a test case.

llvm-svn: 213826

10 years agoRemove unused Prev pointer from MacroInfo chain.
Richard Smith [Thu, 24 Jul 2014 01:13:23 +0000 (01:13 +0000)]
Remove unused Prev pointer from MacroInfo chain.

Remove pointless MICache: it only ever contained up to 1 object, and was only
non-empty when recovering from an error. There's no performance or memory win
from maintaining this cache.

llvm-svn: 213825

10 years agoIR: Add Value::sortUseList()
Duncan P. N. Exon Smith [Thu, 24 Jul 2014 00:53:19 +0000 (00:53 +0000)]
IR: Add Value::sortUseList()

Add `Value::sortUseList()`, templated on the comparison function to use.

The sort is an iterative merge sort that uses a binomial vector of
already-merged lists to limit the size overhead to `O(1)`.

This is part of PR5680.

llvm-svn: 213824

10 years agoAdd a .clang-format file to enhance formatting experience with clang-format
David Majnemer [Thu, 24 Jul 2014 00:26:04 +0000 (00:26 +0000)]
Add a .clang-format file to enhance formatting experience with clang-format

clang-format is a handy tool that formats code very intelligently.  I'd
like to use it with LLDB but it requires a .clang-format file to inform
it about LLDB-specific formatting rules.

More information on these rules are here:
http://clang.llvm.org/docs/ClangFormatStyleOptions.html

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

llvm-svn: 213823

10 years agoObjectFileMachO: Silence signed/unsigned comparison warning
David Majnemer [Thu, 24 Jul 2014 00:24:12 +0000 (00:24 +0000)]
ObjectFileMachO: Silence signed/unsigned comparison warning

File::SeekFromStart returns an off_t representing the position of the
file after seeking.  This return value is always going to be one of two
values: the input or -1 in the case of failure.

ObjectFileMachO compares an expression of type off_t from the return of
File::SeekFromStart(segment.fileoff) and compares it for equality with
segment.fileoff.

The type of segment_command_64::fileoff is unsigned while off_t is
signed, comparing them emits a diagnostic under GCC.

Instead, we can just compare SeekFromSTart with -1 to see if we
successfully seeked.

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

llvm-svn: 213822

10 years agoChange the signature of insertElementAt and rename addInputElementFront
Rui Ueyama [Thu, 24 Jul 2014 00:08:22 +0000 (00:08 +0000)]
Change the signature of insertElementAt and rename addInputElementFront

insertElementAt(x, END) does the identical thing as addInputElement(x),
so the only reasonable use of insertElementAt is to call it with the
other possible argument, BEGIN. That means the second parameter of the
function is just redundant. This patch is to remove the second
parameter and rename the function accordingly.

llvm-svn: 213821

10 years agoReplace r213816's fix with a different one. It's not meaningful to call
Richard Smith [Wed, 23 Jul 2014 23:50:25 +0000 (23:50 +0000)]
Replace r213816's fix with a different one. It's not meaningful to call
isOnePastTheEnd on an invalid designator, so assert and push the check into the
one caller that wasn't already checking.

llvm-svn: 213820

10 years agoAdd a VS "14" msbuild toolset
Reid Kleckner [Wed, 23 Jul 2014 23:49:16 +0000 (23:49 +0000)]
Add a VS "14" msbuild toolset

This allows people to try clang inside MSBuild with the VS "14" CTP
releases.

Fixes PR20341.

Patch by Marcel Raad!

llvm-svn: 213819

10 years ago[PECOFF] Simplify.
Rui Ueyama [Wed, 23 Jul 2014 23:47:28 +0000 (23:47 +0000)]
[PECOFF] Simplify.

insertElementAt(x, END) is the same as addInputElement(x).

llvm-svn: 213818

10 years agoSplit -Winvalid-command-line-argument into -Wignored-optimization-argument
Reid Kleckner [Wed, 23 Jul 2014 23:29:01 +0000 (23:29 +0000)]
Split -Winvalid-command-line-argument into -Wignored-optimization-argument

Reviewers: rsmith, nlewycky

Subscribers: cfe-commits

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

llvm-svn: 213817

10 years agoAdd a missing Invalid check to SubobjectDesignator::isOnePastEnd()
Reid Kleckner [Wed, 23 Jul 2014 23:24:25 +0000 (23:24 +0000)]
Add a missing Invalid check to SubobjectDesignator::isOnePastEnd()

The class seems to have an invariant that Entries is non-empty if
Invalid is false.  It appears this method was previously private, and
all internal uses checked Invalid.  Now there is an external caller, so
check Invalid to avoid array OOB underflow.

Fixes PR20420.

llvm-svn: 213816

10 years agoSimplifyCFG: fix a bug in switch to table conversion
Manman Ren [Wed, 23 Jul 2014 23:13:23 +0000 (23:13 +0000)]
SimplifyCFG: fix a bug in switch to table conversion

We use gep to access the global array "switch.table", and the table index
should be treated as unsigned. When the highest bit is 1, this commit
zero-extends the index to an integer type with larger size.

For a switch on i2, we used to generate:
%switch.tableidx = sub i2 %0, -2
getelementptr inbounds [4 x i64]* @switch.table, i32 0, i2 %switch.tableidx

It is incorrect when %switch.tableidx is 2 or 3. The fix is to generate
%switch.tableidx = sub i2 %0, -2
%switch.tableidx.zext = zext i2 %switch.tableidx to i3
getelementptr inbounds [4 x i64]* @switch.table, i32 0, i3 %switch.tableidx.zext

rdar://17735071

llvm-svn: 213815

10 years agoFix the build when building with only the ARM backend.
Rafael Espindola [Wed, 23 Jul 2014 22:54:28 +0000 (22:54 +0000)]
Fix the build when building with only the ARM backend.

llvm-svn: 213814

10 years agoDocument what backwards compatibility we provide for bitcode.
Rafael Espindola [Wed, 23 Jul 2014 22:43:22 +0000 (22:43 +0000)]
Document what backwards compatibility we provide for bitcode.

llvm-svn: 213813

10 years agoLet llvm/test/CodeGen/X86/avx512*-mask-op.ll(s) aware of Win32 x64 calling convention.
NAKAMURA Takumi [Wed, 23 Jul 2014 22:38:25 +0000 (22:38 +0000)]
Let llvm/test/CodeGen/X86/avx512*-mask-op.ll(s) aware of Win32 x64 calling convention.

llvm-svn: 213812

10 years agoFix indenting.
Eric Christopher [Wed, 23 Jul 2014 22:34:13 +0000 (22:34 +0000)]
Fix indenting.

llvm-svn: 213811

10 years ago[x86] Rip out some broken test cases for avx512 i1 store support.
Chandler Carruth [Wed, 23 Jul 2014 22:29:19 +0000 (22:29 +0000)]
[x86] Rip out some broken test cases for avx512 i1 store support.

It isn't reasonable to test storing things using undef pointers --
storing through those is at best "good luck" and really should be
transformed to "unreachable". Random changes in the combiner can
randomly break these tests for no good reason. I'm following up on the
original commit regarding the right long-term strategy here.

llvm-svn: 213810

10 years agoReorganize and simplify local variables.
Eric Christopher [Wed, 23 Jul 2014 22:27:10 +0000 (22:27 +0000)]
Reorganize and simplify local variables.

llvm-svn: 213809

10 years agoFinish inverting the MC -> Object dependency.
Rafael Espindola [Wed, 23 Jul 2014 22:26:07 +0000 (22:26 +0000)]
Finish inverting the MC -> Object dependency.

There were still some disassembler bits in lib/MC, but their use of Object
was only visible in the includes they used, not in the symbols.

llvm-svn: 213808

10 years ago[RuntimeDyld][AArch64] Update relocation tests and also add a simple GOT test.
Juergen Ributzka [Wed, 23 Jul 2014 22:23:17 +0000 (22:23 +0000)]
[RuntimeDyld][AArch64] Update relocation tests and also add a simple GOT test.

llvm-svn: 213807

10 years agoRemove the query for TargetMachine and TargetInstrInfo since we're
Eric Christopher [Wed, 23 Jul 2014 22:12:03 +0000 (22:12 +0000)]
Remove the query for TargetMachine and TargetInstrInfo since we're
already inside TargetInstrInfo.

llvm-svn: 213806

10 years agoArgPromo+DebugInfo: Handle updating debug info over multiple applications of argument...
David Blaikie [Wed, 23 Jul 2014 22:09:29 +0000 (22:09 +0000)]
ArgPromo+DebugInfo: Handle updating debug info over multiple applications of argument promotion.

While the subprogram map cache used by Dead Argument Elimination works
there, I made a mistake when reusing it for Argument Promotion in
r212128 because ArgPromo may transform functions more than once whereas
DAE transforms each function only once, removing all the dead arguments
in one go.

To address this, ensure that the map is updated after each argument
promotion.

In retrospect it might be a little wasteful to create a map of all
subprograms when only handling a single CGSCC, but the alternative is
walking the debug info for each function in the CGSCC that gets updated.
It's not clear to me what the right tradeoff is there, but since the
current tradeoff seems to be working OK (and the code to keep things
updated is very cheap), let's stick with that for now.

llvm-svn: 213805

10 years ago[PECOFF] Add the entry point file at the right place.
Rui Ueyama [Wed, 23 Jul 2014 21:41:20 +0000 (21:41 +0000)]
[PECOFF] Add the entry point file at the right place.

The entry point file needs to be processed after all other
object files and before all .lib files. It was processed
after .lib files. That caused an issue that the entry point
function was not resolved from the standard library files.

llvm-svn: 213804

10 years agoTest debug info in arg promotion with an actual promotion case, rather than a degener...
David Blaikie [Wed, 23 Jul 2014 21:30:59 +0000 (21:30 +0000)]
Test debug info in arg promotion with an actual promotion case, rather than a degenerate arg promotion that's actually DAE performed by ArgPromo

Also the debug location I had here was bogus, describing the location of
the call site as in the callee - and unnecessary, so just drop it.

llvm-svn: 213803

10 years ago[PECOFF] Fix entry point address.
Rui Ueyama [Wed, 23 Jul 2014 20:51:04 +0000 (20:51 +0000)]
[PECOFF] Fix entry point address.

Because of a bug, the entry point address in the PE/COFF header
was not correct.

llvm-svn: 213802

10 years agoUse an explicit triple in testcase.
Jim Grosbach [Wed, 23 Jul 2014 20:46:32 +0000 (20:46 +0000)]
Use an explicit triple in testcase.

Make the test work better on non-darwin hosts. Hopefully.

llvm-svn: 213801

10 years ago[X86,AArch64] Extend vcmp w/ unary op combine to work w/ more constants.
Jim Grosbach [Wed, 23 Jul 2014 20:41:43 +0000 (20:41 +0000)]
[X86,AArch64] Extend vcmp w/ unary op combine to work w/ more constants.

The transform to constant fold unary operations with an AND across a
vector comparison applies when the constant is not a splat of a scalar
as well.

llvm-svn: 213800

10 years agoX86: restrict combine to when type sizes are safe.
Jim Grosbach [Wed, 23 Jul 2014 20:41:38 +0000 (20:41 +0000)]
X86: restrict combine to when type sizes are safe.

The folding of unary operations through a vector compare and mask operation
is only safe if the unary operation result is of the same size as its input.
For example, it's not safe for [su]itofp from v4i32 to v4f64.

llvm-svn: 213799

10 years agoDAG: fp->int conversion for non-splat constants.
Jim Grosbach [Wed, 23 Jul 2014 20:41:31 +0000 (20:41 +0000)]
DAG: fp->int conversion for non-splat constants.

Constant fold the lanes of the input constant build_vector individually
so we correctly handle when the vector elements are not all the same
constant value.

PR20394

llvm-svn: 213798

10 years ago[Fix] Typo during refactoring
Johannes Doerfert [Wed, 23 Jul 2014 20:26:25 +0000 (20:26 +0000)]
[Fix] Typo during refactoring

llvm-svn: 213795

10 years ago[NVPTX] Add some extra tests for mul.wide to test non-power-of-two source types
Justin Holewinski [Wed, 23 Jul 2014 20:23:49 +0000 (20:23 +0000)]
[NVPTX] Add some extra tests for mul.wide to test non-power-of-two source types

llvm-svn: 213794

10 years ago[NVPTX] Silence a GCC warning found by the buildbots
Justin Holewinski [Wed, 23 Jul 2014 20:23:47 +0000 (20:23 +0000)]
[NVPTX] Silence a GCC warning found by the buildbots

The cast to NVPTXTargetLowering was missing a 'const', but let's
just access the right pointer through the subtarget anyway.

llvm-svn: 213793

10 years ago[Refactor] IslAst and payload struct
Johannes Doerfert [Wed, 23 Jul 2014 20:17:28 +0000 (20:17 +0000)]
[Refactor] IslAst and payload struct

  + Renamed context into build when it's the isl_ast_build
  + Use the IslAstInfo functions to extract the schedule of a node
  + Use the IslAstInfo functions to extract the build/context of a node
  + Move the payload struct into the IslAstInfo class
  + Use a constructor and destructor (also new and delete) to
    allocate/initialize the payload struct

llvm-svn: 213792

10 years agoBuild libcxx-tsan only if TSan is supported on host architecture
Alexey Samsonov [Wed, 23 Jul 2014 20:07:26 +0000 (20:07 +0000)]
Build libcxx-tsan only if TSan is supported on host architecture

llvm-svn: 213791

10 years agoPR20228: don't retain a pointer to a vector element after the container has been...
Richard Smith [Wed, 23 Jul 2014 20:07:08 +0000 (20:07 +0000)]
PR20228: don't retain a pointer to a vector element after the container has been resized.

llvm-svn: 213790

10 years agoDo not add unroll disable metadata after unrolling pass for loops with #pragma clang...
Mark Heffernan [Wed, 23 Jul 2014 20:05:44 +0000 (20:05 +0000)]
Do not add unroll disable metadata after unrolling pass for loops with #pragma clang loop unroll(full).

llvm-svn: 213789

10 years ago[FastISel][AArch64] Fix return type in FastLowerCall.
Juergen Ributzka [Wed, 23 Jul 2014 20:03:13 +0000 (20:03 +0000)]
[FastISel][AArch64] Fix return type in FastLowerCall.

I used the wrong method to obtain the return type inside FinishCall. This fix
simply uses the return type from FastLowerCall, which we already determined to
be a valid type.

Reduced test case from Chad. Thanks.

llvm-svn: 213788

10 years agoFix unused-variable warning
Alexey Samsonov [Wed, 23 Jul 2014 19:40:54 +0000 (19:40 +0000)]
Fix unused-variable warning

llvm-svn: 213786

10 years agoFix ctype_base::xdigit for Android.
Dan Albert [Wed, 23 Jul 2014 19:32:03 +0000 (19:32 +0000)]
Fix ctype_base::xdigit for Android.

Android's ctype implementation comes from openbsd, which for some reason
doesn't consider numbers to be hex digits.

llvm-svn: 213785

10 years ago[NVPTX] mul.wide generation works for any smaller integer source types, not just...
Justin Holewinski [Wed, 23 Jul 2014 18:46:03 +0000 (18:46 +0000)]
[NVPTX] mul.wide generation works for any smaller integer source types, not just the next smaller power of two

llvm-svn: 213784

10 years ago[UBSan] Add the ability to dump call stacks to -fsanitize=vptr
Alexey Samsonov [Wed, 23 Jul 2014 18:44:54 +0000 (18:44 +0000)]
[UBSan] Add the ability to dump call stacks to -fsanitize=vptr

This change introduces the first UBSan-specific runtime flag: print_stacktrace
(off by default). It can be set in UBSAN_OPTIONS to unwind and print call stacks
in addition to diagnostic messages. For now these stacks are printed only
in vptr checker.

This change is based on http://reviews.llvm.org/D4410 by Byoungyoung Lee!

llvm-svn: 213783

10 years ago[UBSan] Introduce UBSAN_OPTIONS environment variable.
Alexey Samsonov [Wed, 23 Jul 2014 18:32:55 +0000 (18:32 +0000)]
[UBSan] Introduce UBSAN_OPTIONS environment variable.

If UBSan is run in a standalone mode (w/o any other sanitizer), it
still uses functions from sanitizer_common, some of which depend on
the value of runtime flags. Allow to override the default values of these
flags with UBSAN_OPTIONS variable. In particular, UBSAN_OPTIONS=symbolize=0
can be used to turn off online symbolization.

llvm-svn: 213782

10 years agoEnsure that if some unspecified person were to pass in an invalid architecture when...
Enrico Granata [Wed, 23 Jul 2014 18:18:38 +0000 (18:18 +0000)]
Ensure that if some unspecified person were to pass in an invalid architecture when trying to create a target, that it would fail, but not cause LLDB to crash.

llvm-svn: 213781

10 years ago[SKX] Added missed test files for rev 213757
Robert Khasanov [Wed, 23 Jul 2014 18:17:49 +0000 (18:17 +0000)]
[SKX] Added missed test files for rev 213757

llvm-svn: 213780

10 years ago[Refactor] Unify IslAst print methods
Johannes Doerfert [Wed, 23 Jul 2014 18:14:43 +0000 (18:14 +0000)]
[Refactor] Unify IslAst print methods

  + Add const annotations to some member functions

llvm-svn: 213779

10 years agoMake sure we don't crash if someone (E.G.) comments out on entry from g_core_definiti...
Greg Clayton [Wed, 23 Jul 2014 18:12:06 +0000 (18:12 +0000)]
Make sure we don't crash if someone (E.G.) comments out on entry from g_core_definitions[] without removing the ArchSpec::Core enumeration when submitting from source.

We now catch the issue with a static_assert() at compile time and use llvm::array_lengthof(g_core_definitions) as well.

<rdar://problem/17767541>

llvm-svn: 213778

10 years agoAsmParser: remove deprecated LLIR support
Saleem Abdulrasool [Wed, 23 Jul 2014 18:09:31 +0000 (18:09 +0000)]
AsmParser: remove deprecated LLIR support

linker_private and linker_private_weak were deprecated in 3.5.  Remove support
for them now that the 3.5 branch has been created.

llvm-svn: 213777

10 years agoExecutionEngine: remove a stray semicolon
Saleem Abdulrasool [Wed, 23 Jul 2014 18:09:28 +0000 (18:09 +0000)]
ExecutionEngine: remove a stray semicolon

Detected via GCC 4.8 [-Wpedantic].

llvm-svn: 213776

10 years agoRename metadata in test which was missed when renaming loop unroll metadata in r213771.
Mark Heffernan [Wed, 23 Jul 2014 17:59:07 +0000 (17:59 +0000)]
Rename metadata in test which was missed when renaming loop unroll metadata in r213771.

llvm-svn: 213775

10 years ago[SKX] Fix lowercase "error:" in rev 213757
Robert Khasanov [Wed, 23 Jul 2014 17:42:13 +0000 (17:42 +0000)]
[SKX] Fix lowercase "error:" in rev 213757

llvm-svn: 213774

10 years ago[NVPTX] Make sure we do not generate MULWIDE ISD nodes when optimizations are disabled
Justin Holewinski [Wed, 23 Jul 2014 17:40:45 +0000 (17:40 +0000)]
[NVPTX] Make sure we do not generate MULWIDE ISD nodes when optimizations are disabled

With optimizations disabled, we disable the isel patterns for mul.wide; but we
were still generating MULWIDE ISD nodes.  Now, we only try to generate MULWIDE
ISD nodes in DAGCombine if the optimization level is not zero.

llvm-svn: 213773

10 years agoIn unroll pragma syntax and loop hint metadata, change "enable" forms to a new form...
Mark Heffernan [Wed, 23 Jul 2014 17:31:37 +0000 (17:31 +0000)]
In unroll pragma syntax and loop hint metadata, change "enable" forms to a new form using the string "full".

llvm-svn: 213772

10 years agoIn unroll pragma syntax and loop hint metadata, change "enable" forms to a new form...
Mark Heffernan [Wed, 23 Jul 2014 17:31:31 +0000 (17:31 +0000)]
In unroll pragma syntax and loop hint metadata, change "enable" forms to a new form using the string "full".

llvm-svn: 213771

10 years agotest commit: remove trailing space
Alex Lorenz [Wed, 23 Jul 2014 17:18:05 +0000 (17:18 +0000)]
test commit: remove trailing space

llvm-svn: 213770