platform/upstream/llvm.git
8 years ago-Wdeprecated-clean: Fix cases of violating the rule of 5 in ways that are deprecated...
David Blaikie [Mon, 3 Aug 2015 20:12:58 +0000 (20:12 +0000)]
-Wdeprecated-clean: Fix cases of violating the rule of 5 in ways that are deprecated in C++11

Some functions return concrete ByteStreamers by value - explicitly
support that in the base class. (dtor can be virtual, no one seems to be
polymorphically owning/destroying them)

llvm-svn: 243897

8 years agoRecommit r243824: -Wdeprecated-clean: Fix cases of violating the rule of 5 in ways...
David Blaikie [Mon, 3 Aug 2015 20:08:41 +0000 (20:08 +0000)]
Recommit r243824: -Wdeprecated-clean: Fix cases of violating the rule of 5 in ways that are deprecated in C++11

This reverts commit r243888, recommitting r243824.

This broke the Windows build due to a difference in the C++ standard
library implementation. Using emplace/forward_as_tuple should ensure
there's no need to copy ValIDs.

llvm-svn: 243896

8 years ago[asan] Print VAs instead of RVAs for module offsets on Windows
Reid Kleckner [Mon, 3 Aug 2015 19:51:18 +0000 (19:51 +0000)]
[asan] Print VAs instead of RVAs for module offsets on Windows

Summary:
This is consistent with binutils and ASan behavior on other platforms,
and makes it easier to use llvm-symbolizer with WinASan. The
--relative-address flag to llvm-symbolizer is also no longer needed.

An RVA is a "relative virtual address", meaning it is the address of
something inside the image minus the base of the mapping at runtime.

A VA in this context is an RVA plus the "preferred base" of the module,
and not a real runtime address. The real runtime address of a symbol
will equal the VA iff the module is loaded at its preferred base at
runtime.

On Windows, the preferred base is stored in the ImageBase field of one
of the PE file header, and this change adds the necessary code to
extract it. On Linux, this offset is typically included in program and
section headers of executables.

ELF shared objects typically use a preferred base of zero, meaning the
smallest p_vaddr field in the program headers is zero. This makes it so
that PIC and PIE module offsets come out looking like RVAs, but they're
actually VAs. The difference between them simply happens to be zero.

Reviewers: samsonov, majnemer

Subscribers: llvm-commits

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

llvm-svn: 243895

8 years agoConvert some AArch64 code to foreach loops. NFC.
Pete Cooper [Mon, 3 Aug 2015 19:04:32 +0000 (19:04 +0000)]
Convert some AArch64 code to foreach loops.  NFC.

Also converted a cast<> to dyn_cast while i was working on the same
line of code.

llvm-svn: 243894

8 years agoFix the memory find command such that it can actually take an expression
Enrico Granata [Mon, 3 Aug 2015 18:51:39 +0000 (18:51 +0000)]
Fix the memory find command such that it can actually take an expression

llvm-svn: 243893

8 years ago[MCJIT] Fix a cast warning in the unit-test introduced in r243589.
Lang Hames [Mon, 3 Aug 2015 18:03:40 +0000 (18:03 +0000)]
[MCJIT] Fix a cast warning in the unit-test introduced in r243589.

Thanks to Aaron Ballman for spotting this.

llvm-svn: 243891

8 years agoFix testing for end of stream in bitstream reader.
Derek Schuff [Mon, 3 Aug 2015 18:01:50 +0000 (18:01 +0000)]
Fix testing for end of stream in bitstream reader.

This fixes a bug found while working on the bitcode reader. In
particular, the method BitstreamReader::AtEndOfStream doesn't always
behave correctly when processing a data streamer. The method
fillCurWord doesn't properly set CurWord/BitsInCurWord if the data
streamer was already at eof, but GetBytes had not yet set the
ObjectSize field of the streaming memory object.

This patch fixes this problem, and provides a test to show that
this problem has been fixed.

Patch by Karl Schimpf.

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

llvm-svn: 243890

8 years agoDo not add spaces into memory-access identifiers
Tobias Grosser [Mon, 3 Aug 2015 17:53:21 +0000 (17:53 +0000)]
Do not add spaces into memory-access identifiers

llvm-svn: 243889

8 years agoRevert "-Wdeprecated-clean: Fix cases of violating the rule of 5 in ways that are...
Reid Kleckner [Mon, 3 Aug 2015 17:36:22 +0000 (17:36 +0000)]
Revert "-Wdeprecated-clean: Fix cases of violating the rule of 5 in ways that are deprecated in C++11"

This reverts commit r243824.

It broke the build on Windows.

llvm-svn: 243888

8 years agoUpdate testcases after LLVM r243885
Duncan P. N. Exon Smith [Mon, 3 Aug 2015 17:28:43 +0000 (17:28 +0000)]
Update testcases after LLVM r243885

llvm-svn: 243887

8 years agoDI: Disallow uniquable DICompileUnits
Duncan P. N. Exon Smith [Mon, 3 Aug 2015 17:26:41 +0000 (17:26 +0000)]
DI: Disallow uniquable DICompileUnits

Since r241097, `DIBuilder` has only created distinct `DICompileUnit`s.
The backend is liable to start relying on that (if it hasn't already),
so make uniquable `DICompileUnit`s illegal and automatically upgrade old
bitcode.  This is a nice cleanup, since we can remove an unnecessary
`DenseSet` (and the associated uniquing info) from `LLVMContextImpl`.

Almost all the testcases were updated with this script:

    git grep -e '= !DICompileUnit' -l -- test |
    grep -v test/Bitcode |
    xargs sed -i '' -e 's,= !DICompileUnit,= distinct !DICompileUnit,'

I imagine something similar should work for out-of-tree testcases.

llvm-svn: 243885

8 years agoARM: prefer allocating VFP regs at stride 4 on Darwin.
Tim Northover [Mon, 3 Aug 2015 17:20:10 +0000 (17:20 +0000)]
ARM: prefer allocating VFP regs at stride 4 on Darwin.

This is necessary for WatchOS support, where the compact unwind format assumes
this kind of layout. For now we only want this on Swift-like CPUs though, where
it's been the Xcode behaviour for ages. Also, since it can expand the prologue
we don't want it at -Oz.

llvm-svn: 243884

8 years agoLinker: Move distinct MDNodes instead of cloning
Duncan P. N. Exon Smith [Mon, 3 Aug 2015 17:09:38 +0000 (17:09 +0000)]
Linker: Move distinct MDNodes instead of cloning

Instead of cloning distinct `MDNode`s when linking in a module, just
move them over.  The module linker destroys the source module, so the
old node would otherwise just be leaked on the context.  Create the new
node in place.  This also reduces the number of cloned uniqued nodes
(since it's less likely their operands have changed).

This mapping strategy is only correct when we're discarding the source,
so the linker turns it on via a ValueMapper flag, `RF_MoveDistinctMDs`.

There's nothing observable in terms of `llvm-link` output here: the
linked module should be semantically identical.

I'll be adding more 'distinct' nodes to the debug info metadata graph in
order to break uniquing cycles, so the benefits of this will partly come
in future commits.  However, we should get some gains immediately, since
we have a fair number of 'distinct' `DILocation`s being linked in.

llvm-svn: 243883

8 years agoAdd option -polly-view-only
Tobias Grosser [Mon, 3 Aug 2015 16:39:56 +0000 (16:39 +0000)]
Add option -polly-view-only

If set, this option instructs -view-scops and -polly-show to only print
functions that contain the specified string in their name. This allows to
look at the scops of a specific function in a large .ll file, without flooding
the screen with .dot graphs.

llvm-svn: 243882

8 years agoAllow derived DOTViewers to choose the functions to illustrate
Tobias Grosser [Mon, 3 Aug 2015 16:37:12 +0000 (16:37 +0000)]
Allow derived DOTViewers to choose the functions to illustrate

Instead of always showing/printing all functions, a class derived from
the DOTViewer class can overwrite the set of functions that will be
processed.

This will be used (and tested) by Polly's scop viewers, but other users
can be imagined as well.

llvm-svn: 243881

8 years agoRefactor AtomicExpand::expandAtomicRMWToCmpXchg into a standalone function.
JF Bastien [Mon, 3 Aug 2015 15:29:47 +0000 (15:29 +0000)]
Refactor AtomicExpand::expandAtomicRMWToCmpXchg into a standalone function.

Summary:
This is useful for PNaCl's `RewriteAtomics` pass. NaCl intrinsics don't exist for some of the more exotic RMW instructions, so by refactoring this function into its own, `RewriteAtomics` can share code rewriting those atomics with `AtomicExpand` while additionally saving a few cycles by generating the `cmpxchg` NaCl-specific intrinsic with the callback. Without this patch, `RewriteAtomics` would require two extra passes over functions, by first requiring use of the full `AtomicExpand` pass to just expand the leftover exotic RMWs and then running itself again to expand resulting `cmpxchg`s.

NFC

Reviewers: jfb

Subscribers: jfb, llvm-commits

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

llvm-svn: 243880

8 years ago[asan] Fix dyld version detection on OS X
Kuba Brecka [Mon, 3 Aug 2015 14:48:59 +0000 (14:48 +0000)]
[asan] Fix dyld version detection on OS X

We currently have a dyld check in DyldNeedsEnvVariable that detects whether we are on a new OS X (10.11+) where we don't need to re-exec. For iOS simulator, we have a dlsym() hack that checks for a specific symbol, but this turns out to be fragile and problematic, because dlsym can sometimes call malloc(), which is not a good idea this early in the process runtime.

Let's instead of this do a direct comparison of dyld's version, which is exported in a public symbol `dyldVersionNumber`.

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

llvm-svn: 243879

8 years ago[SHAVE] Pass all -f, -g, -O, -W options through directly to moviCompile.
Douglas Katzman [Mon, 3 Aug 2015 14:34:22 +0000 (14:34 +0000)]
[SHAVE] Pass all -f, -g, -O, -W options through directly to moviCompile.

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

llvm-svn: 243878

8 years agoCurrently string attributes on function arguments/return values can be generated...
Artur Pilipenko [Mon, 3 Aug 2015 14:31:49 +0000 (14:31 +0000)]
Currently string attributes on function arguments/return values can be generated using LLVM API. However they are not supported in parser. So, the following scenario will fail:
* generate function with string attribute using API,
* dump it in LL format,
* try to parse.
Add parser support for string attributes to fix the issue.

Reviewed By: reames, hfinkel

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

llvm-svn: 243877

8 years ago[CONCEPTS] Add concept to VarDecl and diagnostic for uninitialized variable concept
Nathan Wilson [Mon, 3 Aug 2015 14:25:45 +0000 (14:25 +0000)]
[CONCEPTS] Add concept to VarDecl and diagnostic for uninitialized variable concept

Summary: Add IsConcept bit to VarDecl::NonParmVarDeclBitfields and associated isConcept/setConcept member functions. Set IsConcept to true when 'concept' specifier is in variable declaration. Create diagnostic when variable concept is not initialized.

Reviewers: fraggamuffin, hubert.reinterpretcast, faisalv, aaron.ballman, rsmith

Subscribers: aemerson, cfe-commits

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

llvm-svn: 243876

8 years ago[TTI] Fix default costs for interleaved accesses
Silviu Baranga [Mon, 3 Aug 2015 14:00:58 +0000 (14:00 +0000)]
[TTI] Fix default costs for interleaved accesses

Summary:
Modify the cost calculation function for interleaved accesses
to use the target-specific costs for insert/extract element and
memory operations.

This better models the case where the backend can't match
the interleaved group, and we are forced to use a wide load
and shuffle vectors.

Interleaved accesses are not enabled by default, so this shouldn't
cause a performance change.

Reviewers: jmolloy

Subscribers: jmolloy, llvm-commits

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

llvm-svn: 243875

8 years ago[ARM] Make GlobalMerge merge extern globals by default
John Brawn [Mon, 3 Aug 2015 12:13:33 +0000 (12:13 +0000)]
[ARM] Make GlobalMerge merge extern globals by default

Enabling merging of extern globals appears to be generally either beneficial or
harmless. On some benchmarks suites (on Cortex-M4F, Cortex-A9, and Cortex-A57)
it gives improvements in the 1-5% range, but in the rest the overall effect is
zero.

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

llvm-svn: 243874

8 years ago[GlobalMerge] Allow targets to enable merging of extern variables, NFC.
John Brawn [Mon, 3 Aug 2015 12:08:41 +0000 (12:08 +0000)]
[GlobalMerge] Allow targets to enable merging of extern variables, NFC.

Adjust the GlobalMergeOnExternal option so that the default behaviour is to
do whatever the Target thinks is best. Explicitly enabled or disabling the
option will override this default.

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

llvm-svn: 243873

8 years agoDon't use test inputs from other directories.
Alexander Kornienko [Mon, 3 Aug 2015 11:59:45 +0000 (11:59 +0000)]
Don't use test inputs from other directories.

The test/DebugInfo/dwarfdump-macho-universal.test test added in r243862 uses
an input from another test's directory (test/tools/dsymutil/Inputs/fat-test.o)
which breaks our test setup.

Copying the required test input to the test's Input directory to fix the issue.

llvm-svn: 243872

8 years agoReplace callback-if with isExpansionInMainFile as suggested in post
Daniel Jasper [Mon, 3 Aug 2015 10:52:27 +0000 (10:52 +0000)]
Replace callback-if with isExpansionInMainFile as suggested in post
commit review.

llvm-svn: 243871

8 years agoAdditional fix for PR14269: Crash on vector elements / global register vars in inline...
Andrey Bokhanko [Mon, 3 Aug 2015 10:38:10 +0000 (10:38 +0000)]
Additional fix for PR14269: Crash on vector elements / global register vars in inline assembler.

Compiler crashed when vector elements / global register vars were used in inline assembler with "m" restriction. This patch fixes this.

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

llvm-svn: 243870

8 years agoBe less conservative about forming IT blocks.
James Molloy [Mon, 3 Aug 2015 09:24:48 +0000 (09:24 +0000)]
Be less conservative about forming IT blocks.

In http://reviews.llvm.org/rL215382, IT forming was made more conservative under
the belief that a flag-setting instruction was unpredictable inside an IT block on ARMv6M.

But actually, ARMv6M doesn't even support IT blocks so that's impossible. In the ARMARM for
v7M, v7AR and v8AR it states that the semantics of such an instruction changes inside an
IT block - it doesn't set the flags. So actually it is fine to use one inside an IT block
as long as the flags register is dead afterwards.

This gives significant performance improvements in a variety of MPEG based workloads.

Differential revision: http://reviews.llvm.org/D11680

llvm-svn: 243869

8 years agoFix the test added at r243777.
Alexander Kornienko [Mon, 3 Aug 2015 09:13:19 +0000 (09:13 +0000)]
Fix the test added at r243777.

When RUN: lines are split into multiple lines, each one must be prefixed with
RUN:.

llvm-svn: 243868

8 years ago[X86][AVX512VLBW] add pack, cvt, mulhi and madd intrinsics
Asaf Badouh [Mon, 3 Aug 2015 07:51:00 +0000 (07:51 +0000)]
[X86][AVX512VLBW] add pack, cvt, mulhi and madd intrinsics

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

llvm-svn: 243867

8 years agoValueMapper: Only check for cycles if operands change
Duncan P. N. Exon Smith [Mon, 3 Aug 2015 03:45:32 +0000 (03:45 +0000)]
ValueMapper: Only check for cycles if operands change

This is a minor optimization to only check for unresolved operands
inside `mapDistinctNode()` if the operands have actually changed.  This
shouldn't really cause any change in behaviour.  I didn't actually see a
slowdown in a profile, I was just poking around nearby and saw the
opportunity.

llvm-svn: 243866

8 years agoValueMapper: Use a range-based for, NFC
Duncan P. N. Exon Smith [Mon, 3 Aug 2015 03:27:12 +0000 (03:27 +0000)]
ValueMapper: Use a range-based for, NFC

llvm-svn: 243865

8 years agoValueMapper: Reuse local variable, NFC
Duncan P. N. Exon Smith [Mon, 3 Aug 2015 03:24:28 +0000 (03:24 +0000)]
ValueMapper: Reuse local variable, NFC

llvm-svn: 243864

8 years agoUse early return NFC.
Frederic Riss [Mon, 3 Aug 2015 00:10:33 +0000 (00:10 +0000)]
Use early return NFC.

llvm-svn: 243863

8 years ago[dwarfdump] Add support for dumping mach-o universal objectfiles
Frederic Riss [Mon, 3 Aug 2015 00:10:31 +0000 (00:10 +0000)]
[dwarfdump] Add support for dumping mach-o universal objectfiles

llvm-svn: 243862

8 years ago[dwarfdump] Move dumping to a helper function NFC
Frederic Riss [Mon, 3 Aug 2015 00:10:25 +0000 (00:10 +0000)]
[dwarfdump] Move dumping to a helper function NFC

llvm-svn: 243861

8 years agoWebAssembly: implement getScalarShiftAmountTy so we can shift by amount, with type
JF Bastien [Mon, 3 Aug 2015 00:00:11 +0000 (00:00 +0000)]
WebAssembly: implement getScalarShiftAmountTy so we can shift by amount, with type

Summary: This currently sets the shift amount RHS to the same type as the LHS, and assumes that the LHS is a simple type. This isn't currently the case e.g. with weird integers sizes, but will eventually be true and will assert if not. That's what you get for having an experimental backend: break it and you get to keep both pieces. Most backends either set the RHS to MVT::i32 or MVT::i64, but WebAssembly is a virtual ISA and tries to have regular-looking binary operations where both operands are the same type (even if a 64-bit RHS shifter is slightly silly, hey it's free!).

Subscribers: llvm-commits, sunfish, jfb

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

llvm-svn: 243860

8 years agoUse range-based for loops. NFC
Craig Topper [Sun, 2 Aug 2015 22:34:02 +0000 (22:34 +0000)]
Use range-based for loops. NFC

llvm-svn: 243859

8 years agoAsmPrinter: Stop inheriting from DIE
Duncan P. N. Exon Smith [Sun, 2 Aug 2015 20:54:50 +0000 (20:54 +0000)]
AsmPrinter: Stop inheriting from DIE

Change `DIELoc` and `DIEBlock` to stop inheriting from `DIE`, instead
inheriting from `DIEValueList` to share the value storage API.  This
awkward bit of code-sharing was also fairly confusing: neither `DIELoc`
nor `DIEBlock` represents a `DIE`, so why would they inherit from it?

Aside from the API cleanup, this should improve debug info memory usage
in the backend, since it shaves five pointers off of every `DIELoc` and
`DIEBlock`.  I haven't bothered to measure the savings, though.

llvm-svn: 243858

8 years agoDwarfLinker: Use DIEValueList instead of DIE, NFC
Duncan P. N. Exon Smith [Sun, 2 Aug 2015 20:48:47 +0000 (20:48 +0000)]
DwarfLinker: Use DIEValueList instead of DIE, NFC

Use `DIEValueList` as a pointer to either `DIEBlock` or `DIELoc` instead
of `DIE`, since soon they won't inherit from the latter.

llvm-svn: 243857

8 years agoAsmPrinter: Split out non-DIE printing from DIE::print(), NFC
Duncan P. N. Exon Smith [Sun, 2 Aug 2015 20:46:49 +0000 (20:46 +0000)]
AsmPrinter: Split out non-DIE printing from DIE::print(), NFC

Split out a helper `printValues()` for printing `DIEBlock` and `DIELoc`,
instead of relying on `DIE::print()`.  The shared code was actually
fairly small there.  No functionality change intended.

llvm-svn: 243856

8 years agoAsmPrinter: Take DIEValueList in some DwarfUnit API, NFC
Duncan P. N. Exon Smith [Sun, 2 Aug 2015 20:44:46 +0000 (20:44 +0000)]
AsmPrinter: Take DIEValueList in some DwarfUnit API, NFC

Take `DIEValueList` instead of `DIE` so that `DIEBlock` and `DIELoc` can
stop inheriting from `DIE` in a future commit.

llvm-svn: 243855

8 years agoAsmPrinter: Change DIEValueList to a subclass of DIE, NFC
Duncan P. N. Exon Smith [Sun, 2 Aug 2015 20:42:45 +0000 (20:42 +0000)]
AsmPrinter: Change DIEValueList to a subclass of DIE, NFC

Rewrite `DIEValueList` as a subclass of `DIE`, renaming its API to match
`DIE`'s.  This is preparation for changing `DIEBlock` and `DIELoc` to
stop inheriting from `DIE` and inherit directly from `DIEValueList`.

I thought about leaving this as a has-a relationship (and changing
`DIELoc` and `DIEBlock` to also have-a `DIEValueList`), but that seemed
to require a fair bit more boilerplate and I think it needed more
changes to the `DwarfUnit` API than this will.

No functionality change intended here.

llvm-svn: 243854

8 years agoRemove dead code, NFC
Duncan P. N. Exon Smith [Sun, 2 Aug 2015 20:40:05 +0000 (20:40 +0000)]
Remove dead code, NFC

llvm-svn: 243853

8 years agoUse the branch instruction to define the location of a PHI-node write
Tobias Grosser [Sun, 2 Aug 2015 16:17:41 +0000 (16:17 +0000)]
Use the branch instruction to define the location of a PHI-node write

We use the branch instruction as the location at which a PHI-node write takes
place, instead of the PHI-node itself. This allows us to identify the
basic-block in a region statement which is on the incoming edge of the PHI-node
and for which the write access was originally introduced. As a result we can,
during code generation, avoid generating PHI-node write accesses for basic
blocks that do not preceed the PHI node without having to look at the IR
again.

This change fixes a bug which was introduced in r243420, when we started to
explicitly model PHI-node reads and writes, but dropped some additional checks
that where still necessary during code generation to not emit PHI-node writes
for basic-blocks that are not on incoming edges of the original PHI node.
Compared to the code before r243420 the new code does not need to inspect the IR
any more and we also do not generate multiple redundant writes.

llvm-svn: 243852

8 years agoFix invalid shufflevector operands
Simon Pilgrim [Sun, 2 Aug 2015 15:28:10 +0000 (15:28 +0000)]
Fix invalid shufflevector operands

This patch fixes bug 23800 ( https://llvm.org/bugs/show_bug.cgi?id=23800#c2 ). There existed a case where the index operand from extractelement was directly used to create a shufflevector mask. Since the index can be of any integral type but the mask must only contain 32 bit integers a 64 bit index operand led to an assertion error later on.

Committed on behalf of mpflanzer (Moritz Pflanzer)

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

llvm-svn: 243851

8 years ago[X86][SSE] Refreshed sse2 vector shift tests
Simon Pilgrim [Sun, 2 Aug 2015 15:23:53 +0000 (15:23 +0000)]
[X86][SSE] Refreshed sse2 vector shift tests

llvm-svn: 243850

8 years agoDependences: Zero pad the schedule map
Tobias Grosser [Sun, 2 Aug 2015 13:30:33 +0000 (13:30 +0000)]
Dependences: Zero pad the schedule map

The schedule map we derive from a schedule tree map may map statements into
schedule spaces of different dimensionality. This change adds zero padding
to ensure just a single schedule space is used and the translation from
a union_map to an isl_multi_union_pw_aff does not fail.

llvm-svn: 243849

8 years ago[X86][AVX512VLDQ] add reduce/range/cvt intrinsics
Asaf Badouh [Sun, 2 Aug 2015 12:43:08 +0000 (12:43 +0000)]
[X86][AVX512VLDQ] add reduce/range/cvt intrinsics
add 128 & 256 width intrinsic versions of reduce/range and cvt i64 to FP and vice versa

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

llvm-svn: 243848

8 years agoAdd support to set/get ordering for load/store from the C API
Andrew Wilkins [Sun, 2 Aug 2015 12:16:57 +0000 (12:16 +0000)]
Add support to set/get ordering for load/store from the C API

Summary: As per title

Reviewers: chandlerc, bogner, majnemer, axw

Subscribers: llvm-commits

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

llvm-svn: 243847

8 years agoGDBRemoteCommunication::DecompressPacket assumed that the buffer it was
Jason Molenda [Sun, 2 Aug 2015 01:36:09 +0000 (01:36 +0000)]
GDBRemoteCommunication::DecompressPacket assumed that the buffer it was
working with (the Communication m_bytes ivar) contained a single packet.
Instead, it may contain multitudes.  Find the boundaries of the first packet
in the buffer and replace that with the decompressed version leaving the
rest of the buffer unmodified.
<rdar://problem/21841377>

llvm-svn: 243846

8 years agoMark CompositeType::getTypeAtIndex as const. NFC
Craig Topper [Sat, 1 Aug 2015 22:52:12 +0000 (22:52 +0000)]
Mark CompositeType::getTypeAtIndex as const. NFC

llvm-svn: 243845

8 years agoMark Type::getPointerTo as const. Unfortunately, this requires a const_cast inside...
Craig Topper [Sat, 1 Aug 2015 22:20:31 +0000 (22:20 +0000)]
Mark Type::getPointerTo as const. Unfortunately, this requires a const_cast inside, but at least it makes all methods on Type const. NFC

llvm-svn: 243844

8 years agoMerge the const and non-const Type::getScalarType to a const version that returns...
Craig Topper [Sat, 1 Aug 2015 22:20:27 +0000 (22:20 +0000)]
Merge the const and non-const Type::getScalarType to a const version that returns a non-const pointer. Since we don't put const on Types all places were already calling the non-const version.

llvm-svn: 243843

8 years agoDe-constify pointers to Type since they can't be modified. NFC
Craig Topper [Sat, 1 Aug 2015 22:20:21 +0000 (22:20 +0000)]
De-constify pointers to Type since they can't be modified. NFC

This was already done in most places a while ago. This just fixes the ones that crept in over time.

llvm-svn: 243842

8 years agoRangify for loops, NFC.
Yaron Keren [Sat, 1 Aug 2015 19:11:36 +0000 (19:11 +0000)]
Rangify for loops, NFC.

llvm-svn: 243841

8 years agoRevert r243827.
Davide Italiano [Sat, 1 Aug 2015 18:25:03 +0000 (18:25 +0000)]
Revert r243827.

Until I figure out what's the right way of updating this file.

llvm-svn: 243840

8 years ago[NVPTX] allow register copy between float and int
Jingyue Wu [Sat, 1 Aug 2015 18:02:12 +0000 (18:02 +0000)]
[NVPTX] allow register copy between float and int

Summary:
Fixes PR24303. With Bruno's WIP (D11197) on PeepholeOptimizer, across-class
register copying (e.g. i32 to f32) becomes possible. Enhance
NVPTXInstrInfo::copyPhysReg to handle these cases.

Reviewers: jholewinski

Subscribers: eliben, jholewinski, llvm-commits, bruno

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

llvm-svn: 243839

8 years agoRemove trailing whitespace. NFCI.
Simon Pilgrim [Sat, 1 Aug 2015 17:06:47 +0000 (17:06 +0000)]
Remove trailing whitespace. NFCI.

llvm-svn: 243838

8 years agoUse SDValue bool check. NFCI.
Simon Pilgrim [Sat, 1 Aug 2015 17:05:50 +0000 (17:05 +0000)]
Use SDValue bool check. NFCI.

llvm-svn: 243837

8 years agoProvide move constructor to appease Visual C++.
Yaron Keren [Sat, 1 Aug 2015 15:50:53 +0000 (15:50 +0000)]
Provide move constructor to appease Visual C++.

llvm-svn: 243836

8 years ago[Mips] Implement definition of the DT_MIPS_RLD_MAP_REL dynamic tag
Simon Atanasyan [Sat, 1 Aug 2015 14:53:49 +0000 (14:53 +0000)]
[Mips] Implement definition of the DT_MIPS_RLD_MAP_REL dynamic tag

llvm-svn: 243835

8 years ago[Mips] Support DT_MIPS_RLD_MAP_REL dynamic section tag in the llvm-readobj
Simon Atanasyan [Sat, 1 Aug 2015 12:02:02 +0000 (12:02 +0000)]
[Mips] Support DT_MIPS_RLD_MAP_REL dynamic section tag in the llvm-readobj

llvm-svn: 243833

8 years ago[SemaExpr] Factor out common diagnostic code for remainder/division.
Davide Italiano [Sat, 1 Aug 2015 10:13:39 +0000 (10:13 +0000)]
[SemaExpr] Factor out common diagnostic code for remainder/division.

llvm-svn: 243832

8 years ago[DAGCombiner] Convert constant AND masks to shuffle clear masks down to the byte...
Simon Pilgrim [Sat, 1 Aug 2015 10:01:46 +0000 (10:01 +0000)]
[DAGCombiner] Convert constant AND masks to shuffle clear masks down to the byte level

The XformToShuffleWithZero method currently checks AND masks at the per-lane level for all-one and all-zero constants and attempts to convert them to legal shuffle clear masks.

This patch generalises XformToShuffleWithZero, splitting and checking the sub-lanes of the constants down to the byte level to see if any legal shuffle clear masks are possible. This allows a lot of masks (often from legalization or truncation) to be folded into existing shuffle patterns and removes a lot of constant mask loading.

There are a few examples of poor shuffle lowering that are exposed by this patch that will be cleaned up in future patches (e.g. merging shuffles that are separated by bitcasts, x86 legalized v8i8 zero extension uses PMOVZX+AND+AND instead of AND+PMOVZX, etc.)

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

llvm-svn: 243831

8 years agoOnly use instructions as insert locations for SCEVExpander
Tobias Grosser [Sat, 1 Aug 2015 09:07:57 +0000 (09:07 +0000)]
Only use instructions as insert locations for SCEVExpander

SCEVExpander, which we are using during code generation, only allows
instructions as insert locations, but breaks in case BasicBlock->end() iterators
are passed to it due to it trying to obtain the basic block in which code should
be generated by calling Instruction->getParent(), which is not defined for
->end() iterators.

This change adds an assert to Polly that ensures we only pass valid instructions
to SCEVExpander and it fixes one case, where we used IRBuilder->SetInsertBlock()
to set an ->end() insert location which was later passed to SCEVExpander.

In general, Polly is always trying to build up the CFG first, before we actually
insert instructions into the CFG sceleton. As a result, each basic block should
already have at least one branch instruction before we start adding code. Hence,
always requiring the IRBuilder insert location to be set to a real instruction
should always be possible.

Thanks Utpal Bora <cs14mtech11017@iith.ac.in> for his help with test case
reduction.

llvm-svn: 243830

8 years agoFix typo
Tobias Grosser [Sat, 1 Aug 2015 06:26:51 +0000 (06:26 +0000)]
Fix typo

llvm-svn: 243829

8 years ago[MS ABI] Create a mangling for extended vector types
David Majnemer [Sat, 1 Aug 2015 05:51:55 +0000 (05:51 +0000)]
[MS ABI] Create a mangling for extended vector types

Extended vector types are mangled just like normal vector types.

llvm-svn: 243828

8 years agoConvertibility of nullptr_t to bool is available in clang. Note it.
Davide Italiano [Sat, 1 Aug 2015 05:48:03 +0000 (05:48 +0000)]
Convertibility of nullptr_t to bool is available in clang. Note it.

llvm-svn: 243827

8 years agoUse the reserved keyword spelling of 'typeof'
David Majnemer [Sat, 1 Aug 2015 05:31:56 +0000 (05:31 +0000)]
Use the reserved keyword spelling of 'typeof'

No functional change intended, just a drive-by cleanup.

llvm-svn: 243826

8 years ago-Wdeprecated-clean: Fix cases of violating the rule of 5 in ways that are deprecated...
David Blaikie [Sat, 1 Aug 2015 05:31:27 +0000 (05:31 +0000)]
-Wdeprecated-clean: Fix cases of violating the rule of 5 in ways that are deprecated in C++11

Remove some unnecessary explicit special members in Hexagon that, once
removed, allow the other implicit special members to be used without
depending on deprecated features.

llvm-svn: 243825

8 years ago-Wdeprecated-clean: Fix cases of violating the rule of 5 in ways that are deprecated...
David Blaikie [Sat, 1 Aug 2015 05:10:40 +0000 (05:10 +0000)]
-Wdeprecated-clean: Fix cases of violating the rule of 5 in ways that are deprecated in C++11

llvm-svn: 243824

8 years agoWorkaround some compilers that give a stricter throw spec to = default than implicit...
David Blaikie [Sat, 1 Aug 2015 05:10:37 +0000 (05:10 +0000)]
Workaround some compilers that give a stricter throw spec to = default than implicit dtors

llvm-svn: 243823

8 years agoWebAssembly: handle more than int32 argument/return
JF Bastien [Sat, 1 Aug 2015 04:48:44 +0000 (04:48 +0000)]
WebAssembly: handle more than int32 argument/return

Summary: Also test 64-bit integers, except shifts for now which are broken because isel dislikes the 32-bit truncate that precedes them.

Reviewers: sunfish

Subscribers: llvm-commits, jfb

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

llvm-svn: 243822

8 years agoMissing formatting
David Blaikie [Sat, 1 Aug 2015 04:42:53 +0000 (04:42 +0000)]
Missing formatting

llvm-svn: 243821

8 years ago-Wdeprecated-clean: Fix cases of violating the rule of 5 in ways that are deprecated...
David Blaikie [Sat, 1 Aug 2015 04:40:41 +0000 (04:40 +0000)]
-Wdeprecated-clean: Fix cases of violating the rule of 5 in ways that are deprecated in C++11

Various targets use std::swap on specific MCAsmOperands (ARM and
possibly Hexagon as well). It might be helpful to mark those subclasses
as final, to ensure that the availability of move/copy operations can't
lead to slicing. (same sort of requirements as the non-vitual dtor -
protected or a final class)

llvm-svn: 243820

8 years ago[Tests] Add explicit -std=lang option to a number of tests.
Yunzhong Gao [Sat, 1 Aug 2015 02:55:59 +0000 (02:55 +0000)]
[Tests] Add explicit -std=lang option to a number of tests.

This patch should not change the test results, but it is useful if clang's
default C++ language is ever changed from gnu++98.

Patch by: Charles Li

http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20150727/134667.html

llvm-svn: 243819

8 years ago[libFuzzer] more refactoring of the Mutator and adding tests to it
Kostya Serebryany [Sat, 1 Aug 2015 02:23:06 +0000 (02:23 +0000)]
[libFuzzer] more refactoring of the Mutator and adding tests to it

llvm-svn: 243818

8 years ago[libFuzzer] start refactoring the Mutator and adding tests to it
Kostya Serebryany [Sat, 1 Aug 2015 01:42:51 +0000 (01:42 +0000)]
[libFuzzer] start refactoring the Mutator and adding tests to it

llvm-svn: 243817

8 years ago-Wdeprecated-clean: Fix cases of violating the rule of 5 in ways that are deprecated...
David Blaikie [Sat, 1 Aug 2015 01:08:30 +0000 (01:08 +0000)]
-Wdeprecated-clean: Fix cases of violating the rule of 5 in ways that are deprecated in C++11

llvm-svn: 243816

8 years ago[asan] Link tests with ld.gold on Android.
Evgeniy Stepanov [Sat, 1 Aug 2015 00:01:23 +0000 (00:01 +0000)]
[asan] Link tests with ld.gold on Android.

ld.bfd fails to find dependencies of asan runtime library w/o an
extra -rpath-link pointing to usr/lib under the sysroot. Gold does
not have this problem.

llvm-svn: 243802

8 years agoFix polly tests after LLVM IR change in r243774
Duncan P. N. Exon Smith [Fri, 31 Jul 2015 23:58:50 +0000 (23:58 +0000)]
Fix polly tests after LLVM IR change in r243774

llvm-svn: 243801

8 years ago[ASan] Fix two tests on FreeBSD: alloca.h is missing there.
Alexey Samsonov [Fri, 31 Jul 2015 23:57:06 +0000 (23:57 +0000)]
[ASan] Fix two tests on FreeBSD: alloca.h is missing there.

llvm-svn: 243800

8 years agoAMDGPU/SI: Add implicit register operands in the correct order.
Alex Lorenz [Fri, 31 Jul 2015 23:30:09 +0000 (23:30 +0000)]
AMDGPU/SI: Add implicit register operands in the correct order.

This commit fixes a bug in the class 'SIInstrInfo' where the implicit register
machine operands were added to a machine instruction in an incorrect order -
the implicit uses were added before the implicit defs.

I found this bug while working on moving the implicit register operand
verification code from the MIR parser to the machine verifier.

This commit also makes the method 'addImplicitDefUseOperands' in the machine
instruction class public so that it can be reused in the 'SIInstrInfo' class.

Reviewers: Matt Arsenault

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

llvm-svn: 243799

8 years agoMIR Parser: Report an error when a jump table entry is redefined.
Alex Lorenz [Fri, 31 Jul 2015 23:13:23 +0000 (23:13 +0000)]
MIR Parser: Report an error when a jump table entry is redefined.

llvm-svn: 243798

8 years ago[Sanitizer] Try to fix sanitizer_libc_test on FreeBSD.
Alexey Samsonov [Fri, 31 Jul 2015 23:02:51 +0000 (23:02 +0000)]
[Sanitizer] Try to fix sanitizer_libc_test on FreeBSD.

llvm-svn: 243797

8 years agoMIR Parser: Remove unused variable.
Alex Lorenz [Fri, 31 Jul 2015 22:59:20 +0000 (22:59 +0000)]
MIR Parser: Remove unused variable.

This variable is unused as of r243572.

llvm-svn: 243796

8 years ago[libFuzzer] limit the size of the inputs printed to stderr
Kostya Serebryany [Fri, 31 Jul 2015 22:07:17 +0000 (22:07 +0000)]
[libFuzzer] limit the size of the inputs printed to stderr

llvm-svn: 243795

8 years agoCOFF: Fix error message. Space was missing.
Rui Ueyama [Fri, 31 Jul 2015 21:51:25 +0000 (21:51 +0000)]
COFF: Fix error message. Space was missing.

llvm-svn: 243794

8 years ago[libFuzzer] minimal documentation on data-flow-guided fuzzing
Kostya Serebryany [Fri, 31 Jul 2015 21:48:10 +0000 (21:48 +0000)]
[libFuzzer] minimal documentation on data-flow-guided fuzzing

llvm-svn: 243793

8 years agoFix an MSVC build break since it can't synthesize move ctors.
David Blaikie [Fri, 31 Jul 2015 21:47:07 +0000 (21:47 +0000)]
Fix an MSVC build break since it can't synthesize move ctors.

llvm-svn: 243792

8 years agoFix a GCC buildbot that seemed to be having trouble producing the implicit move ctor
David Blaikie [Fri, 31 Jul 2015 21:47:04 +0000 (21:47 +0000)]
Fix a GCC buildbot that seemed to be having trouble producing the implicit move ctor

llvm-svn: 243791

8 years ago[NVPTX] convert pointers in byval kernel arguments to global
Jingyue Wu [Fri, 31 Jul 2015 21:44:14 +0000 (21:44 +0000)]
[NVPTX] convert pointers in byval kernel arguments to global

Summary:
For example, in

  struct S {
    int *x;
    int *y;
  };
  __global__ void foo(S s) {
    int *b = s.y;
    // use b
  }

"b" is guaranteed to point to global. NVPTX should emit ld.global/st.global for
accessing "b".

Reviewers: jholewinski

Subscribers: llvm-commits, jholewinski

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

llvm-svn: 243790

8 years agoFix some formatting from a recent commit.
David Blaikie [Fri, 31 Jul 2015 21:37:58 +0000 (21:37 +0000)]
Fix some formatting from a recent commit.

llvm-svn: 243789

8 years ago-Wdeprecated-clean: Fix cases of violating the rule of 5 in ways that are deprecated...
David Blaikie [Fri, 31 Jul 2015 21:37:09 +0000 (21:37 +0000)]
-Wdeprecated-clean: Fix cases of violating the rule of 5 in ways that are deprecated in C++11

llvm-svn: 243788

8 years ago[asan] Fix wrong __ANDROID_API__ preprocessor condition.
Evgeniy Stepanov [Fri, 31 Jul 2015 21:35:15 +0000 (21:35 +0000)]
[asan] Fix wrong __ANDROID_API__ preprocessor condition.

This fixes report symbolization on L devices when building for API
level 21 or 22.

llvm-svn: 243787

8 years ago-Wdeprecated-clean: Fix cases of violating the rule of 5 in ways that are deprecated...
David Blaikie [Fri, 31 Jul 2015 21:26:16 +0000 (21:26 +0000)]
-Wdeprecated-clean: Fix cases of violating the rule of 5 in ways that are deprecated in C++11

llvm-svn: 243786

8 years ago[CMake] Don't build libc++ with MSan-with-calls instrumentation.
Alexey Samsonov [Fri, 31 Jul 2015 21:15:34 +0000 (21:15 +0000)]
[CMake] Don't build libc++ with MSan-with-calls instrumentation.

Instead, refactor the build rules so that we build libc++ with MSan for
each supported architecture.

llvm-svn: 243785

8 years agoRemove -Werror when using check_cxx_compiler_flag because it was causing compiler...
Eric Fiselier [Fri, 31 Jul 2015 21:09:38 +0000 (21:09 +0000)]
Remove -Werror when using check_cxx_compiler_flag because it was causing compiler-rt breakages.

llvm-svn: 243784

8 years agoWebAssembly: handle `ret void`.
JF Bastien [Fri, 31 Jul 2015 21:04:18 +0000 (21:04 +0000)]
WebAssembly: handle `ret void`.

Summary:
Use -1 as numoperands for the return SDTypeProfile, denoting that return is variadic. Note that the patterns in InstrControl.td still need to match the inputs, so this ins't an "anything goes" variadic on ret!

The next step will be to handle other local types (not just int32).

Reviewers: sunfish

Subscribers: llvm-commits, jfb

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

llvm-svn: 243783

8 years ago[lldb-mi] Fix evaluation for children of created variable object.
Dawn Perchik [Fri, 31 Jul 2015 21:00:00 +0000 (21:00 +0000)]
[lldb-mi] Fix evaluation for children of created variable object.

Move code in CMICmdCmdVarListChildren::Execute() up so that the child
object will always be added when the MI command -var-list-children is
entered (instead of only when the print-value was all or simple).  This
patch fixes evaluation of expressions like varobj.member for a created
varobj with children.

Reviewed by: abidh
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D11659

llvm-svn: 243782